test.tar.gz does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.
See original GitHub issueDescription
I’m writing a small build-backend, essentiall a wrapper around setuptools. In a test project, the pyproject.toml
is
[build-system]
requires = [
"setuptools",
"mybuildbackend",
"wheel"
]
# build-backend = "setuptools.build_meta"
build-backend = "mybuildbackend.build_meta"
Upon
python -m build --sdist
this spits out a nice-looking dist/test-project.tar.gz
. When trying to
pip install dist/test-project.tar.gz
however, I’m getting
ERROR: file:///path/to/dist/test-project-0.0.1.tar.gz does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.
It works fine when pip-installing the untarred folder. It also works when changing just one line in tar, namely adding
build-backend = "setuptools.build_meta"
instead of the custom one.
I have no clue why that could be. The error message is misleadiing since there is a pyproject.toml.
Any idea what may be going wrong?
Expected behavior
No response
pip version
22.0.4
Python version
3.9.10
OS
Ubuntu 22.04
How to Reproduce
See above.
Output
No response
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Directory is not installable. Neither 'setup.py' nor 'pyproject ...
When looking at the items to be installed, pip checks what type of item each is, in the following order: Project or archive...
Read more >Contributing — brainiak 0.11 documentation
If the package is installed normally and the test command is called from the project root directory, the coverage program will fail to...
Read more >3 The anatomy of a minimal Python package
3.1.1 Parts of the Python build system. In the root directory for your project, start by running build using the following command: $...
Read more >setuptools-scm - PyPI
First, ensure that setuptools_scm is present during the project's built step by specifying it as one of the build requirements. # pyproject.toml ......
Read more >Python Packaging Guidelines - Fedora Docs
Fedora's Python SIG not only develops these guidelines, but it's also ... Common locations are pyproject.toml , setup.py , setup.cfg , config.toml ....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks everyone for the input. I’ve found the bug, and it was a subtle one in the backend. When recreating the tar.gz-file, a leading
/
was accidentally added in the file. That’s why pip was not able to find thepyproject.toml
file.I would have been happy about a clearer error message (found the file here but it should be there), but I think this is so niche that it doesn’t warrant anyone spending more time on this. Thanks again!
There’s no “found file here” – it basically looks if there’s a file pyproject.toml or setup.py file in the tarball. It doesn’t go around searching or recursing to look for it – it’s a one-time lookup of a specific filename.
It didn’t find any file with that filename where it looked (the root of the source tarball) and presented that as an error.
I agree that working to add a clearer error message is not worth the effort here.