~dricottone/gap

ref: 572a6188a2634b95e380126bcce0a3c785b36874 gap/Makefile -rw-r--r-- 1.2 KiB
572a6188Dominic Ricottone Toolchain updates to accompany migration away from setup.py 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
PY_COMPILE_BIN=python -m py_compile

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

#UNITTEST_BIN=python -m unittest
UNITTEST_BIN=unittest --color

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

#PIPX_BIN=python -m pipx
PIPX_BIN=pipx

.PHONY: clean bootstrap test build unittest reinstall install uninstall

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

bootstrap:
	./gap/bootstrap.py > gap/cli.py

test:
	mkdir -p tests/generated_syntax
	touch tests/__init__.py tests/generated_syntax/__init__.py
	$(PY_COMPILE_BIN) gap/*.py
	$(UNITTEST_BIN) --working-directory . tests
	$(PY_COMPILE_BIN) tests/generated_syntax/*.py
	$(UNITTEST_BIN) tests/generated_syntax_tests.py
	$(MYPY_BIN) -p gap

# more verbose than `make test`, skips `py_compile` and `mypy`
unittest:
	mkdir -p tests/generated_syntax
	touch tests/__init__.py tests/generated_syntax/__init__.py
	$(UNITTEST_BIN) --working-directory . tests --verbose
	$(UNITTEST_BIN) tests/generated_syntax_tests.py --verbose

build:
	mkdir -p build
	$(BUILD_BIN) --wheel --no-isolation --outdir build/

reinstall: uninstall install

install:
	$(PIPX_BIN) install build/gap-1.0.2-py3-none-any.whl

uninstall:
	$(PIPX_BIN) uninstall gap