-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
94 lines (76 loc) · 2.1 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
83
84
85
86
87
88
89
90
91
92
93
94
.PHONY: build
build:
pip install -e .
.PHONY: venv
venv:
@echo Build test_venv
rm -rf test_venv
virtualenv test_venv
(. test_venv/bin/activate; pip install --upgrade pip)
.PHONY: test_dep
test_dep:
$(MAKE) venv
(. test_venv/bin/activate; pip install .)
(. test_venv/bin/activate; $(MAKE) test;)
.PHONY: sdist
sdist:
@echo Building source distribution
python setup.py build sdist bdist_wheel
.PHONY: test_sdist
test_sdist:
$(MAKE) venv
$(MAKE) sdist
@echo Installing distribution in clean venv. This will take a while...
(. test_venv/bin/activate; pip install dist/*-$$(cat VERSION.txt).tar.gz );
(. test_venv/bin/activate; $(MAKE) test)
deploy_requirements.txt:
$(MAKE) test_dep
(. test_venv/bin/activate; pip freeze > $@)
.PHONY: core_distclean
core_distclean:
rm -rf test_venv
rm -rf .eggs
.PHONY: clean
clean:
distclean: core_distclean
.PHONY:test
test: # build
cd test && python -m unittest discover -v .
.PHONY: doc
doc: build $(wildcard doc/*.rst)
$(MAKE) -C doc html
.PHONY: doczip
doczip: doc
T=$$PWD; (cd doc/_build/html; zip -r $$T/Swoop-$$(cat $$T/VERSION.txt)-docs.zip *)
.PHONY: diff
diff:
diff Swoop/eagle-7.2.0.dtd Swoop/eagle-swoop.dtd > Swoop/eagle.dtd.diff
.PHONY: release
release: clean
touch VERSION.txt
-git commit -m "Commit before release $$(cat VERSION.txt)" -a
git push
git checkout release
git merge --no-ff master
git tag -a $$(cat VERSION.txt) -m "Tag version $$(cat VERSION.txt)"
git push --follow-tags
$(MAKE) test_sdist
$(MAKE) do-deploy
$(MAKE) doczip
.PHONY: do-deploy
do-deploy:
twine upload dist/*$$(cat VERSION.txt)*
.PHONY: test-deployed
test-deployed:
# (mkdir _test; cd _test; virtualenv venv; . venv/bin/activate; pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple Swoop)
(rm -rf _test; virtualenv _test/venv; . _test/venv/bin/activate; pip install Swoop; make test)
clean:
rm -rf Swoop/eagleDTD.py
rm -rf test/inputs/*.broken.xml
rm -rf Swoop/Swoop.py
if [ -d doc ]; then $(MAKE) -C doc clean; fi
rm -rf *~
rm -rf .eggs
rm -rf Swoop.egg-info
rm -rf build
find . -name '*.pyc' | xargs rm -rf