Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .workspace/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from __future__ import annotations

import importlib.metadata

try:
__version__ = importlib.metadata.version(__name__)
except importlib.metadata.PackageNotFoundError:
__version__ = "0.0.0"
3 changes: 3 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ mod proto ".just/proto.just"
default:
@just --list

bumpver *ARGS:
uv run --with bumpver bumpver {{ ARGS }}

clean:
rm -rf target/

Expand Down
32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ However, the foundation has been laid:

## Requirements

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

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

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

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

## Installation

Expand Down Expand Up @@ -99,7 +99,7 @@ pip install djls-agent

## Editor Setup

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)!
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)

- [Neovim](#neovim)

Expand Down Expand Up @@ -158,6 +158,30 @@ Using [lazy.nvim](https://github.com/folke/lazy.nvim) and [nvim-lspconfig](https
> [!NOTE]
> 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.

## Versioning

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:

> 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.

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.

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.

### Breaking Changes

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:

- Configuration options (settings in editor config files)
- CLI commands and arguments
- LSP protocol extensions (custom commands/notifications)

The project will provide deprecation warnings where possible and document breaking changes clearly in release notes. For example, if a configuration option is renamed:

- **`v5.1.0`**: Old option works but logs deprecation warning
- **`v5.1.1`**: Old option still works, continues to show warning
- **`v5.1.2`**: Old option removed, only new option works

## Contributing

The project needs help in several areas:
Expand Down
2 changes: 1 addition & 1 deletion crates/djls/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "djls"
version = "0.1.0"
version = "5.1.0-alpha.0"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion packages/djls-agent/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dev = [

[project]
name = "djls-agent"
version = "0.1.0"
version = "5.1.0a0"
description = "Python agent for django-language-server"
readme = "README.md"
authors = [
Expand Down
8 changes: 8 additions & 0 deletions packages/djls-agent/src/djls_agent/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from __future__ import annotations

import importlib.metadata

try:
__version__ = importlib.metadata.version(__name__)
except importlib.metadata.PackageNotFoundError:
__version__ = "0.0.0"
2 changes: 1 addition & 1 deletion packages/djls-server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "djls-server"
version = "0.1.0"
version = "5.1.0a0"
description = "Binary distribution package for the Django Language Server"
readme = "README.md"
authors = [
Expand Down
25 changes: 24 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dev = [

[project]
name = "djls"
version = "0.1.0"
version = "5.1.0a0"
description = "A language server for the Django web framework"
readme = "README.md"
authors = [
Expand Down Expand Up @@ -46,6 +46,29 @@ classifiers = [
[project.optional-dependencies]
server = ["djls-server"]

[tool.bumpver]
commit = true
commit_message = ":bookmark: bump version {old_version} -> {new_version}"
current_version = "5.1.0-alpha.0"
push = false # set to false for CI
tag = false
version_pattern = "MAJOR.MINOR.PATCH[-TAG[.NUM]]"

[tool.bumpver.file_patterns]
"crates/djls/Cargo.toml" = [
'version = "{version}"',
]
"packages/djls-agent/pyproject.toml" = [
'version = "{pep440_version}"',
]
"packages/djls-server/pyproject.toml" = [
'version = "{pep440_version}"',
]
"pyproject.toml" = [
'version = "{pep440_version}"',
'current_version = "{version}"',
]

[tool.hatch.build]
packages = [".workspace/"]

Expand Down
6 changes: 3 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading