Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
533ef04740 | ||
|
|
8a3935551b | ||
|
|
1b33c4cac5 | ||
|
|
f734bffc1e | ||
|
|
b40852ec90 | ||
|
|
a232b09fee |
@@ -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 @@
|
||||
__version__ = '0.2.0'
|
||||
__version__ = '0.2.1'
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
@@ -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,5 +1,5 @@
|
||||
[bumpversion]
|
||||
current_version = 0.2.0
|
||||
current_version = 0.2.1
|
||||
commit = True
|
||||
tag = True
|
||||
message = Bump version
|
||||
|
||||
Reference in New Issue
Block a user