Skip to content

Commit

Permalink
Support Python 3.10
Browse files Browse the repository at this point in the history
Now it has been released.
  • Loading branch information
pgjones committed Nov 3, 2021
1 parent 9c7b05e commit 8517557
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
12 changes: 9 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ py39:
image: python:3.9
script:
- pip install tox
- tox -e docs,format,mypy,py39,pep8,setuppy,manifest
- tox -e py39

py310:
image: python:3.10
script:
- pip install tox
- tox -e docs,format,mypy,py310,pep8,setuppy,manifest

pages:
image: python:3.9
image: python:3.10
script:
- pip install sphinx git+https://github.com/pandas-dev/pydata-sphinx-theme.git@master
- python setup.py install
Expand All @@ -31,7 +37,7 @@ pages:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

.h2spec-script: &h2spec-script
image: python:3.9
image: python:3.10
script:
- python3 -m pip install trio .
- cd compliance/h2spec && nohup hypercorn --keyfile key.pem --certfile cert.pem -k $WORKER_CLASS server:App &
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules",
],
Expand Down
7 changes: 2 additions & 5 deletions src/hypercorn/asyncio/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ async def _server_callback(reader: asyncio.StreamReader, writer: asyncio.StreamW
await asyncio.start_server(
_server_callback,
backlog=config.backlog,
loop=loop,
ssl=ssl_context,
sock=sock,
ssl_handshake_timeout=ssl_handshake_timeout,
Expand All @@ -122,9 +121,7 @@ async def _server_callback(reader: asyncio.StreamReader, writer: asyncio.StreamW
sock = _share_socket(sock)

servers.append(
await asyncio.start_server(
_server_callback, backlog=config.backlog, loop=loop, sock=sock
)
await asyncio.start_server(_server_callback, backlog=config.backlog, sock=sock)
)
bind = repr_socket_addr(sock.family, sock.getsockname())
await config.log.info(f"Running on http://{bind} (CTRL + C to quit)")
Expand Down Expand Up @@ -242,7 +239,7 @@ def _cancel_all_tasks(loop: asyncio.AbstractEventLoop) -> None:

for task in tasks:
task.cancel()
loop.run_until_complete(asyncio.gather(*tasks, loop=loop, return_exceptions=True))
loop.run_until_complete(asyncio.gather(*tasks, return_exceptions=True))

for task in tasks:
if not task.cancelled() and task.exception() is not None:
Expand Down
14 changes: 7 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = docs,format,mypy,py37,py38,py39,pep8,setuppy,manifest
envlist = docs,format,mypy,py37,py38,py39,py310,pep8,setuppy,manifest

[testenv]
deps =
Expand All @@ -13,7 +13,7 @@ deps =
commands = pytest --cov=hypercorn {posargs}

[testenv:docs]
basepython = python3.9
basepython = python3.10
deps =
git+https://github.com/pandas-dev/pydata-sphinx-theme.git@master
sphinx
Expand All @@ -23,7 +23,7 @@ commands =
sphinx-build -W --keep-going -b html -d {envtmpdir}/doctrees docs/ docs/_build/html/

[testenv:format]
basepython = python3.9
basepython = python3.10
deps =
black
isort
Expand All @@ -32,7 +32,7 @@ commands =
isort --check --diff src/hypercorn tests

[testenv:pep8]
basepython = python3.9
basepython = python3.10
deps =
flake8
pep8-naming
Expand All @@ -41,15 +41,15 @@ deps =
commands = flake8 src/hypercorn/ tests/

[testenv:mypy]
basepython = python3.9
basepython = python3.10
deps =
mypy
types-toml
commands =
mypy src/hypercorn/ tests/

[testenv:setuppy]
basepython = python3.9
basepython = python3.10
deps =
docutils
Pygments
Expand All @@ -60,6 +60,6 @@ commands =
--strict

[testenv:manifest]
basepython = python3.9
basepython = python3.10
deps = check-manifest
commands = check-manifest

0 comments on commit 8517557

Please sign in to comment.