generated from cubao/cubao-pypi-example
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
72 lines (60 loc) · 1.69 KB
/
Makefile
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
PROJECT_SOURCE_DIR ?= $(abspath ./)
PROJECT_NAME ?= $(shell basename $(PROJECT_SOURCE_DIR))
all:
@echo nothing special
lint:
pre-commit run -a
lint_install:
pre-commit install
clean:
rm -rf build dist *.egg-info __pycache__ *.pyc
force_clean:
docker run --rm -v `pwd`:`pwd` -w `pwd` -it alpine/make make clean
.PHONY: clean force_clean
tox_check:
python -m tox -e py
data_pull:
make pull -C data
data_clean:
make clean -C data
docs_build:
mkdocs build
docs_serve:
mkdocs serve -a 0.0.0.0:8088
install:
python3 -m pip install . --force --user
package:
python3 -m build
build: package
list:
unzip -l dist/cubao_pypi_example-*.whl
pypi_remote ?= testpypi
upload:
python3 -m pip install --upgrade twine
python3 -m twine upload --repository $(pypi_remote) dist/*
.PHONY: install package build upload
ci:
python -m tox -e py
.PHONY: ci
test: data_pull pytest clitest
pytest:
python3 -m pip install pytest
# pytest --capture=tee-sys tests
pytest tests -vv
clitest:
@echo not ready
.PHONY: test pytest clitest
DOCKER_TAG_WINDOWS ?= ghcr.io/cubao/build-env-windows-x64:v0.0.1
DOCKER_TAG_LINUX ?= ghcr.io/cubao/build-env-manylinux2014-x64:v0.0.1
DOCKER_TAG_MACOS ?= ghcr.io/cubao/build-env-macos-arm64:v0.0.1
test_in_win:
docker run --rm -w `pwd` -v `pwd`:`pwd` -v `pwd`/build/win:`pwd`/build -it $(DOCKER_TAG_WINDOWS) bash
test_in_mac:
docker run --rm -w `pwd` -v `pwd`:`pwd` -v `pwd`/build/mac:`pwd`/build -it $(DOCKER_TAG_MACOS) bash
test_in_linux:
docker run --rm -w `pwd` -v `pwd`:`pwd` -v `pwd`/build/linux:`pwd`/build -it $(DOCKER_TAG_LINUX) bash
# https://stackoverflow.com/a/25817631
echo-% : ; @echo -n $($*)
Echo-% : ; @echo $($*)
ECHO-% : ; @echo $* = $($*)
echo-Tab: ; @echo -n ' '