@@ -5,6 +5,7 @@ PYTHON=python
5
5
PIP =pip
6
6
PYTEST =py.test
7
7
COVERAGE =coverage
8
+ TWINE =twine
8
9
PYFLAGS =
9
10
DEST_DIR =/
10
11
@@ -45,14 +46,14 @@ DOC_SOURCES:=
45
46
SUBDIRS: =
46
47
47
48
# Calculate the name of all outputs
48
- DIST_EGG =dist/$(NAME ) -$(VER ) -$( PYVER ) .egg
49
+ DIST_WHEEL =dist/$(NAME ) -$(VER ) -py2.py3-none-any.whl
49
50
DIST_TAR =dist/$(NAME ) -$(VER ) .tar.gz
50
51
DIST_ZIP =dist/$(NAME ) -$(VER ) .zip
51
52
DIST_DEB =dist/python-$(NAME ) _$(VER )$(DEB_SUFFIX ) _all.deb \
52
53
dist/python3-$(NAME ) _$(VER )$(DEB_SUFFIX ) _all.deb \
53
54
dist/python-$(NAME ) -doc_$(VER )$(DEB_SUFFIX ) _all.deb \
54
55
dist/$(NAME ) _$(VER )$(DEB_SUFFIX ) _$(DEB_ARCH ) .changes
55
- DIST_DSC =dist/$(NAME ) _$(VER )$(DEB_SUFFIX ) .tar.gz \
56
+ DIST_DSC =dist/$(NAME ) _$(VER )$(DEB_SUFFIX ) .tar.xz \
56
57
dist/$(NAME ) _$(VER )$(DEB_SUFFIX ) .dsc \
57
58
dist/$(NAME ) _$(VER )$(DEB_SUFFIX ) _source.changes
58
59
MAN_PAGES =man/pinout.1 man/remote-gpio.7
@@ -85,15 +86,15 @@ doc: $(DOC_SOURCES)
85
86
86
87
source : $(DIST_TAR ) $(DIST_ZIP )
87
88
88
- egg : $(DIST_EGG )
89
+ wheel : $(DIST_WHEEL )
89
90
90
91
zip : $(DIST_ZIP )
91
92
92
93
tar : $(DIST_TAR )
93
94
94
95
deb : $(DIST_DEB ) $(DIST_DSC )
95
96
96
- dist : $(DIST_EGG ) $(DIST_DEB ) $(DIST_DSC ) $(DIST_TAR ) $(DIST_ZIP )
97
+ dist : $(DIST_WHEEL ) $(DIST_DEB ) $(DIST_DSC ) $(DIST_TAR ) $(DIST_ZIP )
97
98
98
99
develop : tags
99
100
@# These have to be done separately to avoid a cockup...
@@ -106,13 +107,11 @@ test:
106
107
$(COVERAGE ) report --rcfile coverage.cfg
107
108
108
109
clean :
109
- $(PYTHON ) $(PYFLAGS ) setup.py clean
110
110
dh_clean
111
- rm -fr build/ dist/ $(NAME ) .egg-info/ tags
111
+ rm -fr $(NAME ) .egg-info/ tags
112
112
for dir in $( SUBDIRS) ; do \
113
113
$(MAKE ) -C $$ dir clean; \
114
114
done
115
- find $(CURDIR ) -name " *.pyc" -delete
116
115
117
116
tags : $(PY_SOURCES )
118
117
ctags -R --exclude=" build/*" --exclude=" debian/*" --exclude=" docs/*" --languages=" Python"
@@ -131,8 +130,8 @@ $(DIST_TAR): $(PY_SOURCES) $(SUBDIRS)
131
130
$(DIST_ZIP ) : $(PY_SOURCES ) $(SUBDIRS )
132
131
$(PYTHON ) $(PYFLAGS ) setup.py sdist --formats zip
133
132
134
- $(DIST_EGG ) : $(PY_SOURCES ) $(SUBDIRS )
135
- $(PYTHON ) $(PYFLAGS ) setup.py bdist_egg
133
+ $(DIST_WHEEL ) : $(PY_SOURCES ) $(SUBDIRS )
134
+ $(PYTHON ) $(PYFLAGS ) setup.py bdist_wheel --universal
136
135
137
136
$(DIST_DEB ) : $(PY_SOURCES ) $(SUBDIRS ) $(DEB_SOURCES ) $(MAN_PAGES )
138
137
# build the binary package in the parent directory then rename it to
@@ -161,16 +160,14 @@ changelog: $(PY_SOURCES) $(DOC_SOURCES) $(DEB_SOURCES)
161
160
# commit the changes and add a new tag
162
161
git commit debian/changelog -m " Updated changelog for release $( VER) "
163
162
164
- release : $(PY_SOURCES ) $(DOC_SOURCES ) $(DIST_DEB ) $(DIST_DSC )
163
+ release : $(DIST_DEB ) $(DIST_DSC ) $(DIST_TAR ) $(DIST_WHEEL )
165
164
git tag -s v$(VER ) -m " Release v$( VER) "
166
165
git push --tags
167
- # update the package's registration on PyPI (in case any metadata's changed)
168
- $(PYTHON ) $(PYFLAGS ) setup.py register -r https://pypi.python.org/pypi
169
166
# build a source archive and upload to PyPI
170
- $(PYTHON ) $( PYFLAGS ) setup.py sdist upload -r https://pypi.python.org/pypi
167
+ $(TWINE ) upload $( DIST_TAR ) $( DIST_WHEEL )
171
168
# build the deb source archive and upload to Raspbian
172
169
dput raspberrypi dist/$(NAME ) _$(VER )$(DEB_SUFFIX ) _source.changes
173
170
dput raspberrypi dist/$(NAME ) _$(VER )$(DEB_SUFFIX ) _$(DEB_ARCH ) .changes
174
171
175
- .PHONY : all install develop test doc source egg zip tar deb dist clean tags release upload $(SUBDIRS )
172
+ .PHONY : all install develop test doc source egg wheel zip tar deb dist clean tags release upload $(SUBDIRS )
176
173
0 commit comments