-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (43 loc) · 1.52 KB
/
Copy pathMakefile
File metadata and controls
57 lines (43 loc) · 1.52 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
48
49
50
51
52
53
54
55
56
57
ARGS ?=
VENV_DIR ?= .venv
POETRY ?= poetry
POETRY_PYTHON ?= python
# Any non-empty CI value (even 'false' or '0') means that CI is enabled
CI ?=
-include .env.dev
export
all: build
init_env:
$(if $(CI),,$(POETRY) env use $(POETRY_PYTHON))
install: init_env
$(POETRY) install --all-extras
build: install
$(POETRY) build
publish: build
$(POETRY) publish -u __token__ -p $(PYPI_TOKEN) --skip-existing
lint: install
$(POETRY) run nox -s lint
format: install
$(POETRY) run nox -s format
test: install
$(POETRY) run -- nox -s test $(if $(PYTHON),--python=$(PYTHON),) -- $(ARGS)
test_fast: install
$(POETRY) run -- nox -s test $(if $(PYTHON),--python=$(PYTHON),) -- -m 'not slow' $(ARGS)
benchmark: install
python -m benchmark.benchmark_merge_chunks
install_git_hooks: install
$(VENV_DIR)/bin/pre-commit install
help:
@echo '===================='
@echo 'build - build the library'
@echo 'clean - clean virtual env and build artifacts'
@echo 'publish - publish the library to Pypi'
@echo 'install_git_hooks - install the git hooks'
@echo '-- LINTING --'
@echo 'format - run code formatters'
@echo 'lint - run linters'
@echo '-- TESTS --'
@echo 'test - run unit tests'
@echo 'test_fast - run unit tests without slow tests'
@echo 'test PYTHON=<python_version> - run unit tests with the specific python version'
@echo 'benchmark - run benchmarks'