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
|
|
|
|
2024-01-16 22:29:56 +03:00
|
|
|
all: build debian archlinux
|
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-12-03 23:25:34 +03:00
|
|
|
build: version format lint
|
2023-06-17 20:07:50 +03:00
|
|
|
poetry build
|
|
|
|
|
2024-01-16 22:26:59 +03:00
|
|
|
debian:
|
|
|
|
cd packaging/debian && $(MAKE)
|
|
|
|
|
|
|
|
archlinux:
|
|
|
|
cd packaging/archlinux && $(MAKE)
|
2023-11-23 02:34:02 +03:00
|
|
|
|
2023-12-03 23:25:34 +03:00
|
|
|
version:
|
|
|
|
VERSION=$$(awk '/^version/{print $$3}' pyproject.toml); \
|
|
|
|
sed "s/__version__ =.*/__version__ = $$VERSION/" -i $(SRCDIR)/__init__.py; \
|
|
|
|
sed "s/release =.*/release = $$VERSION/" -i $(DOCS_SRCDIR)/conf.py
|
|
|
|
|
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-12-03 23:25:34 +03:00
|
|
|
poetry run sphinx-autobuild $(DOCS_SRCDIR) $(DOCS_BUILDDIR) \
|
|
|
|
--pre-build 'make clean'
|
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
|
2024-01-16 22:26:59 +03:00
|
|
|
cd packaging/debian && $(MAKE) clean
|
|
|
|
cd packaging/archlinux && $(MAKE) clean
|
2023-11-06 12:52:19 +03:00
|
|
|
|
2024-01-16 22:26:59 +03:00
|
|
|
test-build: build debian
|
|
|
|
scp packaging/debian/build/compute*.deb vm:~
|
2023-12-03 23:25:34 +03:00
|
|
|
|
2024-01-16 22:26:59 +03:00
|
|
|
upload-docs:
|
2024-01-13 00:45:30 +03:00
|
|
|
ssh root@hitomi 'rm -rf /srv/http/nixhacks.net/hstack/compute/*'
|
|
|
|
scp -r $(DOCS_BUILDDIR)/* root@hitomi:/srv/http/nixhacks.net/hstack/compute/
|