Skip to content

Support for version parsing#1

Merged
amol- merged 9 commits intomainfrom
version-parsing
Oct 28, 2025
Merged

Support for version parsing#1
amol- merged 9 commits intomainfrom
version-parsing

Conversation

@amol-
Copy link
Copy Markdown
Collaborator

@amol- amol- commented Oct 28, 2025

Implement support for parsing versions of packages published on PyPi.

The focus on published packages means we can make it simpler by ignoring local releases.
Also as they are rarely if ever released, and are only used in development environments, we can also avoid support for combined dev versions of pre releases (IE: 1.2.3alpha5.dev12)

@amol- amol- requested a review from Copilot October 28, 2025 17:21
@amol- amol- marked this pull request as ready for review October 28, 2025 17:23
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds PEP 440 version parsing functionality to picopip, enabling version comparison and ordering without external dependencies. The implementation provides a practical subset of PEP 440, excluding rarely-used features like epochs and local versions.

  • Implements parse_version() function that returns a comparable tuple representation
  • Adds comprehensive test suite covering version ordering, equivalence, and edge cases
  • Updates documentation with usage examples and API description

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/picopip.py Adds parse_version() function and _VersionParser class implementing PEP 440 version comparison logic with regex-based parsing and offset-based ordering
tests/test_version_ordering.py Comprehensive test suite covering version sorting, equivalence, stage ordering, error cases, and edge cases for the new version parsing functionality
ruff.toml Adds linter rule exceptions (EM101, EM102, TRY003, RUF012) to accommodate error message patterns used in the new code
README.md Documents the new parse_version() function with usage examples demonstrating version comparison capabilities
.github/workflows/tests.yml Adds Python 3.14 to the test matrix for future compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/picopip.py Outdated
@amol- amol- merged commit 2798d6e into main Oct 28, 2025
8 checks passed
@amol- amol- deleted the version-parsing branch October 28, 2025 18:18
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