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

APPCOM-411: python 3.11 support #22

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
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
7 changes: 3 additions & 4 deletions aiocometd/_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
TITLE = "aiocometd"
DESCRIPTION = "CometD client for asyncio"
KEYWORDS = "asyncio aiohttp comet cometd bayeux push streaming"
URL = "https://github.com/robertmrk/aiocometd"
URL = "https://github.com/hyperscience/aiocometd"
PROJECT_URLS = {
"CI": "https://travis-ci.org/robertmrk/aiocometd",
"Coverage": "https://coveralls.io/github/robertmrk/aiocometd",
"Docs": "http://aiocometd.readthedocs.io/"
}
VERSION = "0.4.5"
AUTHOR = "Róbert Márki"
AUTHOR_EMAIL = "[email protected]"
VERSION = "0.4.5+hs0"
AUTHOR = "Hyperscience"
5 changes: 2 additions & 3 deletions aiocometd/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,7 @@ async def _get_message(self, connection_timeout: Union[int, float]) \
try:
done, pending = await asyncio.wait(
tasks,
return_when=asyncio.FIRST_COMPLETED,
loop=self._loop)
return_when=asyncio.FIRST_COMPLETED)

# cancel all pending tasks
for task in pending:
Expand Down Expand Up @@ -546,7 +545,7 @@ async def _wait_connection_timeout(self, timeout: Union[int, float]) \
try:
await asyncio.wait_for(
self._transport.wait_for_state(TransportState.CONNECTED),
timeout, loop=self._loop
timeout
)
except asyncio.TimeoutError:
break
Expand Down
2 changes: 1 addition & 1 deletion aiocometd/transports/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def _start_connect_task(self, coro: Awaitable[JsonObject]) \
:param coro: Coroutine
:return: Future
"""
self._connect_task = asyncio.ensure_future(coro, loop=self._loop)
self._connect_task = asyncio.ensure_future(coro)
self._connect_task.add_done_callback(self._connect_done)
return self._connect_task

Expand Down
2 changes: 1 addition & 1 deletion aiocometd/transports/long_polling.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, **kwargs: Any) -> None:
super().__init__(**kwargs)

#: semaphore to limit the number of concurrent HTTP connections to 2
self._http_semaphore = asyncio.Semaphore(2, loop=self._loop)
self._http_semaphore = asyncio.Semaphore(2)

async def _send_final_payload(self, payload: Payload, *,
headers: Headers) -> JsonObject:
Expand Down
2 changes: 1 addition & 1 deletion aiocometd/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def defer(coro_func: CoroFunction, delay: Union[int, float, None] = None, *,
async def wrapper(*args: Any, **kwargs: Any) -> Any: \
# pylint: disable=missing-docstring
if delay:
await asyncio.sleep(delay, loop=loop) # type: ignore
await asyncio.sleep(delay) # type: ignore
return await coro_func(*args, **kwargs)

return wrapper
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,17 @@ def read(file_path):
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Framework :: AsyncIO",
"License :: OSI Approved :: MIT License"
],
keywords=metadata["KEYWORDS"],
author=metadata["AUTHOR"],
author_email=metadata["AUTHOR_EMAIL"],
url=metadata["URL"],
project_urls=metadata["PROJECT_URLS"],
license="MIT",
packages=find_packages(exclude=("tests*", "examples")),
python_requires=">=3.6.0",
python_requires=">=3.10.0",
install_requires=INSTALL_REQUIRES,
tests_require=TESTS_REQUIRE,
extras_require={
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py36,py37
envlist = py310,py311,py312

[testenv]
passenv = TRAVIS TRAVIS_*
Expand Down