Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbb9bcb4d5 | ||
|
|
c585dbd6f3 | ||
|
|
fdda1ee2e1 | ||
|
|
533ef04740 | ||
|
|
8a3935551b | ||
|
|
1b33c4cac5 | ||
|
|
f734bffc1e | ||
|
|
b40852ec90 | ||
|
|
a232b09fee |
@@ -44,7 +44,7 @@ Usage
|
|||||||
- os: osx
|
- os: osx
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- pip install cibuildwheel==0.2.0
|
- pip install cibuildwheel==0.3.0
|
||||||
- cibuildwheel --output-dir wheelhouse
|
- cibuildwheel --output-dir wheelhouse
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ Usage
|
|||||||
|
|
||||||
```
|
```
|
||||||
build_script:
|
build_script:
|
||||||
- pip install cibuildwheel==0.2.0
|
- pip install cibuildwheel==0.3.0
|
||||||
- cibuildwheel --output-dir wheelhouse
|
- cibuildwheel --output-dir wheelhouse
|
||||||
artifacts:
|
artifacts:
|
||||||
- path: "wheelhouse\\*.whl"
|
- 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`
|
> 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!
|
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.
|
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
|
Contributing
|
||||||
============
|
============
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
__version__ = '0.2.0'
|
__version__ = '0.3.0'
|
||||||
|
|||||||
@@ -12,8 +12,6 @@ except ImportError:
|
|||||||
def build(project_dir, package_name, output_dir, test_command, test_requires, before_build, skip):
|
def build(project_dir, package_name, output_dir, test_command, test_requires, before_build, skip):
|
||||||
PythonConfiguration = namedtuple('PythonConfiguration', ['identifier', 'path'])
|
PythonConfiguration = namedtuple('PythonConfiguration', ['identifier', 'path'])
|
||||||
python_configurations = [
|
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-cp27m'),
|
||||||
PythonConfiguration(identifier='cp27-manylinux1_x86_64', path='/opt/python/cp27-cp27mu'),
|
PythonConfiguration(identifier='cp27-manylinux1_x86_64', path='/opt/python/cp27-cp27mu'),
|
||||||
PythonConfiguration(identifier='cp33-manylinux1_x86_64', path='/opt/python/cp33-cp33m'),
|
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}
|
PATH=$PYBIN:$PATH sh -c {before_build}
|
||||||
fi
|
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
|
done
|
||||||
|
|
||||||
for whl in /tmp/linux_wheels/*.whl; do
|
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
|
# Install packages and test
|
||||||
for PYBIN in {pybin_paths}; do
|
for PYBIN in {pybin_paths}; do
|
||||||
# Install the wheel we just built
|
# 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
|
# Install any requirements to run the tests
|
||||||
if [ ! -z "{test_requires}" ]; then
|
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),
|
'-v', '%s:/output' % os.path.abspath(output_dir),
|
||||||
docker_image,
|
docker_image,
|
||||||
'/bin/bash'],
|
'/bin/bash'],
|
||||||
stdin=subprocess.PIPE)
|
stdin=subprocess.PIPE, universal_newlines=True)
|
||||||
|
|
||||||
docker_process.communicate(bash_script)
|
docker_process.communicate(bash_script)
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
before_build_prepared = prepare_command(before_build, python=python, pip=pip)
|
||||||
shell(shlex.split(before_build_prepared), env=env)
|
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
|
# build the wheel to temp dir
|
||||||
temp_wheel_dir = '/tmp/tmpwheel%s' % config.version
|
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]
|
temp_wheel = glob(temp_wheel_dir+'/*.whl')[0]
|
||||||
|
|
||||||
if temp_wheel.endswith('none-any.whl'):
|
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
|
# rebuild the wheel with shared libraries included and place in output dir
|
||||||
shell(['delocate-wheel', '-w', output_dir, temp_wheel], env=env)
|
shell(['delocate-wheel', '-w', output_dir, temp_wheel], env=env)
|
||||||
|
|
||||||
# install the wheel
|
# now install the package from the generated wheel
|
||||||
shell([pip, 'install', package_name, '--no-index', '--find-links', output_dir], env=env)
|
shell([pip, 'install', package_name, '--upgrade', '--force-reinstall',
|
||||||
|
'--no-deps', '--no-index', '--find-links', output_dir], env=env)
|
||||||
|
|
||||||
# test the wheel
|
# test the wheel
|
||||||
if test_requires:
|
if test_requires:
|
||||||
|
|||||||
+13
-4
@@ -1,5 +1,9 @@
|
|||||||
from __future__ import print_function
|
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 collections import namedtuple
|
||||||
|
|
||||||
from .util import prepare_command
|
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')
|
run_with_env = os.path.join(tempfile.gettempdir(), 'appveyor_run_with_env.cmd')
|
||||||
if not os.path.exists(run_with_env):
|
if not os.path.exists(run_with_env):
|
||||||
with open(run_with_env, 'wb') as f:
|
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())
|
f.write(request.read())
|
||||||
|
|
||||||
def shell(args, env=None, cwd=None):
|
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')
|
before_build_prepared = prepare_command(before_build, python='python', pip='pip')
|
||||||
shell([before_build_prepared], env=env)
|
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
|
# 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
|
# 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
|
# test the wheel
|
||||||
if test_requires:
|
if test_requires:
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 0.2.0
|
current_version = 0.3.0
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
message = Bump version
|
message = Bump version
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ except ImportError:
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='cibuildwheel',
|
name='cibuildwheel',
|
||||||
version='0.2.0',
|
version='0.3.0',
|
||||||
description="Build Python wheels on CI with minimal configuration.",
|
description="Build Python wheels on CI with minimal configuration.",
|
||||||
long_description='For readme please see http://github.com/joerick/cibuildwheel',
|
long_description='For readme please see http://github.com/joerick/cibuildwheel',
|
||||||
author="Joe Rickerby",
|
author="Joe Rickerby",
|
||||||
|
|||||||
Reference in New Issue
Block a user