Skip to content

Commit 67165e1

Browse files
committed
Add more supported Django versions to test setup
1 parent f868915 commit 67165e1

File tree

11 files changed

+1452
-120
lines changed

11 files changed

+1452
-120
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,28 @@ jobs:
1818
strategy:
1919
matrix:
2020
python-version:
21-
- '3.10'
22-
- '3.11'
23-
- '3.12'
24-
- '3.13'
21+
- "3.10"
22+
- "3.11"
23+
- "3.12"
24+
- "3.13"
25+
- "3.14"
2526

2627
steps:
27-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@v4
2829

29-
- uses: actions/setup-python@v5
30-
with:
31-
python-version: ${{ matrix.python-version }}
32-
allow-prereleases: true
30+
- uses: actions/setup-python@v5
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
allow-prereleases: true
3334

34-
- name: Install uv
35-
uses: astral-sh/setup-uv@v5
36-
with:
37-
enable-cache: true
38-
cache-dependency-glob: tests/requirements/*.txt
35+
- name: Install uv
36+
uses: astral-sh/setup-uv@v5
37+
with:
38+
enable-cache: true
39+
cache-dependency-glob: tests/requirements/*.txt
3940

40-
- name: Install dependencies
41-
run: uv pip install --system tox tox-uv
41+
- name: Install dependencies
42+
run: uv pip install --system tox tox-uv
4243

43-
- name: Run tox targets for ${{ matrix.python-version }}
44-
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)
44+
- name: Run tox targets for ${{ matrix.python-version }}
45+
run: tox run -f py$(echo ${{ matrix.python-version }} | tr -d .)

tests/requirements/compile.py

Lines changed: 23 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -23,104 +23,27 @@
2323
"requirements.in",
2424
*sys.argv[1:],
2525
]
26+
django_python_versions = {
27+
"Django>=4.2,<5.0": ["3.10", "3.11", "3.12"],
28+
"Django>=5.0,<5.1": ["3.10", "3.11", "3.12"],
29+
"Django>=5.1,<5.2": ["3.10", "3.11", "3.12", "3.13"],
30+
"Django>=5.2,<6.0": ["3.10", "3.11", "3.12", "3.13", "3.14"],
31+
"Django>=6.0,<6.1": ["3.12", "3.13", "3.14"],
32+
}
2633
run = partial(subprocess.run, check=True)
27-
run(
28-
[
29-
*common_args,
30-
"--python",
31-
"3.10",
32-
"--output-file",
33-
"py310-django42.txt",
34-
],
35-
input=b"Django>=4.2a1,<5.0",
36-
)
37-
run(
38-
[
39-
*common_args,
40-
"--python",
41-
"3.10",
42-
"--output-file",
43-
"py310-django50.txt",
44-
],
45-
input=b"Django>=5.0a1,<5.1",
46-
)
47-
run(
48-
[
49-
*common_args,
50-
"--python",
51-
"3.10",
52-
"--output-file",
53-
"py310-django51.txt",
54-
],
55-
input=b"Django>=5.1a1,<5.2",
56-
)
57-
run(
58-
[
59-
*common_args,
60-
"--python",
61-
"3.11",
62-
"--output-file",
63-
"py311-django42.txt",
64-
],
65-
input=b"Django>=4.2a1,<5.0",
66-
)
67-
run(
68-
[
69-
*common_args,
70-
"--python",
71-
"3.11",
72-
"--output-file",
73-
"py311-django50.txt",
74-
],
75-
input=b"Django>=5.0a1,<5.1",
76-
)
77-
run(
78-
[
79-
*common_args,
80-
"--python",
81-
"3.11",
82-
"--output-file",
83-
"py311-django51.txt",
84-
],
85-
input=b"Django>=5.1a1,<5.2",
86-
)
87-
run(
88-
[
89-
*common_args,
90-
"--python",
91-
"3.12",
92-
"--output-file",
93-
"py312-django42.txt",
94-
],
95-
input=b"Django>=4.2a1,<5.0",
96-
)
97-
run(
98-
[
99-
*common_args,
100-
"--python",
101-
"3.12",
102-
"--output-file",
103-
"py312-django50.txt",
104-
],
105-
input=b"Django>=5.0a1,<5.1",
106-
)
107-
run(
108-
[
109-
*common_args,
110-
"--python",
111-
"3.12",
112-
"--output-file",
113-
"py312-django51.txt",
114-
],
115-
input=b"Django>=5.1a1,<5.2",
116-
)
117-
run(
118-
[
119-
*common_args,
120-
"--python",
121-
"3.13",
122-
"--output-file",
123-
"py313-django51.txt",
124-
],
125-
input=b"Django>=5.1a1,<5.2",
126-
)
34+
for django_version, python_versions in django_python_versions.items():
35+
for python_version in python_versions:
36+
django_nodot = (
37+
django_version.split("=", 1)[1].split(",", 1)[0].replace(".", "")
38+
)
39+
python_nodot = python_version.replace(".", "")
40+
run(
41+
[
42+
*common_args,
43+
"--python",
44+
python_version,
45+
"--output-file",
46+
f"py{python_nodot}-django{django_nodot}.txt",
47+
],
48+
input=django_version.encode("utf-8"),
49+
)

0 commit comments

Comments
 (0)