Skip to content

Commit 80a6eb1

Browse files
authored
Merge branch 'codingjoe:main' into do-not-retry-when-no-file
2 parents 7c73c82 + 1a64de0 commit 80a6eb1

26 files changed

+506
-398
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
github: codingjoe
2+
buy_me_a_coffee: codingjoe
23
tidelift: pypi/django-pictures
34
custom: https://www.paypal.me/codingjoe

.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: 22 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,27 @@
11
name: CI
2-
32
on:
43
push:
54
branches:
65
- main
76
pull_request:
8-
97
jobs:
10-
11-
lint:
12-
runs-on: ubuntu-latest
13-
strategy:
14-
matrix:
15-
lint-command:
16-
- bandit -r . -x ./tests
17-
- black --check --diff .
18-
- flake8 .
19-
- isort --check-only --diff .
20-
- pydocstyle .
21-
steps:
22-
- uses: actions/checkout@v4
23-
- uses: actions/setup-python@v5
24-
with:
25-
python-version: "3.x"
26-
cache: 'pip'
27-
cache-dependency-path: 'pyproject.toml'
28-
- run: python -m pip install -e .[lint]
29-
- run: ${{ matrix.lint-command }}
30-
318
dist:
329
runs-on: ubuntu-latest
3310
steps:
34-
- uses: actions/checkout@v4
35-
- uses: actions/setup-python@v5
11+
- uses: actions/checkout@v5
12+
- uses: actions/setup-python@v6
3613
with:
3714
python-version: "3.x"
3815
- run: sudo apt install gettext -y
3916
- run: python -m pip install --upgrade pip build wheel twine
4017
- run: make gettext
4118
- run: python -m build --sdist --wheel
4219
- run: python -m twine check dist/*
43-
- uses: actions/upload-artifact@v4
20+
- uses: actions/upload-artifact@v5
4421
with:
4522
path: dist/*
46-
4723
pytest-os:
4824
name: PyTest
49-
needs:
50-
- lint
5125
strategy:
5226
matrix:
5327
os:
@@ -56,9 +30,9 @@ jobs:
5630
- "windows-latest"
5731
runs-on: ${{ matrix.os }}
5832
steps:
59-
- uses: actions/checkout@v4
33+
- uses: actions/checkout@v5
6034
- name: Set up Python ${{ matrix.python-version }}
61-
uses: actions/setup-python@v5
35+
uses: actions/setup-python@v6
6236
with:
6337
python-version: "3.x"
6438
- run: python -m pip install .[test]
@@ -67,25 +41,22 @@ jobs:
6741
with:
6842
flags: ${{ matrix.os }}
6943
token: ${{ secrets.CODECOV_TOKEN }}
70-
7144
pytest-python:
7245
name: PyTest
73-
needs:
74-
- lint
7546
strategy:
7647
matrix:
7748
python-version:
78-
- "3.8"
7949
- "3.9"
8050
- "3.10"
8151
- "3.12"
52+
- "3.13"
8253
django-version:
83-
- "3.2" # LTS
54+
- "4.2" # LTS
8455
runs-on: ubuntu-latest
8556
steps:
86-
- uses: actions/checkout@v4
57+
- uses: actions/checkout@v5
8758
- name: Set up Python ${{ matrix.python-version }}
88-
uses: actions/setup-python@v5
59+
uses: actions/setup-python@v6
8960
with:
9061
python-version: ${{ matrix.python-version }}
9162
- run: python -m pip install .[test]
@@ -95,24 +66,21 @@ jobs:
9566
with:
9667
flags: py${{ matrix.python-version }}
9768
token: ${{ secrets.CODECOV_TOKEN }}
98-
9969
pytest-django:
10070
name: PyTest
101-
needs:
102-
- lint
10371
strategy:
10472
matrix:
10573
python-version:
106-
- "3.11"
74+
- "3.12"
10775
django-version:
10876
# LTS gets tested on all OS
109-
- "4.1"
110-
- "4.2"
77+
- "5.1"
78+
- "5.2"
11179
runs-on: ubuntu-latest
11280
steps:
113-
- uses: actions/checkout@v4
81+
- uses: actions/checkout@v5
11482
- name: Set up Python ${{ matrix.python-version }}
115-
uses: actions/setup-python@v5
83+
uses: actions/setup-python@v6
11684
with:
11785
python-version: ${{ matrix.python-version }}
11886
- run: python -m pip install .[test]
@@ -122,11 +90,8 @@ jobs:
12290
with:
12391
flags: dj${{ matrix.django-version }}
12492
token: ${{ secrets.CODECOV_TOKEN }}
125-
12693
pytest-extras:
12794
name: PyTest
128-
needs:
129-
- lint
13095
strategy:
13196
matrix:
13297
extras:
@@ -137,9 +102,9 @@ jobs:
137102
- "cleanup"
138103
runs-on: ubuntu-latest
139104
steps:
140-
- uses: actions/checkout@v4
105+
- uses: actions/checkout@v5
141106
- name: Set up Python ${{ matrix.python-version }}
142-
uses: actions/setup-python@v5
107+
uses: actions/setup-python@v6
143108
with:
144109
python-version: 3.x
145110
- name: Install redis
@@ -151,10 +116,9 @@ jobs:
151116
with:
152117
flags: ${{ matrix.extras }}
153118
token: ${{ secrets.CODECOV_TOKEN }}
154-
155119
codeql:
156120
name: CodeQL
157-
needs: [ dist, pytest-os, pytest-python, pytest-django, pytest-extras ]
121+
needs: [dist, pytest-os, pytest-python, pytest-django, pytest-extras]
158122
runs-on: ubuntu-latest
159123
permissions:
160124
actions: read
@@ -163,18 +127,18 @@ jobs:
163127
strategy:
164128
fail-fast: false
165129
matrix:
166-
language: [ python ]
130+
language: [python]
167131
steps:
168132
- name: Checkout
169-
uses: actions/checkout@v4
133+
uses: actions/checkout@v5
170134
- name: Initialize CodeQL
171-
uses: github/codeql-action/init@v3
135+
uses: github/codeql-action/init@v4
172136
with:
173137
languages: ${{ matrix.language }}
174138
queries: +security-and-quality
175139
- name: Autobuild
176-
uses: github/codeql-action/autobuild@v3
140+
uses: github/codeql-action/autobuild@v4
177141
- name: Perform CodeQL Analysis
178-
uses: github/codeql-action/analyze@v3
142+
uses: github/codeql-action/analyze@v4
179143
with:
180144
category: "/language:${{ matrix.language }}"

.github/workflows/release.yml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
name: Release
2-
32
on:
43
release:
54
types: [published]
6-
5+
workflow_dispatch:
76
jobs:
8-
PyPi:
9-
7+
pypi-build:
108
runs-on: ubuntu-latest
119
steps:
12-
- uses: actions/checkout@v4
13-
- uses: actions/setup-python@v5
14-
with:
15-
python-version: "3.10"
16-
- run: sudo apt install gettext -y
17-
- run: python -m pip install --upgrade pip build wheel twine
18-
- run: make gettext
19-
- run: python -m build --sdist --wheel
20-
- run: python -m twine upload dist/*
21-
env:
22-
TWINE_USERNAME: __token__
23-
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
10+
- uses: actions/checkout@v5
11+
- uses: actions/setup-python@v6
12+
with:
13+
python-version: "3.x"
14+
- run: python -m pip install --upgrade pip build wheel
15+
- run: python -m build --sdist --wheel
16+
- uses: actions/upload-artifact@v5
17+
with:
18+
name: release-dists
19+
path: dist/
20+
pypi-publish:
21+
runs-on: ubuntu-latest
22+
needs:
23+
- pypi-build
24+
permissions:
25+
id-token: write
26+
steps:
27+
- uses: actions/download-artifact@v6
28+
with:
29+
name: release-dists
30+
path: dist/
31+
- uses: pypa/gh-action-pypi-publish@release/v1

.pre-commit-config.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: check-merge-conflict
7+
- id: check-ast
8+
- id: check-toml
9+
- id: check-yaml
10+
- id: check-symlinks
11+
- id: debug-statements
12+
- id: end-of-file-fixer
13+
exclude: "pictures/templates/pictures/attrs.html"
14+
- id: no-commit-to-branch
15+
args: [--branch, main]
16+
- repo: https://github.com/asottile/pyupgrade
17+
rev: v3.21.1
18+
hooks:
19+
- id: pyupgrade
20+
- repo: https://github.com/adamchainz/django-upgrade
21+
rev: 1.29.1
22+
hooks:
23+
- id: django-upgrade
24+
- repo: https://github.com/hukkin/mdformat
25+
rev: 1.0.0
26+
hooks:
27+
- id: mdformat
28+
additional_dependencies:
29+
- mdformat-ruff
30+
- mdformat-footnote
31+
- mdformat-gfm
32+
- mdformat-gfm-alerts
33+
- repo: https://github.com/astral-sh/ruff-pre-commit
34+
rev: v0.14.5
35+
hooks:
36+
- id: ruff-check
37+
args: [--fix, --exit-non-zero-on-fix]
38+
- id: ruff-format
39+
- repo: https://github.com/google/yamlfmt
40+
rev: v0.20.0
41+
hooks:
42+
- id: yamlfmt
43+
ci:
44+
autoupdate_schedule: weekly
45+
skip:
46+
- no-commit-to-branch

0 commit comments

Comments
 (0)