-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (54 loc) · 1.64 KB
/
Makefile
File metadata and controls
63 lines (54 loc) · 1.64 KB
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
# To make a release, edit `version` keyword in setup.py and
# modify make commands below accordingly. Then
# echo "One must manually update the version in setup.py and in autoplot/__init__.py"
# git commit .
# make test PYTHON=python2.7
# make test PYTHON=python3.6
# make version-tag
# make package
# make release
SHELL:= /bin/bash
VERSION=0.9.2
PYTHONV=3.8
PYTHON=python$(PYTHONV)
URL=https://upload.pypi.org/
version-tag: version-tag-commit version-tag-push
version-tag-commit:
echo "VERSION=$(VERSION)"
- git commit -a -m "Last $(VERSION) commit"
echo "done commit"
git push
echo "done push"
version-tag-push:
git tag -a v$(VERSION) -m "Version $(VERSION)"
git push --tags
package:
make dist/autoplot-$(VERSION).tar.gz
dist/autoplot-$(VERSION).tar.gz:
# TODO: one must manually update the version
python setup.py sdist
release: dist/autoplot-$(VERSION).tar.gz
pip install twine
twine upload \
-r pypi dist/autoplot-$(VERSION).tar.gz \
&& \
echo Uploaded to $(subst upload.,,$(URL))/project/autoplot/
# TODO: Use tox
test:
- conda create -n $(PYTHON) python=$(PYTHONV) 2>/dev/null
source activate $(PYTHON); $(PYTHON) setup.py develop
source activate $(PYTHON); $(PYTHON) -m pytest autoplot/test/test_autoplot.py
clean:
- python setup.py --uninstall
- find . -name __pycache__ | xargs rm -rf {}
- find . -name *.pyc | xargs rm -rf {}
- find . -name *.DS_Store | xargs rm -rf {}
- find . -type d -name __pycache__ | xargs rm -rf {}
- find . -type d -name ".egg-info" | xargs rm -rf {}
- find . -name *.pyc | xargs rm -rf {}
- rm -f *~
- rm -f \#*\#
- rm -rf env
- rm -rf dist
- rm -f MANIFEST
- rm -rf .pytest_cache/