~dricottone/hist

ref: 7a26b5eaf451110f3039afe3bf87fc2a515e93a1 hist/Makefile -rw-r--r-- 1.2 KiB
7a26b5eaDominic Ricottone Adding documentation and a license 2 years ago
                                                                                
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
VERSION=1.0.0

PY_COMPILE_BIN=python -m py_compile

#BUILD_BIN=python -m build
BUILD_BIN=pyproject-build

#UNITTEST_FILE_BIN=python -m unittest
#UNITTEST_DIR_BIN=python -m unittest discover --top-level-directory .
UNITTEST_FILE_BIN=unittest --color
UNITTEST_DIR_BIN=unittest --color --working-directory .

#MYPY_BIN=python -m mypy
MYPY_BIN=MYPY_CACHE_DIR=hist/__mypycache__ mypy

#PIPX_BIN=python -m pipx
PIPX_BIN=pipx

.PHONY: clean
clean:
	rm -rf **/__pycache__ **/__mypycache__ **/*.pyc build *.egg-info

hist/cli.py: hist/cli.toml
	gap hist/cli.toml --no-debug-mode --output=hist/cli.py

.PHONY: test
test:
	$(PY_COMPILE_BIN) hist/*.py
	$(MYPY_BIN) -p hist

PY_FILES=hist/cli.py hist/__main__.py hist/histogram.py
PYBUILD_FILES=pyproject.toml LICENSE.md README.md

build/hist-$(VERSION)-py3-none-any.whl: $(PY_FILES) $(PYBUILD_FILES)
	mkdir -p build
	$(BUILD_BIN) --wheel --no-isolation --outdir build/

.PHONY: build
build: build/hist-$(VERSION)-py3-none-any.whl

.PHONY: reinstall
reinstall: uninstall install

.PHONY: install
install: build/hist-$(VERSION)-py3-none-any.whl
	$(PIPX_BIN) install build/hist-$(VERSION)-py3-none-any.whl

.PHONY: uninstall
uninstall:
	$(PIPX_BIN) uninstall hist