Skip to content
This repository was archived by the owner on Sep 22, 2023. It is now read-only.

Commit feb4c74

Browse files
authored
setup: Update dependencies (aiohttp 3.7) (#142)
* test: Temporarily patch aioresponses for unit tests * ci: Update GitHub workflows for better caching and to check towncrier changelog by ourselves * setup: Add requirements/build.txt for the lint-towncrier workflow
1 parent b6512e2 commit feb4c74

File tree

7 files changed

+68
-20
lines changed

7 files changed

+68
-20
lines changed

.github/workflows/lint-flake8.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Lint with flake8
22

3-
on: [push, pull_request]
3+
on: [push]
44

55
jobs:
6-
lint:
6+
lint-flake8:
77

88
runs-on: ubuntu-latest
99
strategy:
@@ -20,10 +20,10 @@ jobs:
2020
uses: actions/cache@v2
2121
with:
2222
path: ~/.cache/pip
23-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
23+
key: lint-flake8-${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
2424
restore-keys: |
25-
${{ runner.os }}-pip-${{ matrix.python-version }}
26-
${{ runner.os }}-pip-
25+
lint-flake8-${{ runner.os }}-pip-${{ matrix.python-version }}
26+
lint-flake8-${{ runner.os }}-pip-
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install -U pip setuptools

.github/workflows/lint-towncrier.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Check existence of news fragment
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
lint-towncrier:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
- name: Set up Python 3.8
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.8
18+
- name: Cache pip packages
19+
uses: actions/cache@v2
20+
with:
21+
path: ~/.cache/pip
22+
key: lint-towncrier-${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.cfg') }}
23+
restore-keys: |
24+
lint-towncrier-${{ runner.os }}-pip-${{ matrix.python-version }}
25+
lint-towncrier-${{ runner.os }}-pip-
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install -U pip setuptools
29+
python -m pip install -U -r requirements/build.txt
30+
- name: Check existence of news fragment
31+
run: |
32+
git fetch --no-tags origin +refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH}
33+
python -m towncrier.check --compare-with=origin/${BASE_BRANCH}
34+
env:
35+
BASE_BRANCH: ${{ github.base_ref }}

.github/workflows/test-pytest.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,25 @@ jobs:
2121
uses: actions/cache@v2
2222
with:
2323
path: ~/.cache/pip
24-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
24+
key: test-pytest-${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
2525
restore-keys: |
26-
${{ runner.os }}-pip-${{ matrix.python-version }}
27-
${{ runner.os }}-pip-
26+
test-pytest-${{ runner.os }}-pip-${{ matrix.python-version }}
27+
test-pytest-${{ runner.os }}-pip-
2828
- name: Install dependencies
2929
run: |
3030
python -m pip install -U pip setuptools
3131
python -m pip install -U -r requirements/test.txt
32+
python <<EOF
33+
# temporary patch until pnuckowski/aioresponses#174 is released or aiohttp is patched.
34+
from pathlib import Path
35+
import aioresponses
36+
p = (Path(aioresponses.__file__).parent / "compat.py")
37+
print(">>> Patching aioresponses #174 manually")
38+
t = p.read_text()
39+
t = t.replace("return StreamReader(protocol, loop=loop)", "return StreamReader(protocol, limit=2 ** 16, loop=loop)")
40+
p.write_text(t)
41+
EOF
42+
shell: bash
3243
- name: Test with pytest
3344
run: |
3445
python -m pytest -v --cov=src -m 'not integration' tests

.github/workflows/typecheck-mypy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Type check with mypy
33
on: [push, pull_request]
44

55
jobs:
6-
typecheck:
6+
typecheck-mypy:
77

88
runs-on: ubuntu-latest
99
strategy:
@@ -20,10 +20,10 @@ jobs:
2020
uses: actions/cache@v2
2121
with:
2222
path: ~/.cache/pip
23-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
23+
key: typecheck-mypy-${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
2424
restore-keys: |
25-
${{ runner.os }}-pip-${{ matrix.python-version }}
26-
${{ runner.os }}-pip-
25+
typecheck-mypy-${{ runner.os }}-pip-${{ matrix.python-version }}
26+
typecheck-mypy-${{ runner.os }}-pip-
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install -U pip setuptools

changes/142.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update dependencies (including aiohttp 3.7.1) and CI workflows to use `towncrier.check` instead of the psf-chronogrphaer app

requirements/build.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-e .[build]

setup.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@
88
]
99
install_requires = [
1010
'backend.ai-cli~=0.4.1',
11-
'aiohttp~=3.6.2',
11+
'aiohttp~=3.7.1',
1212
'aiotusclient~=0.1.3',
1313
'appdirs~=1.4.3',
1414
'async_timeout~=3.0', # to avoid pip10 resolver issue
15-
'attrs>=19.3', # to avoid pip10 resolver issue
16-
'click~=7.1.1',
15+
'attrs>=20.1', # to avoid pip10 resolver issue
16+
'click~=7.1.2',
1717
'colorama~=0.4.3',
18-
'humanize~=1.0.0',
19-
'janus~=0.5.0',
18+
'humanize~=3.1.0',
19+
'janus~=0.6.0',
2020
'multidict~=4.7.4',
2121
'python-dateutil~=2.8.1',
2222
'PyYAML~=5.3.1',
2323
'tabulate~=0.8.6',
2424
'tqdm~=4.48',
25-
'yarl~=1.5.1',
25+
'yarl~=1.6.1',
2626
'typing-extensions~=3.7.4',
2727
]
2828
build_requires = [
@@ -31,11 +31,11 @@
3131
'towncrier>=19.2.0',
3232
]
3333
test_requires = [
34-
'pytest~=5.4.2',
34+
'pytest~=6.1.1',
3535
'pytest-cov',
3636
'pytest-mock',
3737
'pytest-asyncio>=0.12.0',
38-
'aioresponses~=0.6.3',
38+
'aioresponses~=0.7.0',
3939
'asynctest>=0.13; python_version<"3.8"',
4040
'codecov',
4141
]

0 commit comments

Comments
 (0)