forked from workhorsy/py-cpuinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (47 loc) · 1.44 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
VERSION = 8.0.0
all:
@echo build: Builds the python source dist package
@echo install: Installs python source dist package
@echo clean: Removes any generated files
@echo rst: uses pandoc to generate the README.rst file from README.md
@echo test: Runs the unit tests
clean:
rm -f *.pyc
rm -f */*.pyc
rm -f -rf __pycache__
rm -f -rf */__pycache__
rm -f -rf py_cpuinfo.egg-info
rm -f -rf dist
rm -f -rf py-cpuinfo-$(VERSION)
rm -f -rf py-cpuinfo-$(VERSION).tar.gz
rm -f -rf py-cpuinfo-$(VERSION).zip
build: clean
python3 setup.py sdist --formats=gztar,zip
mv dist/py-cpuinfo-$(VERSION).tar.gz py-cpuinfo-$(VERSION).tar.gz
mv dist/py-cpuinfo-$(VERSION).zip py-cpuinfo-$(VERSION).zip
rm -f -rf py_cpuinfo.egg-info
rm -f -rf dist
release:
# Create release
git commit -a -m "Release $(VERSION)"
git push
# Create and push tag
git tag v$(VERSION) -m "Release $(VERSION)"
git push --tags
upload: clean
python3 setup.py sdist --formats=gztar,zip
twine upload dist/py-cpuinfo-$(VERSION).tar.gz
install: remove
tar xzf py-cpuinfo-$(VERSION).tar.gz
cd py-cpuinfo-$(VERSION)/ && python3 setup.py install
rm -f -rf py-cpuinfo-$(VERSION)
@echo now try "from cpuinfo import get_cpu_info"
@echo "get_cpu_info()"
remove:
rm -f -rf /usr/local/lib/python2.7/dist-packages/py_cpuinfo-$(VERSION)-py2.7.egg
rm -f /usr/local/bin/cpuinfo
test:
python3 setup.py test
rst:
rm -f -rf README.rst
pandoc --from=markdown --to=rst --output=README.rst README.md