Skip to content

Commit 372637c

Browse files
add support for Django 6.0 (#252)
1 parent 53c581f commit 372637c

File tree

7 files changed

+55
-13
lines changed

7 files changed

+55
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/
1818

1919
## [Unreleased]
2020

21+
### Added
22+
23+
- Added support for Django 6.0.
24+
2125
### Changed
2226

2327
- Bumped Rust toolchain from 1.88 to 1.90

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,18 @@ $ # just --list --list-submodules
4040

4141
Available recipes:
4242
bumpver *ARGS
43+
check *ARGS
4344
clean
45+
clippy *ARGS
46+
fmt *ARGS
4447
lint # run pre-commit on all files
4548
test *ARGS
4649
testall *ARGS
50+
dev:
51+
debug
52+
explore FILENAME="djls.db"
53+
inspect
54+
record FILENAME="djls.db"
4755
docs:
4856
build LOCATION="site" # Build documentation
4957
serve PORT="8000" # Serve documentation locally

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ default:
1111

1212
[private]
1313
cog:
14-
uv run --no-project --with cogapp --with nox --no-project cog -r CONTRIBUTING.md README.md pyproject.toml
14+
uv run --no-project --with cogapp --with nox cog -r CONTRIBUTING.md README.md pyproject.toml
1515

1616
[private]
1717
nox SESSION *ARGS:

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ import cog
66
77
from noxfile import DJ_VERSIONS
88
from noxfile import PY_VERSIONS
9+
from noxfile import display_version
10+
11+
django_versions = [display_version(version) for version in DJ_VERSIONS]
912
1013
cog.outl("[![PyPI](https://img.shields.io/pypi/v/django-language-server)](https://pypi.org/project/django-language-server/)")
1114
cog.outl("![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-language-server)")
12-
cog.outl(f"![Django Version](https://img.shields.io/badge/django-{'%20%7C%20'.join(DJ_VERSIONS)}-%2344B78B?labelColor=%23092E20)")
15+
cog.outl(f"![Django Version](https://img.shields.io/badge/django-{'%20%7C%20'.join(django_versions)}-%2344B78B?labelColor=%23092E20)")
1316
]]] -->
1417
[![PyPI](https://img.shields.io/pypi/v/django-language-server)](https://pypi.org/project/django-language-server/)
1518
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-language-server)
16-
![Django Version](https://img.shields.io/badge/django-4.2%20%7C%205.1%20%7C%205.2%20%7C%20main-%2344B78B?labelColor=%23092E20)
19+
![Django Version](https://img.shields.io/badge/django-4.2%20%7C%205.1%20%7C%205.2%20%7C%206.0%20%7C%20main-%2344B78B?labelColor=%23092E20)
1720
<!-- [[[end]]] -->
1821

1922
A language server for the Django web framework.
@@ -51,12 +54,17 @@ import cog
5154
5255
from noxfile import DJ_VERSIONS
5356
from noxfile import PY_VERSIONS
57+
from noxfile import display_version
58+
59+
django_versions = [
60+
display_version(version) for version in DJ_VERSIONS if version != "main"
61+
]
5462
55-
cog.outl(f"- Python {', '.join([version for version in PY_VERSIONS])}")
56-
cog.outl(f"- Django {', '.join([version for version in DJ_VERSIONS if version != 'main'])}")
63+
cog.outl(f"- Python {', '.join(PY_VERSIONS)}")
64+
cog.outl(f"- Django {', '.join(django_versions)}")
5765
]]] -->
5866
- Python 3.9, 3.10, 3.11, 3.12, 3.13
59-
- Django 4.2, 5.1, 5.2
67+
- Django 4.2, 5.1, 5.2, 6.0
6068
<!-- [[[end]]] -->
6169

