Skip to content

Commit 202150f

Browse files
Use pyproject.toml instead of setup.py since pyproject.toml is the new standard
1 parent 0a45592 commit 202150f

File tree

5 files changed

+67
-47
lines changed

5 files changed

+67
-47
lines changed

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ENV = env
22
BIN = $(ENV)/bin
33
PYTHON = $(BIN)/python
4-
CODE_LOCATIONS = djlsp setup.py tests
4+
CODE_LOCATIONS = djlsp tests
55

66
clean:
77
rm -rf $(ENV)
@@ -31,11 +31,11 @@ test: lint
3131
$(BIN)/tox run
3232

3333
install-ci: $(ENV)
34-
$(PYTHON) -m pip install --upgrade pip setuptools wheel twine .
34+
$(PYTHON) -m pip install --upgrade pip setuptools wheel twine build .
3535

3636
.PHONY: build
3737
build:
38-
$(PYTHON) setup.py sdist bdist_wheel
38+
$(PYTHON) -m build
3939
$(BIN)/twine check dist/*
4040

4141
upload:

djlsp/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
__version__ = "0.9.5"
1+
from importlib.metadata import version
2+
3+
__version__ = version("django-template-lsp")

pyproject.toml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
[project]
2+
name = "django-template-lsp"
3+
version = "0.9.5"
4+
description = "Django template LSP"
5+
readme = "README.md"
6+
authors = [{name = "Four Digits", email = "[email protected]" }]
7+
license = { file = "LICENSE" }
8+
classifiers = [
9+
"Environment :: Web Environment",
10+
"Framework :: Django",
11+
"Intended Audience :: Developers",
12+
"License :: OSI Approved :: GPL3 License",
13+
"Programming Language :: Python",
14+
"Programming Language :: Python :: 3.9",
15+
"Programming Language :: Python :: 3.10",
16+
"Programming Language :: Python :: 3.11",
17+
"Programming Language :: Python :: 3.12"
18+
]
19+
keywords = ["django", "template", "lsp", "python"]
20+
dependencies = [
21+
"pygls",
22+
"jedi"
23+
]
24+
requires-python = ">=3.9"
25+
26+
[project.scripts]
27+
djlsp = "djlsp.cli:main"
28+
django-template-lsp = "djlsp.cli:main"
29+
30+
[project.optional-dependencies]
31+
dev = [
32+
"tox",
33+
"black",
34+
"isort",
35+
"flake8",
36+
"pytest",
37+
"pytest-check",
38+
"pytest-cov",
39+
]
40+
41+
[project.urls]
42+
Homepage = "https://github.com/fourdigits/django-template-lsp"
43+
44+
[build-system]
45+
requires = ["setuptools", "wheel", "build"]
46+
build-backend = "setuptools.build_meta"
47+
48+
[tool.setuptools]
49+
include-package-data = false
50+
51+
[tool.setuptools.packages.find]
52+
include = ["djlsp*"]
53+
54+
[tool.isort]
55+
profile = "black"
56+
known_first_party = "djlsp"
57+
58+
[tool.flake8]
59+
max-line-length = 88
60+
extend-ignore = "W503"

releasing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
To create a new release, follow these steps:
44

5-
- Update the version number in `djlsp/__init__.py` and push this to `main`.
5+
- Update the version number in `pyproject.toml` and push this to `main`.
66
- We use [semantic](https://semver.org/) versioning.
77
- Create a new tag and push the tag using `git push --tags`.
88

setup.py

-42
This file was deleted.

0 commit comments

Comments
 (0)