Skip to content

fix: use valid PEP 440 syntax for requires-python - #501

Merged
kkikendall merged 1 commit into
mainfrom
fix/pyproject-requires-python-pep440
Sep 16, 2026
Merged

kkikendall merged 1 commit into
mainfrom
fix/pyproject-requires-python-pep440

Conversation

@kkikendall

Copy link
Copy Markdown
Contributor

Summary

The release pipeline has been silently broken since the Poetry [tool.poetry] -> PEP 621 [project] migration: requires-python = "^3.9.2" uses Poetry's caret syntax, which is valid under the old [tool.poetry] table but is not valid PEP 440, which is what PyPI's upload validator requires for the PEP 621 requires-python field.

The last two release attempts both succeeded at bumping the version, tagging, and creating a GitHub Release, but the final poetry publish step failed:

HTTP Error 400: '^3.9.2' is invalid for 'requires-python'.

As a result, PyPI is currently stuck on 6.9.0 even though the repo/tags say 6.9.1.

Changes

  • pyproject.toml: requires-python = "^3.9.2" -> requires-python = ">=3.9.2,<4.0.0" (equivalent constraint, valid PEP 440 syntax).
  • poetry.lock: regenerated (poetry lock) to match — only the python-versions/content-hash metadata lines changed.

Test plan

  • poetry build succeeds
  • python -m twine check dist/* — PASSED on both sdist and wheel (previously this metadata shape is what PyPI itself rejects)
  • Confirmed generated PKG-INFO now has Requires-Python: >=3.9.2,<4.0.0
  • poetry run poe lint — all checks pass (isort, black, flake8, mypy)
  • poetry run poe test — 15 passed, 1 skipped, 2 pre-existing failures unrelated to this change (they depend on a local httpbin-style server on localhost:8080 not present in this environment; confirmed they fail identically on unmodified main)

Once merged, the next conventional-commit release to main should finally reach PyPI (superseding the never-published 6.9.1).

🤖 Generated with Claude Code

The Poetry [tool.poetry] -> PEP 621 [project] migration carried over
Poetry's caret syntax (^3.9.2) verbatim into the PEP 621
requires-python field, which PyPI's upload validator rejects outright.
The last two release attempts (v0.1.0, v6.9.1) both tagged and created
GitHub Releases successfully, but `poetry publish` failed at the last
step with "HTTP Error 400: '^3.9.2' is invalid for 'requires-python'",
so PyPI is still stuck on 6.9.0.

Verified the fix produces valid Requires-Python metadata and passes
`twine check` on both the sdist and wheel.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The constraint and lock metadata updates are consistent and address the publishing issue.

Pull request overview

Fixes the package’s Python version constraint so release metadata is valid for PyPI publishing.

Changes:

  • Replaces Poetry caret syntax with >=3.9.2,<4.0.0 in pyproject.toml.
  • Regenerates matching lock metadata in poetry.lock.
File summaries
File Description
pyproject.toml Defines the corrected Python version constraint.
poetry.lock Synchronizes lock metadata with the updated constraint.
Review details
  • Files reviewed: 1/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@kkikendall
kkikendall merged commit 7a19ee1 into main Sep 16, 2026
11 checks passed
@kkikendall
kkikendall deleted the fix/pyproject-requires-python-pep440 branch September 16, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants