From c85ed3a02397b12b3849230bddc41a41de3bcdc5 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 27 Apr 2026 16:48:25 +0200 Subject: [PATCH 01/11] Pin black to latest version (26.3.1) Make sure we use this in CI, development environments and pre-commit --- .github/workflows/black.yml | 11 ++++++----- .pre-commit-config.yaml | 4 ++-- pyproject.toml | 3 +++ requirements.txt | 3 ++- 4 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 pyproject.toml diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index b818536..d2bf677 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -1,10 +1,7 @@ -# GitHub Action that uses Black to reformat the Python code in an incoming pull request. -# If all Python code in the pull request is compliant with Black then this Action does nothing. -# Othewrwise, Black is run and its changes are committed back to the incoming pull request. -# https://github.com/cclauss/autoblack +# GitHub Action that checks Python formatting with a pinned Black release. -name: autoblack +name: black on: [pull_request] jobs: black: @@ -12,3 +9,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: psf/black@stable + with: + options: "--check --diff --verbose" + version: "26.3.1" + src: "." diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8450495..2b5697b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,7 @@ repos: - id: trailing-whitespace - id: check-yaml - id: check-added-large-files -- repo: https://github.com/psf/black - rev: 22.1.0 +- repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.3.1 hooks: - id: black diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5a9302c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[tool.black] +line-length = 120 +required-version = "26.3.1" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 5a244eb..6521a1c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,5 @@ codecov twine check-manifest readme_renderer[md] -black~=22.1.0 +black==26.3.1 +pre-commit From 4bea2857ee5e0edb600d9cd3a11b5f8f46b83f53 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 27 Apr 2026 16:53:45 +0200 Subject: [PATCH 02/11] Update python test matrix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef43906..e0d63d0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] env: SDIST_DIR: /tmp/sdist From 313861a7ff072a399f68bad2becccb56e547baf1 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 27 Apr 2026 16:56:02 +0200 Subject: [PATCH 03/11] Expand supported python versions --- setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.py b/setup.py index 83e9796..f4741f5 100644 --- a/setup.py +++ b/setup.py @@ -62,5 +62,8 @@ def readme(fname): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", ], ) From 048537105dff5fb3daf058a550819adf108a68b6 Mon Sep 17 00:00:00 2001 From: Erik Cederstrand Date: Mon, 27 Apr 2026 14:41:59 +0200 Subject: [PATCH 04/11] Add license info Fixes license specifiers according to https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license-and-license-files This allows automatic license inspection tools like pip-licenses to correctly categorize this package. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index f4741f5..6dd4226 100644 --- a/setup.py +++ b/setup.py @@ -48,6 +48,7 @@ def readme(fname): author_email="pauloa.herrera@gmail.com", maintainer="Adamos Kyriakou", maintainer_email="somada141@gmail.com", + license="BSD-2-Clause", url="https://github.com/pyscience-projects/pyevtk", packages=["pyevtk", "evtk"], package_dir={"pyevtk": "pyevtk"}, From 850611229a71d573dc7eb0c15b401fcd4d5ea300 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 27 Apr 2026 17:06:47 +0200 Subject: [PATCH 05/11] Fix testing --- .github/workflows/test.yml | 2 +- setup.cfg | 4 ---- setup.py | 3 --- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e0d63d0..805012a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: pip install -r requirements.txt - name: Test with pytest run: | - python setup.py test + pytest codecov - name: Test with pytest run: | diff --git a/setup.cfg b/setup.cfg index 0960662..99a82c0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,3 @@ -[aliases] -# this allows calling 'python setup.py test' -test=pytest - [pep8] max-line-length = 120 ignore = E221,E226,E241,E242, W0105, N803, N806 diff --git a/setup.py b/setup.py index 6dd4226..ff73b8d 100644 --- a/setup.py +++ b/setup.py @@ -54,9 +54,6 @@ def readme(fname): package_dir={"pyevtk": "pyevtk"}, package_data={"pyevtk": ["LICENSE.txt", "examples/*.py"]}, install_requires=["numpy >= 1.8.0"], - # necessary for 'python setup.py test' - setup_requires=["pytest-runner"], - tests_require=["pytest>=3.1", "pytest-cov", "twine", "check-manifest"], classifiers=[ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", From 6498049a2390aa33c4fd62558f32f30784b8d1b3 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 27 Apr 2026 17:15:57 +0200 Subject: [PATCH 06/11] Fix tests (again) --- .github/workflows/test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 805012a..952d3a5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,10 +26,11 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt + python -m pip install -r requirements.txt + python -m pip install -e . - name: Test with pytest run: | - pytest + python -m pytest codecov - name: Test with pytest run: | From 243946c1aa9811b95ad9884047fecc0ea44ae5b3 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 27 Apr 2026 17:19:51 +0200 Subject: [PATCH 07/11] Hopefully fix pytest warnings --- setup.cfg | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 99a82c0..5bc9377 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,9 +18,7 @@ exclude = __init__.py [tool:pytest] testpaths = tests/ python_files = tests/*.py -python_class = Test -pep8maxlinelength = 120 -pep8ignore = E221,E226,E241,E242 +python_classes = Test addopts= --cov pyevtk # See the docstring in versioneer.py for instructions. Note that you must From f9d500375b1d80d886b3bfc756768012332ee27d Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 27 Apr 2026 17:30:33 +0200 Subject: [PATCH 08/11] Switch line lenght to 88 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5a9302c..c36bd67 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [tool.black] -line-length = 120 +line-length = 88 required-version = "26.3.1" \ No newline at end of file From f06571141f29f63bdb8a7c4fb955dcb174c01ebb Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 27 Apr 2026 16:49:42 +0200 Subject: [PATCH 09/11] Lint existing code with black --- pyevtk/vtk.py | 1 - versioneer.py | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pyevtk/vtk.py b/pyevtk/vtk.py index 7b4bc0a..6da4949 100644 --- a/pyevtk/vtk.py +++ b/pyevtk/vtk.py @@ -31,7 +31,6 @@ from .evtk import writeBlockSize, writeArrayToFile, writeArraysToFile from .xml import XmlWriter - # ================================ # VTK Types # ================================ diff --git a/versioneer.py b/versioneer.py index d5e0eb5..b9a087b 100644 --- a/versioneer.py +++ b/versioneer.py @@ -1,5 +1,6 @@ # Version: 0.19 + """The Versioneer - like a rocketeer, but for versions. The Versioneer @@ -417,9 +418,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env= return stdout, p.returncode -LONG_VERSION_PY[ - "git" -] = r''' +LONG_VERSION_PY["git"] = r''' # This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build From ed9cae11dd064d00d68c2dae8a2f737e630df4c4 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 27 Apr 2026 17:34:42 +0200 Subject: [PATCH 10/11] Add missing linebreak --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c36bd67..442254e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [tool.black] line-length = 88 -required-version = "26.3.1" \ No newline at end of file +required-version = "26.3.1" From ee42c80c84c6ba0e1eb97b83369ce6be54411278 Mon Sep 17 00:00:00 2001 From: Xylar Asay-Davis Date: Mon, 27 Apr 2026 17:43:16 +0200 Subject: [PATCH 11/11] Loosen black constraint to ~=26.0 --- .github/workflows/black.yml | 2 +- .pre-commit-config.yaml | 11 ++++++++--- pyproject.toml | 2 +- requirements.txt | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index d2bf677..89dfedb 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -11,5 +11,5 @@ jobs: - uses: psf/black@stable with: options: "--check --diff --verbose" - version: "26.3.1" + version: "~=26.0" src: "." diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b5697b..9179504 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,7 +7,12 @@ repos: - id: trailing-whitespace - id: check-yaml - id: check-added-large-files -- repo: https://github.com/psf/black-pre-commit-mirror - rev: 26.3.1 +- repo: local hooks: - - id: black + - id: black + name: black + entry: black + language: python + additional_dependencies: + - black~=26.0 + types: [python] diff --git a/pyproject.toml b/pyproject.toml index 442254e..89f052d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [tool.black] line-length = 88 -required-version = "26.3.1" +required-version = "26" diff --git a/requirements.txt b/requirements.txt index 6521a1c..d66fa09 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,5 +6,5 @@ codecov twine check-manifest readme_renderer[md] -black==26.3.1 +black>=26.0,<27.0 pre-commit