Skip to content

Commit 20cce6e

Browse files
committed
👷🔧📝 Switch to prek
* Remove pre-commit * Fix Python syntax
1 parent 6962de0 commit 20cce6e

33 files changed

Lines changed: 222 additions & 270 deletions
Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: BSD-3-Clause
44

5-
name: pre-commit
5+
name: prek
66

77
on:
88
pull_request:
@@ -16,8 +16,8 @@ concurrency:
1616
permissions: {}
1717

1818
jobs:
19-
pre-commit:
20-
name: pre-commit
19+
prek:
20+
name: prek
2121
# External pull requests should be checked, but not our own internal pull
2222
# requests again, as these are already checked by the push on the branch.
2323
# Without this if condition, the checks would be performed twice, as
@@ -28,12 +28,7 @@ jobs:
2828
github.event.pull_request.head.repo.full_name != github.repository
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
3232
with:
3333
persist-credentials: false
34-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
35-
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
36-
with:
37-
path: ~/.cache/pre-commit
38-
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
39-
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
34+
- uses: j178/prek-action@e98a699c41eb69ab013a45817a0406469a748f8d # v2.0.5

.pre-commit-config.yaml

Lines changed: 7 additions & 7 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: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # v6.0.0
13+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
1414
hooks:
1515
- id: check-json
1616
types: [file] # override `types: [json]`
@@ -24,33 +24,33 @@ repos:
2424
- id: end-of-file-fixer
2525
- id: trailing-whitespace
2626
- repo: https://github.com/tox-dev/pyproject-fmt
27-
rev: 0c8c15d8fe996493035be407c5cf4a288cf6bf8e # v2.25.1
27+
rev: 3632ea90e7641b574983ddf3a11ccedefff3c881 # frozen: v2.25.3
2828
hooks:
2929
- id: pyproject-fmt
3030
- repo: https://github.com/abravalheri/validate-pyproject
31-
rev: 4b2e70d08cb2ccd26d1fba73588de41c7a5d50b7 # v0.25
31+
rev: 4b2e70d08cb2ccd26d1fba73588de41c7a5d50b7 # frozen: v0.25
3232
hooks:
3333
- id: validate-pyproject
3434
- repo: https://github.com/astral-sh/ruff-pre-commit
35-
rev: c59bba8fb259db0fec2bbb77ad8ba51ea7341b56 # v0.15.20
35+
rev: 01a675ea018f2fb714478a5ffb83fcea8374bb06 # frozen: v0.15.21
3636
hooks:
3737
- id: ruff-check
3838
args: [--fix, --exit-non-zero-on-fix]
3939
- id: ruff-format
4040
- repo: https://github.com/sphinx-contrib/sphinx-lint
41-
rev: c883505f64b59c3c5c9375191e4ad9f98e727ccd # v1.0.2
41+
rev: c883505f64b59c3c5c9375191e4ad9f98e727ccd # frozen: v1.0.2
4242
hooks:
4343
- id: sphinx-lint
4444
types: [rst]
4545
- repo: https://github.com/adamchainz/blacken-docs
46-
rev: fda77690955e9b63c6687d8806bafd56a526e45f # 1.20.0
46+
rev: fda77690955e9b63c6687d8806bafd56a526e45f # frozen: 1.20.0
4747
hooks:
4848
- id: blacken-docs
4949
args: [--line-length=79]
5050
additional_dependencies:
5151
- black
5252
- repo: https://github.com/codespell-project/codespell
53-
rev: 2ccb47ff45ad361a21071a7eedda4c37e6ae8c5a # v2.4.2
53+
rev: 2ccb47ff45ad361a21071a7eedda4c37e6ae8c5a # frozen: v2.4.2
5454
hooks:
5555
- id: codespell
5656
args: [--toml pyproject.toml]

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ Notfälle, wenn Zweige für ältere Versionen erstellt werden müssen.
1919
`Unreleased <https://github.com/cusyio/Python4DataScience-de/compare/26.1.0...HEAD>`_
2020
-------------------------------------------------------------------------------------
2121

22+
Changed
23+
~~~~~~~
24+
25+
* 👷🔧📝 Switch to prek
26+
27+
* Remove pre-commit
28+
* Fix Python syntax
29+
2230
`26.1.0 <https://github.com/cusyio/Python4DataScience/compare/24.3.0...26.1.0>`_: 2026-07-09
2331
--------------------------------------------------------------------------------------------
2432

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Status
1616
.. image:: https://img.shields.io/github/license/cusyio/Python4DataScience-de.svg
1717
:alt: License
1818
:target: https://github.com/cusyio/Python4DataScience-de/blob/main/LICENSES/BSD-3-Clause.txt
19-
.. image:: https://results.pre-commit.ci/badge/github/cusyio/Python4DataScience-de/main.svg
20-
:target: https://results.pre-commit.ci/run/github/649725482/1726568571.WhuLTrgJT3aZZkF-R0Fd8w
21-
:alt: pre-commit.ci status
19+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/cusyio/Python4Datascience-de/main/badge-v0.json
20+
:target: https://github.com/j178/prek
21+
:alt: prek
2222
.. image:: https://app.readthedocs.org/projects/python4datascience-de/badge/?version=latest
2323
:alt: Docs
2424
:target: https://python4data.science/de/latest/

badge-v0.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "prek",
3+
"message": "enabled",
4+
"logoSvg": "<svg xmlns=\"http://www.w3.org/2000/svg\" xml:space=\"preserve\" viewBox=\"0 0 150.7 163\"><path fill=\"#fff\" d=\"M84.3 0c-2.6-.3-5.8 10-8.9 10-3 0-6.2-10.1-9-9.8-2.7.4-3.8 11-6.7 11.7-2.9.7-8.5-8.5-11-7.6-2.5 1-1.7 11.8-4.6 13.2-2.8 1.4-9.4-6.6-11.9-5-2.4 1.5 0 11.7-2.4 13.8-2.3 2.1-10.2-3.2-12-1.2-2 2 2.3 11 .5 13.6-1.8 2.6-9.6-.2-11 2.3-1.5 2.5 3.7 9.4 2.5 12.4-1.2 3-9 3.4-9.7 6.2-.8 2.7 5.1 7.9 5.1 10.6.2 3.6-6.8 3.3-3.6 17 2 5.4 2.5 30.7 40.6 48.5-2.2 17.3-7.8 18.5-8.5 23.2.2 3.2 3.7 4.3 4.4 4.1 1.2 0 17-6 28.8-22.2a86.5 86.5 0 0 0 65.2-20 68.7 68.7 0 0 0 18.2-43.5c.7-4.2-4.4-4.4-4.5-7.3-.1-2.8 5.6-7.6 4.8-10.3-.6-4.1-9.1-2.8-9.7-7-.5-3.1 3.6-9.6 2.7-11.5-1.3-2.6-10.1-1-11-2.7-1.5-2.8 2.2-11.1.2-13.2-1.9-2.1-10.3 2.5-11.6 1-2-2.4.3-12-2.7-13.7-3.3-1.8-9.8 6.2-11.6 5-2.6-1.6-2.4-12.4-5-13.4-2.5-1-7.3 8.3-10.2 7.6C88.7 11 86.9.3 84.3 0zM106.8 40c1.4 0 3 1 3.1 2 .2 2.3-.5 1.9-7.8 14-7.2 12.2-27.4 44.6-30.3 50-3 5.7-7.1 10.8-12.2 5.4a569 569 0 0 1-20.6-24c-4.6-5.7-3.6-5.2-3.7-5.5-.1-.4-.7-1.8.9-3.6 3.3-4 6.2-5.4 8.5-6.9 2.4-1.5 2.9-2 5.3.5 2.4 2.4 7.8 10 10.1 12.3 2.4 2.4 2.1 1 9.6-6.4C77.2 70.2 88 57 95.5 49.4c7.5-7.6 8-9.6 11.3-9.5z\"/></svg>",
5+
"logoWidth": 10,
6+
"labelColor": "grey",
7+
"color": "#ff600a"
8+
}

