Repository navigation
Fix PrettyPrint dependency compatibility - #118
appleweiping wants to merge 1 commit into
Conversation
cd53445 to
3e129ed
Compare
Remove the unused prettyprint package, which collides with PrettyPrintTree on case-insensitive filesystems. Constrain PrettyPrintTree to the compatible 1.x API, install it in the lightweight unit-test job, and cover PortTree text output with a regression test. Signed-off-by: Weiping Yan <152196713+appleweiping@users.noreply.github.com> Assisted-by: OpenAI Codex
|
Closing this draft in favour of #123, which supersedes its dependency fix. This draft pinned This draft also carries a regression test ( |
Summary
prettyprintpackage from the base installationPrettyPrintTreeto>=1.36.4,<2, whose API matches the existingPortTree.print()callPortTree.print(savetofile=True)writes the expected hierarchyWhy
A clean Python 3.11 installation of current
mainresolves bothprettyprint 0.1.5andprettyprinttree 2.0.2. On the case-insensitive Windows filesystem used for reproduction, theirprettyprint/andPrettyPrint/package trees collide. The imports inport_utils.pythen fall through to the no-op shim, soPortTree.print()silently produces no file.Removing only the unused package is not sufficient:
PrettyPrintTree 2.0.2changed its constructor API and raisesTypeErrorfor the existingdefault_orientationoption. Version 1.36.4 has the compatible API and already ships a universalpy3-none-anywheel.The original report concerned Apple Silicon. I have not reproduced on arm64 macOS, so this PR limits its claim to the dependency conflict and API mismatch verified on Windows/Python 3.11.
Tests
python -m pytest -q tests/test_port_tree.py— 1 passedpython -m pytest -q tests/test_port_tree.py tests/test_import_paths.py tests/test_repo_layout.py— 9 passedpython -m pytest -q tests --ignore=tests/test_cells_layout.py— 26 passed, 16 subtests passed.github/workflows/tests.ymlparsed successfully with PyYAMLsetup.py(prettyprint 0.1.5+PrettyPrintTree 2.0.2) — new test fails because the output file is not createdThe passing runs report existing Pydantic v2 deprecation warnings; this change does not add or address them.
Review status
This is intentionally a draft while awaiting maintainer direction in #78. It preserves the current
PortTreeAPI and avoids broader renderer or packaging refactors.Closes #78
Assisted-by: OpenAI Codex