-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
102 lines (82 loc) · 2.67 KB
/
Makefile
File metadata and controls
102 lines (82 loc) · 2.67 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#REQUIREMENTS_TXT ?= requirements.txt requirements-dev.txt
.DEFAULT_GOAL := help
.PHONY: help dev test
include Makefile.venv
Makefile.venv:
curl \
-o Makefile.fetched \
-L "https://github.com/sio/Makefile.venv/raw/v2022.07.20/Makefile.venv"
echo "147b164f0cbbbe4a2740dcca6c9adb6e9d8d15b895be3998697aa6a821a277d8 *Makefile.fetched" \
| sha256sum --check - \
&& mv Makefile.fetched Makefile.venv
ifndef UV
# Try to find uv in PATH
_UV_OPTION:=$(shell command -v uv 2>/dev/null || which uv 2>/dev/null)
ifeq ($(origin _UV_OPTION),file)
# uv was found via which/command -v
UV=$(_UV_OPTION)
$(info Using uv: $(UV))
else
# Try default uv command
_UV_TEST:=uv
ifeq (ok,$(shell $(_UV_TEST) -c "print('ok')" 2>/dev/null))
UV=$(_UV_TEST)
$(info Using uv: $(UV))
else
$(error uv executable not found. Please install uv from https://docs.astral.sh/uv/getting-started/installation/ or set UV=/path/to/uv)
endif
endif
endif
# Override default venv packages for uv virtualenv
$(VENV):
$(UV) venv
$(shell source .venv/bin/activate)
$(UV) sync
$(UV) pip install pip
$(shell pwd)
help: # Help for the Makefile
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
dev: venv ## Create the virtualenv with all the requirements installed
docs: build
cp README.rst docs/readme.rst
cp Changelog docs/changelog.rst
tox -edocs
clean: clean-build clean-pyc clean-test clean-pyenv ## remove all build, test, coverage and Python artifacts
clean-pyenv:
rm -rf .venv
rm Makefile.venv
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -fr {} +
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
coverage: ## check code coverage quickly with the default Python
coverage run --source aprsd_rich_cli_extension setup.py test
coverage report -m
coverage html
$(BROWSER) htmlcov/index.html
changelog: dev
npm i -g auto-changelog
auto-changelog -l false --sort-commits date -o ChangeLog.md
test: dev ## Run all the tox tests
tox -p all
build: test ## Make the build artifact prior to doing an upload
$(VENV)/python3 setup.py sdist bdist_wheel
$(VENV)/twine check dist/*
upload: build ## Upload a new version of the plugin
$(VENV)/twine upload dist/*
check: dev ## Code format check with tox and pep8
tox -epep8
fix: dev ## fixes code formatting with gray
tox -efmt