pytest-dev / pytest-dev/pytest

pip download fails due to missing version in metadata

Open
#9,370 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting setup.cfg's [metadata] section and how pytest exposes its version. Reproduce the pip download command with pytest 6.2.5, then verify that the downloaded package metadata reports version 6.2.5 instead of 0.0.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.