How to drop support for an older Python version
To drop an older Python version, raise requires-python and update the tests and compatibility code that enforce that promise. Changing a development interpreter alone does not change which Python versions can install a release.
Prerequisites
Use this checklist for an existing library managed with uv, with a build backendThe tool that does the actual work of turning your source code into an installable package. Examples include hatchling, setuptools, and uv_build. and pytest configured. The examples drop Python 3.10 and retain Python 3.11 through 3.15; substitute the versions your library supports. Run commands from the project root.
Raise the minimum in package metadata
In the existing [project] table of pyproject.toml, change the floor:
requires-python = ">=3.11"Remove Programming Language :: Python :: 3.10 from classifiers, keeping classifiers for versions you still test. Classifiers describe support; requires-python enforces it. Compatible installers skip a release whose requirement excludes their interpreter, then look for an older compatible release that satisfies the other constraints.
Align the interpreter and CI matrix
If .python-version still pins the dropped version, update it:
uv python pin 3.11Expect .python-version to contain 3.11. A newer supported development pin can stay unchanged; see changing a uv project’s Python version.
Remove "3.10" from the existing GitHub Actions test matrix. Keep the new minimum, not just the newest interpreter:
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]Ensure each test job actually selects matrix.python-version, rather than silently using .python-version. Update other version lists, such as tox environments or wheel-build targets, if present. Follow testing against multiple Python versions for the test commands and CI setup.
Remove obsolete compatibility code
Update explicit Python targets in linting and type-checker configuration. Ruff infers its target from requires-python when no explicit target overrides it; remove or update a stale target-version.
Find version guards that the new floor makes obsolete:
uvx ruff check --select UP036 --target-version py311 .Expect UP036 diagnostics for recognized outdated sys.version_info branches, or All checks passed! when none are found. Review each branch before removing it: Ruff marks automatic fixes unsafe because they discard code and comments.
Check conditional dependencies and fallback imports too. For example, after replacing a Python 3.10 tomli fallback with tomllib, remove a dependency used only under python_version < '3.11'. Do not remove every backport blindly; some expose features newer than the new minimum.
Refresh the lockfile and test the new minimum
uv lock
uv run --locked --python 3.11 pytestuv lock updates the project’s lockfileA file that records the exact version of every installed package, so everyone working on the project gets identical installs.
for the new requirements; review its requires-python field and package changes. It prefers existing compatible pins, so raising the floor does not automatically upgrade every dependency. Keep deliberate dependency upgrades separate from the support change.
uv run executes the command inside the project’s virtual environment, ensuring all dependencies are installed first. Expect pytest to pass on 3.11; --locked rejects a stale lockfile instead of updating it.
Repeat the tests across the retained CI matrix, including relevant optional dependencies. A successful resolution does not prove runtime compatibility.
Verify the release and tell users
uv buildExpect a wheelA prebuilt Python package file (.whl) that installs without compiling anything. The standard distribution format for Python packages.
Learn more โ
and source distribution in dist/. Open the new wheel as a ZIP archive and unpack the source distribution. Inspect .dist-info/METADATA in the wheel and PKG-INFO in the source distribution: both should contain Requires-Python: >=3.11 and omit the dropped classifier.
Check the artifacts from this build, not an older file left in dist/.
Before publishing, update the changelog, installation instructions, and any Python-version badge. State the new minimum and the last release that supports the dropped version; announce the change in advance when your support policy promises notice.
Keep that older release available, and say whether it will receive fixes. Commit the metadata, compatibility edits, CI changes, and uv.lock together.