nncli

NextCloud Notes Command Line Interface
git clone git://git.danielmoch.com/nncli.git
Log | Files | Refs | LICENSE

commit 345b99fea8a39afedc2baeec111473ad7004adb1
parent c53de1aca3358c456c3348923291f5b5f9cd2525
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Fri, 17 Dec 2021 06:38:09 -0500

Convert Makefiles to POSIX style

Diffstat:
MMakefile | 91+++++++++++++++++++++++++++----------------------------------------------------
Mdocs/Makefile | 2+-
2 files changed, 32 insertions(+), 61 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,98 +1,69 @@ -.PHONY: clean clean-test clean-pyc clean-build help lint coverage coverage-html release dist install run debug docs -.DEFAULT_GOAL := help - -define BROWSER_PYSCRIPT -import os, webbrowser, sys - -try: - from urllib import pathname2url -except: - from urllib.request import pathname2url - -webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) -endef -export BROWSER_PYSCRIPT +.POSIX: -define PRINT_HELP_PYSCRIPT -import re, sys - -for line in sys.stdin: - match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) - if match: - target, help = match.groups() - print("%-20s %s" % (target, help)) -endef -export PRINT_HELP_PYSCRIPT +.PHONY: clean clean-test clean-pyc clean-build help lint coverage coverage-html release dist install run debug docs -BROWSER := python -c "$$BROWSER_PYSCRIPT" -PIPENV := pipenv -PIPRUN := $(PIPENV) run -PIPINST := $(PIPENV) --bare install --dev --skip-lock +BROWSER := firefox -help: - @python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) +dist: + flit build -clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts +clean: clean-build clean-pyc clean-test make -C docs clean -clean-build: ## remove build artifacts +clean-build: rm -fr build/ rm -fr dist/ rm -fr .eggs/ find . -name '*.egg-info' -exec rm -fr {} + find . -name '*.egg' -exec rm -f {} + -clean-pyc: ## remove Python file artifacts +clean-pyc: find . -name '*.pyc' -exec rm -f {} + find . -name '*.pyo' -exec rm -f {} + find . -name '*~' -exec rm -f {} + find . -name '__pycache__' -exec rm -fr {} + - $(PIPRUN) pip uninstall -y nncli + pip uninstall -y nncli -clean-test: ## remove test and coverage artifacts +clean-test: rm -f .coverage rm -fr htmlcov/ rm -fr .pytest_cache rm -fr .tox -lint: ## check style with pylint - $(PIPRUN) pylint nncli tests --disable=parse-error - $(PIPRUN) vulture nncli .vulture_whitelist.py - -test: ## run tests quickly with the default Python - $(PIPRUN) python -m pytest +lint: + pylint nncli tests --disable=parse-error + vulture nncli .vulture_whitelist.py -test-all: ## run tests on every Python version with tox - $(PIPRUN) tox +test: + python -m pytest -test-install: ## install dependenices from Pipfile (for tox / CI builds) - $(PIPINST) +test-all: + tox -coverage: ## check code coverage quickly with the default Python - $(PIPRUN) python -m pytest --cov=nncli +coverage: + python -m pytest --cov=nncli -coverage-html: coverage ## generate an HTML report and open in browser - $(PIPRUN) coverage html +coverage-html: coverage + coverage html $(BROWSER) htmlcov/index.html -release: dist ## package and upload a release +release: dist twine upload -s dist/* -dist: ## builds source and wheel package - $(PIPRUN) flit build - ls -l dist +dist: + flit build -docs: ## builds the sphinx documentation and opens in the browser +docs: make -C docs html make -C docs latexpdf make -C docs man $(BROWSER) docs/build/html/index.html -install: ## install the package to the active Python's site-packages - $(PIPRUN) flit install --deps=none +install: + flit install --deps=none -run: ## run the package from site-packages - $(PIPRUN) python -m nncli $(cmd) +run: + python -m nncli $(cmd) -debug: install ## debug the package from site packages - $(PIPRUN) pudb3 $$($(PIPRUN) which nncli) $(cmd) +debug: install + pudb3 $$(which nncli) $(cmd) diff --git a/docs/Makefile b/docs/Makefile @@ -3,7 +3,7 @@ # You can set these variables from the command line. SPHINXOPTS = -SPHINXBUILD = pipenv run sphinx-build +SPHINXBUILD = sphinx-build SPHINXPROJ = nncli SOURCEDIR = source BUILDDIR = build