Drop python 3.10 support - #207
Conversation
Reviewer's GuideDrop Python 3.10 support, standardize tooling and CI on Python 3.11+, and adopt Python 3.11-specific language and stdlib features while cleaning up type hints and tests. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="pyproject.toml" line_range="11" />
<code_context>
]
license = { text = "MIT" }
readme = "README.md"
-requires-python = ">=3.10"
+requires-python = ">=3.11"
classifiers = [
"Development Status :: 4 - Beta",
</code_context>
<issue_to_address>
**issue (broader_impact):** The repository CI and contributor instructions still provision Python 3.10, but `uv sync --frozen` and `pip install .` now reject Python 3.10 because the project metadata requires `>=3.11`. The 3.10 entries remain in `.github/workflows/ci.yaml`, `.github/workflows/complexity.yaml`, `CONTRIBUTING.md`, and `AGENTS.md`, so CI jobs and documented development setup fail until those references are updated or removed.
**Triggers:** When the existing Python 3.10 CI jobs run or contributors follow the documented setup.
**Suggested fix:** Update all CI matrices/setup steps and contributor documentation to use Python 3.11+; remove Python 3.10 from the test matrix.
</issue_to_address>
### Comment 2
<location path="pyproject.toml" line_range="53-52" />
<code_context>
"invoke>=2.2.0",
"mypy>=1.10.0",
"packaging>=26.0",
- "pre-commit>=3.7.0",
+ "prek>=0.4.14",
"pyfakefs>=5.4.1",
- "pytest>=8.0.0",
</code_context>
<issue_to_address>
**issue (bug_risk):** The development dependency now installs `prek` instead of `pre-commit`, but `CONTRIBUTING.md` still instructs contributors to run `uv run pre-commit install`; that executable is not provided by the renamed dependency, so the documented hook-installation command fails.
**Triggers:** When a contributor follows the current Getting Started instructions after syncing dependencies.
**Suggested fix:** Change the documented command to `uv run prek install` and update any remaining setup instructions that invoke `pre-commit` as a local executable.
</issue_to_address>
### Comment 3
<location path="pyproject.toml" line_range="89-88" />
<code_context>
packages = ["src/ruff_sync"]
[tool.mypy]
-python_version = "3.10"
+python_version = "3.11"
files = ["src", "tests/", "tasks.py", ".agents/"]
strict = true
</code_context>
<issue_to_address>
**nitpick:** The repository's agent/development instructions still state that mypy uses `python_version = "3.10"`, while the configuration now analyzes code as Python 3.11. Contributors following those instructions receive incorrect type-checking expectations and can misdiagnose differences between documented and actual checks.
**Triggers:** When contributors use `AGENTS.md` to understand or reproduce the type-check configuration.
**Suggested fix:** Update the stale Python-version references in `AGENTS.md` and related development documentation from 3.10 to 3.11.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 2 findings to address first, and this changes the published compatibility policy so every Python 3.10 user is blocked from installing or upgrading to this version, and the decision is effective immediately without a runtime failure signal. Reverting the repository change would not undo the incompatibility for any package artifact already released.
Blocking findings: pyproject.toml:11, pyproject.toml:52
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Merging this PR will degrade performance by 1.21%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_bench_resolve_raw_url_github_blob |
187 µs | 286.6 µs | -34.77% |
| ❌ | test_bench_resolve_raw_url_github_repo |
249.9 µs | 361.9 µs | -30.94% |
| ❌ | test_bench_resolve_raw_url_gitlab |
224.9 µs | 324.9 µs | -30.78% |
| ❌ | test_bench_resolve_raw_url_github_tree |
284.1 µs | 382 µs | -25.64% |
| ⚡ | test_bench_get_ruff_config_small |
2.7 ms | 1.6 ms | +69.44% |
| ⚡ | test_bench_get_ruff_config_large |
17.5 ms | 13.1 ms | +33.86% |
| ⚡ | test_bench_toml_parse_and_serialize |
18 ms | 13.6 ms | +32.86% |
| ⚡ | test_bench_get_ruff_config_with_exclusions |
18.3 ms | 14.1 ms | +29.86% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing drop-py310 (4435a46) with main (b8bece2)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #207 +/- ##
==========================================
+ Coverage 94.06% 94.21% +0.14%
==========================================
Files 10 10
Lines 1602 1590 -12
==========================================
- Hits 1507 1498 -9
+ Misses 95 92 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/ruff_sync/core.py" line_range="711-714" />
<code_context>
-
- return fetch_results
+ return [t.result() for t in tasks]
+ except* Exception as eg:
+ errors: list[tuple[URL, BaseException]] = []
+ for i, t in enumerate(tasks):
+ if t.done():
+ exc = t.exception()
+ if exc is not None:
+ errors.append((upstream_list[i], exc))
+ if errors:
+ raise UpstreamError(errors) from eg
</code_context>
<issue_to_address>
**issue (bug_risk):** When one upstream task fails and TaskGroup cancels a slower sibling, `t.exception()` raises `asyncio.CancelledError` for the cancelled task instead of returning an exception. The exception handler therefore escapes before raising the documented `UpstreamError`, so callers receive cancellation rather than the aggregated upstream failure.
**Triggers:** When upstream fetches complete at different times and at least one failing fetch cancels another in-flight fetch.
**Suggested fix:** Skip cancelled tasks before calling `t.exception()`, for example with `if t.done() and not t.cancelled():`, while preserving the original failure in the aggregated errors.
```suggestion
if t.done() and not t.cancelled():
exc = t.exception()
if exc is not None:
errors.append((upstream_list[i], exc))
```
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: src/ruff_sync/core.py:714
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
Python 3.10 is going end of life on Oct 2026 (in approximately 2 months).
https://endoflife.date/python
Dropping support earlier simplifies our dependencies and enables new python 3.11+ features.
Summary by Sourcery
Drop Python 3.10 support and standardize development, CI, and runtime configuration on Python 3.11 and newer.
Bug Fixes:
Enhancements:
Build:
CI:
Documentation:
Tests:
Chores: