Skip to content

.python-version is not necessarily a version specifier (per PEP 440) and thus cannot necessarily be used for environment.python.requires #659

Closed
@Lytol

Description

@Lytol

Per PEP 440, a version specifier must contain a comparison operator (i.e. >, ==, etc). Connect expects a PEP-440 compliant version specifier for the environment.python.requires manifest property.

A few options that I see:

  1. Ensure that .python-version is a valid version specifier; otherwise, skip.
  2. Modify the version that we get from .python-version to make it a compliant version specifier (i.e. prepend ==)
  3. Do not use .python-version at all 🤷

I'm fine with any of these, but here's my 2 cents:

Given that .python-version appears to be pretty bespoke for uv and can contain a wide variety of non-version-specifier values (see https://docs.astral.sh/uv/concepts/python-versions/#requesting-a-version), then I'd vote to drop the precedence of .python-version below pyproject.toml and setup.cfg, and then (1) skip if not a valid version specifier.

@amol- What do you think?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions