Skip to content

Commit 0e97c56

Browse files
committed
⬆️ Update pre-commit hooks
* Switch to SHA values instead of git tags * Upgrade to isort 5 * Use black config for isort
1 parent 9d80f3b commit 0e97c56

8 files changed

Lines changed: 27 additions & 61 deletions

File tree

.pre-commit-config.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ci:
1010

1111
repos:
1212
- repo: https://github.com/pre-commit/pre-commit-hooks
13-
rev: v6.0.0
13+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0
1414
hooks:
1515
- id: check-json
1616
types: [file] # override `types: [json]`
@@ -24,43 +24,43 @@ repos:
2424
- id: end-of-file-fixer
2525
- id: trailing-whitespace
2626
- repo: https://github.com/tox-dev/pyproject-fmt
27-
rev: v2.16.2
27+
rev: 6e10264313f53d6247a8b1b984f5b5ccf50ba539 # v2.21.0
2828
hooks:
2929
- id: pyproject-fmt
3030
- repo: https://github.com/abravalheri/validate-pyproject
31-
rev: v0.25
31+
rev: 4b2e70d08cb2ccd26d1fba73588de41c7a5d50b7 # v0.25
3232
hooks:
3333
- id: validate-pyproject
3434
- repo: https://github.com/sphinx-contrib/sphinx-lint
35-
rev: v1.0.2
35+
rev: c883505f64b59c3c5c9375191e4ad9f98e727ccd # v1.0.2
3636
hooks:
3737
- id: sphinx-lint
3838
types: [rst]
3939
- repo: https://github.com/pycqa/isort
40-
rev: 8.0.1
40+
rev: a333737ed43df02b18e6c95477ea1b285b3de15a # 8.0.1
4141
hooks:
4242
- id: isort
4343
additional_dependencies: ["toml"]
4444
entry: isort --profile=black
4545
name: isort (python)
4646
- repo: https://github.com/psf/black-pre-commit-mirror
47-
rev: 26.1.0
47+
rev: fa505ab9c3e0fedafe1709fd7ac2b5f8996c670d # 26.3.1
4848
hooks:
4949
- id: black
5050
- repo: https://github.com/tonybaloney/perflint
51-
rev: 0.8.1
51+
rev: 22f831509bc7765ce272ad6fcb99398d86a26a52 # 0.8.1
5252
hooks:
5353
- id: perflint
5454
exclude: ^docs/
5555
- repo: https://github.com/adamchainz/blacken-docs
56-
rev: "1.20.0"
56+
rev: fda77690955e9b63c6687d8806bafd56a526e45f # 1.20.0
5757
hooks:
5858
- id: blacken-docs
5959
args: [--line-length=79]
6060
additional_dependencies:
6161
- black
6262
- repo: https://github.com/codespell-project/codespell
63-
rev: v2.4.1
63+
rev: 2ccb47ff45ad361a21071a7eedda4c37e6ae8c5a # v2.4.2
6464
hooks:
6565
- id: codespell
6666
args: [--toml pyproject.toml]

docs/data-processing/postgresql/db-api.rst

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,21 @@ Connection
2727

2828
Beispiel:
2929

30-
.. blacken-docs:off
31-
3230
.. code-block:: python
3331
3432
import driver
3533
36-
conn = driver.connect(database='example',
37-
host='localhost',
38-
port=5432)
34+
conn = driver.connect(database="example", host="localhost", port=5432)
3935
4036
try:
41-
# create the cursor
42-
# use the cursor
37+
cursor = conn.cursor()
38+
cursor.execute("SQL-STATEMENT")
4339
except Exception:
4440
conn.rollback()
4541
else:
4642
conn.commit()
4743
conn.close()
4844
49-
.. blacken-docs:on
50-
5145
Cursor
5246
`Cursorobjekte <https://peps.python.org/pep-0249/#cursor-objects>`_ werden
5347
zum Verwalten des Kontexts einer ``.fetch*()``-Methode verwendet.
@@ -82,12 +76,10 @@ Cursor
8276
.. code-block:: python
8377
8478
cursor = conn.cursor()
85-
cursor.execute(
86-
"""
79+
cursor.execute("""
8780
SELECT column1, column2
8881
FROM tableA
89-
"""
90-
)
82+
""")
9183
for column1, column2 in cursor.fetchall():
9284
print(column1, column2)
9385

docs/data-processing/serialisation-formats/pyproject.toml

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/data-processing/serialisation-formats/toml/pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# SPDX-FileCopyrightText: 2022 Veit Schiele
22
#
33
# SPDX-License-Identifier: BSD-3-Clause
4-
54
[tool.black]
65
line-length = 79
76

