various improvements

This commit is contained in:
ge
2023-11-23 02:34:02 +03:00
parent b9d089dd78
commit 05f90b14f2
200 changed files with 15968 additions and 84 deletions

View File

@ -1,36 +1,44 @@
SRC = compute/
DIST = dist/
DOCS_SRC = docs/source/
DOCS_BUILD = docs/build/
SRCDIR = compute
DISTDIR = dist
DOCS_SRCDIR = docs/source
DOCS_BUILDDIR = docs/build
.PHONY: docs
all: build
requirements.txt:
poetry export -f requirements.txt -o requirements.txt
build: format lint
awk '/^version/{print $$3}' pyproject.toml \
| xargs -I {} sed "s/__version__ =.*/__version__ = '{}'/" -i $(SRCDIR)/__init__.py
poetry build
build-deb: build
cd packaging && $(MAKE)
format:
poetry run isort $(SRC)
poetry run ruff format $(SRC)
poetry run isort $(SRCDIR)
poetry run ruff format $(SRCDIR)
lint:
poetry run ruff check $(SRC)
poetry run ruff check $(SRCDIR)
docs:
poetry run sphinx-build $(DOCS_SRC) $(DOCS_BUILD)
poetry run sphinx-build $(DOCS_SRCDIR) $(DOCS_BUILDDIR)
docs-versions:
poetry run sphinx-multiversion $(DOCS_SRC) $(DOCS_BUILD)
poetry run sphinx-multiversion $(DOCS_SRCDIR) $(DOCS_BUILDDIR)
serve-docs:
poetry run sphinx-autobuild $(DOCS_SRC) $(DOCS_BUILD)
poetry run sphinx-autobuild $(DOCS_SRCDIR) $(DOCS_BUILDDIR)
clean:
[ -d $(DIST) ] && rm -rf $(DIST) || true
[ -d $(DOCS_BUILD) ] && rm -rf $(DOCS_BUILD) || true
[ -d $(DISTDIR) ] && rm -rf $(DISTDIR) || true
[ -d $(DOCS_BUILDDIR) ] && rm -rf $(DOCS_BUILDDIR) || true
find . -type d -name __pycache__ -exec rm -rf {} \; > /dev/null 2>&1 || true
cd packaging && $(MAKE) clean
test-build:
poetry build
scp $(DIST)/*.tar.gz vm:~
test-build: build-deb
scp packaging/build/compute*.deb vm:~