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 Python 3.12 #508

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
name: Test
strategy:
matrix:
pyver: ['3.8', '3.9', '3.10']
pyver: ['3.8', '3.9', '3.10', '3.11', '3.12']
os: [ubuntu, macos, windows]
include:
- pyver: pypy-3.8
Expand Down
2 changes: 1 addition & 1 deletion aiohttp_debugtoolbar/panels/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_packages(cls) -> List[Dict[str, str]]:
for distribution in Distribution.discover():
name = distribution.metadata["Name"]
dependencies = [d for d in distribution.requires or ()]
url = distribution.metadata["Home-page"]
url = distribution.metadata.get("Home-page")

packages.append(
{
Expand Down
18 changes: 13 additions & 5 deletions tests/test_imports.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import platform
import sys
import time

import pytest

Expand All @@ -14,9 +15,16 @@ def test_import_time(pytester: pytest.Pytester) -> None:
from time to time, but this should provide an early warning if something is
added that significantly increases import time.
"""
r = pytester.run(
sys.executable, "-We", "-c", "import aiohttp_debugtoolbar", timeout=0.6
)
best_time_ms = 1000
cmd = "import time, timeit; time.sleep(1); print(int(timeit.timeit('import aiohttp_debugtoolbar', number=1) * 1000))"
for _ in range(3):
time.sleep(1)
r = pytester.run(sys.executable, "-We", "-X", "importtime", "-c", cmd)

assert not r.stdout.str()
assert not r.stderr.str()
print(r.stderr.str())
assert not r.stderr.str()
runtime_ms = int(r.stdout.str())
if runtime_ms < best_time_ms:
best_time_ms = runtime_ms

assert best_time_ms < 200
Loading