Skip to content

Commit 6139e84

Browse files
Use pre-commit CI in favor of GitHub action (#111)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 5759699 commit 6139e84

File tree

8 files changed

+52
-196
lines changed

8 files changed

+52
-196
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
name: CI
2-
32
on:
43
push:
54
branches:
65
- main
76
pull_request:
8-
97
jobs:
10-
118
dist:
129
runs-on: ubuntu-latest
1310
steps:
@@ -21,27 +18,7 @@ jobs:
2118
- uses: actions/upload-artifact@v5
2219
with:
2320
path: dist/*
24-
25-
lint:
26-
runs-on: ubuntu-latest
27-
strategy:
28-
matrix:
29-
lint-command:
30-
- black --check --diff .
31-
- ruff check --output-format=github .
32-
steps:
33-
- uses: actions/checkout@v5
34-
- uses: actions/setup-python@v6
35-
with:
36-
python-version: "3.x"
37-
cache: 'pip'
38-
cache-dependency-path: 'pyproject.toml'
39-
- run: python -m pip install -e .[lint]
40-
- run: ${{ matrix.lint-command }}
41-
4221
pytest:
43-
needs:
44-
- lint
4522
services:
4623
postgres:
4724
image: postgres:latest
@@ -66,7 +43,7 @@ jobs:
6643
- "3.13"
6744
django-version:
6845
# we don't need to support version that haven't deprecated CIText
69-
- "4.2" # LTS
46+
- "4.2" # LTS
7047
- "5.0"
7148
extras:
7249
- ""
@@ -78,16 +55,16 @@ jobs:
7855
is-latest-django: true
7956
runs-on: ubuntu-latest
8057
steps:
81-
- uses: actions/checkout@v5
82-
- uses: actions/setup-python@v6
83-
with:
84-
python-version: ${{ matrix.python-version }}
85-
- run: python -m pip install .[test]
86-
- run: python -m pip install .[${{ matrix.extras }}]
87-
if: matrix.extras != ''
88-
- run: python -m pip install django~=${{ matrix.django-version }}.0
89-
if: matrix.django-version != 'latest'
90-
- run: python -m pip install git+https://github.com/django/django.git@main#egg=django
91-
if: matrix.django-version == 'latest'
92-
- run: python -m pytest
93-
- uses: codecov/codecov-action@v5
58+
- uses: actions/checkout@v5
59+
- uses: actions/setup-python@v6
60+
with:
61+
python-version: ${{ matrix.python-version }}
62+
- run: python -m pip install .[test]
63+
- run: python -m pip install .[${{ matrix.extras }}]
64+
if: matrix.extras != ''
65+
- run: python -m pip install django~=${{ matrix.django-version }}.0
66+
if: matrix.django-version != 'latest'
67+
- run: python -m pip install git+https://github.com/django/django.git@main#egg=django
68+
if: matrix.django-version == 'latest'
69+
- run: python -m pytest
70+
- uses: codecov/codecov-action@v5

.github/workflows/release.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
name: Release
2-
32
on:
43
release:
54
types: [published]
65
workflow_dispatch:
7-
86
permissions:
97
id-token: write
10-
118
jobs:
129
release-build:
1310
runs-on: ubuntu-latest
@@ -22,7 +19,6 @@ jobs:
2219
with:
2320
name: release-dists
2421
path: dist/
25-
2622
pypi-publish:
2723
runs-on: ubuntu-latest
2824
needs:

.pre-commit-config.yaml

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,51 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.6.0
5+
rev: v6.0.0
66
hooks:
77
- id: trailing-whitespace
88
- id: check-merge-conflict
9+
- id: check-ast
10+
- id: check-toml
911
- id: check-yaml
1012
- id: debug-statements
1113
- id: end-of-file-fixer
1214
- id: name-tests-test
1315
args: ["--pytest-test-first"]
16+
exclude: ^tests\/(testapp\/|manage.py)
1417
- id: no-commit-to-branch
1518
args: [--branch, main]
16-
- id: detect-private-key
17-
- repo: local
19+
- repo: https://github.com/asottile/pyupgrade
20+
rev: v3.20.0
1821
hooks:
19-
- id: ruff
20-
name: ruff
21-
language: system
22-
entry: ruff check
23-
types: [python]
22+
- id: pyupgrade
23+
- repo: https://github.com/adamchainz/django-upgrade
24+
rev: 1.29.0
25+
hooks:
26+
- id: django-upgrade
27+
- repo: https://github.com/hukkin/mdformat
28+
rev: 0.7.22
29+
hooks:
30+
- id: mdformat
31+
additional_dependencies:
32+
- mdformat-ruff
33+
- mdformat-deflist
34+
- mdformat-footnote
35+
- mdformat-gfm
36+
- mdformat-gfm-alerts
37+
- mdformat-tables
38+
- repo: https://github.com/astral-sh/ruff-pre-commit
39+
rev: v0.13.3
40+
hooks:
41+
- id: ruff-check
2442
args: [--fix, --exit-non-zero-on-fix]
25-
26-
- id: black
27-
name: black
28-
language: system
29-
entry: black
30-
types: [python]
43+
- id: ruff-format
44+
- repo: https://github.com/google/yamlfmt
45+
rev: v0.19.0
46+
hooks:
47+
- id: yamlfmt
48+
# See https://pre-commit.ci/
49+
ci:
50+
autoupdate_schedule: weekly
51+
skip:
52+
- no-commit-to-branch

CODE_OF_CONDUCT.md

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ python3 -m pip install django-citext
1515
```python
1616
# settings.py
1717
INSTALLED_APPS = [
18-
'citext',
18+
"citext",
1919
# ...
2020
]
2121
```

pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ test = [
4545
"pytest-cov",
4646
"pytest-django",
4747
]
48-
lint = [
49-
"black==25.9.0",
50-
"pre-commit==4.3.0",
51-
"ruff==0.14.3",
52-
]
5348
psycopg2 = ["psycopg2-binary"]
5449
bakery = ["model-bakery"]
5550

setup.cfg

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

tests/testapp/settings.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/
2121

2222
# SECURITY WARNING: keep the secret key used in production secret!
23-
SECRET_KEY = (
24-
"django-insecure-4787+%emei)bk2ue$5^0(5_i3+ef-0^87v)myt+8y__n$-o4@l" # noqa: S105
25-
)
23+
SECRET_KEY = "django-insecure-4787+%emei)bk2ue$5^0(5_i3+ef-0^87v)myt+8y__n$-o4@l" # noqa: S105
2624

2725
# SECURITY WARNING: don't run with debug turned on in production!
2826
DEBUG = True

0 commit comments

Comments
 (0)