With `--use-pep517`, file:/// and tar.gz sdists support `setup.cfg` only source trees, but implicit file paths do not
See original GitHub issueDescription
Interestingly, while testing this I noticed that, assuming ./pkgdir
contains setup.cfg
but no setup.py
:
pip install file://$PWD/pkgdir
works, but pip install ./pkgdir
complains that Neither 'setup.py' nor 'pyproject.toml' found.
.
The “fix” for that would be easy (in is_installable_dir()
), but I’m not sure how far these ripples will go…
_Originally posted by @sbidoul in https://github.com/pypa/pip/issues/9945#issuecomment-835770102_
Expected behavior
$ echo '[metadata]\nname=foo' > setup.cfg && pip install --use-pep517 file:///$(pwd)
ERROR: Directory '.' is not installable. Neither 'setup.py' nor 'pyproject.toml' found.
pip version
pip 21.2.4 from /home/graingert/.virtualenvs/testing39/lib/python3.9/site-packages/pip (python 3.9)
Python version
Python 3.9.7
OS
Ubuntu 20.04.3 LTS
How to Reproduce
$ echo '[metadata]\nname=foo' > setup.cfg && pip install --use-pep517 file:///$(pwd)
Processing //home/graingert/projects/foo
DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Building wheels for collected packages: foo
Building wheel for foo (PEP 517) ... done
Created wheel for foo: filename=foo-0.0.0-py3-none-any.whl size=933 sha256=b0ec4bd32d639456067a52c0297824efbc46d9a1f7b3894c63106ed25c9168fa
Stored in directory: /tmp/pip-ephem-wheel-cache-qxna4rsa/wheels/4c/98/64/53a57a6326621aeffd6d95082ac196bdb3e2a8459e121fa09a
Successfully built foo
Installing collected packages: foo
Attempting uninstall: foo
Found existing installation: foo 0.0.0
Uninstalling foo-0.0.0:
Successfully uninstalled foo-0.0.0
Successfully installed foo-0.0.0
Output
No response
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:42 (42 by maintainers)
Top Results From Across the Web
PEP 517 – A build-system independent format for source trees
It must return the basename (not the full path) of the .tar.gz file it creates, as a unicode string. A .tar.gz source distribution...
Read more >distutils-r1 — standard Python build systems
The complete process is done in compile phase, and the install phase merely moves the files into the image directory. The PEP 517...
Read more >Python Packaging: Data files are put properly in tar.gz file but ...
Found a solution that worked for me here. Using setuptools==2.0.2 I did: setuptools.setup( ... packages=setuptools.find_packages(), ...
Read more >Configuring setuptools using setup.cfg files
Setuptools allows using configuration files (usually setup.cfg ) to define a package's metadata and other options that are normally supplied to the setup() ......
Read more >mozilla-central: changeset 597869 ...
Bug 1732946: Vendor pip/setuptools/wheel instead of installing into venv r=ahal Now that are prioritizing system over virtualenv ...
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
Does it? [^1]
[^1]: Ooh, yes it does[^2]! [^2]: I’m quite attached to my autohotkey macro for “superscript 1”, but having proper support is good[^3] [^3]: Unfortunately, it looks like Discourse doesn’t support footnotes, so I may stick with doing them manually for consistency.
OK, enough silliness for today 🙂
This is not generic to all backends having “decent error handling” - it’s specific to setuptools, because only setuptools is invoked implicitly. I think we’re struggling to stay on top of when or not to invoke the legacy setuptools backend. There’s at least six different variables to consider and all of their combinations: has
setup.py
, haspyproject.toml
, hasbuild-table
, hasrequires
, hasbuild-backend
, and--[no-]use-pep517
. Something has to give - either we invoke setuptools implicitly in fewer situations, or if we can remove the first variable, by delegating thesetup.py
existence check to thesetuptools
legacy backend, then we should probably do that.