-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Better error message with failing discovery #2493
Comments
PR welcome. |
I'm not familiar with the codebase, but if you've any suggestions I can take a look. I'm honestly not terribly sure what discovery is doing. It appears from a quick glance at run/plugin/discovery.py that it is attempting to add arguments to a specialized argparse parser. The code is failing on ln20 which sets the default argument for add_argument(). I'm guessing that the only way this would happen would be if I'm not sure what |
I'm having the same problem when packaging the latest version for Fedora Linux.
I've tried to load entry points manually and this is the result:
Could you please help me understand where the problem might be? |
That should never happen because we register at least once discovery entry here https://github.com/pypa/virtualenv/blob/main/pyproject.toml#L95, so the only way for that to happen is a broken packaging. We moved over the hatchling a while back from setuptools - https://github.com/pypa/virtualenv/blob/main/pyproject.toml#L3, so perhaps you did not change the build dependencies? |
That change happened a month ago here #2474 |
So, the problem in my case was that the build backend creates a .dist-info directory when you use the hook to get build dependencies, and then |
I don't think hatchling does such a thing; this is some setuptools legacy thing. |
No, it's not, see https://github.com/pypa/hatch/blob/a122f0cc022c428418b9afe7acd10c5cbcb3157d/backend/src/hatchling/build.py#L97-L112 |
@frenzymadness any ideas how to fix it? 😆 |
What about just having a better error message (something about broken installation maybe) when the list of loaded entry points is empty? |
What's the problem this feature will solve?
pre-commit
failed due toStopIteration
. Investigation shows that this is caused by an error thrown byvirtualenv
. See below for full trace when attempting to construct a virtual environment. Through discussion on the virtualenv discord, this closed issue was suggested as related: #2176Investigation strongly suggested that the issue was indeed related. Pip uninstalling all packages and reinstalling only
virtualenv
allowed for creation of the virtual environment.pip list
before uninstalling shows that there were some horribly out of date packages for the python version used. Removing or updating the packages fixed the issue.Describe the solution you'd like
While I was able to identify and fix the issue with a bit of help from the virtualenv community, the error was cryptic and did not provide information about what problem was or what steps could be taken to solve it.
I am not familiar with the discovery process, but a message stating which package or path was causing the issue would be helpful. Perhaps:
Alternative Solutions
pip list -o
does show the installed and latest version of all packages which was able to help me find which were significantly out of date, but this is a partial solution unless a user knows that other packages are the issue. Adding a note to the Users Guide may be helpful.This is the current output (with full traceback):
The text was updated successfully, but these errors were encountered: