-
Notifications
You must be signed in to change notification settings - Fork 3k
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
(TestPyPI) "ERROR: No matching distribution found for setuptools" if pyproject.toml is present in a very basic package #9242
Comments
I think the problem here actually has little to do with PEP 517 and pyproject.toml, but simply that TestPyPI does not serve setuptools and returns 404 when you route index traffic to TestPyPI. So essentially this is the same as #5402 in that pip is not “smart enough” when populating the isolated environment, and rely too much on the index being redily available. Your package should install fine if uploaded to PyPI, where setuptools is available. |
As I constantly question my own expertise in this area, it never occurred to me that this might be due to a limitation of TestPyPI... :) What's the proposition for those who verify the integrity of a new distribution release via TestPyPI? I thought TestPyPI should be used for release validation before flooding the official PyPI with immature releases. Plus, I can imagine that there will be others running into similar problems. I assume there should something be done about it, when build isolation becomes the new standard. |
Personally I feel the simplistic fix would be to have setuptools available on TestPyPI. But that proposal needs to be raised to setuptools maintainers. pip likely should be smarter when populating the build environment (i.e. use the seuptools installation available in the runtime environment instead of fetching again), but that’s a broader enhancement that needs more discussion. If you need to test the installation right now, the easiest fix available without involving others would be to serve your own setuptools copy instead. Something like
|
I can confirm that releasing directly to PyPI does not exhibit those problems. Thanks @uranusjr for pointing this out. In other words: my release has always been functional and I spent 1d to figure this out 😅 The workaround is useful and works. Is removing the folder |
Yup. |
That will only work for projects requiring only setuptools. I think better option is just to use |
Are there outstanding issues remaining here? I feel we have addressed the problem, and there’s nothing further actionable for pip. |
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further. |
@uranusjr I agree. I think pip cannot do much here. Let me know in case you know a better place to address this issue. The transition to "new-style" build system specification is a bit bumpy for a common user like me. It's probably good if the failure was a bit more specific and some more resources were available. For example, a note in the popular packaging tutorial could be helpful. Generally, the tutorial could be updated with a couple of notes and links about PEP 517. Where would you request such an improvement? |
I informed the maintainers of setuptools about this issue. |
Updated pyproject.toml to include the setup requirements needed by numpy. pypa/pip#9242 indicates that testing on TestPyPi does not work for the reasons it is failing locally.
Environment
Description
As demonstrated in this minimal reproducing project, the presence of
pyproject.toml
breaks its installation later through pip viaPyPI/TestPyPI.I've tried several things, which didn't change my observations described here:
--no-deps
flaginstall_requires
andsetup_requires
python -m pep517.build .
By now, I understand that pyproject.toml triggers build isolation, and that the sdist package somehow misses the wheels for
wheel
andsetuptools
to install those packages during isolated installation. Removing pyproject.toml from the project or installing the sdist (.tar.gz) simply uses the packagessetuptools
andwheel
that python can find. Consequently, the installation works when usingpip install ...... --no-build-isolation
. But this disables build isolation.I found a possibly related issue #5402, but I got the impression that this is not exactly the same situation, since I am not using the pip flag
--no-index
.Expected behavior
Following the (still pretty scarce) material in the web, most notably PEP517/PEP518, I understood that the default choice for pyproject.toml is as follows.
Expected behavior:
I think the build isolation is certainly a good thing for a healthy Python ecosystem. But for me as rookie package publisher, it cannot be that after 3 days reading about packaging and the PEP517/518 initiatives, I came only this far. :)
How to Reproduce
Sources:
run.sh
setup.cfg
setup.py
pyproject.toml
Related question
How to bundle the package such that the additional
--no-build-isolation
flag is not required? I'd wish that a usualpip install <package_name>
will work for my packages also in the pep517-style projects.Output
Output of my script is found in this pastebin.
The text was updated successfully, but these errors were encountered: