python-compute/Makefile

45 lines
1018 B
Makefile
Raw Normal View History

2023-11-23 02:34:02 +03:00
SRCDIR = compute
DISTDIR = dist
DOCS_SRCDIR = docs/source
DOCS_BUILDDIR = docs/build
2023-11-06 12:52:19 +03:00
.PHONY: docs
2023-08-24 22:36:12 +03:00
2023-12-01 01:39:26 +03:00
all: docs build-deb
2023-06-17 20:07:50 +03:00
2023-11-23 02:34:02 +03:00
requirements.txt:
poetry export -f requirements.txt -o requirements.txt
2023-11-06 12:52:19 +03:00
build: format lint
2023-11-23 02:34:02 +03:00
awk '/^version/{print $$3}' pyproject.toml \
| xargs -I {} sed "s/__version__ =.*/__version__ = '{}'/" -i $(SRCDIR)/__init__.py
2023-06-17 20:07:50 +03:00
poetry build
2023-11-23 02:34:02 +03:00
build-deb: build
cd packaging && $(MAKE)
2023-08-24 22:36:12 +03:00
format:
2023-11-23 02:34:02 +03:00
poetry run isort $(SRCDIR)
poetry run ruff format $(SRCDIR)
2023-08-24 22:36:12 +03:00
lint:
2023-11-23 02:34:02 +03:00
poetry run ruff check $(SRCDIR)
2023-11-06 12:52:19 +03:00
docs:
2023-11-23 02:34:02 +03:00
poetry run sphinx-build $(DOCS_SRCDIR) $(DOCS_BUILDDIR)
2023-11-06 12:52:19 +03:00
2023-11-06 17:47:56 +03:00
docs-versions:
2023-11-23 02:34:02 +03:00
poetry run sphinx-multiversion $(DOCS_SRCDIR) $(DOCS_BUILDDIR)
2023-11-06 17:47:56 +03:00
2023-11-09 01:17:50 +03:00
serve-docs:
2023-11-23 02:34:02 +03:00
poetry run sphinx-autobuild $(DOCS_SRCDIR) $(DOCS_BUILDDIR)
2023-11-06 12:52:19 +03:00
clean:
2023-11-23 02:34:02 +03:00
[ -d $(DISTDIR) ] && rm -rf $(DISTDIR) || true
[ -d $(DOCS_BUILDDIR) ] && rm -rf $(DOCS_BUILDDIR) || true
2023-11-06 12:52:19 +03:00
find . -type d -name __pycache__ -exec rm -rf {} \; > /dev/null 2>&1 || true
2023-11-23 02:34:02 +03:00
cd packaging && $(MAKE) clean
2023-11-06 12:52:19 +03:00
2023-11-23 02:34:02 +03:00
test-build: build-deb
scp packaging/build/compute*.deb vm:~