diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eaa6a64..18bfbba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Prepare tag @@ -35,7 +35,7 @@ jobs: needs: check-release-tag if: ${{ needs.check-release-tag.outputs.tag }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Prepare tag run: | export TAG=v$(awk '/VERSION =/ { gsub("'"\'"'",""); print $3 }' pusher/version.py) @@ -63,7 +63,7 @@ jobs: runs-on: ubuntu-latest needs: create-github-release steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: '3.10' diff --git a/.github/workflows/release_pr.yml b/.github/workflows/release_pr.yml index 191cb25..83a3e30 100644 --- a/.github/workflows/release_pr.yml +++ b/.github/workflows/release_pr.yml @@ -11,13 +11,13 @@ jobs: name: Prepare release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Get current version shell: bash run: | CURRENT_VERSION=$(awk '/VERSION =/ { gsub("'"\'"'",""); print $3 }' pusher/version.py) echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: repository: pusher/public_actions path: .github/actions diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5614e1b..1b0752c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,24 +5,28 @@ on: push: branches: [master, main] +env: + FORCE_COLOR: 1 + jobs: test: runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: - python: [2.7, 3.6, 3.7, 3.8, "3.10"] + python: ["2.7", "3.6", "3.7", "3.8", "3.10", "3.11"] name: Python ${{ matrix.python }} Test steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} + cache: pip - name: Install dependencies run: pip install -r requirements.txt diff --git a/pusher/aiohttp.py b/pusher/aiohttp.py index 12cd870..b5d78f1 100644 --- a/pusher/aiohttp.py +++ b/pusher/aiohttp.py @@ -20,13 +20,11 @@ def __init__(self, client): """ self.client = client - - @asyncio.coroutine - def send_request(self, request): + async def send_request(self, request): session = response = None try: session = aiohttp.ClientSession() - response = yield from session.request( + response = await session.request( request.method, "%s%s" % (request.base_url, request.path), params=request.query_params, @@ -34,10 +32,10 @@ def send_request(self, request): headers=request.headers, timeout=self.client.timeout ) - body = yield from response.text('utf-8') + body = await response.text('utf-8') return process_response(response.status, body) finally: if response is not None: response.close() if session is not None: - yield from session.close() + await session.close() diff --git a/requirements.txt b/requirements.txt index 7cdd39b..be67539 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,7 @@ requests==2.22.0; python_version < '3.10' six==1.12.0; python_version < '3.10' urllib3==1.25.9; python_version < '3.10' aiohttp==3.5.4; python_version >= '3.5' and python_version < '3.10' -aiohttp==3.8.1; python_version >= '3.10' +aiohttp==3.8.5; python_version >= '3.10' aiosignal==1.2.0; python_version >= '3.10' async-timeout==3.0.1; python_version >= '3.5' and python_version < '3.10' async-timeout==4.0.2; python_version >= '3.10' @@ -26,7 +26,7 @@ attrs==21.4.0; python_version >= '3.10' certifi==2021.10.8; python_version >= '3.10' charset-normalizer==2.0.12; python_version >= '3.10' cryptography==37.0.1; python_version >= '3.10' -frozenlist==1.3.0; python_version >= '3.10' +frozenlist==1.4.0; python_version >= '3.10' httpretty==1.1.4; python_version >= '3.10' idna-ssl==1.1.0; python_version >= '3.5' and python_version < '3.7' idna==3.3; python_version >= '3.10' @@ -42,4 +42,4 @@ tornado==5.1.1; python_version < '3.5' tornado==6.0.2; python_version >= '3.5' and python_version < '3.10' urllib3==1.26.9; python_version >= '3.10' yarl==1.3.0; python_version >= '3.5' and python_version < '3.10' -yarl==1.7.2; python_version >= '3.10' \ No newline at end of file +yarl==1.9.2; python_version >= '3.10' diff --git a/setup.py b/setup.py index eba5109..de673ef 100644 --- a/setup.py +++ b/setup.py @@ -14,8 +14,8 @@ setup( name='pusher', version=VERSION, - description='A Python library to interract with the Pusher Channels API', - long_description='A Python library to interract with the Pusher Channels API', + description='A Python library to interact with the Pusher Channels API', + long_description='A Python library to interact with the Pusher Channels API', long_description_type='text/x-rst', url='https://github.com/pusher/pusher-http-python', author='Pusher',