scaffold code for lib + cli
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
ROOT_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
PYTHON := $(ROOT_DIR)venv/bin/python
|
||||
PYTHONCLI := $(ROOT_DIR)venv.dist/bin/python
|
||||
|
||||
SRC_NAME = optimg
|
||||
|
||||
.PHONY: venv
|
||||
venv:
|
||||
@python3 -m venv venv
|
||||
pip install -r requirements-dev.txt
|
||||
$(PYTHON) -m pip install -r requirements-dev.txt
|
||||
|
||||
lint:
|
||||
$(PYTHON) -m ruff check --fix
|
||||
@@ -15,4 +18,17 @@ format:
|
||||
check-type:
|
||||
$(PYTHON) -m mypy .
|
||||
|
||||
check: format lint check-type
|
||||
check: format lint check-type
|
||||
|
||||
build: check
|
||||
@rm -rf dist/*
|
||||
$(PYTHON) -m hatch -v build -t wheel
|
||||
|
||||
install: build
|
||||
@python3 -m venv venv.dist
|
||||
$(PYTHONCLI) -m pip install dist/$(SRC_NAME)-*.whl --force-reinstall
|
||||
|
||||
documentation:
|
||||
$(PYTHON) -m pdoc --html -o docs src/ --force
|
||||
@find docs/src/* -type f -exec sed -i 's/src\./$(SRC_NAME)\./g' {} \; -exec sed -i 's/src</$(SRC_NAME)</g' {} \;
|
||||
@sed -i 's/<code>src<\/code>/<code>$(SRC_NAME)<\/code>/g' docs/src/index.html
|
||||
Reference in New Issue
Block a user