Skip to content

Commit 149d72e

Browse files
Use pre-commit CI in favor of GitHub actions (#155)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent f65a328 commit 149d72e

File tree

9 files changed

+81
-64
lines changed

9 files changed

+81
-64
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
pyproject.toml @herrbenesch @amureki
44
## GitHub Actions
55
.github/workflows/ci.yml @herrbenesch @amureki
6-
.github/workflows/release.yml @herrbenesch @amureki
6+
.github/workflows/release.yml @herrbenesch @amureki

.github/dependabot.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
version: 2
22
updates:
3-
- package-ecosystem: pip
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
- package-ecosystem: github-actions
8-
directory: "/"
9-
schedule:
10-
interval: daily
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
- package-ecosystem: github-actions
8+
directory: "/"
9+
schedule:
10+
interval: daily

.github/workflows/ci.yml

Lines changed: 11 additions & 35 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 .[lint]
40-
- run: ${{ matrix.lint-command }}
41-
4221
pytest:
43-
needs:
44-
- lint
4522
strategy:
4623
matrix:
4724
os:
@@ -52,7 +29,7 @@ jobs:
5229
- "3.12"
5330
- "3.13"
5431
django-version:
55-
- "4.2" # LTS
32+
- "4.2" # LTS
5633
- "5.1"
5734
- "5.2"
5835
extras:
@@ -73,16 +50,15 @@ jobs:
7350
options: --entrypoint redis-server
7451
env:
7552
REDIS_URL: redis:///0
76-
7753
runs-on: ${{ matrix.os }}
7854
steps:
79-
- uses: actions/checkout@v5
80-
- uses: actions/setup-python@v6
81-
with:
82-
python-version: ${{ matrix.python-version }}
83-
- run: python -m pip install .[${{ matrix.extras }}]
84-
- run: python -m pip install django~=${{ matrix.django-version }}.0
85-
- run: python -m pytest
86-
- uses: codecov/codecov-action@v5
87-
with:
88-
token: ${{ secrets.CODECOV_TOKEN }}
55+
- uses: actions/checkout@v5
56+
- uses: actions/setup-python@v6
57+
with:
58+
python-version: ${{ matrix.python-version }}
59+
- run: python -m pip install .[${{ matrix.extras }}]
60+
- run: python -m pip install django~=${{ matrix.django-version }}.0
61+
- run: python -m pytest
62+
- uses: codecov/codecov-action@v5
63+
with:
64+
token: ${{ secrets.CODECOV_TOKEN }}

.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:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,4 @@ dmypy.json
131131

132132
# Packaging
133133

134-
dramatiq_crontab/_version.py
134+
dramatiq_crontab/_version.py

.pre-commit-config.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v6.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: check-merge-conflict
9+
- id: check-ast
10+
- id: check-toml
11+
- id: check-yaml
12+
- id: debug-statements
13+
- id: end-of-file-fixer
14+
- id: name-tests-test
15+
args: ["--pytest-test-first"]
16+
exclude: ^tests\/(testapp\/|manage.py)
17+
- id: no-commit-to-branch
18+
args: [--branch, main]
19+
- repo: https://github.com/asottile/pyupgrade
20+
rev: v3.20.0
21+
hooks:
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
42+
args: [--fix, --exit-non-zero-on-fix]
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

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
**Cron style scheduler for asynchronous Dramatiq tasks in Django.**
66

7-
* setup recurring tasks via crontab syntax
8-
* lightweight helpers build on robust tools like [Dramatiq][dramatiq] and [APScheduler][apscheduler]
9-
* [Sentry][sentry] cron monitor support
7+
- setup recurring tasks via crontab syntax
8+
- lightweight helpers build on robust tools like [Dramatiq] and [APScheduler]
9+
- [Sentry] cron monitor support
1010

1111
[![PyPi Version](https://img.shields.io/pypi/v/dramatiq-crontab.svg)](https://pypi.python.org/pypi/dramatiq-crontab/)
1212
[![Test Coverage](https://codecov.io/gh/voiio/dramatiq-crontab/branch/main/graph/badge.svg)](https://codecov.io/gh/voiio/dramatiq-crontab)
1313
[![GitHub License](https://img.shields.io/github/license/voiio/dramatiq-crontab)](https://raw.githubusercontent.com/voiio/dramatiq-crontab/master/LICENSE)
1414

1515
## Setup
1616

17-
You need to have [Dramatiq][dramatiq] installed and setup properly.
17+
You need to have [Dramatiq] installed and setup properly.
1818

1919
```ShellSession
2020
python3 -m pip install dramatiq-crontab
@@ -27,7 +27,7 @@ Add `dramatiq_crontab` to your `INSTALLED_APPS` in `settings.py`:
2727
```python
2828
# settings.py
2929
INSTALLED_APPS = [
30-
'dramatiq_crontab',
30+
"dramatiq_crontab",
3131
# ...
3232
]
3333
```
@@ -90,7 +90,7 @@ be at 12:00:45.
9090

9191
### Sentry Cron Monitors
9292

93-
If you use [Sentry][sentry] you can add cron monitors to your tasks.
93+
If you use [Sentry] you can add cron monitors to your tasks.
9494
The monitor's slug will be the actor's name. Like `my_task` in the example above.
9595

9696
### The crontab command
@@ -109,6 +109,6 @@ options:
109109
--no-heartbeat Don't start the heartbeat actor.
110110
```
111111

112-
[dramatiq]: https://dramatiq.io/
113112
[apscheduler]: https://apscheduler.readthedocs.io/en/stable/
113+
[dramatiq]: https://dramatiq.io/
114114
[sentry]: https://docs.sentry.io/product/crons/

pyproject.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ test = [
5151
sentry = ["sentry-sdk"]
5252
redis = ["redis"]
5353

54-
lint = [
55-
"black==25.9.0",
56-
"ruff==0.14.3",
57-
]
58-
5954
[project.urls]
6055
Project-URL = "https://github.com/voiio/dramatiq-crontab"
6156
Changelog = "https://github.com/voiio/dramatiq-crontab/releases"

tests/testapp/settings.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
2525

2626
# SECURITY WARNING: keep the secret key used in production secret!
27-
SECRET_KEY = (
28-
"django-insecure--@w!1qsi6azo&=a**ia3b43k^@q9aor_rqyu=1i5yd-zinpo)0" # noqa: S105
29-
)
27+
SECRET_KEY = "django-insecure--@w!1qsi6azo&=a**ia3b43k^@q9aor_rqyu=1i5yd-zinpo)0" # noqa: S105
3028

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

0 commit comments

Comments
 (0)