Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd29d50a

Browse files
committed
Add deploy wheel automation to Travis.
Refs#1555Let testing work in manylinux when test.support isn't installed.If test.support can't be imported many of the stdlib tests cant run either.
1 parentc3d0346 commitd29d50a

23 files changed

+294
-107
lines changed

‎.travis.yml

Lines changed: 117 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ dist: xenial
1111
group:travis_latest
1212
os:linux
1313

14+
1415
env:
1516
global:
1617
-BUILD_RUNTIMES=$HOME/.runtimes
1718
-PYTHONHASHSEED=8675309
19+
-PYTHONUNBUFFERED=1
20+
-PYTHONDONTWRITEBYTECODE=1
1821
-PIP_UPGRADE_STRATEGY=eager
1922
-CC="ccache gcc"
2023
-CCACHE_NOCPP2=true
@@ -28,9 +31,13 @@ env:
2831
-CPPFLAGS="-I$BUILD_LIBS/include -DEV_VERIFY=3"
2932
-LDFLAGS="-L$BUILD_LIBS/lib"
3033
-LD_LIBRARY_PATH="$BUILD_LIBS/lib"
34+
# Uploading built wheels for releases.
35+
# TWINE_PASSWORD is encrypted and stored directly in the
36+
# travis repo settings.
37+
-TWINE_USERNAME="__token__"
3138

3239
# Note that this list is again *manually* expanded
33-
# for the 'cache' stage. The benefit of doing this (instead of
40+
# for the 'build-gevent' stage. The benefit of doing this (instead of
3441
# only listing a single version here, or using a different 'language')
3542
# is that we get separate caches per version. This keeps them small,
3643
# and prevents stepping on each other when we change Python minor
@@ -51,42 +58,50 @@ env:
5158
-TRAVIS_PYTHON_VERSION=pypy3.6
5259
-TRAVIS_PYTHON_VERSION=2.7 GEVENTSETUP_EMBED=0 GEVENTSETUP_EV_VERIFY=3
5360

54-
55-
before_install:
56-
-export PATH=$BUILD_RUNTIMES/snakepit/$TRAVIS_PYTHON_VERSION.d/bin:$PATH
57-
-export G_SITE=$BUILD_RUNTIMES/snakepit/$TRAVIS_PYTHON_VERSION.d/lib/*/site-packages/
58-
# Restore the configure caches
59-
-if [ -f $BUILD_LIBS/config.cache.ares ]; then cp $BUILD_LIBS/config.cache.ares deps/c-ares/config.cache ; fi
60-
-if [ -f $BUILD_LIBS/config.cache.libev ]; then cp $BUILD_LIBS/config.cache.libev deps/libev/config.cache ; fi
61-
-if [ -f $BUILD_LIBS/config.cache.libuv ]; then cp $BUILD_LIBS/config.cache.libuv deps/libuv/config.cache ; fi
62-
63-
before_script:
64-
# Show some details of interest
65-
-python --version
66-
->
67-
python -c "import greenlet; print(greenlet, greenlet.__version__)"
68-
->
69-
python -c "import gevent.core; print(gevent.core.loop)"
70-
->
71-
python -c "import gevent.ares; print(gevent.ares)"
72-
7361
cache:
7462
pip:true
7563
directories:
7664
-$HOME/.venv
7765
-$HOME/.runtimes
7866
-$HOME/.wheelhouse
7967
-$HOME/.ccache
80-
-$HOME/.libs
68+
-$BUILD_LIBS
69+
-$HOME/Library/Caches/pip
8170

8271
before_cache:
8372
-rm -f $HOME/.cache/pip/log/debug.log
8473
# Store the configure caches. Having a cache can speed up c-ares
8574
# configure from 2-3 minutes to 20 seconds.
8675
-mkdir -p $BUILD_LIBS
87-
-cp deps/c-ares/config.cache $BUILD_LIBS/config.cache.ares
88-
-cp deps/libev/config.cache $BUILD_LIBS/config.cache.libev
89-
-cp deps/libuv/config.cache $BUILD_LIBS/config.cache.libuv
76+
-if [ -f deps/c-ares/config.cache ]; then cp deps/c-ares/config.cache $BUILD_LIBS/config.cache.ares ; fi
77+
-if [ -f deps/libev/config.cache ]; then cp deps/libev/config.cache $BUILD_LIBS/config.cache.libev ; fi
78+
-if [ -f deps/libuv/config.cache ]; then cp deps/libuv/config.cache $BUILD_LIBS/config.cache.libuv ; fi
79+
80+
before_install:
81+
-export PATH=$BUILD_RUNTIMES/snakepit/$TRAVIS_PYTHON_VERSION.d/bin:$PATH
82+
-export G_SITE=$BUILD_RUNTIMES/snakepit/$TRAVIS_PYTHON_VERSION.d/lib/*/site-packages/
83+
# Restore the configure caches
84+
-if [ -f $BUILD_LIBS/config.cache.ares ]; then cp $BUILD_LIBS/config.cache.ares deps/c-ares/config.cache ; fi
85+
-if [ -f $BUILD_LIBS/config.cache.libev ]; then cp $BUILD_LIBS/config.cache.libev deps/libev/config.cache ; fi
86+
-if [ -f $BUILD_LIBS/config.cache.libuv ]; then cp $BUILD_LIBS/config.cache.libuv deps/libuv/config.cache ; fi
87+
-|
88+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
89+
whoami
90+
mkdir -p $HOME/Library/Caches/pip
91+
chown -R `whoami` $HOME/Library/Caches/pip
92+
git clone https://github.com/MacPython/terryfy
93+
source terryfy/travis_tools.sh
94+
get_python_environment $TERRYFY_PYTHON venv
95+
unset CC
96+
fi
97+
98+
before_script:
99+
# Show some details of interest
100+
-|
101+
python --version
102+
python -c 'import greenlet; print(greenlet, greenlet.__version__)'
103+
python -c 'import gevent.core; print(gevent.core.loop)'
104+
python -c 'import gevent.ares; print(gevent.ares)'
90105
91106
92107
# Installing is taken care of by the first stage.
@@ -112,15 +127,30 @@ script:
112127

