Skip to content

Rename the misspelled BuildOptions check_for_cyces keyword - #167

Merged
ESultanik merged 1 commit into
masterfrom
157-check-for-cycles-kwarg
Sep 9, 2026
Merged

ESultanik merged 1 commit into
masterfrom
157-check-for-cycles-kwarg

Conversation

@ESultanik

Copy link
Copy Markdown
Collaborator

Closes #157

BuildOptions.__init__ advertised a keyword named check_for_cyces but assigned it to the correctly spelled check_for_cycles attribute, so the signature disagreed with the attribute docstrings, the API docs, and docs/library.rst. Callers passing the documented check_for_cycles=False worked only by accident: the **kwargs catch-all set the unrecognized name as an attribute, and that loop ran after the misspelled parameter had already been assigned, so it happened to overwrite the same attribute.

This renames the parameter to check_for_cycles and keeps check_for_cyces as a deprecated alias:

  • The alias is popped out of kwargs before the catch-all runs, so it no longer leaves a misspelled junk attribute behind.
  • Using it raises a DeprecationWarning naming the new spelling.
  • Passing both spellings raises a TypeError instead of silently choosing one. Without this, a mistake would be invisible, because BuildOptions.__getattr__ returns False for any attribute that was never set.

Nothing in this repository passes either spelling, so the alias exists only for out-of-tree callers. It can be removed in the next release that allows breaking changes, such as 0.4.0.

The **kwargs catch-all is left as is. Rejecting unknown keywords would be a separate breaking change beyond the scope of this issue.

Validation

The four new tests in test/test_builder.py were run against the unfixed code first: all four failed (no DeprecationWarning, no TypeError, and check_for_cycles missing from the constructor signature while check_for_cyces was present). They pass after the fix.

  • uv run --frozen --extra dev ruff check graphtage test docs bindist: passes
  • uv run --frozen --extra dev pytest: 144 passed
  • uv run --frozen --extra dev make -C docs html SPHINXOPTS="-W --keep-going": build succeeded
  • uv lock --check: reports the lockfile needs updating, but that reproduces on an unmodified master checkout in this environment because of a global exclude-newer setting. Neither pyproject.toml nor uv.lock is touched by this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GypKU5KdLfs2Cf8kS2TzJa

The BuildOptions constructor advertised check_for_cyces while assigning
the correctly spelled check_for_cycles attribute, so the signature
disagreed with both the attribute docstrings and docs/library.rst.
Callers passing the documented check_for_cycles=False only worked by
accident: the **kwargs catch-all set the unrecognized name as an
attribute, and it ran after the misspelled parameter had already been
assigned, so it happened to overwrite the same attribute.

Rename the parameter to check_for_cycles and keep check_for_cyces as a
deprecated alias. The alias is popped out of kwargs before the catch-all
runs, so it no longer leaves a misspelled junk attribute behind, and it
raises a DeprecationWarning that points callers at the new spelling. An
out-of-tree caller that passes both spellings now gets a TypeError
rather than a silently chosen value, because BuildOptions.__getattr__
returns False for anything unset and would otherwise hide the mistake.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GypKU5KdLfs2Cf8kS2TzJa
@ESultanik
ESultanik merged commit b26140e into master Sep 9, 2026
12 checks passed
@ESultanik
ESultanik deleted the 157-check-for-cycles-kwarg branch September 9, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BuildOptions constructor keyword check_for_cyces is misspelled

1 participant