@@ -14,6 +13,5 @@ lines_between_types = 1
1413
multi_line_output = 3
1514
not_skip = "__init__.py"
1615
use_parentheses = true
17-
1816
known_first_party = [ "MY_FIRST_MODULE", "MY_SECOND_MODULE" ]
1917
known_third_party = [ "mpi4py", "numpy", "requests" ]

docs/productive/git/advanced/bisect.rst

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,33 +144,29 @@ komplizierteren Verhaltensänderungen suchen. Für Performance-Tests benötigen
144144
hierfür ein Testprogramm, das mehrere Durchläufe durchführen und die minimale
145145
Zeit ermitteln kann, wobei mögliches Rauschen eliminiert werden soll:
146146

147-
.. blacken-docs:off
148-
149147
.. code-block:: python
150148
151149
from subprocess import run
152150
from time import perf_counter
153151
154-
155152
times = []
156153
for _ in range(10):
157154
start = perf_counter()
158155
run(
159-
[./perftest, PARAM],
156+
"./perftest",
157+
PARAM,
160158
check=True,
161159
capture_output=True,
162160
)
163161
elapsed = perf_counter() - start
164162
times.append(elapsed)
165-
if min(times) > X.0:
163+
if min(times) > 2.0:
166164
print("Too slow")
167165
raise SystemExit(1)
168166
else:
169167
print("Fast enough")
170168
raise SystemExit(0)
171169
172-
.. blacken-docs:on
173-
174170
Das Programm führt :samp:`python perftest.py {PARAM}` zehnmal aus und misst bei
175171
jeder Ausführung die Zeit. Anschließend vergleicht es die minimale
176172
Ausführungszeit mit einem Grenzwert von ``X`` Sekunden. Liegt die Mindestzeit

docs/productive/git/work.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ An einem Projekt arbeiten
326326

327327
.. tip::
328328
Normalerweise müsst ihr nach jedem Befehl, der einen Buchstaben
329-
enthält, die Taste :kbd:`↩︎` drücken. Ihr könnt diesen Overhead jedoch
329+
enthält, die Taste :kbd:`↩︎` drücken. Ihr könnt diesen Overhead jedoch
330330
abschalten:
331331

332332
.. code-block:: console

docs/workspace/ipython/extensions.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,18 @@ IPython-Erweiterungen schreiben
4646
Eine IPython-Erweiterung ist ein importierbares Python-Modul, das über spezielle
4747
Funktionen zum Laden und Entladen verfügt:
4848

49-
.. blacken-docs:off
50-
5149
.. code-block:: python
5250
5351
def load_ipython_extension(ipython):
5452
# The `ipython` argument is the currently active `InteractiveShell`
5553
# instance, which can be used in any way. This allows you to register
5654
# new magics or aliases, for example.
55+
pass
56+
5757
5858
def unload_ipython_extension(ipython):
5959
# If you want your extension to be unloadable, put that logic here.
60-
61-
.. blacken-docs:on
60+
pass
6261
6362
.. seealso::
6463
* :label:`defining_magics`

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ classifiers = [
2222
"Programming Language :: Python :: 3.13",
2323
"Programming Language :: Python :: 3.14",
2424
]
25-
dependencies = [ ]
26-
25+
dependencies = []
2726
urls."Bug Tracker" = "https://github.com/cusyio/Python4DataScience/issues"
2827
urls."Homepage" = "https://github.com/cusyio/Python4DataScience/"
2928

@@ -52,7 +51,7 @@ docs = [
5251
]
5352

5453
[tool.setuptools]
55-
packages = [ ]
54+
packages = []
5655

5756
[tool.black]
5857
line-length = 79
@@ -64,9 +63,7 @@ include_trailing_comma = true
6463
lines_after_imports = 2
6564
lines_between_types = 1
6665
multi_line_output = 3
67-
not_skip = "__init__.py"
6866
use_parentheses = true
69-
7067
known_first_party = "Python4DataScience"
7168
known_third_party = [
7269
"Cython",
@@ -84,5 +81,8 @@ known_third_party = [
8481
]
8582

8683
[tool.codespell]
87-
skip = "*.csv, *.html, *.pdf, *.rst, *.ipynb, ./docs/_build/*, */books.json, */books.txt, ./styles/*, ./Python4DataScience.egg-info/*"
84+
skip = """\
85+
*.csv, *.html, *.pdf, *.rst, *.ipynb, ./docs/_build/*, */books.json, */books.txt, ./styles/*, \
86+
./Python4DataScience.egg-info/*\
87+
"""
8888
ignore-words-list = "comit"

0 commit comments

Comments
 (0)