Repository navigation
Require click for the always-installed deep CLI - #628
Pitchfork-and-Torch wants to merge 1 commit into
Conversation
The deep console script imports click unconditionally, but click lived only in the optional cli extra, so bare installs (e.g. uv tool install deepdiff) raised ModuleNotFoundError (qlustered#594).
seperman
left a comment
There was a problem hiding this comment.
Static review: #628 Require click for the always-installed deep CLI
Summary: Moves click from the optional cli extra into the core dependencies as click>=8.0, so the always-installed deep script works on a bare install (#594). The PR targets master.
Overlap with other PRs
- #608 ("fix(cli): give actionable error when 'deep' runs without cli extra (#594)") was merged into
devon 2026-08-04 and addresses the same issue a different way:- It points
[project.scripts] deepat a new wrapper,deepdiff.cli:main. - That wrapper checks for
clickand exits with apip install deepdiff[cli]hint instead of a traceback. - It keeps
clickoptional on purpose. Its description says: "keeps the CLI dependencies optional ... rather than promoting click/pyyaml to core dependencies".
- It points
- Because #608 is only on
dev, it does not appear onmaster, which this PR is based on. Issue #594 is still open, probably becausedevhas not been released tomasteryet. - If both changes land, the
ImportErrorbranch indeepdiff/cli.pybecomes effectively unreachable, and its docstring (deepdiff/cli.py:3-4, "optional and installed via the cli extra") becomes inaccurate.
Security / supply chain
No security concerns found in static review. The change is one pyproject.toml line moved between sections. The package name is the well-known click. No lockfile, CI or entry-point changes are included.
Correctness
- Every library user would install
click, not only CLI users. This is a policy trade-off for the maintainer. click>=8.0has no upper bound. Other runtime dependencies cap the next major version (cachebox>=5.2,<6,orderly-set>=5.5.0,<6). The 8.0 floor is also untested here: the test and dev extras resolve againstclick~=8.3.1.- Removing
click~=8.3.1from thecliextra drops the previous pin fordeepdiff[cli]users. uv.lockis not updated. It still listsclickonly undermarker = "extra == 'cli'", specifier = "~=8.3.1"(uv.lock:555), so the lock would be stale.- A trial
git merge-treeontoorigin/devshows no textual conflicts. The overlap with #608 is semantic.
Suggestions
- Could this be rebased on
devso it can be evaluated next to #608? If makingclicka hard dependency is still wanted after #608:- use a capped range such as
click>=8.0,<9; - re-lock
uv.lock; - update or simplify the
deepdiff/cli.pywrapper and its docstring.
- use a capped range such as
AI-assisted static review; the code was not executed.
|
#608 on dev keeps click optional and replaces the traceback with an install hint. This PR targets master, where that wrapper is not present, and makes click a core dependency so deep works after a default install. That is the behavior #594 asks for. I will not combine a hard click dependency with the #608 wrapper. That would make the ImportError path dead and leave its docstring wrong. If you want the hard dependency evaluated next to #608, I will retarget onto dev, cap the range at click>=8.0,<9, refresh uv.lock, and update the wrapper. If the optional extra on dev is the design you intend to release, I will close this. |
Summary
deepconsole script is always installed and importsclick, butclickwas only in the optionalcliextra.pip install deepdiff,uv tool install deepdiff) therefore raisedModuleNotFoundError: No module named 'click'.clickinto core dependencies; keeppyyamlin thecliextra.Test plan
deepdiff.commandsimportsclickat module level and[project.scripts] deep = ...is unconditionalpip install .thendeep --helpsucceeds without installingdeepdiff[cli]