diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index b818536..89dfedb 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.0" + src: "." diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef43906..952d3a5 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 @@ -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: | - python setup.py test + python -m pytest codecov - name: Test with pytest run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8450495..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 - rev: 22.1.0 +- repo: local hooks: - - id: black + - id: black + name: black + entry: black + language: python + additional_dependencies: + - black~=26.0 + types: [python] 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/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..89f052d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[tool.black] +line-length = 88 +required-version = "26" diff --git a/requirements.txt b/requirements.txt index 5a244eb..d66fa09 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,5 @@ codecov twine check-manifest readme_renderer[md] -black~=22.1.0 +black>=26.0,<27.0 +pre-commit diff --git a/setup.cfg b/setup.cfg index 0960662..5bc9377 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 @@ -22,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 diff --git a/setup.py b/setup.py index 83e9796..ff73b8d 100644 --- a/setup.py +++ b/setup.py @@ -48,19 +48,20 @@ 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"}, 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", "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", ], ) 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