-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (25 loc) · 873 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
.PHONY: env run test lint docs requirements
.DEFAULT: env
SHELL := /bin/bash
# List and check for commands.
COMMANDS = make
COMMAND_CHECK := $(foreach exec,$(COMMANDS), $(if $(shell which $(exec)),some string,$(error "No $(exec) in PATH")))
env:
@echo "Building the python environment..."
@poetry install
run:
@echo "Sawmill is a library and has nothing to run!"
test:
@source .env && poetry run coverage run --branch -m unittest discover --pattern=tests/*.py; poetry run coverage html
lint:
@poetry run isort --virtual-env .venv **/*.py && poetry run flake8
docs:
@poetry run sphinx-apidoc -o docs/source ./ ./tests/*.py
@cd docs && make html
## Generate a fresh requirements.txt file from poetry environment
requirements:
@poetry export \
--format requirements.txt \
--output requirements.txt \
--without-hashes
@poetry show --tree > poetry-show-tree