1
0
mirror of https://github.com/venthur/blag.git synced 2025-11-25 20:52:43 +00:00
Files
blag/Makefile
Bastian Venthur d8ff4afddb Revert "WIP"
This reverts commit 169f0f2e0b.
2023-04-16 10:32:04 +02:00

66 lines
1.1 KiB
Makefile

# system python interpreter. used only to create virtual environment
PY = python3
VENV = venv
BIN=$(VENV)/bin
DOCS_SRC = docs
DOCS_OUT = $(DOCS_SRC)/_build
ifeq ($(OS), Windows_NT)
BIN=$(VENV)/Scripts
PY=python
endif
.PHONY: all
all: lint mypy test test-release
$(VENV): requirements.txt requirements-dev.txt pyproject.toml
$(PY) -m venv $(VENV)
$(BIN)/pip install --upgrade -r requirements.txt
$(BIN)/pip install --upgrade -r requirements-dev.txt
$(BIN)/pip install -e .['dev']
touch $(VENV)
.PHONY: test
test: $(VENV)
$(BIN)/pytest
.PHONY: mypy
mypy: $(VENV)
$(BIN)/mypy
.PHONY: lint
lint: $(VENV)
$(BIN)/flake8
.PHONY: build
build: $(VENV)
rm -rf dist
$(BIN)/python3 -m build
.PHONY: test-release
test-release: $(VENV) build
$(BIN)/twine check dist/*
.PHONY: release
release: $(VENV) build
$(BIN)/twine upload dist/*
.PHONY: docs
docs: $(VENV)
$(BIN)/sphinx-build $(DOCS_SRC) $(DOCS_OUT)
.PHONY: clean
clean:
rm -rf build dist *.egg-info
rm -rf $(VENV)
rm -rf $(DOCS_OUT)
rm -rf $(DOCS_SRC)/api
find . -type f -name *.pyc -delete
find . -type d -name __pycache__ -delete
# coverage
rm -rf htmlcov .coverage
rm -rf .mypy_cache