Skip to content

PrettyPrint #78

Open
Open

Description

@kelvinopoku777

When you go through the tutorial to install glayout and you try to run the quickstart code, you get this "No Module found "PrettyPrint" error.

Activity

  1. AL-255 commented on Mar 13, 2026

    @AL-255
    Contributor

    This is because PrettyPrintTree doesn't have a pre-built package for Apple Silicon. A temporary fix is to install it directly from the repo:
    python -m pip install -U "git+https://github.com/AharonSambol/PrettyPrintTree.git"
    However, I don't think we need to keep it in the dependencies; maybe we should remove this module entirely.

  2. adityakak27 commented on Mar 22, 2026

    @adityakak27
    Contributor

    Hi @kelvinopoku777 , if you just try to set it up after commenting out this particular import, everything should work fine. Also, I agree with @AL-255 , if it works without the import, maybe it is better to remove the import altogether.

  3. appleweiping commented on Aug 30, 2026

    @appleweiping

    Hi, I audited this against current main and the installation failure still appears actionable.

    src/glayout/util/port_utils.py already treats both PrettyPrint and prettyprinttree as optional by falling back when neither can be imported. However, setup.py still lists both prettyprint and prettyprinttree in install_requires, so pip install . must install them before that fallback can ever help. Also, prettyprint itself is not imported anywhere; only PrettyPrintTree is used, by PortTree.print().

    I would like to work on a focused fix if this is still available. My proposed scope is:

    • remove the unused hard dependency on prettyprint;
    • stop making the optional tree renderer block the base installation (either move prettyprinttree to an optional extra or replace the small rendering use, according to your preference);
    • preserve the existing PortTree API and make absence of an optional renderer explicit rather than silently producing an empty file;
    • add regression coverage for importing/using the base package without the third-party pretty-print modules;
    • avoid unrelated dependency or packaging changes.

    Would you prefer prettyprinttree as an optional extra, or a small dependency-free tree rendering implementation so PortTree.print() keeps working in the base install?

    I used OpenAI Codex interactively for repository navigation and this current-main audit. I will personally review, test, and understand every change, remain responsible for the contribution, and disclose the assistance in the PR.

  4. appleweiping commented on Aug 30, 2026

    @appleweiping

    One current-data update after checking both PyPI artifacts and a clean Python 3.11 install:

    • prettyprinttree 2.0.2 (released 2026-08-18) now has a universal py3-none-any wheel, so the original Apple Silicon wheel blocker may have changed.
    • The current dependency set still has a reproducible problem. On a case-insensitive Windows filesystem, installing both prettyprint 0.1.5 and prettyprinttree 2.0.2 causes their prettyprint/ and PrettyPrint/ package trees to collide. Both imports attempted by port_utils.py then fail, and gLayout silently selects its no-op fallback; PortTree.print(savetofile=True) produces no file.
    • Removing the unused prettyprint package alone exposes a second incompatibility: PrettyPrintTree 2.0.2 rejects the existing default_orientation argument with TypeError.
    • PrettyPrintTree 1.36.4 already provides a universal py3-none-any wheel and is compatible with the current PortTree.print() call. With only prettyprinttree>=1.36.4,<2, the same regression test writes and reads the expected hierarchy successfully.

    I opened draft PR #118 with the smallest compatibility-preserving candidate: remove the unused prettyprint dependency, constrain the actual renderer to prettyprinttree>=1.36.4,<2, install it in the lightweight unit-test job, and add one PortTree.print() regression test. The test fails with the dependencies resolved by current setup.py and passes with that candidate. The PR remains a draft while awaiting maintainer direction here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions