diff --git a/rtool.py b/rtool.py index 822443816..f901fb648 100644 --- a/rtool.py +++ b/rtool.py @@ -14,6 +14,7 @@ import pprint from zipfile import ZipFile import tarfile import platform +import sys import click @@ -73,7 +74,17 @@ def version(project): return runpy.run_path(projects[project]["vfile"])["VERSION"] def sdist_name(project): - return "{project}-{version}.tar.gz".format(project=project, version=version(project)) + return "{project}-{version}.tar.gz".format( + project=project, + version=version(project) + ) + +def wheel_name(project): + return "{project}-{version}-py{py_version}-none-any.whl".format( + project=project, + version=version(project), + py_version=sys.version_info.major + ) @contextlib.contextmanager def empty_pythonpath(): @@ -170,7 +181,7 @@ def sdist(): subprocess.check_call( [ "python", "./setup.py", - "-q", "sdist", "--dist-dir", DIST_DIR, "--formats=gztar" + "-q", "sdist", "--dist-dir", DIST_DIR, "--formats=gztar", "bdist_wheel", "--dist-dir", DIST_DIR, ], cwd=conf["dir"] ) @@ -183,7 +194,7 @@ def sdist(): with chdir(DIST_DIR): for project, conf in projects.items(): print("Installing %s..." % project) - subprocess.check_call([VENV_PIP, "install", "-q", sdist_name(project)]) + subprocess.check_call([VENV_PIP, "install", "-q", wheel_name(project)]) print("Running binaries...") for project, conf in projects.items(): @@ -262,15 +273,16 @@ def upload_release(username, password, repository): """ for project in projects.keys(): - print("Uploading {} to {}...".format(project, repository)) - subprocess.check_call([ - "twine", - "upload", - "-u", username, - "-p", password, - "-r", repository, - join(DIST_DIR, sdist_name(project)) - ]) + for f in (sdist_name(project), wheel_name(project)): + print("Uploading {} to {}...".format(f, repository)) + subprocess.check_call([ + "twine", + "upload", + "-u", username, + "-p", password, + "-r", repository, + join(DIST_DIR, f) + ]) @cli.command("wizard") diff --git a/setup.py b/setup.py index 2422d7a93..e99c159cf 100644 --- a/setup.py +++ b/setup.py @@ -5,9 +5,10 @@ setup( version='1.0', py_modules=['rtool'], install_requires=[ - 'click~=6.2', - 'twine~=1.6.4', - 'virtualenv~=13.1.2', + 'click>=6.2', + 'twine>=1.6.4', + 'virtualenv>=13.1.2', + 'wheel>=0.26.0', ], entry_points={ 'console_scripts': [