-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
55 lines (40 loc) · 1.31 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
47
48
49
50
51
52
53
54
55
.PHONY: venv setup ruff format test check clean build test-publish
SHELL := /bin/bash
PYTHON_INTERPRETER := python
VENV := source .venv/bin/activate
PROJECT_CONFIG := pyproject.toml
venv: .venv/touchfile
.venv/touchfile: requirements.txt requirements-dev.txt
$(VENV); pip-sync requirements.txt requirements-dev.txt
$(VENV); pip install -e .
touch .venv/touchfile
requirements.txt: $(PROJECT_CONFIG)
$(VENV); pip-compile --output-file=requirements.txt --resolver=backtracking $(PROJECT_CONFIG)
requirements-dev.txt: $(PROJECT_CONFIG)
$(VENV); pip-compile --extra=dev --output-file=requirements-dev.txt --resolver=backtracking $(PROJECT_CONFIG)
test: venv
$(VENV); tox
build:
rm -rf build dist
$(VENV); python -m build
test-publish:
$(VENV); python -m twine upload --repository testpypi dist/* --verbose
publish:
$(VENV); python -m twine upload --repository tryangle dist/* --verbose
setup:
virtualenv .venv
$(VENV); pip install --upgrade pip setuptools wheel build
$(VENV); pip install pip-tools
ruff:
$(VENV); ruff .
format:
$(VENV); ruff .
$(VENV); black .
check:
$(VENV); ruff check .
$(VENV); black --check .
clean:
find . -type d -name ".ipynb_checkpoints" -exec rm -r {} +
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name "__pycache__" -exec rm -rf {} +
rm -rf build dist