Skip to content

Commit

Permalink
fix 3.6 support (#936)
Browse files Browse the repository at this point in the history
  • Loading branch information
thehesiod committed May 9, 2022
1 parent d9e1438 commit 4c18d3d
Show file tree
Hide file tree
Showing 25 changed files with 857 additions and 807 deletions.
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[flake8]
# to match longest line in botocore: https://github.com/boto/botocore/blob/develop/botocore/client.py#L730
max-line-length = 88
exclude = .git,__pycache__,.pytest_cache,.venv,*.egg-info,build,dist
21 changes: 10 additions & 11 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,31 @@ on:
- '[0-9].[0-9]+.[0-9]+'

jobs:

test:
name: Test
name: Test ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
pyver: [3.6, 3.8, 3.9]
os: [ubuntu]
python-version: [3.6, 3.8, 3.9]
fail-fast: true
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Python ${{ matrix.pyver }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.pyver }}
python-version: ${{ matrix.python-version }}
# cache: 'pipenv'
- name: Run unittests
env:
COLOR: 'yes'
run: |
pip install -U setuptools pip
pip install -U pipenv codecov
pipenv lock
python -c "import sys; print(f'Python version: {sys.version}')"
python -m pip install -U setuptools pip pipenv codecov
pipenv lock --python ${{ matrix.python-version }}
pipenv sync --dev
pipenv check || true
pipenv graph
Expand Down
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changes
-------
2.3.2 (2022-05-08)
^^^^^^^^^^^^^^^^^^
* fix 3.6 testing and and actually fix 3.6 support

2.3.1 (2022-05-06)
^^^^^^^^^^^^^^^^^^
* fix 3.6 support
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
FLAGS=

flake: checkrst
pipenv run python3 -m flake8 --format=abspath
pipenv run python -m flake8 --format=abspath

test: flake
pipenv run python3 -Wd -m pytest -s -vv $(FLAGS) ./tests/
pipenv run python -Wd -m pytest -s -vv $(FLAGS) ./tests/

vtest:
pipenv run python3 -Wd -X tracemalloc=5 -X faulthandler -m pytest -s -vv $(FLAGS) ./tests/
pipenv run python -Wd -X tracemalloc=5 -X faulthandler -m pytest -s -vv $(FLAGS) ./tests/

checkrst:
pipenv run python3 setup.py check -rms
pipenv run python setup.py check -rms

cov cover coverage: flake
pipenv run python3 -Wd -m pytest -s -vv --cov-report term --cov-report html --cov aiobotocore ./tests
pipenv run python -Wd -m pytest -s -vv --cov-report term --cov-report html --cov aiobotocore ./tests
@echo "open file://`pwd`/htmlcov/index.html"

# BOTO_CONFIG solves https://github.com/travis-ci/travis-ci/issues/7940
mototest:
docker pull alpine
docker pull lambci/lambda:python3.8
BOTO_CONFIG=/dev/null pipenv run python3 -Wd -X tracemalloc=5 -X faulthandler -m pytest -vv -m moto -n auto --cov-report term --cov-report html --cov-report xml --cov=aiobotocore --cov=tests --log-cli-level=DEBUG aiobotocore tests
BOTO_CONFIG=/dev/null pipenv run python -Wd -X tracemalloc=5 -X faulthandler -m pytest -vv -m moto -n auto --cov-report term --cov-report html --cov-report xml --cov=aiobotocore --cov=tests --log-cli-level=DEBUG aiobotocore tests
@echo "open file://`pwd`/htmlcov/index.html"


Expand Down
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pytest = "==6.2.4"
pytest-cov = "==2.11.1"
pytest-asyncio = "==0.14.0"
pytest-xdist = "==2.2.1"
async_exit_stack = {version = "*", markers="python_version < '3.7.0'"}

# this is needed for test_patches
dill = "==0.3.3"
Expand Down
2 changes: 1 addition & 1 deletion aiobotocore/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.3.1'
__version__ = '2.3.2'
5 changes: 5 additions & 0 deletions aiobotocore/_helpers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import inspect

try:
from contextlib import asynccontextmanager # noqa: F401 lgtm[py/unused-import]
except ImportError:
from async_generator import asynccontextmanager # noqa: F401 E501, lgtm[py/unused-import]


async def resolve_awaitable(obj):
if inspect.isawaitable(obj):
Expand Down
3 changes: 1 addition & 2 deletions aiobotocore/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import asyncio
import logging
import json
from contextlib import asynccontextmanager
import inspect

import aiohttp.client_exceptions
Expand All @@ -15,7 +14,7 @@
)
import botocore.awsrequest
import aiobotocore.httpsession

from aiobotocore._helpers import asynccontextmanager

logger = logging.getLogger(__name__)
RETRYABLE_HTTP_ERRORS = (aiohttp.client_exceptions.ClientError, asyncio.TimeoutError)
Expand Down
2 changes: 1 addition & 1 deletion aiobotocore/waiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# WaiterModel is required for client.py import
from botocore.exceptions import ClientError
from botocore.waiter import WaiterModel # noqa: F401, lgtm [py/unused-import]
from botocore.waiter import WaiterModel # noqa: F401 lgtm[py/unused-import]
from botocore.waiter import Waiter, xform_name, logger, WaiterError, \
NormalizedOperationMethod as _NormalizedOperationMethod, is_valid_waiter_error
from botocore.docs.docstring import WaiterDocstring
Expand Down
Empty file added tests/__init__.py
Empty file.
4 changes: 4 additions & 0 deletions tests/_helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
try:
from contextlib import AsyncExitStack # noqa: F401 lgtm[py/unused-import]
except ImportError:
from async_exit_stack import AsyncExitStack # noqa: F401 lgtm[py/unused-import]
Empty file added tests/boto_tests/__init__.py
Empty file.
4 changes: 2 additions & 2 deletions tests/botocore/helpers.py → tests/boto_tests/helpers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from contextlib import asynccontextmanager, AsyncExitStack

import aiobotocore.session
from aiobotocore._helpers import asynccontextmanager
from tests._helpers import AsyncExitStack
from botocore.stub import Stubber


Expand Down
Loading

0 comments on commit 4c18d3d

Please sign in to comment.