-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
71 lines (56 loc) · 1.94 KB
/
Makefile
File metadata and controls
71 lines (56 loc) · 1.94 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) nexB Inc. and contributors
# See https://github.com/aboutcode-org/aboutcode.federated/ for support and sources
# Python version can be specified with `$ PYTHON_EXE=python3.x make conf`
PYTHON_EXE?=python3
VENV=venv
ACTIVATE?=. ${VENV}/bin/activate;
virtualenv:
@echo "-> Bootstrap the virtualenv with PYTHON_EXE=${PYTHON_EXE}"
@${PYTHON_EXE} -m venv ${VENV}
@${ACTIVATE} pip install --upgrade pip
conf: virtualenv
@echo "-> Install dependencies"
@${ACTIVATE} pip install --editable .
dev: virtualenv
@echo "-> Configure and install development dependencies"
@${ACTIVATE} pip install --editable .[dev]
build: test
@echo "-> Building sdist and wheel"
rm -rf build/ dist/
${VENV}/bin/flot --pyproject pyproject.toml --sdist --wheel
publish: build
@echo "-> Publish built sdist and wheel to PyPi"
${VENV}/bin/twine upload dist/*
doc8:
@echo "-> Run doc8 validation"
@${ACTIVATE} doc8 --quiet docs/ *.rst
valid:
@echo "-> Run Ruff format"
@${ACTIVATE} ruff format
@echo "-> Run Ruff linter"
@${ACTIVATE} ruff check --fix
check:
@echo "-> Run Ruff linter validation (pycodestyle, bandit, isort, and more)"
@${ACTIVATE} ruff check
@echo "-> Run Ruff format validation"
@${ACTIVATE} ruff format --check
@$(MAKE) doc8
clean:
@echo "-> Clean the Python env"
rm -rf ${VENV} build/ dist/ docs/_build/ pip-selfcheck.json .tox .pytest_cache/ .coverage
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
test: check
@echo "-> Run the test suite"
${ACTIVATE} ${PYTHON_EXE} -m pytest -vvs
bump:
@echo "-> Bump the version"
venv/bin/bump-my-version bump patch
docs:
rm -rf docs/_build/
@${ACTIVATE} sphinx-build docs/source docs/_build/
docs-check:
@${ACTIVATE} sphinx-build -E -W -b html docs/source docs/_build/
@${ACTIVATE} sphinx-build -E -W -b linkcheck docs/source docs/_build/
.PHONY: virtualenv conf dev build publish doc8 valid check clean test bump docs docs-check