Compare commits

...
9 Commits
Author SHA1 Message Date
Joe Rickerby dbb9bcb4d5 Bump version 2017-06-27 17:48:34 +01:00
Joe Rickerby c585dbd6f3 Remove Python 2.6 support on Linux
See #12 for discussion. Fix #12.
2017-06-27 16:44:41 +01:00
Joe Rickerby fdda1ee2e1 Add changelog to README 2017-06-11 16:32:13 +01:00
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 60 additions and 17 deletions
+30 -2
View File
@@ -44,7 +44,7 @@ Usage
- os: osx
script:
- pip install cibuildwheel==0.2.0
- pip install cibuildwheel==0.3.0
- cibuildwheel --output-dir wheelhouse
```
@@ -54,7 +54,7 @@ Usage
```
build_script:
- pip install cibuildwheel==0.2.0
- pip install cibuildwheel==0.3.0
- 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!
---------------
@@ -234,6 +240,28 @@ Legal note
Since `cibuildwheel` runs the wheel through delocate or auditwheel, it will automatically bundle library dependencies. This is similar to static linking - it might have some licence implications. Check the license for any code you're pulling in to make sure that's allowed.
Changelog
=========
### 0.2.1
11 June 2017
- Changed the build process to install the package before building the wheel - this allows direct dependencies to be installed first (#9, thanks @tgarc!)
- Added Python 3 support for the main process, for systems where Python 3 is the default (#8, thanks @tgarc).
### 0.2.0
13 April 2017
- Added `CIBW_SKIP` option, letting users explicitly skip a build
- Added `CIBW_BEFORE_BUILD` option, letting users run a shell command before the build starts
### 0.1.3
31 March 2017
- First public release!
Contributing
============
+1 -1
View File
@@ -1 +1 @@
__version__ = '0.2.0'
__version__ = '0.3.0'
+7 -5
View File
@@ -12,8 +12,6 @@ except ImportError:
def build(project_dir, package_name, output_dir, test_command, test_requires, before_build, skip):
PythonConfiguration = namedtuple('PythonConfiguration', ['identifier', 'path'])
python_configurations = [
PythonConfiguration(identifier='cp26-manylinux1_x86_64', path='/opt/python/cp26-cp26m'),
PythonConfiguration(identifier='cp26-manylinux1_x86_64', path='/opt/python/cp26-cp26mu'),
PythonConfiguration(identifier='cp27-manylinux1_x86_64', path='/opt/python/cp27-cp27m'),
PythonConfiguration(identifier='cp27-manylinux1_x86_64', path='/opt/python/cp27-cp27mu'),
PythonConfiguration(identifier='cp33-manylinux1_x86_64', path='/opt/python/cp33-cp33m'),
@@ -51,7 +49,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 +67,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 +103,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.3.0
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.3.0',
description="Build Python wheels on CI with minimal configuration.",
long_description='For readme please see http://github.com/joerick/cibuildwheel',
author="Joe Rickerby",