-
-
Notifications
You must be signed in to change notification settings - Fork 301
Runtime dependency on setuptools #215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Not sure about the correct version constraint: please amend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be a more appropriate version constraint? (this is latest on pypi as of today)
Could you provide the full traceback? Thanks!
Could you provide the full traceback? Thanks!
Actually that's the full traceback when running cz --help
- What where you expecting? (Or I'm misinterpreting?)
I was expecting an exception at the end. It's not clear why it fails.
Which OS are you on?
Oh sorry! Might be that I clipped that unintentionally.
The exception was that pkg_resources
is not importable.
This modules is made available by setuptools
.
In a python environment without setuptools
installed this results in an error as per the dependencies declared in the pyproject.toml
.
In such a environment, the truth is: setuptools
is a runtime dependency because of this import.
The python environment is the one crafted by the following nix expression:
4 │ mach-nix = import (
5 │ builtins.fetchGit {
6 │ url = "https://github.com/DavHau/mach-nix/";
7 │ ref = "2.0.1";
8 │ }
9 │ );
10 │
11 │ commitizenPython = mach-nix.mkPython {
12 │ python = pkgs.python38;
13 │ requirements = ''
14 │ commitizen
15 │ setuptools
16 │ '';
17 │ };
What this does:
- takes a bare
pkgs.python38
- adds
commitizen
(from pypi) - additionally declares (unexposed) dependency
setuptools
- this is the motivation for this PR
With this setup it works. If I left setuptools
undeclared, it would result in the exception.
Hypothesis: In most common standard python environments setuptools might be shipped or available.
But that doesn't change the fact that it still is a runtime dependency.
Note: https://github.com/DavHau/mach-nix/ has it's build in completely resolved dependency graph of all pypi packages (250MB database). This database is published every 12 hours or so and used for static dependency resolution. Since setuptools
is not declared, the tool cannot generate the complete runtime closure for commitizen
and I have to complement it manually.
@woile Apologies for the noise... Does my latter explanation make sense? I still wonder what an appropriate version of setuptools
would be, though.
Hey, yes, thanks, I gotta research now, I don't want to run in the issue that it doesn't work in a machine which already has setuptools
.
Yeah, I understand. I think tagging the lowest possible setuptools version, which also implements pkg_resouces
, upwards could be pretty safe.
We have removed the dependency 🎉 You can try the latest version 💪
Uh oh!
There was an error while loading. Please reload this page.
Imported here:
commitizen/commitizen/changelog.py
Line 33 in b8fc1ee
Types of changes
Please put an
x
in the box that appliesWithout it in a pristine python environment: