Skip to content

Commit f5a1309

Browse files
committed
Updates for latest Django supported versions
1 parent 8329c90 commit f5a1309

File tree

16 files changed

+75
-73
lines changed

16 files changed

+75
-73
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,20 @@ on:
99
jobs:
1010
tests:
1111
name: Python ${{ matrix.python-version }}
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
1313

1414
strategy:
1515
matrix:
16-
python-version:
17-
- 3.6
18-
- 3.7
19-
- 3.8
20-
- 3.9
16+
python-version: ["3.10", "3.11", "3.12", "3.13"]
2117

2218
steps:
23-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2420

25-
- uses: actions/setup-python@v2
21+
- uses: actions/setup-python@v5
2622
with:
2723
python-version: ${{ matrix.python-version }}
2824

29-
- uses: actions/cache@v2
25+
- uses: actions/cache@v4
3026
with:
3127
path: ~/.cache/pip
3228
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }}

.github/workflows/pre-commit.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ on:
88

99
jobs:
1010
pre-commit:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515
with:
1616
fetch-depth: 0
1717

18-
- uses: actions/setup-python@v2
18+
- uses: actions/setup-python@v5
1919

20-
- uses: pre-commit/action@v2.0.0
20+
- uses: pre-commit/action@v3.0.1
2121
with:
2222
token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ html/
99
htmlcov/
1010
*.egg-info/
1111
.tox/
12+
/temp
13+
/venv

.pre-commit-config.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.3.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-added-large-files
66
- id: check-case-conflict
@@ -11,24 +11,25 @@ repos:
1111
- id: end-of-file-fixer
1212
- id: trailing-whitespace
1313
- repo: https://github.com/psf/black
14-
rev: 22.8.0
14+
rev: 25.1.0
1515
hooks:
1616
- id: black
1717
language_version: python3
1818
- repo: https://github.com/pycqa/isort
19-
rev: 5.10.1
19+
rev: 6.0.1
2020
hooks:
2121
- id: isort
2222
- repo: https://github.com/PyCQA/flake8
23-
rev: 5.0.4
23+
rev: 7.1.2
2424
hooks:
2525
- id: flake8
2626
additional_dependencies:
2727
- flake8-bugbear
2828
- flake8-comprehensions
2929
- flake8-tidy-imports
3030
- repo: https://github.com/mgedmin/check-manifest
31-
rev: "0.48"
31+
rev: "0.50"
3232
hooks:
3333
- id: check-manifest
3434
args: [--no-build-isolation]
35+
additional_dependencies: [setuptools, wheel]

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ Writing the same code with `django-vanilla-views`, you'd instead arrive at a sim
9090

9191
## Requirements
9292

93-
* **Django**: 2.2, 3.0, 3.1, 3.2
94-
* **Python**: 3.6, 3.7, 3.8, 3.9
93+
* **Django**: 4.2, 5.0, 5.1, 5.2
94+
* **Python**: 3.10, 3.11, 3.12, 3.13
9595

9696
## Installation
9797

example/example/notes/migrations/0001_initial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
class Migration(migrations.Migration):
5-
65
initial = True
76

87
dependencies = []

example/manage.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
23
import os
34
import sys
45

5-
if __name__ == "__main__":
6+
7+
def main():
8+
"""Run administrative tasks."""
69
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "example.settings")
10+
try:
11+
from django.core.management import execute_from_command_line
12+
except ImportError as exc:
13+
raise ImportError(
14+
"Couldn't import Django. Are you sure it's installed and "
15+
"available on your PYTHONPATH environment variable? Did you "
16+
"forget to activate a virtual environment?"
17+
) from exc
18+
execute_from_command_line(sys.argv)
719

8-
from django.core.management import execute_from_command_line
920

10-
execute_from_command_line(sys.argv)
21+
if __name__ == "__main__":
22+
main()

example/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Django>=1.8
2-
django-vanilla-views==1.0.4
1+
Django>=4.2
2+
django-vanilla-views>=3.1.0

manage.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
23
import os
34
import sys
45

5-
if __name__ == "__main__":
6+
7+
def main():
8+
"""Run administrative tasks."""
69
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "testsettings")
10+
try:
11+
from django.core.management import execute_from_command_line
12+
except ImportError as exc:
13+
raise ImportError(
14+
"Couldn't import Django. Are you sure it's installed and "
15+
"available on your PYTHONPATH environment variable? Did you "
16+
"forget to activate a virtual environment?"
17+
) from exc
18+
execute_from_command_line(sys.argv)
719

8-
from django.core.management import execute_from_command_line
920

10-
execute_from_command_line(sys.argv)
21+
if __name__ == "__main__":
22+
main()

mkdocs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
next_url_map[path] = rel + path_list[idx + 1][:-3] + suffix
6262

6363

64-
for (dirpath, _dirnames, filenames) in os.walk(docs_dir):
64+
for dirpath, _dirnames, filenames in os.walk(docs_dir):
6565
relative_dir = dirpath.replace(docs_dir, "").lstrip(os.path.sep)
6666
build_dir = os.path.join(html_dir, relative_dir)
6767

0 commit comments

Comments
 (0)