Release 1.2.2

Produce a Pure Python Wheel instead of a source distribution for Linux.
This speeds up installation and simplifies distribution building.

	* setup.py: Drop support for sdist; add support for bdist_wheel
    without --plat-name switch; persist README.rst; increment version
	* dtls/__init__.py: Increment version
incoming
Ray 2017-04-10 17:54:29 -07:00
parent 0525a1e8b7
commit 0d6ee12121
3 changed files with 48 additions and 31 deletions

View File

@ -1,3 +1,12 @@
2017-04-10 Ray Brown <code@liquibits.com>
Release 1.2.2
Produce a Pure Python Wheel instead of a source distribution for Linux. This speeds up installation and simplifies distribution building.
* setup.py: Drop support for sdist; add support for bdist_wheel without --plat-name switch; persist README.rst; increment version
* dtls/__init__.py: Increment version
2017-04-06 Ray Brown <code@liquibits.com> 2017-04-06 Ray Brown <code@liquibits.com>
Installation Fixes and Improvements Installation Fixes and Improvements

View File

@ -32,7 +32,7 @@ sockets.
wrap_socket's parameters and their semantics have been maintained. wrap_socket's parameters and their semantics have been maintained.
""" """
VERSION = 1, 2, 0 VERSION = 1, 2, 2
def _prep_bins(): def _prep_bins():
""" """

View File

@ -29,11 +29,11 @@ from pickle import dump, load
from setuptools import setup from setuptools import setup
NAME = "Dtls" NAME = "Dtls"
VERSION = "1.2.0" VERSION = "1.2.2"
if __name__ == "__main__": if __name__ == "__main__":
# Full upload sequence for new version: # Full upload sequence for new version:
# 1. python setup.py sdist # 1. python setup.py bdist_wheel
# 2. python setup.py bdist_wheel -p win32 # 2. python setup.py bdist_wheel -p win32
# 3. python setup.py bdist_wheel -p win_amd64 # 3. python setup.py bdist_wheel -p win_amd64
# 4. twine upload dist/* # 4. twine upload dist/*
@ -43,16 +43,19 @@ if __name__ == "__main__":
parser.add_argument("command", nargs="*") parser.add_argument("command", nargs="*")
parser.add_argument("-p", "--plat-name") parser.add_argument("-p", "--plat-name")
args = parser.parse_known_args()[0] args = parser.parse_known_args()[0]
sdist = "sdist" in args.command and not args.help dist = "bdist_wheel" in args.command and not args.help
bdist = "bdist_wheel" in args.command and not args.help plat_dist = dist and args.plat_name
if sdist or bdist: if dist:
from pypandoc import convert from pypandoc import convert
long_description = convert("README.md", "rst")\ long_description = convert("README.md", "rst")\
.translate({ord("\r"): None}) .translate({ord("\r"): None})
with open("README.rst", "wb") as readme:
readme.write(long_description)
else: else:
long_description = open("README.md").read() long_description = open("README.rst").read()
top_package_plat_files_file = "dtls_package_files" top_package_plat_files_file = "dtls_package_files"
if bdist: if dist:
if plat_dist:
prebuilt_platform_root = "dtls/prebuilt" prebuilt_platform_root = "dtls/prebuilt"
if args.plat_name == "win32": if args.plat_name == "win32":
platform = "win32-x86" platform = "win32-x86"
@ -68,6 +71,8 @@ if __name__ == "__main__":
# Save top_package_plat_files with the distribution archive # Save top_package_plat_files with the distribution archive
with open(top_package_plat_files_file, "wb") as fl: with open(top_package_plat_files_file, "wb") as fl:
dump(top_package_plat_files, fl) dump(top_package_plat_files, fl)
else:
top_package_plat_files = []
else: else:
# Load top_package_files from the distribution archive, if present # Load top_package_files from the distribution archive, if present
try: try:
@ -79,6 +84,7 @@ if __name__ == "__main__":
"LICENSE", "LICENSE",
"README.md", "README.md",
"ChangeLog"] + top_package_plat_files "ChangeLog"] + top_package_plat_files
if dist:
for extra_file in top_package_extra_files: for extra_file in top_package_extra_files:
copy2(extra_file, "dtls") copy2(extra_file, "dtls")
top_package_extra_files = [path.basename(f) top_package_extra_files = [path.basename(f)
@ -108,11 +114,13 @@ if __name__ == "__main__":
"openssl_ca.cnf", "openssl_ca.cnf",
"openssl_server.cnf", "openssl_server.cnf",
"certs/*.pem"]}, "certs/*.pem"]},
data_files=[('', [top_package_plat_files_file])] data_files=[('', [top_package_plat_files_file])] if plat_dist else []
) )
if dist:
remove("README.rst")
for extra_file in top_package_extra_files: for extra_file in top_package_extra_files:
remove("dtls/" + extra_file) remove("dtls/" + extra_file)
if bdist: if plat_dist:
remove(top_package_plat_files_file) remove(top_package_plat_files_file)
rmtree("Dtls.egg-info", True) rmtree("Dtls.egg-info", True)
rmtree("build", True) rmtree("build", True)