-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
46 lines (35 loc) · 1.09 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
## Summary of available make targets:
##
## make help -- Display this message
## make -B venv -- (Re)install a development virtual environment
## make format -- Run code formatter
## make lint -- Run linter and type checker
## make test -- Run tests
## make docs -- Run documentation
##
## This Makefile needs to be run inside a virtual environment
ifndef VIRTUAL_ENV
$(error "This Makefile needs to be run inside a virtual environment")
endif
.PHONY: help venv format lint test docs
PROJECTNAME=geographer
help:
@sed -rn 's/^## ?//;T;p' $(MAKEFILE_LIST)
venv: $(VIRTUAL_ENV)/timestamp
$(VIRTUAL_ENV)/timestamp: pyproject.toml
pip install --upgrade pip
pip install -e ".[dev,docs]"
ifneq ($(wildcard requirements/extra.txt),)
pip install -r requirements/extra.txt
endif
touch $(VIRTUAL_ENV)/timestamp
format: venv
ruff check $(PROJECTNAME) tests --fix
lint: venv
ruff check $(PROJECTNAME) tests
test: venv
pytest -v -m "not slow"
test-slow: venv
pytest -v -m "slow"
docs: venv
cd docs && sphinx-apidoc -o source/ ../$(PROJECTNAME) && make clean html