Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ jobs:
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
steps:

# repo: https://github.com/actions/checkout
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ jobs:
- "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
include:
# Exercise the Windows-specific code paths at least once per run, matching the
# "Operating System :: Microsoft :: Windows" classifier in pyproject.toml.
Expand Down
4 changes: 2 additions & 2 deletions .just/uv.justfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ alias uv-export := uv-export-requirements
# set python-version in .python-version file
[group: 'uv']
[unix]
uv-set-python-version version="3.10" *args:
uv-set-python-version version="3.11" *args:
mv .python-version .python-version.backup
@ echo "{{version}}" > .python-version
@ echo -e "Set python version to {{version}}"

# set python-version in .python-version file
[group: 'uv']
[windows]
uv-set-python-version version="3.10" *args:
uv-set-python-version version="3.11" *args:
#!pwsh.exe
Move-Item .python-version .python-version.backup -Force
Set-Content -Path .python-version -Value "{{version}}"
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ default_install_hook_types: [commit-msg, pre-commit]
default_stages: [pre-commit, manual]

default_language_version:
python: "3.9"
python: "3.11"

fail_fast: true

Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10
3.11
6 changes: 6 additions & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented anti-chronologically in this file.

## Unreleased

- Drop support for Python 3.9 and 3.10 (both end-of-life); `requires-python` is now `>=3.11`.
Removes the 3.9-only workarounds (`tp.Optional` for cyclopts, coverage pragmas for the
pre-PEP 626 line table), targets ruff at `py311`, and defaults `.python-version` to 3.11.

## 0.1.1 (2026-11-03)

Maintenance release: no changes to the package code or its runtime dependencies.
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Requirements

- Python >= 3.9
- Python >= 3.11
- [uv](https://docs.astral.sh/uv/), to resolve and install the local-path overrides once
`toggle` has enabled them

Expand Down
2 changes: 1 addition & 1 deletion docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ See [Introduction] for the full problem this solves.

## Requirements

- Python >= 3.9
- Python >= 3.11
- [uv]

## Installation
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ version = "0.1.2.dev1"
license = { file = "license.md" }
description = "Toggle [tool.uv.sources] local path overrides in pyproject.toml on and off, and guard against committing them."
readme = "docs/readme.md"
requires-python = ">=3.9"
requires-python = ">=3.11"
authors = [{ name = "Wouter Vanden Hove", email = "wouter@libranet.eu" }]
maintainers = [{ name = "Wouter Vanden Hove", email = "wouter@libranet.eu" }]
keywords = ["uv", "pyproject.toml", "dependencies", "editable-install", "local-development", "pre-commit", "cli"]
Expand All @@ -42,8 +42,6 @@ classifiers = [
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development",
Expand Down Expand Up @@ -165,7 +163,7 @@ testpaths = ["tests"] # search for test-files
cache-dir = "var/cache/ruff" # relative to project_root
fix = true
line-length = 120
target-version = "py39"
target-version = "py311"

[tool.ruff.lint]
select = ["ALL"]
Expand Down
4 changes: 2 additions & 2 deletions src/uv_developer/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

"""

from __future__ import annotations # make | in typing work in Python 3.8
from __future__ import annotations

import importlib.metadata

Expand All @@ -24,7 +24,7 @@

def _get(key: str) -> str | None:
"""Return a metadata field, or None when unavailable/unset."""
return metadata.get(key) if metadata is not None else None
return metadata[key] if metadata is not None and key in metadata else None


authors: str | list[str] = _get("Author-email") or "unknown"
Expand Down
3 changes: 1 addition & 2 deletions src/uv_developer/cli/toggle.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from __future__ import annotations

import pathlib as pl
import typing as tp # `X | None` breaks cyclopts' runtime introspection on Python 3.9

import cyclopts

Expand All @@ -16,7 +15,7 @@


@app.default()
def toggle(action: tp.Optional[str] = None, pyproject: pl.Path = pl.Path("pyproject.toml")) -> None: # noqa: UP045
def toggle(action: str | None = None, pyproject: pl.Path = pl.Path("pyproject.toml")) -> None:
"""Toggle [tool.uv.sources] local path overrides in pyproject.toml.

By default (no action), the command auto-toggles:
Expand Down
13 changes: 2 additions & 11 deletions src/uv_developer/toggle.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ def parse_source_entries(lines: list[str]) -> list[SourceEntry]:
in_uv_sources = False

if not in_uv_sources or not stripped:
# This *is* exercised (see test_toggle_sources_reports_no_entries and friends), but
# CPython 3.9's bytecode line-table doesn't emit a distinct trace event for a bare
# `continue` as the sole body of an `or`-guarded `if` here -- coverage.py sees it as
# never hit. Fixed by PEP 626 (Python 3.10+); confirmed by running the same suite
# under 3.13, where this line and its branch both report 100%.
continue # pragma: no cover
continue

match = SOURCE_KEY_RE.match(line)
if not match:
Expand Down Expand Up @@ -102,11 +97,7 @@ def toggle_sources(mode: ToggleMode | None, pyproject: pl.Path) -> tuple[ToggleM
if entry.pinned:
continue
ensure_cloned(project_root, entry)
# Both branches are exercised (test_toggle_sources_warns_when_missing_clone_comment
# enters it, test_toggle_sources_no_write_when_already_in_target_mode skips it), but
# CPython 3.9's bytecode line-table doesn't record the "skip straight to `continue`"
# arc here as taken -- same PEP 626 limitation as above, confirmed fixed under 3.13.
if entry.line.strip().startswith("#"): # pragma: no branch
if entry.line.strip().startswith("#"):
updated_lines[entry.idx] = re.sub(r"^\s*#\s*", "", entry.line)
changed = True
continue
Expand Down
Loading
Loading