Skip to content

Commit

Permalink
Confirm support for Python 3.13.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaugustin committed Aug 11, 2024
1 parent a3ed160 commit 58787cc
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
with:
platforms: all
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v2.20.0
env:
BUILD_EXTENSION: yes
- name: Save wheels
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "pypy-3.9"
- "pypy-3.10"
is_main:
Expand All @@ -78,6 +79,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Install tox
run: pip install tox
- name: Run tests
Expand Down
3 changes: 3 additions & 0 deletions docs/faq/misc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Miscellaneous

.. currentmodule:: websockets

.. Remove this question when dropping Python < 3.13, which provides natively
.. a good error message in this case.
Why do I get the error: ``module 'websockets' has no attribute '...'``?
.......................................................................

Expand Down
2 changes: 1 addition & 1 deletion docs/project/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ New features
See :func:`websockets.asyncio.client.connect` and
:func:`websockets.asyncio.server.serve` for details.

* Validated compatibility with Python 3.12.
* Validated compatibility with Python 3.12 and 3.13.

* Added :doc:`environment variables <../reference/variables>` to configure debug
logs, the ``Server`` and ``User-Agent`` headers, as well as security limits.
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dynamic = ["version", "readme"]

Expand Down
3 changes: 1 addition & 2 deletions src/websockets/asyncio/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,7 @@ async def ping(self, data: Data | None = None) -> Awaitable[None]:

pong_waiter = self.loop.create_future()
# The event loop's default clock is time.monotonic(). Its resolution
# is a bit low on Windows (~16ms). We cannot use time.perf_counter()
# because it doesn't count time elapsed while the process sleeps.
# is a bit low on Windows (~16ms). This is improved in Python 3.13.
ping_timestamp = self.loop.time()
self.pong_waiters[data] = (pong_waiter, ping_timestamp)
self.protocol.send_ping(data)
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ env_list =
py310
py311
py312
py313
coverage
black
ruff
Expand Down

0 comments on commit 58787cc

Please sign in to comment.