-
Notifications
You must be signed in to change notification settings - Fork 411
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
>= 0.15 has undeclared dependency on setuptools #339
Comments
pkg_resources is not really supported going ahead, instead one should prefer the |
|
True, depending on what subset of pkg_resources we use |
I've been working to eliminate all of the implicit dependencies on setuptools in my environments, especially in my main environment, where pipx resides, but this change means I'm stuck on the older pipx 0.14 until this issue is resolved. |
Investigating deeper, it seems the issue is pretty straightforward. Although pkg_resources is used in venv_metadata_inspector, its usage is optional (all imports are lenient). Only the usage in main.py is required. Replacing that usage with packaging allows the project to run again. |
I was trying to find a reference on pkg_resources being deprecated and couldn't find one. @jaraco, can you add a link to something talking about pkg_resources being deprecated? As for using pkg_resources in venv_metadata_inspector, that will not cause a setuptools dependency in pipx itself. We install setuptools in a separate venv to use for pipx-installed apps. The new use of setuptools in pipx itself is only due to its usage in |
* Rely on packaging to parse the version. Fixes #339. * Update changelog * Suppress lint errors
Pardon my prying, but I don't understand how
|
Reopening since I believe |
I find I'm not precious about it if it's better to remove it! |
An alternative I find ins some projects (e.g. Django) is to do it the other way around: define |
Yes, that is my preferred solution too; I don't use it in most places because automated versioning infrastructure like |
Consumers can pull in |
I'm just wondering (I think along with @layday), does any package use pipx as a dependency? Isn't that the main reason to have things like |
pipx is like pip in this regard. Internal APIs are subject to breaking changes without semantic version bumps. The only supported API is the CLI.
If there is some reason to define a |
This branch has pipx's own version-handling updated that way: there's a |
@clbarnes LGTM, if you make a PR I'll approve. |
I'm working on getting rid of pkg_resources from venv_metadata_inspector too, just having trouble with the record/installed-files.txt. Why can't awscli just be normal 🙄 |
This issue hit me again today. I installed pipx and it immediately failed with a ModuleNotFoundError. Maybe consider adding the dependency on setuptools until it's not needed? |
@jaraco if you installed it via a recent pip this should not happen |
|
A new version with the fix hasn't been released yet. |
Confirmed.
I probably worked around it by installing from master at the time. Let me rephrase my request. How about release a version with the fix? |
Can we close this? (Released) pipx v0.15.4.0 has no dependency on setuptools or pkg_resources. The remaining use of pkg_resources is in the package venvs, which does not depend on the python installation running pipx. |
Sounds good to me.
|
Describe the bug
pkg_resources
, which is part ofsetuptools
, is used to parse the pipx version number and is also used extensively in thevenv_metadata_inspector
.setuptools
should not be assumed to be available in the runtime environment unless explicitly required.How to reproduce
Install pipx in a virtual environment without setuptools:
Expected behavior
As above.
The text was updated successfully, but these errors were encountered: