Skip to content

Commit 5b606d1

Browse files
committed
Switch to twine and wheels
Legacy PyPI upload no longer supported, and universal wheels are preferable to the old egg format
1 parent 5ce7a24 commit 5b606d1

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

Makefile

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ PYTHON=python
55
PIP=pip
66
PYTEST=py.test
77
COVERAGE=coverage
8+
TWINE=twine
89
PYFLAGS=
910
DEST_DIR=/
1011

@@ -45,14 +46,14 @@ DOC_SOURCES:=
4546
SUBDIRS:=
4647

4748
# 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
4950
DIST_TAR=dist/$(NAME)-$(VER).tar.gz
5051
DIST_ZIP=dist/$(NAME)-$(VER).zip
5152
DIST_DEB=dist/python-$(NAME)_$(VER)$(DEB_SUFFIX)_all.deb \
5253
dist/python3-$(NAME)_$(VER)$(DEB_SUFFIX)_all.deb \
5354
dist/python-$(NAME)-doc_$(VER)$(DEB_SUFFIX)_all.deb \
5455
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 \
5657
dist/$(NAME)_$(VER)$(DEB_SUFFIX).dsc \
5758
dist/$(NAME)_$(VER)$(DEB_SUFFIX)_source.changes
5859
MAN_PAGES=man/pinout.1 man/remote-gpio.7
@@ -85,15 +86,15 @@ doc: $(DOC_SOURCES)
8586

8687
source: $(DIST_TAR) $(DIST_ZIP)
8788

88-
egg: $(DIST_EGG)
89+
wheel: $(DIST_WHEEL)
8990

9091
zip: $(DIST_ZIP)
9192

9293
tar: $(DIST_TAR)
9394

9495
deb: $(DIST_DEB) $(DIST_DSC)
9596

96-
dist: $(DIST_EGG) $(DIST_DEB) $(DIST_DSC) $(DIST_TAR) $(DIST_ZIP)
97+
dist: $(DIST_WHEEL) $(DIST_DEB) $(DIST_DSC) $(DIST_TAR) $(DIST_ZIP)
9798

9899
develop: tags
99100
@# These have to be done separately to avoid a cockup...
@@ -106,13 +107,11 @@ test:
106107
$(COVERAGE) report --rcfile coverage.cfg
107108

108109
clean:
109-
$(PYTHON) $(PYFLAGS) setup.py clean
110110
dh_clean
111-
rm -fr build/ dist/ $(NAME).egg-info/ tags
111+
rm -fr $(NAME).egg-info/ tags
112112
for dir in $(SUBDIRS); do \
113113
$(MAKE) -C $$dir clean; \
114114
done
115-
find $(CURDIR) -name "*.pyc" -delete
116115

117116
tags: $(PY_SOURCES)
118117
ctags -R --exclude="build/*" --exclude="debian/*" --exclude="docs/*" --languages="Python"
@@ -131,8 +130,8 @@ $(DIST_TAR): $(PY_SOURCES) $(SUBDIRS)
131130
$(DIST_ZIP): $(PY_SOURCES) $(SUBDIRS)
132131
$(PYTHON) $(PYFLAGS) setup.py sdist --formats zip
133132

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
136135

137136
$(DIST_DEB): $(PY_SOURCES) $(SUBDIRS) $(DEB_SOURCES) $(MAN_PAGES)
138137
# build the binary package in the parent directory then rename it to
@@ -161,16 +160,14 @@ changelog: $(PY_SOURCES) $(DOC_SOURCES) $(DEB_SOURCES)
161160
# commit the changes and add a new tag
162161
git commit debian/changelog -m "Updated changelog for release $(VER)"
163162

164-
release: $(PY_SOURCES) $(DOC_SOURCES) $(DIST_DEB) $(DIST_DSC)
163+
release: $(DIST_DEB) $(DIST_DSC) $(DIST_TAR) $(DIST_WHEEL)
165164
git tag -s v$(VER) -m "Release v$(VER)"
166165
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
169166
# 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)
171168
# build the deb source archive and upload to Raspbian
172169
dput raspberrypi dist/$(NAME)_$(VER)$(DEB_SUFFIX)_source.changes
173170
dput raspberrypi dist/$(NAME)_$(VER)$(DEB_SUFFIX)_$(DEB_ARCH).changes
174171

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)
176173

debian/clean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
tags
21
dist/
32
build/
43
.pybuild/

0 commit comments

Comments
 (0)