6270
See the [Versioning](#versioning) section for details on how this project's version indicates Django compatibility.

docs/index.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@ import cog
1616
1717
from noxfile import DJ_VERSIONS
1818
from noxfile import PY_VERSIONS
19+
from noxfile import display_version
20+
21+
django_versions = [display_version(version) for version in DJ_VERSIONS]
1922
2023
cog.outl("[![PyPI](https://img.shields.io/pypi/v/django-language-server)](https://pypi.org/project/django-language-server/)")
2124
cog.outl("![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-language-server)")
22-
cog.outl(f"![Django Version](https://img.shields.io/badge/django-{'%20%7C%20'.join(DJ_VERSIONS)}-%2344B78B?labelColor=%23092E20)")
25+
cog.outl(
26+
f"![Django Version](https://img.shields.io/badge/django-{'%20%7C%20'.join(django_versions)}-%2344B78B?labelColor=%23092E20)"
27+
)
2328
]]] -->
2429
[![PyPI](https://img.shields.io/pypi/v/django-language-server)](https://pypi.org/project/django-language-server/)
2530
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-language-server)
26-
![Django Version](https://img.shields.io/badge/django-4.2%20%7C%205.1%20%7C%205.2%20%7C%20main-%2344B78B?labelColor=%23092E20)
31+
![Django Version](https://img.shields.io/badge/django-4.2%20%7C%205.1%20%7C%205.2%20%7C%206.0a0%20%7C%20main-%2344B78B?labelColor=%23092E20)
2732
<!-- [[[end]]] -->
2833

2934
A language server for the Django web framework.
@@ -72,12 +77,17 @@ import cog
7277
7378
from noxfile import DJ_VERSIONS
7479
from noxfile import PY_VERSIONS
80+
from noxfile import display_version
81+
82+
django_versions = [
83+
display_version(version) for version in DJ_VERSIONS if version != "main"
84+
]
7585
76-
cog.outl(f"- Python {', '.join([version for version in PY_VERSIONS])}")
77-
cog.outl(f"- Django {', '.join([version for version in DJ_VERSIONS if version != 'main'])}")
86+
cog.outl(f"- Python {', '.join(PY_VERSIONS)}")
87+
cog.outl(f"- Django {', '.join(django_versions)}")
7888
]]] -->
7989
- Python 3.9, 3.10, 3.11, 3.12, 3.13
80-
- Django 4.2, 5.1, 5.2
90+
- Django 4.2, 5.1, 5.2, 6.0a0
8191
<!-- [[[end]]] -->
8292

8393
See the [Versioning](#versioning) section for details on how this project's version indicates Django compatibility.

noxfile.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
DJ42 = "4.2"
2323
DJ51 = "5.1"
2424
DJ52 = "5.2"
25+
DJ60 = "6.0a1"
2526
DJMAIN = "main"
2627
DJMAIN_MIN_PY = PY312
27-
DJ_VERSIONS = [DJ42, DJ51, DJ52, DJMAIN]
28+
DJ_VERSIONS = [DJ42, DJ51, DJ52, DJ60, DJMAIN]
2829
DJ_LTS = [
2930
version for version in DJ_VERSIONS if version.endswith(".2") and version != DJMAIN
3031
]
@@ -37,13 +38,22 @@ def version(ver: str) -> tuple[int, ...]:
3738
return tuple(map(int, ver.split(".")))
3839

3940

41+
def display_version(raw: str) -> str:
42+
match = re.match(r"\d+(?:\.\d+)?", raw)
43+
return match.group(0) if match else raw
44+
45+
4046
def should_skip(python: str, django: str) -> bool:
4147
"""Return True if the test should be skipped"""
4248

4349
if django == DJMAIN and version(python) < version(DJMAIN_MIN_PY):
4450
# Django main requires Python 3.10+
4551
return True
4652

53+
if django == DJ60 and version(python) < version(PY312):
54+
# Django main requires Python 3.12+
55+
return True
56+
4757
if django == DJ52 and version(python) < version(PY310):
4858
# Django 5.2 requires Python 3.10+
4959
return True

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,17 @@ classifiers = [
3232
# import cog
3333
#
3434
# from noxfile import DJ_VERSIONS
35+
# from noxfile import display_version
3536
#
3637
# for version in DJ_VERSIONS:
3738
# if version == "main":
3839
# continue
39-
# cog.outl(f' "Framework :: Django :: {version}",')
40+
# cog.outl(f' "Framework :: Django :: {display_version(version)}",')
4041
# ]]] -->
4142
"Framework :: Django :: 4.2",
4243
"Framework :: Django :: 5.1",
4344
"Framework :: Django :: 5.2",
45+
"Framework :: Django :: 6.0",
4446
# [[[end]]]
4547
"Intended Audience :: Developers",
4648
"License :: OSI Approved :: Apache Software License",

0 commit comments

Comments
 (0)