Skip to content

Commit

Permalink
ci: test all supported python and aiohttp versions
Browse files Browse the repository at this point in the history
  • Loading branch information
brycedrennan committed Jan 12, 2024
1 parent 7090590 commit 88e6106
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 66 deletions.
95 changes: 47 additions & 48 deletions .github/workflows/ci-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
#
# This file is autogenerated by pip-compile with python 3.7
# To update, run:
# This file is autogenerated by pip-compile with Python 3.7
# by the following command:
#
# pip-compile --output-file=.github/workflows/ci-requirements.txt .github/workflows/ci-requirements.in setup.py
#
aiohttp==3.8.1
aiohttp==3.8.6
# via aresponses (setup.py)
aiosignal==1.2.0
aiosignal==1.3.1
# via aiohttp
async-timeout==4.0.2
async-timeout==4.0.3
# via aiohttp
asynctest==0.13.0
# via aiohttp
attrs==21.4.0
attrs==23.2.0
# via
# aiohttp
# flake8-eradicate
# pytest
black==22.6.0
black==23.3.0
# via -r .github/workflows/ci-requirements.in
charset-normalizer==2.1.0
charset-normalizer==3.3.2
# via aiohttp
click==8.1.3
click==8.1.7
# via black
coverage[toml]==6.4.1
coverage[toml]==7.2.7
# via
# -r .github/workflows/ci-requirements.in
# pytest-cov
eradicate==2.1.0
eradicate==2.3.0
# via flake8-eradicate
flake8==4.0.1
exceptiongroup==1.2.0
# via pytest
flake8==5.0.4
# via
# -r .github/workflows/ci-requirements.in
# flake8-builtins
Expand All @@ -39,78 +40,78 @@ flake8==4.0.1
# flake8-printf-formatting
# flake8-use-fstring
# pep8-naming
flake8-builtins==1.5.3
flake8-builtins==2.1.0
# via -r .github/workflows/ci-requirements.in
flake8-comprehensions==3.10.0
flake8-comprehensions==3.13.0
# via -r .github/workflows/ci-requirements.in
flake8-eradicate==1.2.1
flake8-eradicate==1.4.0
# via -r .github/workflows/ci-requirements.in
flake8-mutable==1.2.0
# via -r .github/workflows/ci-requirements.in
flake8-plugin-utils==1.3.2
flake8-plugin-utils==1.3.3
# via flake8-pytest-style
flake8-printf-formatting==1.1.2
# via -r .github/workflows/ci-requirements.in
flake8-pytest-style==1.6.0
flake8-pytest-style==1.7.2
# via -r .github/workflows/ci-requirements.in
flake8-use-fstring==1.3
flake8-use-fstring==1.4
# via -r .github/workflows/ci-requirements.in
flake8-variables-names==0.0.5
flake8-variables-names==0.0.6
# via -r .github/workflows/ci-requirements.in
frozenlist==1.3.0
frozenlist==1.3.3
# via
# aiohttp
# aiosignal
idna==3.3
idna==3.6
# via yarl
importlib-metadata==4.2.0
# via
# attrs
# click
# flake8
# flake8-comprehensions
# flake8-eradicate
# flake8-printf-formatting
# pluggy
# pytest
# pytest-randomly
iniconfig==1.1.1
iniconfig==2.0.0
# via pytest
mccabe==0.6.1
mccabe==0.7.0
# via flake8
multidict==6.0.2
multidict==6.0.4
# via
# aiohttp
# yarl
mypy-extensions==0.4.3
mypy-extensions==1.0.0
# via black
packaging==21.3
# via pytest
pathspec==0.9.0
packaging==23.2
# via
# black
# pytest
pathspec==0.11.2
# via black
pep8-naming==0.13.0
pep8-naming==0.13.3
# via -r .github/workflows/ci-requirements.in
platformdirs==2.5.2
platformdirs==4.0.0
# via black
pluggy==1.0.0
# via pytest
py==1.11.0
pluggy==1.2.0
# via pytest
pycodestyle==2.8.0
pycodestyle==2.9.1
# via flake8
pyflakes==2.4.0
pyflakes==2.5.0
# via flake8
pyparsing==3.0.9
# via packaging
pytest==7.1.2
pytest==7.4.4
# via
# -r .github/workflows/ci-requirements.in
# pytest-asyncio
# pytest-cov
# pytest-randomly
pytest-asyncio==0.18.3
pytest-asyncio==0.21.1
# via
# -r .github/workflows/ci-requirements.in
# aresponses (setup.py)
pytest-cov==3.0.0
pytest-cov==4.1.0
# via -r .github/workflows/ci-requirements.in
pytest-randomly==3.12.0
# via -r .github/workflows/ci-requirements.in
Expand All @@ -119,20 +120,18 @@ tomli==2.0.1
# black
# coverage
# pytest
typed-ast==1.5.4
typed-ast==1.5.5
# via black
typing-extensions==4.2.0
typing-extensions==4.7.1
# via
# aiohttp
# async-timeout
# black
# importlib-metadata
# platformdirs
# pytest-asyncio
# yarl
yarl==1.7.2
yarl==1.9.4
# via aiohttp
zipp==3.8.0
zipp==3.15.0
# via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
# setuptools
51 changes: 35 additions & 16 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,50 @@ jobs:
run: |
black --diff .
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.software-versions.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
include:
- python-version: "3.7"
pytest-asyncio-version: "==0.16.0"
- python-version: "3.8"
pytest-asyncio-version: ">=0.17.0"
- python-version: "3.9"
pytest-asyncio-version: ">=0.17.0"
- python-version: "3.10"
pytest-asyncio-version: ">=0.17.0"
software-versions:
- {py: "3.7", aiohttp: "==3.1.*", os: "ubuntu-latest"}
- {py: "3.7", aiohttp: "==3.2.*", os: "ubuntu-latest"}
- {py: "3.7", aiohttp: "==3.3.*", os: "ubuntu-latest"}
- {py: "3.7", aiohttp: "==3.4.*", os: "ubuntu-latest"}
- {py: "3.7", aiohttp: "==3.5.*", os: "ubuntu-latest"}
- {py: "3.7", aiohttp: "==3.6.*", os: "ubuntu-latest"}
- {py: "3.7", aiohttp: "==3.7.*", os: "ubuntu-latest"}
- {py: "3.7", aiohttp: "==3.8.*", os: "ubuntu-latest"}
- {py: "3.8", aiohttp: "==3.6.*", os: "ubuntu-latest"}
- {py: "3.8", aiohttp: "==3.7.*", os: "ubuntu-latest"}
- {py: "3.8", aiohttp: "==3.8.*", os: "ubuntu-latest"}
- {py: "3.8", aiohttp: "==3.9.*", os: "ubuntu-latest"}
- { py: "3.9", aiohttp: "==3.6.*" , os: "ubuntu-latest"}
- { py: "3.9", aiohttp: "==3.7.*" , os: "ubuntu-latest"}
- { py: "3.9", aiohttp: "==3.8.*" , os: "ubuntu-latest"}
- { py: "3.9", aiohttp: "==3.9.*" , os: "ubuntu-latest"}
- { py: "3.10", aiohttp: "==3.7.*" , os: "ubuntu-latest"}
- { py: "3.10", aiohttp: "==3.8.*" , os: "ubuntu-latest"}
- { py: "3.10", aiohttp: "==3.9.*" , os: "ubuntu-latest"}
- { py: "3.11", aiohttp: "==3.7.*" , os: "ubuntu-latest"}
- { py: "3.11", aiohttp: "==3.8.*" , os: "ubuntu-latest"}
- { py: "3.11", aiohttp: "==3.9.*" , os: "ubuntu-latest"}
- { py: "3.12", aiohttp: "==3.7.*" , os: "ubuntu-latest"}
- { py: "3.12", aiohttp: "==3.9.*" , os: "ubuntu-latest"}
- { py: "3.12", aiohttp: ">=3.9" , os: "ubuntu-latest"}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.software-versions.py }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.software-versions.py }}
- name: Install dependencies
env:
PYTEST_ASYNCIO_VERSION: ${{ matrix.pytest-asyncio-version }}
AIOHTTP_VERSION: ${{ matrix.software-versions.aiohttp }}
PIP_DISABLE_PIP_VERSION_CHECK: 1
run: |
python -m pip install --disable-pip-version-check -r .github/workflows/ci-requirements.txt
python -m pip install --disable-pip-version-check pytest-asyncio$PYTEST_ASYNCIO_VERSION
python -m pip install -r .github/workflows/ci-requirements.in
python -m pip install aiohttp$AIOHTTP_VERSION
python -m pip install -e .
- name: Test with pytest
run: |
pytest
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SHELL := /bin/bash
python_version = 3.7.12
python_version = 3.9.18
venv_prefix = aresponses
venv_name = $(venv_prefix)-$(python_version)
pyenv_instructions=https://github.com/pyenv/pyenv#installation
Expand Down
1 change: 0 additions & 1 deletion aresponses/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ def add_local_passthrough(self, repeat=INFINITY):

async def _find_response(self, request):
for i, (route, response) in enumerate(self._responses):

if not await route.matches(request):
continue

Expand Down

0 comments on commit 88e6106

Please sign in to comment.