1
0
mirror of https://github.com/enpaul/keyosk.git synced 2025-09-18 21:51:57 +00:00

Overhaul repository with newest bestest practices

Add typing stub file
Add metadata tests
Add missing dev dependencies
Add merge conflict check pre-commit
Add tox env for py3.9
Update license from MIT to GPL3
Update pyproject with pypi metadata
Update makefile to reduce duplication and add missing targets
Update dependencies to latest versions
Update pre-commit config to piggy back on poetry env
Update pyproject to use poetry-core
Update toxfile to use locked dependencies
Remove unused codeowners file
Remove placeholder test
This commit is contained in:
2020-11-26 01:22:13 -05:00
parent 5030db2a84
commit ca891dd1fb
17 changed files with 2073 additions and 784 deletions

View File

@@ -1,12 +1,7 @@
# Keyosk makefile for building and deployment prep
VERSION ?= $(shell cat pyproject.toml | grep "^version =" | cut -d "\"" -f 2)
DOC_FORMAT ?= html
DOC_OPTIONS ?=
DOC_SOURCEDIR = ./docs
DOC_BUILDDIR = ./docs/_build
DOC_PROJECT = keyosk
DOCKER_CONTAINER = keyosk
VERSION = $(shell cat pyproject.toml | grep "^version =" | cut -d "\"" -f 2)
PROJECT = keyosk
.PHONY: help docs
# Put it first so that "make" without argument is like "make help"
@@ -20,20 +15,20 @@ tox:
poetry run tox
clean-tox:
rm -rf ./.mypy_cache
rm -rf ./.tox
rm -f .coverage
rm --recursive --force ./.mypy_cache
rm --recursive --force ./.tox
rm --force .coverage
clean-py:
rm -rf ./dist
rm -rf ./build
rm -rf ./*/__pycache__
rm -rf ./*.egg-info
rm --recursive --force ./dist
rm --recursive --force ./build
rm --recursive --force ./*.egg-info
rm --recursive --force ./**/__pycache__
clean-docs:
rm -rf $(DOC_BUILDDIR)
rm -f $(DOC_SOURCEDIR)/$(DOC_PROJECT)*.rst
rm -f $(DOC_SOURCEDIR)/modules.rst
rm --recursive --force ./docs/_build
rm --force ./docs/$(PROJECT)*.rst
rm --force ./docs/modules.rst
clean: clean-tox clean-py clean-docs; ## Clean up all temp build/cache files and directories
@@ -43,10 +38,11 @@ wheel: ## Build Python binary wheel package for distribution
source: ## Build Python source package for distribution
poetry build --format sdist
build: clean-py tox; ## Test and build python distributions
poetry build
test: clean-tox ## Run the project testsuite
poetry run tox
docs: clean-docs ## Generate sphinx documentation, provide `DOC_FORMAT` to override default format of "html"
poetry run sphinx-apidoc -o "${DOC_SOURCEDIR}" "${DOC_PROJECT}"
rm $(DOC_SOURCEDIR)/modules.rst
poetry run sphinx-build -M $(DOC_FORMAT) "$(DOC_SOURCEDIR)" "$(DOC_BUILDDIR)" $(DOC_OPTIONS) $(0)
publish: clean tox wheel source ## Build and upload to pypi (requires $PYPI_API_KEY be set)
@poetry publish --username __token__ --password $(PYPI_API_KEY)
docs: clean-docs ## Generate documentation with Sphinx
poetry run tox -e docs