113128
# Submit coverage info
114129
after_success:
115-
-python -m coverage combine
116-
-python -m coverage report -i
117-
-python -m coveralls
130+
-python -m coverage combine || true
131+
-python -m coverage report -i || true
132+
-python -m coveralls || true
133+
-|
134+
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
135+
ls -l dist
136+
twine check dist/*
137+
if [[ $TRAVIS_TAG ]]; then
138+
twine upload --skip-existing dist/*
139+
fi
140+
fi
141+
-|
142+
if [[ -n "$DOCKER_IMAGE" ]]; then
143+
ls -l wheelhouse
144+
twine check wheelhouse/*
145+
if [[ $TRAVIS_TAG ]]; then
146+
twine upload --skip-existing wheelhouse/*
147+
fi
148+
fi
118149
119150
120151
stages:
121152
-build-gevent
122153
-test
123-
-test-ares
124154

125155

126156
jobs:
@@ -139,7 +169,7 @@ jobs:
139169
# First, the build dependencies (see setup.cfg)
140170
# so that we don't have to use build isolation and can better use the cache;
141171
# Note that we can't use -U for cffi and greenlet on PyPy.
142-
- &build-gevent-deps pip install -U setuptools wheel && pip install -U 'cffi;platform_python_implementation=="CPython"' cython 'greenlet;platform_python_implementation=="CPython"'
172+
- &build-gevent-deps pip install -U setuptools wheeltwine&& pip install -U 'cffi;platform_python_implementation=="CPython"' cython 'greenlet;platform_python_implementation=="CPython"'
143173
# Next, build the wheel *in place*. This helps ccache, and also lets us cache the configure
144174
# output (pip install uses a random temporary directory, making this difficult)
145175
-python setup.py bdist_wheel
@@ -194,7 +224,26 @@ jobs:
194224
-python -c 'import gevent.libuv.loop as CF; assert not CF.libuv.LIBUV_EMBED'
195225

196226
# Ok, now we switch to the test stage. These are all in addition
197-
# to the jobs created by the matrix (and should override the `script` command).
227+
# to the jobs created by the matrix (and should override the
228+
# `script` command).
229+
230+
# The manylinux builds and tests.
231+
# These take awhile, so get them started while others proceed in parallel.
232+
-stage:test
233+
name:64-bit manylinux wheels (all Pythons)
234+
services:docker
235+
env:DOCKER_IMAGE=quay.io/pypa/manylinux2010_x86_64
236+
install:docker pull $DOCKER_IMAGE
237+
script:bash scripts/releases/make-manylinux
238+
before_script:pip install -U twine
239+
240+
-stage:test
241+
name:32-bit manylinux wheels (all Pythons)
242+
services:docker
243+
env:DOCKER_IMAGE=quay.io/pypa/manylinux2010_i686 PRE_CMD=linux32
244+
install:docker pull $DOCKER_IMAGE
245+
script:bash scripts/releases/make-manylinux
246+
before_script:pip install -U twine
198247

199248
# Lint the code. Because this is a separate job, even if it fails fast
200249
# the tests will still run. Put it at the top for fast feedback.
@@ -314,6 +363,44 @@ jobs:
314363
# env: TRAVIS_PYTHON_VERSION=pypy3.6
315364
# name: dnspythonpypy36
316365

366+
###
367+
# Python on macOS.
368+
# These take awhile, and tend to gum up the works getting started.
369+
# TODO: maybe these and manylinux builds should be their own stage?
370+
###
371+
372+
# It's important to use 'macpython' builds to get the least
373+
# restrictive wheel tag. It's also important to avoid
374+
# 'homebrew 3' because it floats instead of being a specific
375+
# version.
376+
# TODO: This could probably be better broken into stages and just
377+
# generally added to the matrix.
378+
- &test-base-osx
379+
name:Python 2.7 wheels for MacOS
380+
os:osx
381+
osx_image:xcode11.3
382+
compiler:clang
383+
# We require at least 2.7.15 to upload wheels.
384+
# See https://github.com/zopefoundation/BTrees/issues/113
385+
env:TERRYFY_PYTHON='macpython 2.7.17'
386+
install:
387+
-mkdir -p $BUILD_LIBS/lib
388+
- *build-gevent-deps
389+
-python setup.py bdist_wheel
390+
-pip uninstall -y gevent
391+
-pip install -U --no-compile `ls dist/gevent*whl`[test]
392+
393+
-<<:*test-base-osx
394+
name:Python 3.6 wheels for MacOS
395+
env:TERRYFY_PYTHON='macpython 3.6.8'
396+
397+
-<<:*test-base-osx
398+
name:Python 3.7 wheels for MacOS
399+
env:TERRYFY_PYTHON='macpython 3.7.6'
400+
401+
-<<:*test-base-osx
402+
name:Python 3.8 wheels for MacOS
403+
env:TERRYFY_PYTHON='macpython 3.8.1'
317404

318405
notifications:
319406
email:false

‎_setuputils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,9 @@ def cythonize1(ext):
320320
# libuv
321321
'-Wno-tautological-compare',
322322
'-Wno-implicit-function-declaration',
323+
# libev
324+
'-Wno-unused-value',
325+
'-Wno-macro-redefined',
323326
)
324327

325328
## Distutils extensions

‎appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ environment:
2727
secure:m1SSFQeqMo/O65xd0tKYT5wBnqVHSmX8nWw5aui+i65GWODEkXbRp4QQha9PLNtiQvYBTO4tAkWaimWhEHZyx6Zun/0yEcBmovFkLaLWXKdekIDcX+Oi0aefP1t4yoo8C9amOLMAV/t229P7hzqCUDHB9JHvhOWbBMsCJ4VCIKCCiMObUeSazD4lBwgiwMHHfyfMF+xWs24jc5D/7a/xpSghvzoaoLl/gBDCy1op2tsuAIgJCF0P1YjUP/bzVNqmjMa2bG5pQY5n8mskuTTqdA==
2828

2929

30-
matrix:
30+
matrix:
3131

3232
# Pre-installed Python versions, which Appveyor may upgrade to
3333
# a later point release.

‎docs/changes/1555.feature

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Let CI (Travis and Appveyor) build and upload release wheels for
2+
Windows, macOS and manylinux. As part of this, (a subset of) gevent's
3+
tests can run if the standard library's ``test.support`` module has
4+
been stripped.

‎scripts/releases/make-manylinux

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@
55
set -e
66
export PYTHONUNBUFFERED=1
77
export PYTHONDONTWRITEBYTECODE=1
8+
# Use a fixed hash seed for reproducability
9+
export PYTHONHASHSEED=8675309
10+
# Disable tests that use external network resources;
11+
# too often we get failures to resolve DNS names or failures
12+
# to connect on AppVeyor.
13+
export GEVENTTEST_USE_RESOURCES="-network"
14+
export CI=1
15+
export TRAVIS=true
16+
export GEVENT_MANYLINUX=1
817

918
if [-d /gevent-a-d /opt/python ];then
1019
# Running inside docker
@@ -18,9 +27,13 @@ if [ -d /gevent -a -d /opt/python ]; then
1827
cd /tmp/build
1928
git clone /gevent gevent
2029
cd gevent
21-
PATH=$variant/bin:$PATH$variant/bin/pip wheel. -w dist
30+
PATH=$variant/bin:$PATH$variant/bin/python -mpip wheel. -w dist
2231
auditwheel repair --plat manylinux2010_x86_64 dist/gevent*.whl
2332
cp wheelhouse/gevent*.whl /gevent/wheelhouse
33+
34+
PATH=$variant/bin:$PATH$variant/bin/python -mpip install -U --no-compile`ls dist/gevent*whl`[test]
35+
PATH=$variant/bin:$PATH$variant/bin/python -mgevent.tests
36+
2437
cd /gevent
2538
rm -rf /tmp/build
2639
done
@@ -29,3 +42,4 @@ if [ -d /gevent -a -d /opt/python ]; then
2942
fi
3043

3144
docker run --rm -ti -v"$(pwd):/gevent" quay.io/pypa/manylinux2010_x86_64 /gevent/scripts/releases/$(basename$0)
45+
ls -l wheelhouse

‎src/gevent/_socket3.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,14 @@ def recvmsg(self, *args):
461461

462462
ifhasattr(_socket.socket,'recvmsg_into'):
463463

464-
defrecvmsg_into(self,*args):
464+
defrecvmsg_into(self,buffers,*args):
465465
whileTrue:
466466
try:
467-
returnself._sock.recvmsg_into(*args)
467+
ifargs:
468+
# The C code is sensitive about whether extra arguments are
469+
# passed or not.
470+
returnself._sock.recvmsg_into(buffers,*args)
471+
returnself._sock.recvmsg_into(buffers)
468472
excepterrorasex:
469473
ifex.args[0]!=EWOULDBLOCKorself.timeout==0.0:
470474
raise

‎src/gevent/testing/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
from .skippingimportskipWithoutResource
9090
from .skippingimportskipWithoutExternalNetwork
9191
from .skippingimportskipOnPy2
92+
from .skippingimportskipOnManylinux
9293

9394
from .exceptionimportExpectedException
9495

‎src/gevent/testing/patched_tests_setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,6 +1239,13 @@ def test(*args, **kwargs):
12391239
'test_ssl.BasicSocketTests.test_openssl_version'
12401240
]
12411241

1242+
ifTRAVISandOSX:
1243+
1244+
disabled_tests+= [
1245+
# This sometimes produces OSError: Errno 40: Message too long
1246+
'test_socket.RecvmsgIntoTCPTest.testRecvmsgIntoGenerator',
1247+
]
1248+
12421249
# Now build up the data structure we'll use to actually find disabled tests
12431250
# to avoid a linear scan for every file (it seems the list could get quite large)
12441251
# (First, freeze the source list to make sure it isn't modified anywhere)

‎src/gevent/testing/resources.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ def get_ALL_RESOURCES():
3838
# shouldn't be enabled by default or when asking for "all" resources.
3939
# ALL_RESOURCES is the list of resources enabled by default or with "all" resources.
4040

41-
42-
4341
try:
4442
# 3.6 and 3.7
4543
fromtest.libregrtestimportALL_RESOURCES
@@ -64,7 +62,10 @@ def get_ALL_RESOURCES():
6462
'xpickle'
6563
)
6664

67-
returnlist(ALL_RESOURCES)
65+
returnlist(ALL_RESOURCES)+ [
66+
# Do we test the stdlib monkey-patched?
67+
'gevent_monkey',
68+
]
6869

6970

7071
defparse_resources(resource_str=None):

‎src/gevent/testing/skipping.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def _do_not_skip(reason):
3535
skipOnWindows=_do_not_skip
3636
skipOnAppVeyor=_do_not_skip
3737
skipOnCI=_do_not_skip
38+
skipOnManylinux=_do_not_skip
3839

3940
skipOnPyPy=_do_not_skip
4041
skipOnPyPyOnCI=_do_not_skip
@@ -76,6 +77,8 @@ def _do_not_skip(reason):
7677
ifsysinfo.RUNNING_ON_CI:
7778
skipOnCI=unittest.skip
7879

80+
ifsysinfo.RUNNING_ON_MANYLINUX:
81+
skipOnManylinux=unittest.skip
7982

8083
ifsysinfo.PYPY:
8184
skipOnPyPy=unittest.skip

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp