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

Commit

Permalink
setup: Update dependencies (aiohttp 3.7) (#142)
Browse files Browse the repository at this point in the history
* 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

Backportd-From: master
Backported-To: 20.03
  • Loading branch information
achimnol committed Oct 27, 2020
1 parent 44b006a commit 06b6395
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 21 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/lint-flake8.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Lint with flake8

on: [push, pull_request]
on: [push]

jobs:
lint:
lint-flake8:

runs-on: ubuntu-latest
strategy:
Expand All @@ -20,10 +20,10 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
key: lint-flake8-${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}
${{ runner.os }}-pip-
lint-flake8-${{ runner.os }}-pip-${{ matrix.python-version }}
lint-flake8-${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install -U pip setuptools
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/lint-towncrier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check existence of news fragment

on: [pull_request]

jobs:
lint-towncrier:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Cache pip packages
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: lint-towncrier-${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.cfg') }}
restore-keys: |
lint-towncrier-${{ runner.os }}-pip-${{ matrix.python-version }}
lint-towncrier-${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install -U pip setuptools
python -m pip install -U -r requirements/build.txt
- name: Check existence of news fragment
run: |
git fetch --no-tags origin +refs/heads/${BASE_BRANCH}:refs/remotes/origin/${BASE_BRANCH}
python -m towncrier.check --compare-with=origin/${BASE_BRANCH}
env:
BASE_BRANCH: ${{ github.base_ref }}
17 changes: 14 additions & 3 deletions .github/workflows/test-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,25 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
key: test-pytest-${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}
${{ runner.os }}-pip-
test-pytest-${{ runner.os }}-pip-${{ matrix.python-version }}
test-pytest-${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install -U pip setuptools
python -m pip install -U -r requirements/test.txt
python <<EOF
# temporary patch until pnuckowski/aioresponses#174 is released or aiohttp is patched.
from pathlib import Path
import aioresponses
p = (Path(aioresponses.__file__).parent / "compat.py")
print(">>> Patching aioresponses #174 manually")
t = p.read_text()
t = t.replace("return StreamReader(protocol, loop=loop)", "return StreamReader(protocol, limit=2 ** 16, loop=loop)")
p.write_text(t)
EOF
shell: bash
- name: Test with pytest
run: |
python -m pytest -v --cov=src -m 'not integration' tests
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/typecheck-mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Type check with mypy
on: [push, pull_request]

jobs:
typecheck:
typecheck-mypy:

runs-on: ubuntu-latest
strategy:
Expand All @@ -20,10 +20,10 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
key: typecheck-mypy-${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.py') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}
${{ runner.os }}-pip-
typecheck-mypy-${{ runner.os }}-pip-${{ matrix.python-version }}
typecheck-mypy-${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install -U pip setuptools
Expand Down
1 change: 1 addition & 0 deletions changes/142.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update dependencies (including aiohttp 3.7.1) and CI workflows to use `towncrier.check` instead of the psf-chronogrphaer app
1 change: 1 addition & 0 deletions requirements/build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-e .[build]
18 changes: 9 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
]
install_requires = [
'backend.ai-cli~=0.4.1',
'aiohttp~=3.6.2',
'aiohttp~=3.7.1',
'appdirs~=1.4.3',
'async_timeout~=3.0', # to avoid pip10 resolver issue
'attrs>=19.3', # to avoid pip10 resolver issue
'click~=7.1.1',
'attrs>=20.1', # to avoid pip10 resolver issue
'click~=7.1.2',
'colorama~=0.4.3',
'humanize~=1.0.0',
'humanize~=3.1.0',
'multidict~=4.7.4',
'python-dateutil~=2.8.1',
'PyYAML~=5.3.1',
'tabulate~=0.8.6',
'tqdm~=4.42',
'yarl~=1.4.2',
'tqdm~=4.48',
'yarl~=1.6.1',
'typing-extensions~=3.7.4',
]
build_requires = [
Expand All @@ -29,19 +29,19 @@
'towncrier>=19.2.0',
]
test_requires = [
'pytest~=5.4.2',
'pytest~=6.1.1',
'pytest-cov',
'pytest-mock',
'pytest-asyncio>=0.12.0',
'aioresponses~=0.6.3',
'aioresponses~=0.7.0',
'asynctest>=0.13; python_version<"3.8"',
'codecov',
]
lint_requires = [
'flake8>=3.8.1',
]
typecheck_requires = [
'mypy>=0.770',
'mypy>=0.790',
]
dev_requires: List[str] = [
# 'pytest-sugar>=0.9.1',
Expand Down

0 comments on commit 06b6395

Please sign in to comment.