Skip to content

Commit 260fe4f

Browse files
committed
Update packaging and CI
* Add Python 3.13 * Add Django 3.14 * Add Django 5.2 (LTS) * Add Django 6.0 * Drop Django 5.1 (EoL) * Drop Django 5.0 (EoL)
1 parent c15d63a commit 260fe4f

File tree

9 files changed

+156
-140
lines changed

9 files changed

+156
-140
lines changed

.bandit

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

.github/FUNDING.yml

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

.github/workflows/ci.yml

Lines changed: 24 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,50 @@
11
name: CI
2-
32
on:
43
push:
54
branches:
65
- main
76
pull_request:
8-
schedule:
9-
- cron: '0 0 * * *'
10-
117
jobs:
12-
13-
lint:
14-
strategy:
15-
fail-fast: false
16-
matrix:
17-
lint-command:
18-
- "bandit ."
19-
- "black --check --diff ."
20-
- "flake8 ."
21-
- "isort --check-only --diff ."
22-
- "pydocstyle ."
8+
dist:
239
runs-on: ubuntu-latest
2410
steps:
2511
- uses: actions/checkout@v6
26-
- uses: actions/setup-python@v6
27-
with:
28-
python-version: "3.x"
29-
cache: 'pip'
30-
cache-dependency-path: 'pyproject.toml'
31-
- run: python -m pip install -e .[lint]
32-
- run: ${{ matrix.lint-command }}
33-
34-
readme:
35-
runs-on: ubuntu-latest
36-
steps:
37-
- uses: actions/checkout@v6
38-
- uses: actions/setup-python@v6
39-
with:
40-
python-version: "3.x"
41-
- name: Install Python dependencies
42-
run: python -m pip install --upgrade pip build wheel twine readme-renderer
43-
- run: python -m build --sdist --wheel
44-
- run: python -m twine check dist/*
12+
- uses: astral-sh/setup-uv@v7
13+
- run: uvx --from build pyproject-build --sdist --wheel
14+
- run: uvx twine check dist/*
4515
- uses: actions/upload-artifact@v6
4616
with:
4717
path: dist/*
48-
4918
pytest:
50-
runs-on: ubuntu-latest
5119
needs:
52-
- readme
53-
- lint
20+
- dist
21+
runs-on: ubuntu-latest
5422
strategy:
5523
matrix:
5624
python-version:
5725
- "3.10"
5826
- "3.11"
5927
- "3.12"
28+
- "3.13"
29+
- "3.14"
6030
django-version:
6131
- "4.2"
62-
- "5.0"
63-
- "5.1"
32+
- "5.2"
33+
- "6.0"
34+
exclude:
35+
- python-version: "3.14"
36+
django-version: "4.2"
37+
- python-version: "3.10"
38+
django-version: "6.0"
39+
- python-version: "3.11"
40+
django-version: "6.0"
6441
steps:
65-
- uses: actions/checkout@v6
66-
- name: Set up Python ${{ matrix.python-version }}
67-
uses: actions/setup-python@v6
68-
with:
69-
python-version: ${{ matrix.python-version }}
70-
- run: python -m pip install .[test]
71-
- name: Install Django ${{ matrix.django-version }}
72-
run: python -m pip install "django~=${{ matrix.django-version }}.0"
73-
- name: Run tests
74-
run: python -m pytest
75-
- uses: codecov/codecov-action@v5
76-
77-
analyze:
78-
name: CodeQL Analyze
79-
needs: [ pytest ]
80-
runs-on: ubuntu-latest
81-
permissions:
82-
actions: read
83-
contents: read
84-
security-events: write
85-
86-
strategy:
87-
fail-fast: false
88-
matrix:
89-
language: [ python ]
90-
91-
steps:
92-
- name: Checkout
93-
uses: actions/checkout@v6
94-
95-
- name: Initialize CodeQL
96-
uses: github/codeql-action/init@v4
42+
- uses: actions/checkout@v6
43+
- uses: astral-sh/setup-uv@v7
9744
with:
98-
languages: ${{ matrix.language }}
99-
queries: +security-and-quality
100-
101-
- name: Autobuild
102-
uses: github/codeql-action/autobuild@v4
103-
104-
- name: Perform CodeQL Analysis
105-
uses: github/codeql-action/analyze@v4
45+
python-version: ${{ matrix.python-version }}
46+
- run: uv run --with django~=${{ matrix.django-version }}.0 pytest -m "not selenium"
47+
- uses: codecov/codecov-action@v5
10648
with:
107-
category: "/language:${{ matrix.language }}"
49+
token: ${{ secrets.CODECOV_TOKEN }}
50+
flags: python-${{ matrix.python-version }}-django-${{ matrix.django-version }}

.github/workflows/release.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
name: Release
2-
32
on:
43
release:
54
types: [published]
6-
5+
workflow_dispatch:
76
jobs:
8-
PyPI:
7+
pypi-build:
98
runs-on: ubuntu-latest
109
steps:
1110
- uses: actions/checkout@v6
12-
- uses: actions/setup-python@v6
11+
- uses: astral-sh/setup-uv@v7
12+
- run: uvx --from build pyproject-build --sdist --wheel
13+
- uses: actions/upload-artifact@v6
1314
with:
14-
python-version: "3.10"
15-
- name: Install Python dependencies
16-
run: python -m pip install --upgrade pip build wheel twine
17-
- name: Build dist packages
18-
run: python -m build --sdist --wheel
19-
- name: Upload packages
20-
run: python -m twine upload dist/*
21-
env:
22-
TWINE_USERNAME: __token__
23-
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
15+
name: release-dists
16+
path: dist/
17+
pypi-publish:
18+
runs-on: ubuntu-latest
19+
needs:
20+
- pypi-build
21+
permissions:
22+
id-token: write
23+
steps:
24+
- uses: actions/download-artifact@v7
25+
with:
26+
name: release-dists
27+
path: dist/
28+
- uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,7 @@ venv.bak/
104104
.mypy_cache/
105105

106106
# setuptools_scm
107-
_version.py
107+
_version.py
108+
109+
# uv
110+
uv.lock

.pre-commit-config.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
- id: no-commit-to-branch
14+
args: [--branch, main]
15+
- repo: https://github.com/asottile/pyupgrade
16+
rev: v3.21.2
17+
hooks:
18+
- id: pyupgrade
19+
- repo: https://github.com/adamchainz/django-upgrade
20+
rev: 1.29.1
21+
hooks:
22+
- id: django-upgrade
23+
- repo: https://github.com/hukkin/mdformat
24+
rev: 1.0.0
25+
hooks:
26+
- id: mdformat
27+
additional_dependencies:
28+
- mdformat-ruff
29+
- mdformat-footnote
30+
- mdformat-gfm
31+
- mdformat-gfm-alerts
32+
- repo: https://github.com/astral-sh/ruff-pre-commit
33+
rev: v0.14.9
34+
hooks:
35+
- id: ruff-check
36+
args: [--fix, --exit-non-zero-on-fix]
37+
- id: ruff-format
38+
- repo: https://github.com/google/yamlfmt
39+
rev: v0.20.0
40+
hooks:
41+
- id: yamlfmt
42+
ci:
43+
autoupdate_schedule: weekly
44+
skip:
45+
- no-commit-to-branch

pyproject.toml

Lines changed: 64 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,36 @@ classifiers = [
2626
"Programming Language :: Python :: 3.10",
2727
"Programming Language :: Python :: 3.11",
2828
"Programming Language :: Python :: 3.12",
29+
"Programming Language :: Python :: 3.13",
30+
"Programming Language :: Python :: 3.14",
2931
"Framework :: Django",
3032
"Framework :: Django :: 4.2",
31-
"Framework :: Django :: 5.0",
32-
"Framework :: Django :: 5.1",
33+
"Framework :: Django :: 5.2",
34+
"Framework :: Django :: 6.0",
3335
]
3436
requires-python = ">=3.10"
3537
dependencies = ["django>=4.2.0"]
3638

37-
[project.optional-dependencies]
39+
[dependency-groups]
40+
dev = [
41+
{ include-group = "test" },
42+
]
3843
test = [
3944
"pytest",
4045
"pytest-cov",
4146
"pytest-django",
4247
]
43-
lint = [
44-
"bandit==1.9.2",
45-
"black==25.12.0",
46-
"flake8==7.3.0",
47-
"isort==7.0.0",
48-
"pydocstyle[toml]==6.3.0",
49-
]
5048

5149
[project.urls]
52-
Project-URL = "https://github.com/codingjoe/django-dynamic-filenames"
50+
# https://packaging.python.org/en/latest/specifications/well-known-project-urls/#well-known-labels
51+
Homepage = "https://github.com/codingjoe/django-dynamic-filenames"
5352
Changelog = "https://github.com/codingjoe/django-dynamic-filenames/releases"
5453
Source = "https://github.com/codingjoe/django-dynamic-filenames"
55-
Documentation = "https://github.com/codingjoe/django-dynamic-filenames#django-dynamic-filenames"
56-
Issue-Tracker = "https://github.com/codingjoe/django-dynamic-filenames/issues"
54+
Releasenotes = "https://github.com/codingjoe/django-dynamic-filenames/releases/latest"
55+
Documentation = "https://github.com/codingjoe/django-dynamic-filenames?tab=readme-ov-file"
56+
Issues = "https://github.com/codingjoe/django-dynamic-filenames/issues"
57+
Funding = "https://github.com/sponsors/codingjoe"
58+
5759

5860
[tool.flit.module]
5961
name = "dynamic_filenames"
@@ -63,7 +65,7 @@ write_to = "dynamic_filenames/_version.py"
6365

6466
[tool.pytest.ini_options]
6567
minversion = "6.0"
66-
addopts = "--cov --tb=short -rxs"
68+
addopts = "--cov --cov-report=xml --cov-report=term --tb=short -rxs"
6769
testpaths = ["tests"]
6870
DJANGO_SETTINGS_MODULE = "tests.testapp.settings"
6971

@@ -72,16 +74,51 @@ source = ["dynamic_filenames"]
7274

7375
[tool.coverage.report]
7476
show_missing = true
75-
omit = ["dynamic_filenames/_version.py", "tests/*"]
76-
77-
[tool.isort]
78-
atomic = true
79-
line_length = 88
80-
known_first_party = "dynamic_filenames, tests"
81-
include_trailing_comma = true
82-
default_section = "THIRDPARTY"
83-
combine_as_imports = true
84-
skip = ["dynamic_filenames/_version.py"]
85-
86-
[tool.pydocstyle]
87-
add_ignore = "D1"
77+
skip_covered = true
78+
79+
[tool.ruff]
80+
src = ["dynamic_filenames", "tests"]
81+
line-length = 88
82+
indent-width = 4
83+
84+
[tool.ruff.format]
85+
quote-style = "double"
86+
indent-style = "space"
87+
skip-magic-trailing-comma = false
88+
line-ending = "auto"
89+
preview = true
90+
91+
[tool.ruff.lint]
92+
select = [
93+
"D", # pydocstyle
94+
"E", # pycodestyle errors
95+
"EXE", # flake8-executable
96+
"F", # pyflakes
97+
"I", # isort
98+
"PGH", # pygrep-hooks
99+
"PT", # flake8-pytest-style
100+
"RET", # flake8-return
101+
"S", # flake8-bandit
102+
"SIM", # flake8-simplify
103+
"UP", # pyupgrade
104+
"W", # pycodestyle warnings
105+
]
106+
107+
ignore = ["D1", "E501", "PT012"]
108+
109+
[tool.ruff.lint.per-file-ignores]
110+
"tests/**" = ["S"]
111+
112+
[tool.ruff.lint.flake8-pytest-style]
113+
fixture-parentheses = false
114+
mark-parentheses = false
115+
116+
[tool.ruff.lint.isort]
117+
combine-as-imports = true
118+
split-on-trailing-comma = true
119+
section-order = ["future", "standard-library", "third-party", "first-party", "local-folder"]
120+
force-wrap-aliases = true
121+
known-first-party = ["dynamic_filenames", "tests"]
122+
123+
[tool.ruff.lint.pydocstyle]
124+
convention = "pep257"

setup.cfg

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

setup.py

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

0 commit comments

Comments
 (0)