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

[BUG] Cannot use .* with >= in version specifiers #3807

Closed
whitequark opened this issue Feb 2, 2023 · 1 comment
Closed

[BUG] Cannot use .* with >= in version specifiers #3807

whitequark opened this issue Feb 2, 2023 · 1 comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@whitequark
Copy link

whitequark commented Feb 2, 2023

setuptools version

setuptools===67.1.0

Python version

Python 3.9.2

OS

Debian 11

Additional environment information

No response

Description

Setuptools validation for pyproject.toml dependency specifications is too strict and rejects amaranth-yosys>=0.10.*.

This doesn't match the grammar defined in PEP 508.

You might ask yourself, "isn't this version specification the same as amaranth-yosys>=0.10?" The answer is no, try running both:

  • pip install 'amaranth-yosys>=0.10.*'
  • pip install 'amaranth-yosys>=0.10'

and comparing the result. Only the former will succeed since all of the amaranth-yosys distributions have a .dev suffix.

Expected behavior

Setuptools accepts amaranth-yosys>=0.10.* in a dependency specification.

How to Reproduce

Put the following in a pyproject.toml file in an empty directory:

[build-system]
requires = ["wheel", "setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "test-project"
version = "1.0"
dependencies = ["amaranth-yosys>=0.10.*"]

Install it with pip install .

Output

  configuration error: `project.dependencies[{data__dependencies_x}]` must be pep508
  DESCRIPTION:
      Project dependency specification according to PEP 508
  
  GIVEN VALUE:
      "amaranth-yosys>=0.10.*"
  
  OFFENDING RULE: 'format'
  
  DEFINITION:
      {
          "$id": "#/definitions/dependency",
          "title": "Dependency",
          "type": "string",
          "format": "pep508"
      }
@whitequark whitequark added bug Needs Triage Issues that need to be evaluated for severity and status. labels Feb 2, 2023
@whitequark
Copy link
Author

This seems to be an intentional change, see pypa/packaging#645. After some consideration I think I've been misusing .dev-versions all this time and will have to (unfortunately painfully) transition to a different scheme.

whitequark added a commit to amaranth-lang/amaranth-yosys that referenced this issue Feb 3, 2023
It is no longer possible to write half-open version constraints
with packages that publish `.dev` versions. Since that was a misuse
of `.dev` versions anyway, stop doing that.

See also pypa/setuptools#3807.
@whitequark whitequark changed the title [BUG] [BUG] Cannot use .* with >= in version specifiers Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

No branches or pull requests

1 participant