Skip to content

Commit 063134e

Browse files
authored
Merge pull request #97 from kraken-tech/jamesbeith/update-project-constraints
Update project constraints
2 parents 57002a1 + bdfe0f6 commit 063134e

File tree

4 files changed

+35
-19
lines changed

4 files changed

+35
-19
lines changed

.github/workflows/tests.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ jobs:
1414
strategy:
1515
matrix:
1616
postgres-image:
17-
- "postgres:13"
1817
- "postgres:14"
1918
- "postgres:15"
2019
- "postgres:16"
20+
- "postgres:17"
21+
- "postgres:18"
2122

2223
services:
2324
postgres:
@@ -40,9 +41,11 @@ jobs:
4041
uses: actions/setup-python@v5
4142
with:
4243
python-version: |
43-
3.12
44-
3.11
4544
3.10
45+
3.11
46+
3.12
47+
3.13
48+
3.14
4649
cache: 'pip'
4750
cache-dependency-path: |
4851
pyproject.toml

noxfile.py

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,37 +29,46 @@ def temp_lock_file() -> Generator[IO[str], None, None]:
2929
yield f
3030

3131

32-
@nox.session()
32+
INCOMPATIBLE_PYTHON_DJANGO_VERSIONS = [
33+
("3.10", "6.0"),
34+
("3.11", "6.0"),
35+
]
36+
37+
38+
@nox.session(
39+
python=[
40+
"3.10",
41+
"3.11",
42+
"3.12",
43+
"3.13",
44+
"3.14",
45+
]
46+
)
3347
@nox.parametrize(
3448
"dependency_file",
3549
[
36-
nox.param("pytest-in-nox-psycopg3", id="psycopg3"),
3750
nox.param("pytest-in-nox-psycopg2", id="psycopg2"),
51+
nox.param("pytest-in-nox-psycopg3", id="psycopg3"),
3852
],
3953
)
4054
@nox.parametrize(
41-
"package_constraint",
42-
[
43-
nox.param("django>=4.2,<4.3", id="django=4.2.X"),
44-
nox.param("django>=5.0,<5.1", id="django=5.0.X"),
45-
],
46-
)
47-
@nox.parametrize(
48-
"python",
55+
"django_version",
4956
[
50-
nox.param("3.10", id="python=3.10"),
51-
nox.param("3.11", id="python=3.11"),
52-
nox.param("3.12", id="python=3.12"),
57+
nox.param("5.2", id="django~=5.2"),
58+
nox.param("6.0", id="django~=6.0"),
5359
],
5460
)
55-
def tests(session: nox.Session, package_constraint: str, dependency_file: str) -> None:
61+
def tests(session: nox.Session, django_version: str, dependency_file: str) -> None:
5662
"""
5763
Run the test suite.
5864
"""
65+
if (session.python, django_version) in INCOMPATIBLE_PYTHON_DJANGO_VERSIONS:
66+
session.skip()
67+
5968
with temp_constraints_file() as constraints_file, temp_lock_file() as lock_file:
6069
# Create a constraints file with the parameterized package versions.
6170
# It's easy to add more constraints here if needed.
62-
constraints_file.write(f"{package_constraint}\n")
71+
constraints_file.write(f"django~={django_version}\n")
6372
constraints_file.flush()
6473

6574
# Compile a new development lock file with the additional package

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ classifiers = [
3737
"Programming Language :: Python :: 3.10",
3838
"Programming Language :: Python :: 3.11",
3939
"Programming Language :: Python :: 3.12",
40+
"Programming Language :: Python :: 3.13",
41+
"Programming Language :: Python :: 3.14",
4042
"Typing :: Typed",
4143
]
4244

@@ -77,7 +79,7 @@ dev = [
7779
# Testing
7880
"django_pg_migration_tools[pytest-in-nox-psycopg3]",
7981
"django_pg_migration_tools[docs]",
80-
"django>=4.2.0", # Django is needed for `make test`, but not for `nox`.
82+
"django>=5.2.8", # Django is needed for `make test`, but not for `nox`.
8183

8284
# Linting
8385
"ruff>=0.5.2",

tests/example_app/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@
2222
"django_pg_migration_tools",
2323
]
2424
USE_TZ = True
25+
26+
DEFAULT_AUTO_FIELD: str = "django.db.models.AutoField"

0 commit comments

Comments
 (0)