Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python 3.11 #216

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions pusher/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,22 @@ 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,
data=request.body,
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()
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand All @@ -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'
yarl==1.9.2; python_version >= '3.10'
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down