docs/clean-prep/scikit-learn-reprocessing.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@
4747
"metadata": {},
4848
"outputs": [],
4949
"source": [
50-
"from datetime import datetime\n",
51-
"\n",
5250
"import numpy as np\n",
5351
"import pandas as pd\n",
5452
"\n",
@@ -62,7 +60,9 @@
6260
"metadata": {},
6361
"outputs": [],
6462
"source": [
65-
"hvac = pd.read_csv(\"https://raw.githubusercontent.com/kjam/data-cleaning-101/master/data/HVAC_with_nulls.csv\")"
63+
"hvac = pd.read_csv(\n",
64+
" \"https://raw.githubusercontent.com/kjam/data-cleaning-101/master/data/HVAC_with_nulls.csv\"\n",
65+
")"
6666
]
6767
},
6868
{
@@ -336,7 +336,7 @@
336336
"metadata": {},
337337
"outputs": [],
338338
"source": [
339-
"hvac[\"TargetTemp\"], hvac[\"SystemAge\"] = transformed[:,0], transformed[:,1]"
339+
"hvac[\"TargetTemp\"], hvac[\"SystemAge\"] = transformed[:, 0], transformed[:, 1]"
340340
]
341341
},
342342
{
@@ -583,7 +583,7 @@
583583
}
584584
],
585585
"source": [
586-
"hvac[\"MinMaxScaledTemp\"] = temp_minmax[:,0]\n",
586+
"hvac[\"MinMaxScaledTemp\"] = temp_minmax[:, 0]\n",
587587
"hvac[\"MinMaxScaledTemp\"].head()"
588588
]
589589
},

docs/conf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@
188188
linkcheck_allowed_redirects = {
189189
r"https://app.pganalyze.com/": r"https://app.pganalyze.com/users/sign_in",
190190
r"https://doi.org/10.5281/zenodo.21259741": r"https://zenodo.org/records/21259741",
191-
r"https://github.com/apps/pre-commit-ci/installations/new": r"https://github.com/login?integration=pre-commit-ci&return_to=%2Fapps%2Fpre-commit-ci%2Finstallations%2Fnew",
192191
r"https://itsdangerous.palletsprojects.com/": r"https://itsdangerous.palletsprojects.com/en/2.2.x/",
193192
r"https://jinja.palletsprojects.com/": r"https://jinja.palletsprojects.com/en/3.1.x/",
194193
r"https://ohwr.org/cern_ohl_p_v2.txt": r"https://ohwr.org/project/cernohl/-/wikis/uploads/3eff4154d05e7a0459f3ddbf0674cae4/cern_ohl_p_v2.txt",
@@ -203,7 +202,6 @@
203202
r"http://127.0.0.1:8000/",
204203
r"https://docs.arangodb.com/",
205204
r"https://github.com/cusyio/Python4DataScience-de/fork",
206-
r"https://github.com/apps/pre-commit-ci/installations/new",
207205
r"https://iopscience.iop.org/journal/*",
208206
r"https://sandbox.zenodo.org/account/settings/applications/tokens/new/",
209207
# Anchor not found

docs/data-processing/intake/data-engineers.ipynb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,6 @@
11281128
}
11291129
],
11301130
"source": [
1131-
"import hvplot.pandas\n",
11321131
"import intake\n",
11331132
"\n",
11341133
"\n",

docs/data-processing/intake/gui.ipynb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5110,24 +5110,15 @@
51105110
"intake.output_notebook()\n",
51115111
"\n",
51125112
"us_crime.plot.bivariate(\n",
5113-
" \"Burglary rate\",\n",
5114-
" \"Property crime rate\",\n",
5115-
" legend=False,\n",
5116-
" width=500,\n",
5117-
" height=400\n",
5113+
" \"Burglary rate\", \"Property crime rate\", legend=False, width=500, height=400\n",
51185114
") * us_crime.plot.scatter(\n",
51195115
" \"Burglary rate\",\n",
51205116
" \"Property crime rate\",\n",
51215117
" color=\"black\",\n",
51225118
" size=15,\n",
51235119
" legend=False,\n",
51245120
") + us_crime.plot.table(\n",
5125-
" [\n",
5126-
" \"Burglary rate\",\n",
5127-
" \"Property crime rate\"\n",
5128-
" ],\n",
5129-
" width=350,\n",
5130-
" height=350\n",
5121+
" [\"Burglary rate\", \"Property crime rate\"], width=350, height=350\n",
51315122
")"
51325123
]
51335124
},

docs/data-processing/postgresql/sqlalchemy.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ Datenbankverbindung
4444
4545
from sqlalchemy import create_engine
4646
47-
4847
engine = create_engine("postgresql:///example", echo=True)
4948
5049
Datenmodell
@@ -56,7 +55,6 @@ Datenmodell
5655
from sqlalchemy.ext.declarative import declarative_base
5756
from sqlalchemy.orm import relationship
5857
59-
6058
Base = declarative_base()
6159
6260

0 commit comments

Comments
 (0)