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,31 +43,36 @@ 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:
prebuilt_platform_root = "dtls/prebuilt" if plat_dist:
if args.plat_name == "win32": prebuilt_platform_root = "dtls/prebuilt"
platform = "win32-x86" if args.plat_name == "win32":
elif args.plat_name == "win_amd64": platform = "win32-x86"
platform = "win32-x86_64" elif args.plat_name == "win_amd64":
platform = "win32-x86_64"
else:
raise ValueError("Unknown platform")
prebuilt_path = prebuilt_platform_root + "/" + platform
config = {"MANIFEST_DIR": prebuilt_path}
execfile(prebuilt_path + "/manifest.pycfg", config)
top_package_plat_files = map(lambda x: prebuilt_path + "/" + x,
config["FILES"])
# Save top_package_plat_files with the distribution archive
with open(top_package_plat_files_file, "wb") as fl:
dump(top_package_plat_files, fl)
else: else:
raise ValueError("Unknown platform") top_package_plat_files = []
prebuilt_path = prebuilt_platform_root + "/" + platform
config = {"MANIFEST_DIR": prebuilt_path}
execfile(prebuilt_path + "/manifest.pycfg", config)
top_package_plat_files = map(lambda x: prebuilt_path + "/" + x,
config["FILES"])
# Save top_package_plat_files with the distribution archive
with open(top_package_plat_files_file, "wb") as fl:
dump(top_package_plat_files, fl)
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,8 +84,9 @@ if __name__ == "__main__":
"LICENSE", "LICENSE",
"README.md", "README.md",
"ChangeLog"] + top_package_plat_files "ChangeLog"] + top_package_plat_files
for extra_file in top_package_extra_files: if dist:
copy2(extra_file, "dtls") for extra_file in top_package_extra_files:
copy2(extra_file, "dtls")
top_package_extra_files = [path.basename(f) top_package_extra_files = [path.basename(f)
for f in top_package_extra_files] for f in top_package_extra_files]
setup(name=NAME, setup(name=NAME,
@ -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 []
) )
for extra_file in top_package_extra_files: if dist:
remove("dtls/" + extra_file) remove("README.rst")
if bdist: for extra_file in top_package_extra_files:
remove(top_package_plat_files_file) remove("dtls/" + extra_file)
rmtree("Dtls.egg-info", True) if plat_dist:
rmtree("build", True) remove(top_package_plat_files_file)
rmtree("Dtls.egg-info", True)
rmtree("build", True)