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
importlib.metadata fails to read version in the 'hatchling' package #100602
Comments
I don't see this on 3.9.10 on Cygwin with hatchling 1.11.0 or 1.11.1, or with 3.10.6 on Ubuntu with hatchling 1.11.1. I don't 3.9.16 handy, but I'll see if I can install it. How did you install hatchling? Is this in a virtual environment? Is this a --user install? |
hatchling was installed from the FreeBSD package/port. |
Try |
I agree with @ned-deily : this is probably an issue with how the FreeBSD port installs hatchling. |
But what is wrong with how it is installed? |
It could also be an issue with FreeBSD modifications to Python. You could try bulding a vanilla Python 3.9.x and installing with it. I don't have a FreeBSD installation available at the moment but your test worked ok on a Python 3.9.x on macOS. |
Surely the simplest solution to debugging the problem is to stop theorizing about what might be wrong with how it is installed or what FreeBSD does to modify python, and simply... upload the relevant files which FreeBSD has (i.e. the contents of the |
The only files this contains are the python files inside
I don't know how you got a distribution with no version, but you "should" actually have significantly bigger errors. |
Sorry, that was an incomplete archive. |
This one does work for me:
If that doesn't work on FreeBSD, then it would indeed seem to be an issue with something other than the metadata... |
@yurivict https://builds.sr.ht/~eschwartz/job/914998 On a FreeBSD 13.1-RELEASE-p3 GENERIC image, I was able to successfully install python39, load your tarball and get dist.version to print 1.11.0, and then repeat the experience with I'm not sure how you got the results you got, but this isn't an importlib.metadata bug and it isn't a FreeBSD bug either, and the example which fails for you, works for my reproducible FreeBSD test job after following the exact instructions you gave. I think the problem is likely in your own local installation which has something other than a FreeBSD port installed in addition to the test case you uploaded. The tarball you uploaded appears to be the port tarball itself, so it's not actually taken from your local environment, which means that there may still be a discrepancy there. |
This is probably a duplicate of #91216 and you have an additional, but broken, metadata directory for hatchling, which does NOT come from the FreeBSD port. |
You are right, some stray file caused this. File:
|
Bug report
This code fails to read version in the 'hatchling' package:
it prints:
Your environment
The text was updated successfully, but these errors were encountered: