Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b39eb3

Browse files
authored
Fix deploy (aio-libs#2337)
* Work on deploy Set strict mode for bash files Drop non-aiohttp wheels from dist * Make tests pass
1 parent 96412ae commit 3b39eb3

6 files changed

Lines changed: 45 additions & 31 deletions

File tree

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ jobs:
7777
- docker
7878
script:
7979
- ./tools/run_docker.sh "aiohttp"
80-
- find dist -not -name "*aiohttp*" -delete
8180
deploy:
8281
provider: pypi
8382
# `skip_cleanup: true` is required to preserve binary wheels, built

requirements/ci-wheel.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
pip==9.0.1
2+
flake8==3.4.1
3+
pyflakes==1.6.0
4+
coverage==4.4.1
5+
cchardet==2.1.1
6+
cython==0.27.1
7+
chardet==3.0.4
8+
isort==4.2.15
9+
tox==2.9.1
10+
multidict==3.3.0
11+
async-timeout==2.0.0
12+
pytest==3.2.3
13+
pytest-cov==2.5.1
14+
pytest-mock==1.6.3
15+
gunicorn==19.7.1
16+
twine==1.9.1
17+
yarl==0.13.0
18+
brotlipy==0.7.0
19+
20+
# Using PEP 508 env markers to control dependency on runtimes:
21+
aiodns==1.1.1; platform_system!="Windows" # required c-ares will not build on windows
22+
codecov==2.0.9; platform_system!="Windows" # We only use it in Travis CI
23+
uvloop==0.8.1; python_version>="3.5" and platform_system!="Windows" # MagicStack/uvloop#14

requirements/ci.txt

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,5 @@
11
setuptools-git==1.2
22

33
-r doc.txt
4-
pip==9.0.1
5-
flake8==3.4.1
6-
pyflakes==1.6.0
7-
coverage==4.4.1
8-
cchardet==2.1.1
9-
cython==0.27.1
10-
chardet==3.0.4
11-
isort==4.2.15
12-
tox==2.9.1
13-
multidict==3.3.0
14-
async-timeout==2.0.0
15-
pytest==3.2.3
16-
pytest-cov==2.5.1
17-
pytest-mock==1.6.3
18-
gunicorn==19.7.1
19-
twine==1.9.1
20-
yarl==0.13.0
21-
brotlipy==0.7.0
4+
-r ci-wheel.txt
225
-e .
23-
24-
# Using PEP 508 env markers to control dependency on runtimes:
25-
aiodns==1.1.1; platform_system!="Windows" # required c-ares will not build on windows
26-
codecov==2.0.9; platform_system!="Windows" # We only use it in Travis CI
27-
uvloop==0.8.1; python_version>="3.5" and platform_system!="Windows" # MagicStack/uvloop#14

tests/test_worker.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Tests for aiohttp/worker.py"""
22
import asyncio
3+
import os
34
import pathlib
45
import socket
56
import ssl
@@ -217,8 +218,9 @@ def test__run_ok(worker, loop):
217218
yield from worker._run()
218219

219220
worker.notify.assert_called_with()
220-
worker.log.info.assert_called_with("Parent changed, shutting down: %s",
221-
worker)
221+
if os.getppid() != 1: # not Docker
222+
worker.log.info.assert_called_with("Parent changed, shutting down: %s",
223+
worker)
222224

223225
args, kwargs = loop.create_server.call_args
224226
assert 'ssl' in kwargs
@@ -257,8 +259,9 @@ def test__run_ok_unix_socket(worker, loop):
257259
yield from worker._run()
258260

259261
worker.notify.assert_called_with()
260-
worker.log.info.assert_called_with("Parent changed, shutting down: %s",
261-
worker)
262+
if os.getppid() != 1: # not Docker
263+
worker.log.info.assert_called_with("Parent changed, shutting down: %s",
264+
worker)
262265

263266
args, kwargs = loop.create_unix_server.call_args
264267
assert 'ssl' in kwargs
@@ -374,8 +377,9 @@ def test__run_ok_no_max_requests(worker, loop):
374377
yield from worker._run()
375378

376379
worker.notify.assert_called_with()
377-
worker.log.info.assert_called_with("Parent changed, shutting down: %s",
378-
worker)
380+
if os.getppid() != 1: # not Docker
381+
worker.log.info.assert_called_with("Parent changed, shutting down: %s",
382+
worker)
379383

380384
args, kwargs = loop.create_server.call_args
381385
assert 'ssl' in kwargs

tools/build-wheels.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/bash
2+
set -e
3+
24
PYTHON_VERSIONS="cp34-cp34m cp35-cp35m cp36-cp36m"
35

46
# Avoid creation of __pycache__/*.py[c|o]
@@ -42,6 +44,10 @@ for PYTHON in ${PYTHON_VERSIONS}; do
4244
echo
4345
echo -n "Test $PYTHON: "
4446
/opt/python/${PYTHON}/bin/python -c "import platform;print(platform.platform())"
47+
/opt/python/${PYTHON}/bin/pip install -r /io/requirements/ci-wheel.txt
4548
/opt/python/${PYTHON}/bin/pip install "$package_name" --no-index -f file:///io/dist
4649
/opt/python/${PYTHON}/bin/py.test /io/tests
50+
51+
# clear python cache
52+
find /io -name __pycache__ | xargs rm -rf
4753
done

tools/run_docker.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/bash
2+
set -e
3+
24
package_name="$1"
35
if [ -z "$package_name" ]
46
then
@@ -17,7 +19,7 @@ do
1719
done
1820

1921
echo Creating dist folder with privileges of host-machine user
20-
mkdir dist # This is required to be created with host-machine user privileges
22+
mkdir -p dist # This is required to be created with host-machine user privileges
2123

2224
for arch in x86_64 i686
2325
do
@@ -33,3 +35,5 @@ do
3335

3436
dock_ext_args="" # Reset docker args, just in case
3537
done
38+
39+
find dist -type f -not -name "*aiohttp*" | xargs rm -f

0 commit comments

Comments
 (0)