Skip to content

Conversation

Copy link

Copilot AI commented Jan 3, 2026

The release workflow accepted arbitrary strings for custom_version without validation, allowing invalid versions like "abc" or "1.2.3.4.5" to be written to pyproject.toml.

Changes

  • Import InvalidVersion from packaging.version
  • Validate custom version with parse() before accepting it
  • Raise ValueError with descriptive message on invalid input
# Handle custom version
if release_type == "custom":
    # Validate custom version
    try:
        parse(custom)
        new_version = custom
    except InvalidVersion as e:
        raise ValueError(f"Invalid custom version '{custom}': {e}")

Workflow now rejects malformed versions early instead of creating invalid package metadata.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 3, 2026 15:24
Co-authored-by: stuartp44 <1926002+stuartp44@users.noreply.github.com>
…fic InvalidVersion exception

Co-authored-by: stuartp44 <1926002+stuartp44@users.noreply.github.com>
Copilot AI changed the title [WIP] Update CI, publish, and release workflows in pyproject.toml Add validation for custom version input in release workflow Jan 3, 2026
Copilot AI requested a review from stuartp44 January 3, 2026 15:27
@stuartp44 stuartp44 marked this pull request as ready for review January 7, 2026 12:26
@stuartp44 stuartp44 merged commit 7321eed into stu/add_ci_pipeline Jan 7, 2026
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.

2 participants