From c30f59da935e6c0ed1e8c098b509f1181a6a4d4e Mon Sep 17 00:00:00 2001 From: Simon Kennedy Date: Thu, 14 Mar 2024 08:25:19 +0000 Subject: [PATCH] Switch to `just` from `make` --- Justfile | 37 +++++++++++++++++++++++++++++++++++++ Makefile | 48 ------------------------------------------------ 2 files changed, 37 insertions(+), 48 deletions(-) create mode 100644 Justfile delete mode 100644 Makefile diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..e2582d1 --- /dev/null +++ b/Justfile @@ -0,0 +1,37 @@ +home_dir := env_var('HOME') +dev_home := env_var_or_default("DEVELOPMENT_HOME", "{{home_dir}}/development") +build_dir := dev_home + '/build/astral' +pypm := 'pdm' + +test: + {{pypm}} run tox + +test-docs: + {{pypm}} run tox -e doc + +test-types: + {{pypm}} run mypy ./src/astral + +export COVERAGE_FILE := build_dir + '/coverage' +test-coverage: + {{pypm}} run pytest --cov=src/astral src/test + +test-coverage-html: + {{pypm}} run coverage html -d "{{build_dir}}/htmlcov/" + @xdg-open "{{build_dir}}/htmlcov/index.html" 2>&1 >/dev/null + +test-coverage-term: + {{pypm}} run coverage report + @xdg-open "{{build_dir}}/htmlcov/index.html" 2>&1 >/dev/null + +build-docs: + {{pypm}} run sphinx-build -a -b html -d {{build_dir}}/doctrees ./src/docs ../gh-pages + +view-docs: + @xdg-open ../gh-pages/index.html 2>&1 >/dev/null + +publish-docs: + git subtree push --prefix docs origin gh-pages + +repl: + @{{pypm}} run python diff --git a/Makefile b/Makefile deleted file mode 100644 index ce35ccd..0000000 --- a/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -.PHONY: clean test test-docs test-all html report build-docs repl show-docs show-cov typecheck doctest - -all: clean test report html - -SPHINXBUILD=sphinx-build -BUILDDIR=$(DEVELOPMENT_HOME)/build/astral - -clean: - @COVERAGE_FILE=$(BUILDDIR)/.coverage coverage erase - @rm -rf $(BUILDDIR)/doctrees - -test: - tox - -test-docs: - tox -e doc - -test-all: - tox -e py36,py37,nopytz,doc - -html: - @COVERAGE_FILE=$(BUILDDIR)/.coverage coverage html -d $(BUILDDIR)/htmlcov/ - -report: - @COVERAGE_FILE=$(BUILDDIR)/.coverage coverage report - -build-docs: - $(SPHINXBUILD) -a -b html -d $(BUILDDIR)/doctrees ./src/docs ./docs - -doctest: - $(SPHINXBUILD) -a -b doctest ./src/docs $(BUILDDIR)/doctest - -repl: - @PYTHONPATH=src python - -show-docs: - /usr/bin/start ./doc/index.html - -publish-docs: - git subtree push --prefix docs origin gh-pages - -show-cov: - /usr/bin/start $(BUILDDIR)/htmlcov/index.html - -typecheck: - @cd src - mypy astral - @cd ..