-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
64 lines (47 loc) · 1.87 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
#
# Copyright (C) 2023 Martin J Levy - W6LHI/G8LHI - @mahtin - https://github.com/mahtin
#
PYTHON = python
PIP = pip
PYLINT = pylint
TWINE = twine
NAME = "es100-wwvb"
NAME_ = "es100_wwvb"
all:
${FORCE}
lint:
${PYLINT} --unsafe-load-any-extension=y es100/__init__.py es100/es100.py es100/gpio_control.py es100/i2c_control.py es100/pico/*.py wwvb/__init__.py wwvb/__main__.py wwvb/wwvb.py wwvb/misc.py wwvb/sun.py wwvb/ntpdriver28.py
clean:
rm -rf build dist
mkdir build dist
$(PYTHON) setup.py clean
rm -rf ${NAME_}.egg-info
test: all
${FORCE}
sdist: all
# make clean
# make test
$(PYTHON) setup.py sdist
@ v=`ls -t dist/${NAME}-*.tar.gz | head -1` ; echo $(TWINE) check $$v ; $(TWINE) check $$v
@ rm -rf ${NAME_}.egg-info build
bdist: all
${PIP} wheel . -w dist --no-deps
@ v=`ls -t dist/${NAME_}-*-py2.py3-none-any.whl | head -1` ; echo $(TWINE) check $$v ; $(TWINE) check $$v
@ rm -rf ${NAME_}.egg-info build
showtag: sdist
@ v=`ls -t dist/${NAME}-*.tar.gz | head -1 | sed -e "s/dist\/${NAME}-//" -e 's/.tar.gz//'` ; echo "\tDIST VERSION =" $$v ; (git tag | fgrep -q "$$v") && echo "\tGIT TAG EXISTS"
tag: sdist
@ v=`ls -t dist/${NAME}-*.tar.gz | head -1 | sed -e "s/dist\/${NAME}-//" -e 's/.tar.gz//'` ; echo "\tDIST VERSION =" $$v ; (git tag | fgrep -q "$$v") || git tag "$$v"
upload: clean all tag upload-github upload-pypi
upload-github:
git push
git push origin --tags
upload-pypi: sdist bdist
@ v=`ls -t dist/${NAME}-*.tar.gz | head -1` ; echo $(TWINE) check $$v ; $(TWINE) check $$v
@ v=`ls -t dist/${NAME_}-*-py2.py3-none-any.whl | head -1` ; echo $(TWINE) check $$v ; $(TWINE) check $$v
${TWINE} upload --repository ${NAME} `ls -t dist/${NAME}-*.tar.gz|head -1` `ls -t dist/${NAME_}-*-py2.py3-none-any.whl|head -1`
docs: all
sphinx-apidoc -Mfe -o docs . setup.py
sphinx-build -j auto -b html docs docs/_build/html
clean-docs: all
rm -rf docs/*.rst docs/_build/