Skip to content

Commit 36d864a

Browse files
authored
Merge pull request #43 from xylar/fix-linting
Update linting and pin `black` (also in CI)
2 parents 4894780 + ee42c80 commit 36d864a

9 files changed

Lines changed: 30 additions & 26 deletions

File tree

.github/workflows/black.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11

2-
# GitHub Action that uses Black to reformat the Python code in an incoming pull request.
3-
# If all Python code in the pull request is compliant with Black then this Action does nothing.
4-
# Othewrwise, Black is run and its changes are committed back to the incoming pull request.
5-
# https://github.com/cclauss/autoblack
2+
# GitHub Action that checks Python formatting with a pinned Black release.
63

7-
name: autoblack
4+
name: black
85
on: [pull_request]
96
jobs:
107
black:
118
runs-on: ubuntu-latest
129
steps:
1310
- uses: actions/checkout@v3
1411
- uses: psf/black@stable
12+
with:
13+
options: "--check --diff --verbose"
14+
version: "~=26.0"
15+
src: "."

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
16+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1717

1818
env:
1919
SDIST_DIR: /tmp/sdist
@@ -26,10 +26,11 @@ jobs:
2626
- name: Install dependencies
2727
run: |
2828
python -m pip install --upgrade pip
29-
pip install -r requirements.txt
29+
python -m pip install -r requirements.txt
30+
python -m pip install -e .
3031
- name: Test with pytest
3132
run: |
32-
python setup.py test
33+
python -m pytest
3334
codecov
3435
- name: Test with pytest
3536
run: |

.pre-commit-config.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ repos:
77
- id: trailing-whitespace
88
- id: check-yaml
99
- id: check-added-large-files
10-
- repo: https://github.com/psf/black
11-
rev: 22.1.0
10+
- repo: local
1211
hooks:
13-
- id: black
12+
- id: black
13+
name: black
14+
entry: black
15+
language: python
16+
additional_dependencies:
17+
- black~=26.0
18+
types: [python]

pyevtk/vtk.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
from .evtk import writeBlockSize, writeArrayToFile, writeArraysToFile
3232
from .xml import XmlWriter
3333

34-
3534
# ================================
3635
# VTK Types
3736
# ================================

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tool.black]
2+
line-length = 88
3+
required-version = "26"

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ codecov
66
twine
77
check-manifest
88
readme_renderer[md]
9-
black~=22.1.0
9+
black>=26.0,<27.0
10+
pre-commit

setup.cfg

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[aliases]
2-
# this allows calling 'python setup.py test'
3-
test=pytest
4-
51
[pep8]
62
max-line-length = 120
73
ignore = E221,E226,E241,E242, W0105, N803, N806
@@ -22,9 +18,7 @@ exclude = __init__.py
2218
[tool:pytest]
2319
testpaths = tests/
2420
python_files = tests/*.py
25-
python_class = Test
26-
pep8maxlinelength = 120
27-
pep8ignore = E221,E226,E241,E242
21+
python_classes = Test
2822
addopts= --cov pyevtk
2923

3024
# See the docstring in versioneer.py for instructions. Note that you must

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,20 @@ def readme(fname):
4848
author_email="pauloa.herrera@gmail.com",
4949
maintainer="Adamos Kyriakou",
5050
maintainer_email="somada141@gmail.com",
51+
license="BSD-2-Clause",
5152
url="https://github.com/pyscience-projects/pyevtk",
5253
packages=["pyevtk", "evtk"],
5354
package_dir={"pyevtk": "pyevtk"},
5455
package_data={"pyevtk": ["LICENSE.txt", "examples/*.py"]},
5556
install_requires=["numpy >= 1.8.0"],
56-
# necessary for 'python setup.py test'
57-
setup_requires=["pytest-runner"],
58-
tests_require=["pytest>=3.1", "pytest-cov", "twine", "check-manifest"],
5957
classifiers=[
6058
"Programming Language :: Python :: 3.7",
6159
"Programming Language :: Python :: 3.8",
6260
"Programming Language :: Python :: 3.9",
6361
"Programming Language :: Python :: 3.10",
6462
"Programming Language :: Python :: 3.11",
63+
"Programming Language :: Python :: 3.12",
64+
"Programming Language :: Python :: 3.13",
65+
"Programming Language :: Python :: 3.14",
6566
],
6667
)

versioneer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Version: 0.19
22

3+
34
"""The Versioneer - like a rocketeer, but for versions.
45
56
The Versioneer
@@ -417,9 +418,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False, env=
417418
return stdout, p.returncode
418419

419420

420-
LONG_VERSION_PY[
421-
"git"
422-
] = r'''
421+
LONG_VERSION_PY["git"] = r'''
423422
# This file helps to compute a version number in source trees obtained from
424423
# git-archive tarball (such as those provided by githubs download-from-tag
425424
# feature). Distribution tarballs (built by setup.py sdist) and build

0 commit comments

Comments
 (0)