Skip to content

Commit

Permalink
Use pyproject.toml instead of setup.py since pyproject.toml is the ne…
Browse files Browse the repository at this point in the history
…w standard
  • Loading branch information
geertjanvdenbosch committed Sep 9, 2024
1 parent 0a45592 commit 202150f
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 47 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ENV = env
BIN = $(ENV)/bin
PYTHON = $(BIN)/python
CODE_LOCATIONS = djlsp setup.py tests
CODE_LOCATIONS = djlsp tests

clean:
rm -rf $(ENV)
Expand Down Expand Up @@ -31,11 +31,11 @@ test: lint
$(BIN)/tox run

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

.PHONY: build
build:
$(PYTHON) setup.py sdist bdist_wheel
$(PYTHON) -m build
$(BIN)/twine check dist/*

upload:
Expand Down
4 changes: 3 additions & 1 deletion djlsp/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
__version__ = "0.9.5"
from importlib.metadata import version

__version__ = version("django-template-lsp")
60 changes: 60 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[project]
name = "django-template-lsp"
version = "0.9.5"
description = "Django template LSP"
readme = "README.md"
authors = [{name = "Four Digits", email = "[email protected]" }]
license = { file = "LICENSE" }
classifiers = [
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: GPL3 License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
]
keywords = ["django", "template", "lsp", "python"]
dependencies = [
"pygls",
"jedi"
]
requires-python = ">=3.9"

[project.scripts]
djlsp = "djlsp.cli:main"
django-template-lsp = "djlsp.cli:main"

[project.optional-dependencies]
dev = [
"tox",
"black",
"isort",
"flake8",
"pytest",
"pytest-check",
"pytest-cov",
]

[project.urls]
Homepage = "https://github.com/fourdigits/django-template-lsp"

[build-system]
requires = ["setuptools", "wheel", "build"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
include-package-data = false

[tool.setuptools.packages.find]
include = ["djlsp*"]

[tool.isort]
profile = "black"
known_first_party = "djlsp"

[tool.flake8]
max-line-length = 88
extend-ignore = "W503"
2 changes: 1 addition & 1 deletion releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

To create a new release, follow these steps:

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

Expand Down
42 changes: 0 additions & 42 deletions setup.py

This file was deleted.

0 comments on commit 202150f

Please sign in to comment.