Skip to content

Drop support for Python 3.9 and 3.10 - #608

Merged
ap-- merged 3 commits into
fsspec:mainfrom
ap--:drop-eol-pythons
Dec 5, 2026
Merged

ap-- merged 3 commits into
fsspec:mainfrom
ap--:drop-eol-pythons

Conversation

@ap--

@ap-- ap-- commented Dec 5, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #544

Python 3.9 reached its end of life in October 2025, and Python 3.10 in October 2026. First PR of
the 0.4.0 series.

Drop support for Python 3.9 and 3.10

  • require python>=3.11, and remove 3.9 and 3.10 from CI, nox, the classifiers, the docs and the
    README compatibility table
  • run the minimum fsspec version tests on Python 3.11
  • remove the code paths and backports for Python < 3.11 in upath.core,
    upath.implementations.local, upath.registry and the tests
  • import Self, Unpack and TypeAlias from typing. typing_extensions isn't needed anymore
    to resolve the type hints at runtime, and is dropped from the dev extra
  • remove the vendored CPython 3.9 and 3.10 pathlib test suites
  • pyupgrade: target Python 3.11

Use Python 3.11 standard library features

  • functools.cache instead of lru_cache(maxsize=None)
  • X | Y instead of typing.Union / typing.Optional in the runtime type aliases of upath.types
  • collections.abc instead of typing for Callable, Iterator and Sequence in
    upath/types/_abc.pyi
  • contextlib.chdir and datetime.UTC in the tests

Type check the code for all supported Python versions

Python 3.15 is in the tests and typesafety matrices since #572, but mypy never ran on the upath
package in CI. The type-checking nox session only checked the sys.version_info branches of the
Python version it runs on (3.13), so the code paths for 3.14 and 3.15 were never type checked.

  • nox: the type-checking session runs mypy with --python-version for every supported version
  • ci: new type-checking job

I checked that a type error in the 3.15-only LocalPath.is_reserved() passes the old session and
fails the new one.

Python 3.15 audit

  • the pathlib changes in 3.15 (mkdir(parent_mode=...), the removal of PurePath.is_reserved())
    are handled and tested since Support python 3.15 #572
  • upath doesn't use any API that's deprecated or removed in 3.15
  • tests on 3.15: no failures, and the only skips are platform-related or about empty directories
    on object stores

Follow-ups: vendoring the CPython pathlib test suites for 3.13, 3.14 and 3.15 (only 3.11 and 3.12
run against PosixUPath/WindowsUPath today), and testing the free-threaded 3.15t build.

Testing

  • nox -s tests-3.11 tests-3.14 tests-3.15 tests-minversion: all green, except the SMB suite,
    which can't bind port 445 on my machine
  • nox -s type-checking type-safety-3.11 type-safety-3.15 type-narrowing: mypy for 3.11 to 3.15,
    the typesafety cases and the pyright/ty narrowing checks pass
  • pre-commit passes on each commit

After merging: the conda-forge feedstock needs python_min 3.11 for the 0.4.0 release.

ap-- added 3 commits December 5, 2026 19:39
Python 3.9 reached its end of life in October 2025, and Python 3.10
in October 2026.

- require python>=3.11, remove 3.9 and 3.10 from ci, nox, the
  classifiers, the docs and the README compatibility table
- run the minimum fsspec version tests on python 3.11
- remove python<3.11 code paths and backports in upath.core,
  upath.implementations.local, upath.registry and the tests
- import Self, Unpack and TypeAlias from typing, typing_extensions
  isn't needed anymore to resolve the type hints at runtime
- remove the vendored cpython 3.9 and 3.10 pathlib test suites
- pyupgrade: target python 3.11

Closes fsspec#544
- functools.cache instead of lru_cache(maxsize=None)
- X | Y instead of typing.Union and typing.Optional in the runtime
  type aliases of upath.types
- collections.abc instead of typing for Callable, Iterator and
  Sequence in upath.types._abc
- contextlib.chdir and datetime.UTC in the tests
Python 3.15 is part of the tests and typesafety matrices since fsspec#572,
but mypy never ran on the upath package in CI, and the nox
type-checking session only checked the sys.version_info branches of
the Python version it runs on (3.13). So the code paths for Python
3.14 and 3.15 were never type checked.

- nox: run mypy with --python-version for every supported version in
  the type-checking session
- ci: add a type-checking job
@ap--
ap-- marked this pull request as ready for review December 5, 2026 22:19
@ap--
ap-- merged commit 39faeeb into fsspec:main Dec 5, 2026
26 checks passed
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.

Drop python 3.9 and 3.10 support

1 participant