chore: update to Python 3.13+ and fix CI issues#6
Merged
Conversation
Add 9 comprehensive tests to reach 100% coverage for: - cancelable.py (99.80% -> all targeted lines covered) - composite.py (76.87% -> 100%) - decorators.py (99% -> 100%) New tests cover: - Parent token linking warnings (line 810) - Combined cancelable linking warnings (line 828) - BaseException handling (branch 723→734) - MonitoredSource exception handling (lines 71-75, 250-254) - Attribute delegation via __getattr__ (lines 79, 258) - Multiple trigger calls (branch 48→54) - Existing cancelable config handling (line 157) All 452 tests passing. 15 files now have 100% coverage.
BREAKING CHANGE: Drop Python 3.12 support, require Python 3.13+ ## Python Version Updates - Update requires-python to >=3.13 in pyproject.toml - Update Python version classifiers (remove 3.12, keep 3.13, 3.14) - Update Ruff target-version to py313 - Update Basedpyright pythonVersion to 3.13 - Update all workflow matrices to test Python 3.13 and 3.14 - Update README.md badges and description ## CI Workflow Fixes - Add conditional guards to prevent duplicate runs: - validate job: runs only on 'pull_request' event - validate-docs job: runs only on 'pull_request' event - check-pr-title job: runs only on 'pull_request_target' event - Remove problematic 'uvx hatch version dev' step from docs build (MkDocs doesn't require version to be set) ## Type Annotation Fixes - Add type annotations to test fixture parameters in: - tests/unit/test_threading_bridge.py - tests/unit/test_thread_cancelation.py - Add missing imports for AnyioBridge and OperationRegistry - Add return type annotations (-> None) to all test methods Resolves duplicate workflow runs issue where both pull_request and pull_request_target events were triggering validation jobs. All tests passing (26 tests in affected files).
This removes the pull_request_target trigger which was causing duplicate workflow runs. The pull_request_target event uses the workflow file from the base branch (main), not the PR branch, which was causing the old workflow configuration to run alongside the new one. Changes: - Remove pull_request_target trigger section - Remove check-pr-title job (depends on pull_request_target) - Remove conditional guards (no longer needed with single trigger) The PR title check can be re-enabled in a separate workflow file after this PR merges.
GitHub Actions uses /bin/sh (dash) by default which doesn't support bash-specific [[syntax used in lefthook.yml. Explicitly specify bash shell for steps that use lefthook to ensure compatibility.
Replace bash-specific [[ syntax with POSIX-compliant [ and case statements. Lefthook internally uses sh (not bash) to execute commands, which requires POSIX compliance. This fixes the "sh: [[: not found" errors in CI.
- Fix import order in 10_shared_context.py - Make cancelable parameter keyword-only in database example to avoid parameter ordering conflict
- Make cancelable parameter keyword-only in monitoring dashboard - Fix import sorting in test_cancelable.py and examples
Test assertions commonly use magic numbers which shouldn't require constants. This rule is too strict for test files where readability is more important.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR updates the library to support only Python 3.13+ (dropping Python 3.12 support) and fixes critical CI configuration issues that were causing:
BREAKING CHANGE: Drops Python 3.12 support, requires Python 3.13+
Changes
1. Python Version Requirements (3.12+ → 3.13+)
Files Modified:
pyproject.toml: Updatedrequires-pythonto>=3.13, removed 3.12 classifier, updated Ruff and Basedpyright targets.github/workflow-config.yml: Updatedsupported-versionsto["3.13", "3.14"].github/workflows/test.yaml: Updated matrix to["3.13", "3.14"].github/workflows/pull_request.yaml: Updated matrix to["3.13", "3.14"]README.md: Updated Python version badge to "3.13 | 3.14" and description to "Python 3.13+"Rationale:
@overridedecorator)2. CI Workflow Fixes
Issue 1: Duplicate Workflow Runs
Problem:
pull_request.yamlhad BOTHpull_requestandpull_request_targettriggers, causing every PR to run validation jobs twice.Solution: Added conditional guards:
Impact: PR workflows now run once instead of twice
Issue 2: Documentation Build Failure
Problem:
uvx hatch version devstep was failing withNotImplementedErrorin shallow git clonesSolution: Removed the step entirely - MkDocs doesn't require version to be set in pyproject.toml for validation builds
Impact: Documentation validation now succeeds
3. Type Annotation Fixes
Files Modified:
tests/unit/test_threading_bridge.pytests/unit/test_thread_cancelation.pyChanges:
bridge: AnyioBridge,clean_registry: OperationRegistry)-> None) to all test methodsAnyioBridgeandOperationRegistryImpact: Resolves basedpyright type checking errors that were blocking CI
Testing
Verification
Once this PR is merged, verify:
Related Issues
Fixes the CI failures on PR #5