Skip to content

Fix consistency-check activation instructions - #281

Open
Gonghan-Princess wants to merge 1 commit into
c0fec0de:mainfrom
Gonghan-Princess:codex/docs-consistency-checks
Open

Gonghan-Princess wants to merge 1 commit into
c0fec0de:mainfrom
Gonghan-Princess:codex/docs-consistency-checks

Conversation

@Gonghan-Princess

Copy link
Copy Markdown

The consistency-check guide currently recommends assigning anytree.config.ASSERTIONS = True after importing anytree, but the node and rendering modules have already copied the original setting by then. Following that example leaves their checks disabled.

Replace it with Python and POSIX shell examples that set ANYTREE_ASSERTIONS=1 before the first import, including imports through dependencies. Explain why changing the setting afterward does not enable checks in already imported modules. Runtime behavior is unchanged.

Refs #279.

Validation on Python 3.12.10:

  • Executed both exact documentation snippets in fresh processes and verified that actual consistency assertions run; also reproduced the old example's failure to enable them.
  • Full pytest suite: 233 passed, 1 skipped (Graphviz unavailable). On Windows this required Git's diff on PATH and LF reference fixtures; no fixture changes are included.
  • Ruff lint/format and mypy passed.
  • Documentation HTML build completed; the changed page also builds with warnings treated as errors. The full documentation retains the same 29 warnings as the unmodified baseline.
  • Full Sphinx doctests retain 58 existing failures, with the same failing examples confirmed against the unmodified baseline.

AI assistance: OpenAI Codex helped investigate the issue, draft the documentation, and run validation. No third-party code was copied into this change.

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.

1 participant