Compare commits

..
6 Commits
Author SHA1 Message Date
Joe Rickerby 533ef04740 Bump version 2017-06-11 16:20:44 +01:00
Joe Rickerby 8a3935551b Merge pull request #9 from tgarc/master
add a 'pip install' step before building wheels
2017-06-11 16:20:19 +01:00
tdos.apone 1b33c4cac5 add a 'pip install' step before building wheels 2017-06-03 12:37:13 -05:00
Joe Rickerby f734bffc1e Merge pull request #8 from tgarc/master
fix python 3 support
2017-05-27 18:37:40 +01:00
tdos.apone b40852ec90 fix python 3 support
+ urllib2 doesn't exist in python 3 - import from urllib.request instead

+ for linux builds open docker process with universal_newlines; this
  opens a pipe in 'text' mode using the default preferred encoding
2017-05-27 09:40:34 -05:00
Joe Rickerby a232b09fee Add automatic deployment option to readme
See #5
2017-04-23 13:25:40 +01:00
7 changed files with 38 additions and 15 deletions
+8 -2
View File
@@ -44,7 +44,7 @@ Usage
- os: osx
script:
- pip install cibuildwheel==0.2.0
- pip install cibuildwheel==0.2.1
- cibuildwheel --output-dir wheelhouse
```
@@ -54,7 +54,7 @@ Usage
```
build_script:
- pip install cibuildwheel==0.2.0
- pip install cibuildwheel==0.2.1
- cibuildwheel --output-dir wheelhouse
artifacts:
- path: "wheelhouse\\*.whl"
@@ -211,6 +211,12 @@ Obviously, manual steps are for chumps, so we can automate this a little by usin
> Quick note from me - using S3 as a storage didn't work due to a [bug](https://issues.apache.org/jira/browse/LIBCLOUD-792) in libcloud. Feel free to use my fork of that package that fixes the bug `pip install https://github.com/joerick/libcloud/archive/v1.5.0-s3fix.zip`
### Automatic method
If you don't need much control over the release of a package, you can set up cibuildwheel to deliver the wheels straight to PyPI. This doesn't require any cloud storage to work - you just need to bump the version and tag it.
Check out [this example repo](https://github.com/joerick/cibuildwheel-autopypi-example) for instructions on how to set this up.
It didn't work!
---------------
+1 -1
View File
@@ -1 +1 @@
__version__ = '0.2.0'
__version__ = '0.2.1'
+7 -3
View File
@@ -51,7 +51,10 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
PATH=$PYBIN:$PATH sh -c {before_build}
fi
"$PYBIN/pip" wheel . -w /tmp/linux_wheels
# install the package first to take care of dependencies
"$PYBIN/pip" install .
"$PYBIN/pip" wheel --no-deps . -w /tmp/linux_wheels
done
for whl in /tmp/linux_wheels/*.whl; do
@@ -66,7 +69,8 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
# Install packages and test
for PYBIN in {pybin_paths}; do
# Install the wheel we just built
"$PYBIN/pip" install {package_name} --no-index -f /output
"$PYBIN/pip" install {package_name} \
--upgrade --force-reinstall --no-deps --no-index -f /output
# Install any requirements to run the tests
if [ ! -z "{test_requires}" ]; then
@@ -101,7 +105,7 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
'-v', '%s:/output' % os.path.abspath(output_dir),
docker_image,
'/bin/bash'],
stdin=subprocess.PIPE)
stdin=subprocess.PIPE, universal_newlines=True)
docker_process.communicate(bash_script)
+7 -3
View File
@@ -58,9 +58,12 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
before_build_prepared = prepare_command(before_build, python=python, pip=pip)
shell(shlex.split(before_build_prepared), env=env)
# install the package first to take care of dependencies
shell([pip, 'install', project_dir], env=env)
# build the wheel to temp dir
temp_wheel_dir = '/tmp/tmpwheel%s' % config.version
shell([pip, 'wheel', project_dir, '-w', temp_wheel_dir], env=env)
shell([pip, 'wheel', project_dir, '-w', temp_wheel_dir, '--no-deps'], env=env)
temp_wheel = glob(temp_wheel_dir+'/*.whl')[0]
if temp_wheel.endswith('none-any.whl'):
@@ -72,8 +75,9 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
# rebuild the wheel with shared libraries included and place in output dir
shell(['delocate-wheel', '-w', output_dir, temp_wheel], env=env)
# install the wheel
shell([pip, 'install', package_name, '--no-index', '--find-links', output_dir], env=env)
# now install the package from the generated wheel
shell([pip, 'install', package_name, '--upgrade', '--force-reinstall',
'--no-deps', '--no-index', '--find-links', output_dir], env=env)
# test the wheel
if test_requires:
+13 -4
View File
@@ -1,5 +1,9 @@
from __future__ import print_function
import os, tempfile, subprocess, urllib2, sys
import os, tempfile, subprocess, sys
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
from collections import namedtuple
from .util import prepare_command
@@ -10,7 +14,7 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
run_with_env = os.path.join(tempfile.gettempdir(), 'appveyor_run_with_env.cmd')
if not os.path.exists(run_with_env):
with open(run_with_env, 'wb') as f:
request = urllib2.urlopen('https://github.com/ogrisel/python-appveyor-demo/raw/09a1c8672e5015a74d8f69d07add6ee803c176ec/appveyor/run_with_env.cmd')
request = urlopen('https://github.com/ogrisel/python-appveyor-demo/raw/09a1c8672e5015a74d8f69d07add6ee803c176ec/appveyor/run_with_env.cmd')
f.write(request.read())
def shell(args, env=None, cwd=None):
@@ -62,11 +66,16 @@ def build(project_dir, package_name, output_dir, test_command, test_requires, be
before_build_prepared = prepare_command(before_build, python='python', pip='pip')
shell([before_build_prepared], env=env)
# install the package first to take care of dependencies
shell(['pip', 'install', project_dir], env=env)
# build the wheel
shell(['pip', 'wheel', project_dir, '-w', output_dir], env=env)
shell(['pip', 'wheel', project_dir, '-w', output_dir, '--no-deps'], env=env)
# install the wheel
shell(['pip', 'install', package_name, '--no-index', '-f', output_dir], env=env)
shell(['pip', 'install', package_name, '--upgrade',
'--force-reinstall', '--no-deps', '--no-index', '-f',
output_dir], env=env)
# test the wheel
if test_requires:
+1 -1
View File
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.2.0
current_version = 0.2.1
commit = True
tag = True
message = Bump version
+1 -1
View File
@@ -8,7 +8,7 @@ except ImportError:
setup(
name='cibuildwheel',
version='0.2.0',
version='0.2.1',
description="Build Python wheels on CI with minimal configuration.",
long_description='For readme please see http://github.com/joerick/cibuildwheel',
author="Joe Rickerby",