Skip to content
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

pip download fails due to missing version in metadata #9370

Open
staer opened this issue Dec 6, 2021 · 4 comments
Open

pip download fails due to missing version in metadata #9370

staer opened this issue Dec 6, 2021 · 4 comments
Labels
type: bug problem that needs to be addressed

Comments

@staer
Copy link

staer commented Dec 6, 2021

Using pip (v21.3.1) and setuptools (v59.5.0) the following command to download pytest fails:

pip download --no-build-isolation --no-binary :all: pytest==6.2.5

Collecting pytest==6.2.5
  Downloading pytest-6.2.5.tar.gz (1.1 MB)
     |████████████████████████████████| 1.1 MB 1.9 MB/s            
  Preparing metadata (pyproject.toml) ... done
  WARNING: Requested pytest==6.2.5 from https://files.pythonhosted.org/packages/4b/24/7d1f2d2537de114bdf1e6875115113ca80091520948d370c964b88070af2/pytest-6.2.5.tar.gz#sha256=131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89, but installing version 0.0.0
WARNING: Discarding https://files.pythonhosted.org/packages/4b/24/7d1f2d2537de114bdf1e6875115113ca80091520948d370c964b88070af2/pytest-6.2.5.tar.gz#sha256=131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89 (from https://pypi.org/simple/pytest/) (requires-python:>=3.6). Requested pytest==6.2.5 from https://files.pythonhosted.org/packages/4b/24/7d1f2d2537de114bdf1e6875115113ca80091520948d370c964b88070af2/pytest-6.2.5.tar.gz#sha256=131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89 has inconsistent version: filename has '6.2.5', but metadata has '0.0.0'
ERROR: Could not find a version that satisfies the requirement pytest==6.2.5 (from versions: 2.0.0, <SNIP ALL VERSIONS>, 6.2.5)
ERROR: No matching distribution found for pytest==6.2.5

I believe this is due to setup.cfg having no version specified in the [metadata] section. I believe something along the lines of:

version = attr: pytest.__version__

might get it working.

@nicoddemus
Copy link
Member

I'm just guessing here, but perhaps --no-build-isolation bypasses setuptools-scm?

cc @RonnyPfannschmidt

@RonnyPfannschmidt
Copy link
Member

@nicoddemus yes, we should probably ensure setup.py fails harshly if the required versions are missing

im also confused as to why pip skips build requires

@staer
Copy link
Author

staer commented Dec 6, 2021

Some additional datapoints:

Using the legacy-resolver works fine:

pip download --no-binary :all: --use-deprecated=legacy-resolver --no-build-isolation pytest==6.2.5

And not using no-build-isolation also works fine:

pip download --no-binary :all: pytest==6.2.5

@RonnyPfannschmidt
Copy link
Member

@staer i beleive that part is a pip bug, - pytest can add a error to make it more visible

@Zac-HD Zac-HD added the type: bug problem that needs to be addressed label Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed
Projects
None yet
Development

No branches or pull requests

4 participants