also build wheels

This commit is contained in:
Maximilian Hils 2015-11-29 19:05:58 +01:00
parent 459ab0434f
commit d3570747e8
2 changed files with 28 additions and 15 deletions

View File

@ -14,6 +14,7 @@ import pprint
from zipfile import ZipFile from zipfile import ZipFile
import tarfile import tarfile
import platform import platform
import sys
import click import click
@ -73,7 +74,17 @@ def version(project):
return runpy.run_path(projects[project]["vfile"])["VERSION"] return runpy.run_path(projects[project]["vfile"])["VERSION"]
def sdist_name(project): 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 @contextlib.contextmanager
def empty_pythonpath(): def empty_pythonpath():
@ -170,7 +181,7 @@ def sdist():
subprocess.check_call( subprocess.check_call(
[ [
"python", "./setup.py", "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"] cwd=conf["dir"]
) )
@ -183,7 +194,7 @@ def sdist():
with chdir(DIST_DIR): with chdir(DIST_DIR):
for project, conf in projects.items(): for project, conf in projects.items():
print("Installing %s..." % project) 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...") print("Running binaries...")
for project, conf in projects.items(): for project, conf in projects.items():
@ -262,14 +273,15 @@ def upload_release(username, password, repository):
""" """
for project in projects.keys(): for project in projects.keys():
print("Uploading {} to {}...".format(project, repository)) for f in (sdist_name(project), wheel_name(project)):
print("Uploading {} to {}...".format(f, repository))
subprocess.check_call([ subprocess.check_call([
"twine", "twine",
"upload", "upload",
"-u", username, "-u", username,
"-p", password, "-p", password,
"-r", repository, "-r", repository,
join(DIST_DIR, sdist_name(project)) join(DIST_DIR, f)
]) ])

View File

@ -5,9 +5,10 @@ setup(
version='1.0', version='1.0',
py_modules=['rtool'], py_modules=['rtool'],
install_requires=[ install_requires=[
'click~=6.2', 'click>=6.2',
'twine~=1.6.4', 'twine>=1.6.4',
'virtualenv~=13.1.2', 'virtualenv>=13.1.2',
'wheel>=0.26.0',
], ],
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [