From to setup.cfg+setuptools to pyproject.toml+hatch
This commit is contained in:
parent
6f75807fc7
commit
e23f1dd3c2
6 changed files with 126 additions and 69 deletions
57
Makefile
57
Makefile
|
@ -1,7 +1,32 @@
|
||||||
|
.DEFAULT_GOAL := help
|
||||||
|
|
||||||
|
.PHONY: install
|
||||||
|
install: ## Install the dependencies
|
||||||
|
python3 -m pip install --upgrade pip
|
||||||
|
python3 -m pip install -e .
|
||||||
|
|
||||||
|
.PHONY: develop
|
||||||
|
develop: ## Install the test and dev dependencies
|
||||||
|
python3 -m pip install -e .[test,dev]
|
||||||
|
|
||||||
|
.PHONY: version
|
||||||
|
version: ## Display the current version
|
||||||
|
@hatch version
|
||||||
|
|
||||||
|
.PHONY: bump
|
||||||
|
bump: ## Bump the current version to a new minor one
|
||||||
|
@hatch version fix
|
||||||
|
|
||||||
|
.PHONY: docker
|
||||||
|
docker: ## Create a new Docker image and publish it
|
||||||
|
$(eval VERSION=$(shell hatch version))
|
||||||
|
@echo "Version to build: ${VERSION}"
|
||||||
|
docker build -t umap/umap:${VERSION} .
|
||||||
|
docker push umap/umap:${VERSION}
|
||||||
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
py.test -xv umap/tests/
|
py.test -xv umap/tests/
|
||||||
develop:
|
|
||||||
pip install -e .[test,dev]
|
|
||||||
release: test compilemessages
|
release: test compilemessages
|
||||||
python setup.py sdist bdist_wheel
|
python setup.py sdist bdist_wheel
|
||||||
test_publish:
|
test_publish:
|
||||||
|
@ -33,14 +58,42 @@ tx_pull:
|
||||||
|
|
||||||
jsdir = umap/static/umap/js/
|
jsdir = umap/static/umap/js/
|
||||||
filepath = "${jsdir}*.js"
|
filepath = "${jsdir}*.js"
|
||||||
|
.PHONY: pretty
|
||||||
pretty: ## Apply PrettierJS to all JS files (or specified `filepath`)
|
pretty: ## Apply PrettierJS to all JS files (or specified `filepath`)
|
||||||
./node_modules/prettier/bin-prettier.js --write ${filepath}
|
./node_modules/prettier/bin-prettier.js --write ${filepath}
|
||||||
|
|
||||||
|
.PHONY: lebab
|
||||||
lebab: ## Convert JS `filepath` to modern syntax with Lebab, then prettify
|
lebab: ## Convert JS `filepath` to modern syntax with Lebab, then prettify
|
||||||
./node_modules/lebab/bin/index.js --replace ${filepath} --transform arrow,arrow-return
|
./node_modules/lebab/bin/index.js --replace ${filepath} --transform arrow,arrow-return
|
||||||
./node_modules/lebab/bin/index.js --replace ${filepath} --transform let
|
./node_modules/lebab/bin/index.js --replace ${filepath} --transform let
|
||||||
./node_modules/lebab/bin/index.js --replace ${filepath} --transform template
|
./node_modules/lebab/bin/index.js --replace ${filepath} --transform template
|
||||||
$(MAKE) pretty filepath=${filepath}
|
$(MAKE) pretty filepath=${filepath}
|
||||||
|
|
||||||
|
.PHONY: lebab-all
|
||||||
lebab-all: $(jsdir)* ## Convert all JS files to modern syntax with Lebab + prettify
|
lebab-all: $(jsdir)* ## Convert all JS files to modern syntax with Lebab + prettify
|
||||||
for file in $^ ; do $(MAKE) lebab filepath=$${file}; done
|
for file in $^ ; do $(MAKE) lebab filepath=$${file}; done
|
||||||
|
|
||||||
|
|
||||||
|
.PHONY: help
|
||||||
|
help:
|
||||||
|
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
|
||||||
|
|
||||||
|
# See https://daniel.feldroy.com/posts/autodocumenting-makefiles
|
||||||
|
define PRINT_HELP_PYSCRIPT # start of Python section
|
||||||
|
import re, sys
|
||||||
|
|
||||||
|
output = []
|
||||||
|
# Loop through the lines in this file
|
||||||
|
for line in sys.stdin:
|
||||||
|
# if the line has a command and a comment start with
|
||||||
|
# two pound signs, add it to the output
|
||||||
|
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
|
||||||
|
if match:
|
||||||
|
target, help = match.groups()
|
||||||
|
output.append("\033[36m%-20s\033[0m %s" % (target, help))
|
||||||
|
# Sort the output in alphanumeric order
|
||||||
|
output.sort()
|
||||||
|
# Print the help result
|
||||||
|
print('\n'.join(output))
|
||||||
|
endef
|
||||||
|
export PRINT_HELP_PYSCRIPT # End of python section
|
||||||
|
|
|
@ -71,8 +71,7 @@ Now, the `umap` command will be available.
|
||||||
|
|
||||||
To test your code, you will add to install umap from your git folder. Go to `~/wk/umap` and run:
|
To test your code, you will add to install umap from your git folder. Go to `~/wk/umap` and run:
|
||||||
|
|
||||||
pip install -e .
|
make install
|
||||||
# or pip install -e ~/wk/umap
|
|
||||||
|
|
||||||
This command will check dependencies and install uMap from sources inside folder.
|
This command will check dependencies and install uMap from sources inside folder.
|
||||||
|
|
||||||
|
|
69
pyproject.toml
Normal file
69
pyproject.toml
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
[build-system]
|
||||||
|
requires = ["hatchling"]
|
||||||
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "umap-project"
|
||||||
|
dynamic = ["version"]
|
||||||
|
description = "Create maps with OpenStreetMap layers in a minute and embed them in your site."
|
||||||
|
readme = "README.md"
|
||||||
|
authors = [
|
||||||
|
{ name = "Yohan Boniface", email = "yb@enix.org" },
|
||||||
|
]
|
||||||
|
maintainers = [
|
||||||
|
{ name = "David Larlet", email = "david@larlet.fr" },
|
||||||
|
]
|
||||||
|
homepage = "https://github.com/umap-project/umap"
|
||||||
|
keywords = ["django", "leaflet", "geodjango", "openstreetmap", "map"]
|
||||||
|
requires-python = ">=3.8"
|
||||||
|
classifiers = [
|
||||||
|
"Development Status :: 4 - Beta",
|
||||||
|
"Intended Audience :: Developers",
|
||||||
|
"Operating System :: OS Independent",
|
||||||
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||||
|
"Programming Language :: Python",
|
||||||
|
"Programming Language :: Python :: 3 :: Only",
|
||||||
|
"Programming Language :: Python :: 3.4",
|
||||||
|
"Programming Language :: Python :: 3.5",
|
||||||
|
"Programming Language :: Python :: 3.6",
|
||||||
|
"Programming Language :: Python :: 3.7",
|
||||||
|
"Programming Language :: Python :: 3.8",
|
||||||
|
"Programming Language :: Python :: 3.9",
|
||||||
|
"Programming Language :: Python :: 3.10",
|
||||||
|
]
|
||||||
|
dependencies = [
|
||||||
|
"Django>=4.1",
|
||||||
|
"django-agnocomplete==2.2.0",
|
||||||
|
"django-compressor==4.3.1",
|
||||||
|
"django-environ==0.10.0",
|
||||||
|
"Pillow==9.5.0",
|
||||||
|
"psycopg2==2.9.6",
|
||||||
|
"requests==2.30.0",
|
||||||
|
"social-auth-core==4.4.2",
|
||||||
|
"social-auth-app-django==5.2.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.optional-dependencies]
|
||||||
|
dev = [
|
||||||
|
"hatch==1.7.0",
|
||||||
|
"black==21.10b0",
|
||||||
|
"mkdocs==1.2.3",
|
||||||
|
]
|
||||||
|
test = [
|
||||||
|
"factory-boy==3.2.1",
|
||||||
|
"pytest==6.2.5",
|
||||||
|
"pytest-django==4.5.2",
|
||||||
|
]
|
||||||
|
docker = [
|
||||||
|
"uwsgi==2.0.21",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
umap = "umap.bin:main"
|
||||||
|
|
||||||
|
[tool.hatch.version]
|
||||||
|
path = "umap/__init__.py"
|
||||||
|
|
||||||
|
[tool.flake8]
|
||||||
|
# Black crazyness.
|
||||||
|
max-line-length = 88
|
56
setup.cfg
56
setup.cfg
|
@ -1,56 +0,0 @@
|
||||||
[metadata]
|
|
||||||
name = umap-project
|
|
||||||
version = 1.3.3
|
|
||||||
description = Create maps with OpenStreetMap layers in a minute and embed them in your site.
|
|
||||||
long_description = file: README.md
|
|
||||||
long_description_content_type = text/markdown
|
|
||||||
author = Yohan Boniface
|
|
||||||
homepage = https://github.com/umap-project/umap
|
|
||||||
keywords = django leaflet geodjango openstreetmap map
|
|
||||||
classifiers =
|
|
||||||
Development Status :: 4 - Beta
|
|
||||||
Intended Audience :: Developers
|
|
||||||
Operating System :: OS Independent
|
|
||||||
Topic :: Software Development :: Libraries :: Python Modules
|
|
||||||
Programming Language :: Python
|
|
||||||
Programming Language :: Python :: 3 :: Only
|
|
||||||
Programming Language :: Python :: 3.4
|
|
||||||
Programming Language :: Python :: 3.5
|
|
||||||
Programming Language :: Python :: 3.6
|
|
||||||
Programming Language :: Python :: 3.7
|
|
||||||
Programming Language :: Python :: 3.8
|
|
||||||
Programming Language :: Python :: 3.9
|
|
||||||
Programming Language :: Python :: 3.10
|
|
||||||
|
|
||||||
[options]
|
|
||||||
packages = find:
|
|
||||||
include_package_data = True
|
|
||||||
install_requires =
|
|
||||||
Django>=4.1
|
|
||||||
django-agnocomplete==2.2.0
|
|
||||||
django-compressor==4.3.1
|
|
||||||
django-environ==0.10.0
|
|
||||||
Pillow==9.5.0
|
|
||||||
psycopg2==2.9.6
|
|
||||||
requests==2.30.0
|
|
||||||
social-auth-core==4.4.2
|
|
||||||
social-auth-app-django==5.2.0
|
|
||||||
|
|
||||||
[options.extras_require]
|
|
||||||
dev =
|
|
||||||
black==21.10b0
|
|
||||||
mkdocs==1.2.3
|
|
||||||
test =
|
|
||||||
factory-boy==3.2.1
|
|
||||||
pytest==6.2.5
|
|
||||||
pytest-django==4.5.2
|
|
||||||
docker =
|
|
||||||
uwsgi==2.0.21
|
|
||||||
|
|
||||||
[options.entry_points]
|
|
||||||
console_scripts =
|
|
||||||
umap = umap.bin:main
|
|
||||||
|
|
||||||
[flake8]
|
|
||||||
# Black crazyness.
|
|
||||||
max-line-length = 88
|
|
2
setup.py
2
setup.py
|
@ -1,2 +0,0 @@
|
||||||
from setuptools import setup
|
|
||||||
setup()
|
|
|
@ -1,7 +1 @@
|
||||||
try:
|
VERSION = "1.3.3"
|
||||||
import pkg_resources
|
|
||||||
except ImportError: # pragma: no cover
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
if __package__:
|
|
||||||
VERSION = pkg_resources.get_distribution("umap-project").version
|
|
||||||
|
|
Loading…
Reference in a new issue