-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
82 lines (65 loc) · 2.27 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
73
74
75
76
77
78
79
80
81
82
PY = python3
SPHINXBUILD = sphinx-build
DOCPREFIX = docs
BUILDDIR = $(DOCPREFIX)/build
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(DOCPREFIX)/source
BUILD_PKG_OPT = sdist
#RELEASE_OPT = sdist bdist_wheel upload
LXC_MOUNT_POINT=/opt/src-original
LXC_WORKING_DIR=/opt/src
LXC_TEST_DOCKER_COMMAND=docker run \
-it --rm \
-w $(LXC_MOUNT_POINT) \
-v `pwd`:$(LXC_MOUNT_POINT):ro \
--privileged \
python
LXC_TEST_EXECUTE=bash -c "make test-lxc-run"
package: clean-dist
python3 -m build
clean-dist:
@git clean -fdX
@rm dist/* 2> /dev/null || echo '(/dist is clean...)'
release: package
@twine upload dist/*
install:
$(PY) setup.py install
test-v2:
$(PY) -m unittest discover -s test/v2
test-v2-dev:
$(PY) -m unittest discover -f -v -s test/v2
test-v3:
$(PY) -m unittest discover -s test/v3
test-v3-dev:
$(PY) -m unittest discover -f -v -s test/v3
test: clean-cache test-v2 test-v3
test-lxc: clean-cache test-lxc-primary
@(make test-lxc-secondary || echo "\nWARNING: Failed tests on legacy support")
test-lxc-primary:
@echo "===================================================================="
@echo "Primary test runs"
@PY_VERSION=latest make test-lxc-on-version
@PY_VERSION=3.7 make test-lxc-on-version
test-lxc-secondary:
@echo "===================================================================="
@echo "Secondary test runs"
@PY_VERSION=3.6 make test-lxc-on-version
@PY_VERSION=3.5 make test-lxc-on-version
test-lxc-on-version:
@echo "--------------------------------------------------------------------"
@echo "Testing with Python $(PY_VERSION)"
@echo "--------------------------------------------------------------------"
@time $(LXC_TEST_DOCKER_COMMAND):$(PY_VERSION) $(LXC_TEST_EXECUTE)
@echo ""
test-lxc-run:
@rm -rfv $(LXC_WORKING_DIR)
@cp -r $(LXC_MOUNT_POINT) $(LXC_WORKING_DIR)
@pip install -q kotoba
@cd $(LXC_WORKING_DIR) \
&& USER=root PYTHONPATH=`pwd`:$$PYTHONPATH bash -c "python -m unittest discover -s test/v2 && python -m unittest discover -s test/v3"
doc:
#cd docs && make clean && make html
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
clean: clean-cache
rm -Rvf MANIFEST build dist docs/build/* imagination.egg-info; echo 'Cache cleared'
clean-cache:
@find . -name *.pyc -exec rm {} \;