-
Notifications
You must be signed in to change notification settings - Fork 54
Issue with new find_distributions and incorrect metadata #211
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
Comments
I just noticed that the Also, here are the installed packages I used to test this.
I also tried newer setuptools and importlib_metadata, but nothing changed. |
Hi @kulikjak, in The same is also valid for
So the reasoning behind the discussion in #195 is justified by the fact that The fact that Other than that, there seems to be 2 problems with versions of dependencies:
All things considered, when the dependency versions are fixed, things seem to be working well in a controlled environment, see the minimum reproducible example below: > docker run --rm -it python:3.9-bookworm /bin/bash
cat <<EOF > /tmp/environment.txt
build==1.0.3
importlib_metadata==7.1.0
packaging==24.1
pyproject_hooks==1.2.0
setuptools==75.2.0 # -- Updated due to race condition bug
tomli==2.0.2 # -------- Downgraded due to setuptools-scm dependency constraint
wheel==0.42.0
zipp==3.19.2
EOF
python3 -m venv /tmp/venv
/tmp/venv/bin/python -m pip install -r /tmp/environment.txt
git clone https://github.com/pypa/setuptools-scm /tmp/setuptools-scm
cd /tmp/setuptools-scm
git fetch --tags
/tmp/venv/bin/python -m build --no-isolation
# ...
# Successfully built setuptools_scm-8.2.2.dev3+g8e11309.tar.gz and setuptools_scm-8.2.2.dev3+g8e11309-py3-none-any.whl Footnotes
|
Hi @abravalheri, thanks for looking in this!
Ah, seems like I've got a little confused. But I still think it doesn't work as expected. Here is the call stack when looking for the setuptools version:
Then, in return next(iter(cls.discover(name=name))) The I think that
Thanks for the catch - unfortunately, even with these two changes, nothing changes. I am pretty confused why you are not seeing the same issues as I do, though.... |
Ah, OK, I see. This makes sense to me! Thank you very much for the detailed explanation.
And the suggested change makes sense as well. I think this functionality is not something that is very clear in the importlib_metadata docs. I think your explanation brings light to the way it works. |
Thanks! I created #212 to address this.
I agree. I had to test it with debug prints to find out what was happening. |
After updating to pyproject_hooks 1.2.0, I am getting the following error when building setuptools_scm:
even though my setuptools version is 73.0.1. The build process erroneously takes the setuptools_scm version and considers it the setuptools one.
(while this says ERROR, the build continues and finishes successfully; the only unexpected result is that the WHEEL file lists
Generator
assetuptools (8.1.0)
, which is not the case).I also noticed similar issue with Python incremental.
I know very little about how the whole build machinery works, but I looked a little into this and found that the
def find_distributions
addition in 1.2.0 is the reason for this. It seems that importlib_metadata (which is used by setuptools to find its own__version__
) uses_BackendPathFinder
and the newfind_distributions
, but the passedcontext
(which is correctly set to look for "setuptools") is ignored and replaced with new context, which is no longer correct for that case.Updating the function with a check:
fixes the issue, but I have no idea whether that is a good idea - it was just a test.
This happens in 3.9.21 (with importlib_metadata 7.1.0), 3.11.11 and 3.13.1.
Also, both setuptools_scm and incremental use custom build backend and "backend-path" (with more than just ".").
The text was updated successfully, but these errors were encountered: