From 33d8a7bfc500a8fbd149792d1a6d9cfc1a7884fd Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 12 Aug 2018 13:40:35 +0300 Subject: [PATCH 01/15] Fix #3162: require cython when building from git clone only --- setup.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8db27e18fb6..64a1002b657 100644 --- a/setup.py +++ b/setup.py @@ -12,6 +12,7 @@ if sys.version_info < (3, 5, 3): raise RuntimeError("aiohttp 3.x requires Python 3.5.3+") +here = pathlib.Path(__file__).parent try: from Cython.Build import cythonize @@ -19,6 +20,19 @@ except ImportError: USE_CYTHON = False +if (here / '.git').exists() and not USE_CYTHON: + print("Install cython when building from git clone") + print("pip install cython") + sys.exit(1) + + +if (here / '.git').exists() and not (here / 'vendor/http-parser/README.md'): + print("Install submodules when building from git clone") + print("git submodule init") + print("git submodule update") + sys.exit(2) + + ext = '.pyx' if USE_CYTHON else '.c' @@ -62,7 +76,6 @@ def build_extension(self, ext): raise BuildFailed() -here = pathlib.Path(__file__).parent txt = (here / 'aiohttp' / '__init__.py').read_text('utf-8') try: From ee4ebf9599097db88943e59a6936dee868449102 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 12 Aug 2018 13:48:19 +0300 Subject: [PATCH 02/15] Don't install inself when building docs --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cd9ec216c9e..f0a2573d5d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,7 +43,7 @@ _helpers: <<: *_lint_base install: - *upgrade_python_toolset - - pip install -U -r requirements/ci.txt -r requirements/doc.txt -r requirements/doc-spelling.txt + - pip install -U -r requirements/doc.txt -r requirements/doc-spelling.txt after_failure: cat docs/_build/spelling/output.txt addons: apt: From bb04d42dc9e1ca5da046e99ff5989691e8a1c3ee Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 12 Aug 2018 14:03:15 +0300 Subject: [PATCH 03/15] Simplify git hint --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 64a1002b657..4ad4fb33b92 100644 --- a/setup.py +++ b/setup.py @@ -28,8 +28,7 @@ if (here / '.git').exists() and not (here / 'vendor/http-parser/README.md'): print("Install submodules when building from git clone") - print("git submodule init") - print("git submodule update") + print("git submodule update --init") sys.exit(2) From c6f015fb4ee68ad4e6ec29d204ccdbfe1afeae7b Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 12 Aug 2018 14:12:12 +0300 Subject: [PATCH 04/15] Improve white list --- docs/spelling_wordlist.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt index a5e77ce9d9f..c88ba8f3b95 100644 --- a/docs/spelling_wordlist.txt +++ b/docs/spelling_wordlist.txt @@ -265,6 +265,7 @@ Tf timestamps toolbar toplevel +towncrier tp tuples UI @@ -302,3 +303,4 @@ WSMsgType wss www xxx +yarl From f05f68832e43a533213257b529dd7d89d3fbfd5b Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 12 Aug 2018 14:14:59 +0300 Subject: [PATCH 05/15] Reorganize requirements --- .travis.yml | 2 ++ requirements/ci-wheel.txt | 1 - requirements/dev.txt | 1 + requirements/towncrier.txt | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 requirements/towncrier.txt diff --git a/.travis.yml b/.travis.yml index f0a2573d5d0..ae15ed4b1a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -152,6 +152,8 @@ jobs: - <<: *_doc_base env: - TARGET=towncrier + install: + - pip install -r requirements/towncrier.txt script: - towncrier --yes diff --git a/requirements/ci-wheel.txt b/requirements/ci-wheel.txt index e18ff9aec79..586247075ed 100644 --- a/requirements/ci-wheel.txt +++ b/requirements/ci-wheel.txt @@ -15,7 +15,6 @@ pytest==3.7.1 pytest-cov==2.5.1 pytest-mock==1.10.0 pytest-xdist==1.22.5 -towncrier==18.6.0 tox==3.1.3 twine==1.11.0 yarl==1.2.6 diff --git a/requirements/dev.txt b/requirements/dev.txt index 1d9ae54a91f..ef0fd265024 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,4 +1,5 @@ -r ci.txt +-r requirements/towncrier.txt ipdb==0.11 pytest-sugar==0.9.1 ipython==6.5.0 diff --git a/requirements/towncrier.txt b/requirements/towncrier.txt new file mode 100644 index 00000000000..51e8bcadddf --- /dev/null +++ b/requirements/towncrier.txt @@ -0,0 +1 @@ +towncrier==18.6.0 From a1342c24ffb144fc2e43c69c0ded3b4b06990297 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 12 Aug 2018 14:21:48 +0300 Subject: [PATCH 06/15] Use stderr for error messages --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 4ad4fb33b92..cf5562a4f7f 100644 --- a/setup.py +++ b/setup.py @@ -21,14 +21,14 @@ USE_CYTHON = False if (here / '.git').exists() and not USE_CYTHON: - print("Install cython when building from git clone") - print("pip install cython") + print("Install cython when building from git clone", file=sys.stderr) + print("pip install cython", file=sys.stderr) sys.exit(1) if (here / '.git').exists() and not (here / 'vendor/http-parser/README.md'): - print("Install submodules when building from git clone") - print("git submodule update --init") + print("Install submodules when building from git clone", file=sys.stderr) + print("git submodule update --init", file=sys.stderr) sys.exit(2) From 21b2e8fe2c2fc02b71593987440368edc1ed9f8f Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 12 Aug 2018 14:26:29 +0300 Subject: [PATCH 07/15] Improve error text --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index cf5562a4f7f..a7262ee6585 100644 --- a/setup.py +++ b/setup.py @@ -22,13 +22,15 @@ if (here / '.git').exists() and not USE_CYTHON: print("Install cython when building from git clone", file=sys.stderr) - print("pip install cython", file=sys.stderr) + print("Hint:", file=sys.stderr) + print(" pip install cython", file=sys.stderr) sys.exit(1) if (here / '.git').exists() and not (here / 'vendor/http-parser/README.md'): print("Install submodules when building from git clone", file=sys.stderr) - print("git submodule update --init", file=sys.stderr) + print("Hint:", file=sys.stderr) + print(" git submodule update --init", file=sys.stderr) sys.exit(2) From fc9f4eb113c84466971e2cccd36040cdc2299221 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 12 Aug 2018 18:25:34 +0300 Subject: [PATCH 08/15] Fix build --- .travis.yml | 4 +++- requirements/ci-wheel.txt | 3 +-- requirements/dev.txt | 2 +- requirements/flake.txt | 2 ++ 4 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 requirements/flake.txt diff --git a/.travis.yml b/.travis.yml index ae15ed4b1a4..aa375273ea4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -160,6 +160,8 @@ jobs: - <<: *_lint_base env: - TARGET=flake8 + install: + - pip install -r requirements/flake.txt script: - flake8 aiohttp examples tests @@ -168,7 +170,7 @@ jobs: - TARGET="'dist setup check'" install: - *upgrade_python_toolset - - pip install -r requirements/doc.txt + - pip install -r requirements/ci.txt -r requirements/doc.txt script: - python setup.py check --metadata --restructuredtext --strict --verbose diff --git a/requirements/ci-wheel.txt b/requirements/ci-wheel.txt index 586247075ed..dfb7635db41 100644 --- a/requirements/ci-wheel.txt +++ b/requirements/ci-wheel.txt @@ -1,3 +1,4 @@ +-r flake.txt attrs==18.1.0 async-generator==1.10 async-timeout==3.0.0 @@ -6,9 +7,7 @@ cchardet==2.1.1 chardet==3.0.4 coverage==4.5.1 cython==0.28.5 -flake8==3.5.0 gunicorn==19.8.1 -isort==4.3.4 pyflakes==2.0.0 multidict==4.3.1 pytest==3.7.1 diff --git a/requirements/dev.txt b/requirements/dev.txt index ef0fd265024..3116a6e0783 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,5 +1,5 @@ -r ci.txt --r requirements/towncrier.txt +-r towncrier.txt ipdb==0.11 pytest-sugar==0.9.1 ipython==6.5.0 diff --git a/requirements/flake.txt b/requirements/flake.txt new file mode 100644 index 00000000000..d4b0e33e4f5 --- /dev/null +++ b/requirements/flake.txt @@ -0,0 +1,2 @@ +flake8==3.5.0 +isort==4.3.4 From f6d105265f905305451d6f8417a741dd6d258739 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 12 Aug 2018 22:24:01 +0300 Subject: [PATCH 09/15] Add upgrade_python_toolset --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index aa375273ea4..dbeacf29888 100644 --- a/.travis.yml +++ b/.travis.yml @@ -153,6 +153,7 @@ jobs: env: - TARGET=towncrier install: + - *upgrade_python_toolset - pip install -r requirements/towncrier.txt script: - towncrier --yes @@ -161,6 +162,7 @@ jobs: env: - TARGET=flake8 install: + - *upgrade_python_toolset - pip install -r requirements/flake.txt script: - flake8 aiohttp examples tests From f856d643961be0b793553c591895870dd1207840 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 12 Aug 2018 22:51:56 +0300 Subject: [PATCH 10/15] Extract cython into a separate requirement file --- .travis.yml | 1 + requirements/ci.txt | 2 +- requirements/cython.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 requirements/cython.txt diff --git a/.travis.yml b/.travis.yml index dbeacf29888..92706eac98e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -172,6 +172,7 @@ jobs: - TARGET="'dist setup check'" install: - *upgrade_python_toolset + - pip install -r requirements/cython.txt - pip install -r requirements/ci.txt -r requirements/doc.txt script: - python setup.py check --metadata --restructuredtext --strict --verbose diff --git a/requirements/ci.txt b/requirements/ci.txt index b59d8cafc49..5be88d2f409 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,6 +1,6 @@ setuptools-git==1.2 mypy==0.620; implementation_name=="cpython" --r doc.txt -r ci-wheel.txt +-r doc.txt -e . diff --git a/requirements/cython.txt b/requirements/cython.txt new file mode 100644 index 00000000000..64c06c65b80 --- /dev/null +++ b/requirements/cython.txt @@ -0,0 +1 @@ +cython==0.28.5 From 6a1a1c2d534077918a63c6805bcef992dc5365e6 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 12 Aug 2018 23:05:01 +0300 Subject: [PATCH 11/15] Configure more --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 92706eac98e..009b45600ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -154,6 +154,8 @@ jobs: - TARGET=towncrier install: - *upgrade_python_toolset + - pip install -r requirements/cython.txt + - pip install -r requirements/ci.txt - pip install -r requirements/towncrier.txt script: - towncrier --yes From 189186ebecdad650adc1d696451274c7d6414483 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 19 Aug 2018 12:47:21 +0300 Subject: [PATCH 12/15] Install cython on tests --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 009b45600ef..729a860c31d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ python: install: - &upgrade_python_toolset pip install --upgrade pip wheel setuptools +- pip install -r requirements/cython.txt - pip install -r requirements/ci.txt script: From 01a98e639cd4bea8c7cd6bd07f384206457f1823 Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 19 Aug 2018 12:48:14 +0300 Subject: [PATCH 13/15] Update cython from makefile --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c2474fd6717..be9592b25a9 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,10 @@ all: test -.install-deps: $(shell find requirements -type f) +install-cython: + @pip install -r requirements/cython.txt + +.install-deps: $(shell find requirements -type f) install-cython @pip install -U -r requirements/dev.txt @touch .install-deps From c874bc74127dd59877290047cc04de7b68787d8f Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 19 Aug 2018 16:07:06 +0300 Subject: [PATCH 14/15] Install cython on Windows --- .appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.appveyor.yml b/.appveyor.yml index 950287dc920..7d79701452b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -14,6 +14,7 @@ install: - git submodule update --init --recursive - "tools/build.cmd %PYTHON%\\python.exe -m pip install -U pip wheel setuptools" + - "tools/build.cmd %PYTHON%\\python.exe -m pip install -r requirements/cython.txt" - "tools/build.cmd %PYTHON%\\python.exe -m pip install -r requirements/ci.txt" build: false From 86479c3ecd34a9e475fd37a80293659439e1397f Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Sun, 19 Aug 2018 16:35:07 +0300 Subject: [PATCH 15/15] Add cython requirements to linux wheels --- tools/build-wheels.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/build-wheels.sh b/tools/build-wheels.sh index f65f639299a..34461a00078 100755 --- a/tools/build-wheels.sh +++ b/tools/build-wheels.sh @@ -24,6 +24,7 @@ echo echo echo "Compile wheels" for PYTHON in ${PYTHON_VERSIONS}; do + /opt/python/${PYTHON}/bin/pip install -r /io/requirements/cython.txt /opt/python/${PYTHON}/bin/pip install -r /io/requirements/wheel.txt /opt/python/${PYTHON}/bin/pip wheel /io/ -w /io/dist/ done @@ -59,6 +60,7 @@ for PYTHON in ${PYTHON_VERSIONS}; do echo echo -n "Test $PYTHON: " /opt/python/${PYTHON}/bin/python -c "import platform; print('Building wheel for {platform} platform.'.format(platform=platform.platform()))" + /opt/python/${PYTHON}/bin/pip install -r /io/requirements/cython.txt /opt/python/${PYTHON}/bin/pip install -r /io/requirements/ci-wheel.txt /opt/python/${PYTHON}/bin/pip install "$package_name" --no-index -f file:///io/dist /opt/python/${PYTHON}/bin/py.test /io/tests