Merge "Determine wheel names for PyPI uploading"
This commit is contained in:
commit
855ed44997
@ -15,9 +15,18 @@
|
|||||||
# Extract Python package name from setup.cfg
|
# Extract Python package name from setup.cfg
|
||||||
|
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import wheel.bdist_wheel
|
||||||
|
|
||||||
setup_cfg = ConfigParser.SafeConfigParser()
|
setup_cfg = ConfigParser.SafeConfigParser()
|
||||||
setup_cfg.read("setup.cfg")
|
setup_cfg.read("setup.cfg")
|
||||||
distname = setup_cfg.get("metadata", "name")
|
distname = setup_cfg.get("metadata", "name")
|
||||||
assert distname
|
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:
|
if universal:
|
||||||
print("py2.py3")
|
print("py2.py3")
|
||||||
else:
|
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
|
# Look in the setup.cfg to determine if a package name is specified, but
|
||||||
# fall back on the project name if necessary
|
# 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`
|
|| echo $PROJECT`
|
||||||
FILENAME="$DISTNAME-$TAG.tar.gz"
|
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
|
# Look in the setup.cfg to determine if a package name is specified, but
|
||||||
# fall back on the project name if necessary
|
# 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`
|
|| echo $PROJECT`
|
||||||
# Look in the setup.cfg to see if this is a universal wheel or not
|
# 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`
|
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
|
rm -rf *.whl
|
||||||
curl --fail -o $FILENAME http://$TARBALL_SITE/$PROJECT/$FILENAME
|
curl --fail -o $FILENAME http://$TARBALL_SITE/$PROJECT/$FILENAME
|
||||||
|
@ -31,8 +31,14 @@ class openstack_project::pypi_slave (
|
|||||||
include pip
|
include pip
|
||||||
|
|
||||||
package { 'twine':
|
package { 'twine':
|
||||||
ensure => present,
|
ensure => latest,
|
||||||
provider => 'pip',
|
provider => pip,
|
||||||
|
require => Class['pip'],
|
||||||
|
}
|
||||||
|
|
||||||
|
package { 'wheel':
|
||||||
|
ensure => latest,
|
||||||
|
provider => pip,
|
||||||
require => Class['pip'],
|
require => Class['pip'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user