forked from purcell/airspeed
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
32 lines (24 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
VENV_DIR ?= .venv
VENV_RUN = . $(VENV_DIR)/bin/activate
PIP_CMD ?= pip
BUILD_DIR ?= dist
TEST_PATH ?= tests
usage: ## Show this help
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
install: ## Install dependencies in local virtualenv folder
(test -e $(VENV_DIR) || python -m venv $(VENV_OPTS) $(VENV_DIR)) && \
($(VENV_RUN) && $(PIP_CMD) install --upgrade pip) && \
($(VENV_RUN); $(PIP_CMD) install .[dev])
publish: ## Publish the library to the central PyPi repository
# build and upload archive
$(VENV_RUN); $(PIP_CMD) install twine
$(VENV_RUN); ./setup.py sdist && twine upload $(BUILD_DIR)/*.tar.gz
test: ## Run automated tests
$(VENV_RUN); pytest $(PYTEST_ARGS) $(TEST_PATH)
lint: ## Run code linter to check code style
$(VENV_RUN); flake8 airspeed tests
format: ## Run code formatter (black/isort)
$(VENV_RUN); python -m black airspeed tests; python -m isort airspeed tests
clean: ## Clean up virtualenv
rm -rf $(VENV_DIR)
.PHONY: usage install clean publish test lint format