Skip to content

Commit 757a400

Browse files
adopt DjangoVer (#41)
* adopt DjangoVer * add section to readme detailing djangover * add subsection about breaking changes * adjust requirements to reference new section * tweak wording * more tweaking * wording and stylistic tweaks * bump uv lock * add metadata for version info * add initial bumpver config * add utility just command * change version pattern
1 parent 7db1e96 commit 757a400

File tree

9 files changed

+77
-11
lines changed

9 files changed

+77
-11
lines changed

.workspace/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import annotations
2+
3+
import importlib.metadata
4+
5+
try:
6+
__version__ = importlib.metadata.version(__name__)
7+
except importlib.metadata.PackageNotFoundError:
8+
__version__ = "0.0.0"

Justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ mod proto ".just/proto.just"
88
default:
99
@just --list
1010

11+
bumpver *ARGS:
12+
uv run --with bumpver bumpver {{ ARGS }}
13+
1114
clean:
1215
rm -rf target/
1316

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ However, the foundation has been laid:
3030

3131
## Requirements
3232

33-
You'll need an editor that supports the Language Server Protocol (LSP).
33+
An editor that supports the Language Server Protocol (LSP) is required.
3434

35-
The server supports Django projects running on:
35+
The Django Language Server aims to supports all actively maintained versions of Python and Django. Currently this includes:
3636

3737
- Python 3.9, 3.10, 3.11, 3.12, 3.13
3838
- Django 4.2, 5.0, 5.1
3939

40-
The aim is to support all actively maintained versions of both Python and Django.
40+
See the [Versioning](#versioning) section for details on how this project's version indicates Django compatibility.
4141

4242
## Installation
4343

@@ -99,7 +99,7 @@ pip install djls-agent
9999

100100
## Editor Setup
101101

102-
The Django Language Server should work with any editor that supports the Language Server Protocol (LSP). Got it working in your editor? [Help us add setup instructions](#testing-and-documenting-editor-setup)!
102+
The Django Language Server should work with any editor that supports the Language Server Protocol (LSP). Got it working in your editor? [Help us add setup instructions!](#testing-and-documenting-editor-setup)
103103

104104
- [Neovim](#neovim)
105105

@@ -158,6 +158,30 @@ Using [lazy.nvim](https://github.com/folke/lazy.nvim) and [nvim-lspconfig](https
158158
> [!NOTE]
159159
> This configuration is copied straight from my Neovim setup and includes a logging setup that sends LSP messages to Neovim's notification system. You can remove all the references to `vim.notify` if you don't care about this functionality.
160160
161+
## Versioning
162+
163+
This project adheres to DjangoVer. For a quick overview of what DjangoVer is, here's an excerpt from Django core developer James Bennett's [Introducing DjangoVer](https://www.b-list.org/weblog/2024/nov/18/djangover/) blog post:
164+
165+
> In DjangoVer, a Django-related package has a version number of the form `DJANGO_MAJOR.DJANGO_FEATURE.PACKAGE_VERSION`, where `DJANGO_MAJOR` and `DJANGO_FEATURE` indicate the most recent feature release series of Django supported by the package, and `PACKAGE_VERSION` begins at zero and increments by one with each release of the package supporting that feature release of Django.
166+
167+
In short, `v5.1.x` means the latest version of Django the Django Language Server would support is 5.1 — so, e.g., versions `v5.1.0`, `v5.1.1`, `v5.1.2`, etc. should all work with Django 5.1.
168+
169+
At this moment, all components of the Django Language Server (the `djls` binary, the `djls-agent` agent package on PyPI, and the `djls-binary` binary distribution package on PyPI) will share the same version number. When a new version is released, all packages are updated together regardless of which component triggered the release.
170+
171+
### Breaking Changes
172+
173+
While DjangoVer doesn't encode API stability in the version number, this project strives to follow Django's standard practice of "deprecate for two releases, then remove" policy for breaking changes. Given this is a language server, breaking changes should primarily affect:
174+
175+
- Configuration options (settings in editor config files)
176+
- CLI commands and arguments
177+
- LSP protocol extensions (custom commands/notifications)
178+
179+
The project will provide deprecation warnings where possible and document breaking changes clearly in release notes. For example, if a configuration option is renamed:
180+
181+
- **`v5.1.0`**: Old option works but logs deprecation warning
182+
- **`v5.1.1`**: Old option still works, continues to show warning
183+
- **`v5.1.2`**: Old option removed, only new option works
184+
161185
## Contributing
162186

163187
The project needs help in several areas:

crates/djls/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "djls"
3-
version = "0.1.0"
3+
version = "5.1.0-alpha.0"
44
edition = "2021"
55

66
[dependencies]

packages/djls-agent/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dev = [
1010

1111
[project]
1212
name = "djls-agent"
13-
version = "0.1.0"
13+
version = "5.1.0a0"
1414
description = "Python agent for django-language-server"
1515
readme = "README.md"
1616
authors = [
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import annotations
2+
3+
import importlib.metadata
4+
5+
try:
6+
__version__ = importlib.metadata.version(__name__)
7+
except importlib.metadata.PackageNotFoundError:
8+
__version__ = "0.0.0"

packages/djls-server/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "maturin"
44

55
[project]
66
name = "djls-server"
7-
version = "0.1.0"
7+
version = "5.1.0a0"
88
description = "Binary distribution package for the Django Language Server"
99
readme = "README.md"
1010
authors = [

pyproject.toml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dev = [
1010

1111
[project]
1212
name = "djls"
13-
version = "0.1.0"
13+
version = "5.1.0a0"
1414
description = "A language server for the Django web framework"
1515
readme = "README.md"
1616
authors = [
@@ -46,6 +46,29 @@ classifiers = [
4646
[project.optional-dependencies]
4747
server = ["djls-server"]
4848

49+
[tool.bumpver]
50+
commit = true
51+
commit_message = ":bookmark: bump version {old_version} -> {new_version}"
52+
current_version = "5.1.0-alpha.0"
53+
push = false # set to false for CI
54+
tag = false
55+
version_pattern = "MAJOR.MINOR.PATCH[-TAG[.NUM]]"
56+
57+
[tool.bumpver.file_patterns]
58+
"crates/djls/Cargo.toml" = [
59+
'version = "{version}"',
60+
]
61+
"packages/djls-agent/pyproject.toml" = [
62+
'version = "{pep440_version}"',
63+
]
64+
"packages/djls-server/pyproject.toml" = [
65+
'version = "{pep440_version}"',
66+
]
67+
"pyproject.toml" = [
68+
'version = "{pep440_version}"',
69+
'current_version = "{version}"',
70+
]
71+
4972
[tool.hatch.build]
5073
packages = [".workspace/"]
5174

uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)