-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (42 loc) · 1.31 KB
/
Copy pathMakefile
File metadata and controls
55 lines (42 loc) · 1.31 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
VENV_DIR = venv
PYTHON = python3.14
PIP = $(VENV_DIR)/bin/pip
PYTHON_VENV = $(VENV_DIR)/bin/python
TOX = $(VENV_DIR)/bin/tox
PRE_COMMIT = $(VENV_DIR)/bin/pre-commit
PKG_NAME = schema_first
SRC_DIR = src/$(PKG_NAME)
.PHONY: venv test format clean build install upload_to_testpypi upload_to_pypi all
venv: venv/pyvenv.cfg $(PKG_DIR)
# Create virtual environment.
venv/pyvenv.cfg: pyproject.toml $(PKG_DIR)
$(PYTHON) -m venv $(VENV_DIR)
$(PIP) -q install --upgrade pip wheel
$(PIP) -q install -e ".[dev]" && $(PIP) -q install -e .
format: venv
# Run checking and formatting sources.
$(PRE_COMMIT) run -a
test: venv
# Run pytest.
./venv/bin/bandit -q -r src/
./venv/bin/pytest -s -x --cov-report term-missing:skip-covered --cov=$(SRC_DIR) tests/
clean:
rm -rf venv/
rm -rf dist/
rm -rf src/Schema_First.egg-info
find . -type d -name __pycache__ -exec rm -r {} \+
build: clean venv
$(PYTHON_VENV) -m build
install: clean venv build
pyenv local 3.12 3.13 3.14
pre-commit install
check_dist: build
$(PYTHON_VENV) -m twine check dist/*
upload_to_testpypi: build
$(PYTHON_VENV) -m twine upload --verbose --repository testpypi dist/*
upload_to_pypi: build
$(PYTHON_VENV) -m twine upload --verbose --repository pypi dist/*
tox: venv
# Testing project via several Python versions.
$(TOX) run-parallel
all: install test