Skip to content

tdd-ai-agents: Treat missing release segments as zero - #877

Merged
martin-martin merged 3 commits into
masterfrom
tdd-ai-agents-trailing-zeros
Oct 6, 2026
Merged

martin-martin merged 3 commits into
masterfrom
tdd-ai-agents-trailing-zeros

Conversation

@realpython-bot

Copy link
Copy Markdown
Collaborator

Follow-up to #807, matching an update to the TDD With AI Agents tutorial.

The ._key() method compared raw release tuples, so Version("1.2") == Version("1.2.0") was False. That goes against Python's version rules and the tutorial's text. It also meant that 1.2.0.dev1 sorted after 1.2.

  • version_check/core.py: ._key() now trims trailing zeros from the release
  • tests/test_core.py: Adds test_missing_segments_count_as_zero() with three cases

The suite passes: 22 tests, up from 19. ruff and black report no issues.

🤖 Generated with Claude Code

martin-martin and others added 3 commits October 6, 2026 06:50
Version("1.2") compared unequal to Version("1.2.0") because ._key()
compared raw release tuples. Trim trailing zeros in ._key() and add
test_missing_segments_count_as_zero() to match the updated tutorial.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@martin-martin
martin-martin merged commit 6882c97 into master Oct 6, 2026
1 check passed
@martin-martin
martin-martin deleted the tdd-ai-agents-trailing-zeros branch October 6, 2026 08:17
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