Merge "Determine wheel names for PyPI uploading"

This commit is contained in:
Jenkins 2014-06-06 19:49:14 +00:00 committed by Gerrit Code Review
commit 855ed44997
5 changed files with 22 additions and 7 deletions

@ -15,9 +15,18 @@
# Extract Python package name from setup.cfg
import ConfigParser
import sys
import wheel.bdist_wheel
setup_cfg = ConfigParser.SafeConfigParser()
setup_cfg.read("setup.cfg")
distname = setup_cfg.get("metadata", "name")
assert distname
print(distname)
if not len(sys.argv) or sys.argv[1] == "--tarball":
print(distname)
elif sys.argv[1] == "--wheel":
print(wheel.bdist_wheel.safer_name(distname))
else:
sys.stderr.write("ERROR: Valid options are --tarball and --wheel")
sys.exit(1)

@ -25,4 +25,4 @@ if setup_cfg.has_section("wheel"):
if universal:
print("py2.py3")
else:
print("py27")
print("py2")

@ -23,7 +23,7 @@ TAG=`echo $ZUUL_REF | sed 's/^refs.tags.//'`
# Look in the setup.cfg to determine if a package name is specified, but
# fall back on the project name if necessary
DISTNAME=`/usr/local/jenkins/slave_scripts/pypi-extract-name.py \
DISTNAME=`/usr/local/jenkins/slave_scripts/pypi-extract-name.py --tarball \
|| echo $PROJECT`
FILENAME="$DISTNAME-$TAG.tar.gz"

@ -23,11 +23,11 @@ TAG=`echo $ZUUL_REF | sed 's/^refs.tags.//'`
# Look in the setup.cfg to determine if a package name is specified, but
# fall back on the project name if necessary
DISTNAME=`/usr/local/jenkins/slave_scripts/pypi-extract-name.py \
DISTNAME=`/usr/local/jenkins/slave_scripts/pypi-extract-name.py --wheel \
|| echo $PROJECT`
# Look in the setup.cfg to see if this is a universal wheel or not
WHEELTYPE=`/usr/local/jenkins/slave_scripts/pypi-extract-universal.py`
FILENAME="$DISTNAME-$TAG.$WHEELTYPE-none-any.whl"
FILENAME="$DISTNAME-$TAG-$WHEELTYPE-none-any.whl"
rm -rf *.whl
curl --fail -o $FILENAME http://$TARBALL_SITE/$PROJECT/$FILENAME

@ -31,8 +31,14 @@ class openstack_project::pypi_slave (
include pip
package { 'twine':
ensure => present,
provider => 'pip',
ensure => latest,
provider => pip,
require => Class['pip'],
}
package { 'wheel':
ensure => latest,
provider => pip,
require => Class['pip'],
}