forked from geoopt/geoopt
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (35 loc) · 1.58 KB
/
Makefile
File metadata and controls
48 lines (35 loc) · 1.58 KB
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
47
.PHONY: help docker dockstyle-check codestyle-check linter-check black test lint check
.DEFAULT_GOAL = help
PYTHON = python
PIP = pip
CONDA = conda
SHELL = bash
help:
@printf "Usage:\n"
@grep -E '^[a-zA-Z_-]+:.*?# .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?# "}; {printf "\033[1;34mmake %-15s\033[0m%s\n", $$1, $$2}'
docker: # Set up a Docker image for development.
@printf "Creating Docker image...\n"
${SHELL} ./scripts/container.sh --build
docker-test: # Run tests in a Docker image.
@printf "Testing in Docker image...\n"
${SHELL} ./scripts/container.sh --test
docstyle-check: # Check geoopt with pydocstyle
@printf "Checking documentation with pydocstyle...\n"
pydocstyle geoopt
@printf "\033[1;34mPydocstyle passes!\033[0m\n\n"
codestyle-check: # Check geoopt with black
@printf "Checking code style with black...\n"
black --check --diff geoopt tests
@printf "\033[1;34mBlack passes!\033[0m\n\n"
linter-check: # Check geoopt with pylint
@printf "Checking code style with pylint...\n"
pylint geoopt
@printf "\033[1;34mPylint passes!\033[0m\n\n"
black: # Format code in-place using black.
black geoopt tests
test: # Test code using pytest.
pytest -v geoopt tests --doctest-modules --html=testing-report.html --self-contained-html
lint: linter-check codestyle-check docstyle-check # Lint code using black and pylint (no pydocstyle yet).
check: lint test # Both lint and test code. Runs `make lint` followed by `make test`.
clear-pycache: # clear __pycache__ in the project files (may appear after running tests in docker)
find -type d -name __pycache__ -exec rm -rf {} +