Skip to content

Cannot install pylock.toml from CPython dev version #1178

@hugovk

Description

@hugovk

Description

CPython's dev versions don't strictly follow PEP 440 because of the plus: 3.15.0a8+

This prevents pip installing from a pylock.toml with this version.

Expected behavior

I expect to be able to install from a CPython dev version, because I'd like to use a lockfile for CPython's docs: python/cpython#149058.

pip version

25.1

Python version

3.15.0a8+

OS

macOS and Linux

How to Reproduce

  1. Build CPython from source: https://devguide.python.org/
  2. Save this as pylock.toml:
lock-version = "1.0"
created-by = "minimal-repro"
requires-python = ">=3.12"
packages = []
  1. Install: python.exe -m pip install -r pylock.toml

Output

Defaulting to user installation because normal site-packages is not writeable
WARNING: Using pylock.toml as a requirements source is an experimental feature. It may be removed/changed in a future release without prior warning.
ERROR: Cannot select requirements from pylock file 'pylock.toml': python_full_version '3.15.0a8+' in provided environment does not satisfy the Python version requirement '>=3.12'

See also https://github.com/python/cpython/actions/runs/25007535303/job/73234353237?pr=149058

This comes from src/packaging/pylock.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions