From 762c131b0f5d528b7c1b956e3c5fa6b1b29dfac6 Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Thu, 28 May 2026 09:21:39 +0200 Subject: [PATCH 1/7] Remove PyPy from the test matrix for now --- .github/workflows/ci.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff4788b..1cc98d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.9"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] optional-deps: [true] with-libs: [true] include: diff --git a/tox.ini b/tox.ini index f1ef44a..8439d31 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = black,flake8,mypy,py39,py310,py311,py312,py313,pypy3 +envlist = black,flake8,mypy,py39,py310,py311,py312,py313 isolated_build = True [testenv] From 8ca323153b4201a8f2437c600d4d3db8949bb9a1 Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Thu, 28 May 2026 09:13:39 +0200 Subject: [PATCH 2/7] Move coverage configuration to pyproject.toml --- pyproject.toml | 9 +++++++++ tox.ini | 8 +------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c0f5bc2..824b05f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,3 +34,12 @@ write_to = "src/xopen/_version.py" [tool.pytest.ini_options] addopts = "--strict-markers" + +[tool.coverage.run] +branch = true + +[tool.coverage.report] +exclude_also = [ + "def __repr__", + "@overload", +] diff --git a/tox.ini b/tox.ini index 8439d31..0a8b3ff 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ setenv = PYTHONDEVMODE = 1 PYTHONWARNDEFAULTENCODING = 1 commands = - coverage run --branch --source=xopen,tests -m pytest -v --doctest-modules tests + coverage run --source=xopen,tests -m pytest -v --doctest-modules tests coverage report coverage xml coverage html @@ -47,9 +47,3 @@ commands = mypy src/ max-line-length = 99 max-complexity = 10 extend_ignore = E731 - -[coverage:report] -exclude_lines = - pragma: no cover - def __repr__ - @overload From 5275d26a352a843945eb501c75db684e67acc2e9 Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Thu, 28 May 2026 09:13:39 +0200 Subject: [PATCH 3/7] Switch from flake8 to ruff --- .github/workflows/ci.yml | 2 +- tox.ini | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cc98d6..fd93b4c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: python-version: ["3.10"] - toxenv: [black, flake8, mypy] + toxenv: [black, ruff, mypy] steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} diff --git a/tox.ini b/tox.ini index 0a8b3ff..719f982 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = black,flake8,mypy,py39,py310,py311,py312,py313 +envlist = black,ruff,mypy,py39,py310,py311,py312,py313 isolated_build = True [testenv] @@ -32,18 +32,13 @@ deps = black==22.3.0 skip_install = true commands = black --check src/ tests/ -[testenv:flake8] +[testenv:ruff] basepython = python3.10 -deps = flake8 -commands = flake8 src/ tests/ +deps = ruff +commands = ruff check src/ tests/ skip_install = true [testenv:mypy] basepython = python3.10 deps = mypy commands = mypy src/ - -[flake8] -max-line-length = 99 -max-complexity = 10 -extend_ignore = E731 From 942a3cc88f1fbbc7f204481f0c12786db020b52b Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Thu, 28 May 2026 09:54:42 +0200 Subject: [PATCH 4/7] Migrate from tox.ini to tox.toml --- .github/workflows/ci.yml | 6 +++--- tox.ini | 44 ---------------------------------------- tox.toml | 43 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 47 deletions(-) delete mode 100644 tox.ini create mode 100644 tox.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd93b4c..b83cbf3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,14 +76,14 @@ jobs: - name: Install dependencies run: python -m pip install tox - name: Test - run: tox -e py + run: tox run -e ${{ matrix.python-version }} if: matrix.with-libs - name: Test without python-isal and python-zlib-ng - run: tox -e no-libs + run: tox run -e no-libs if: true && !matrix.with-libs - name: Test with zstandard if: matrix.with-zstandard - run: tox -e zstd + run: tox run -e zstd - name: Upload coverage report uses: codecov/codecov-action@v3 diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 719f982..0000000 --- a/tox.ini +++ /dev/null @@ -1,44 +0,0 @@ -[tox] -envlist = black,ruff,mypy,py39,py310,py311,py312,py313 -isolated_build = True - -[testenv] -deps = - pytest - pytest-timeout - coverage -setenv = - PYTHONDEVMODE = 1 - PYTHONWARNDEFAULTENCODING = 1 -commands = - coverage run --source=xopen,tests -m pytest -v --doctest-modules tests - coverage report - coverage xml - coverage html - -[testenv:zstd] -deps = - {[testenv]deps} - zstandard - -[testenv:no-libs] -commands= - pip uninstall -y isal zlib-ng - {[testenv]commands} - -[testenv:black] -basepython = python3.10 -deps = black==22.3.0 -skip_install = true -commands = black --check src/ tests/ - -[testenv:ruff] -basepython = python3.10 -deps = ruff -commands = ruff check src/ tests/ -skip_install = true - -[testenv:mypy] -basepython = python3.10 -deps = mypy -commands = mypy src/ diff --git a/tox.toml b/tox.toml new file mode 100644 index 0000000..49d6c45 --- /dev/null +++ b/tox.toml @@ -0,0 +1,43 @@ +env_list = ["black", "ruff", "mypy", "3.9", "3.10", "3.11", "3.12", "3.13"] + +[env_run_base] +default_base_python = "3.10" +deps = [ + "pytest", + "pytest-timeout", + "coverage", +] +set_env = { PYTHONDEVMODE = "1", PYTHONWARNDEFAULTENCODING = "1" } +commands = [ + ["coverage", "run", "--source=xopen,tests", "-m", "pytest", "-v", "--doctest-modules", "tests"], + ["coverage", "report"], + ["coverage", "xml"], + ["coverage", "html"], +] + +[env.zstd] +deps = [ + "{[env_run_base]deps}", + "zstandard", +] + +[env.no-libs] +deps = ["{[env_run_base]deps}", "pip"] +commands = [ + ["{env_python}", "-m", "pip", "uninstall", "-y", "isal", "zlib-ng"], + { replace = "ref", of = ["env_run_base", "commands"], extend = true }, +] + +[env.black] +deps = ["black==22.3.0"] +skip_install = true +commands = [["black", "--check", "src/", "tests/"]] + +[env.ruff] +deps = ["ruff"] +commands = [["ruff", "check", "src/", "tests/"]] +skip_install = true + +[env.mypy] +deps = ["mypy"] +commands = [["mypy", "src/"]] From 940317e99434725d7f4989c4003f92703490ede8 Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Sun, 12 Oct 2025 22:13:45 +0200 Subject: [PATCH 5/7] Drop support for Python 3.9 Closes #173 --- .github/workflows/ci.yml | 2 +- README.rst | 2 +- pyproject.toml | 2 +- src/xopen/__init__.py | 6 ------ tox.toml | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b83cbf3..dbec3c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13"] optional-deps: [true] with-libs: [true] include: diff --git a/README.rst b/README.rst index 2e5c268..da5ff17 100644 --- a/README.rst +++ b/README.rst @@ -185,7 +185,7 @@ Changelog development version ~~~~~~~~~~~~~~~~~~~ -* Dropped support for Python 3.8 +* Dropped support for Python 3.8 and 3.9 * Started supporting Python 3.13 v2.0.2 (2024-06-12) diff --git a/pyproject.toml b/pyproject.toml index 824b05f..afbf201 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 3" ] -requires-python = ">=3.9" +requires-python = ">=3.10" dynamic = ["version"] dependencies = [ 'isal>=1.6.1; platform.machine == "x86_64" or platform.machine == "AMD64" or platform.machine == "aarch64"', diff --git a/src/xopen/__init__.py b/src/xopen/__init__.py index 89f5137..1348ea9 100644 --- a/src/xopen/__init__.py +++ b/src/xopen/__init__.py @@ -72,12 +72,6 @@ try: import fcntl - - # fcntl.F_SETPIPE_SZ will be available in python 3.10. - # https://github.com/python/cpython/pull/21921 - # If not available: set it to the correct value for known platforms. - if not hasattr(fcntl, "F_SETPIPE_SZ") and sys.platform == "linux": - setattr(fcntl, "F_SETPIPE_SZ", 1031) except ImportError: fcntl = None # type: ignore diff --git a/tox.toml b/tox.toml index 49d6c45..599cf59 100644 --- a/tox.toml +++ b/tox.toml @@ -1,4 +1,4 @@ -env_list = ["black", "ruff", "mypy", "3.9", "3.10", "3.11", "3.12", "3.13"] +env_list = ["black", "ruff", "mypy", "3.10", "3.11", "3.12", "3.13"] [env_run_base] default_base_python = "3.10" From f1ce84ce81bde6a227d1ef41b32af181641a8c70 Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Thu, 28 May 2026 11:01:15 +0200 Subject: [PATCH 6/7] Bump Actions versions --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dbec3c9..2d22046 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,9 @@ jobs: python-version: ["3.10"] toxenv: [black, ruff, mypy] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -66,11 +66,11 @@ jobs: - name: Remove xz if: runner.os == 'Linux' && !matrix.optional-deps run: while which xz; do sudo rm $(which xz); done - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -93,11 +93,11 @@ jobs: needs: [lint, test] if: startsWith(github.ref, 'refs/tags') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 0 # required for setuptools_scm - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: "3.10" - name: Make distributions From 90b257e128abcf413577c0fe0156365b92d6c2f0 Mon Sep 17 00:00:00 2001 From: Marcel Martin Date: Mon, 13 Oct 2025 10:34:21 +0200 Subject: [PATCH 7/7] Support Python 3.14 and 3.14t --- .github/workflows/ci.yml | 2 +- tox.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d22046..7a6237c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ["3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"] optional-deps: [true] with-libs: [true] include: diff --git a/tox.toml b/tox.toml index 599cf59..3ee996d 100644 --- a/tox.toml +++ b/tox.toml @@ -1,4 +1,4 @@ -env_list = ["black", "ruff", "mypy", "3.10", "3.11", "3.12", "3.13"] +env_list = ["black", "ruff", "mypy", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"] [env_run_base] default_base_python = "3.10"