Add Python 3.14 Beta To Test Matrix (#4825)

Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
This commit is contained in:
Harshil
2025-06-19 22:18:04 +04:00
committed by GitHub
parent 1457679376
commit b15507fc22
5 changed files with 27 additions and 9 deletions
+3 -5
View File
@@ -21,7 +21,7 @@ jobs:
runs-on: ${{matrix.os}}
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14.0-beta.3']
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: False
steps:
@@ -36,7 +36,6 @@ jobs:
- name: Install dependencies
run: |
python -W ignore -m pip install --upgrade pip
python -W ignore -m pip install -U pytest-cov
python -W ignore -m pip install . --group tests
- name: Test with pytest
@@ -59,11 +58,10 @@ jobs:
TO_TEST="test_no_passport.py or test_datetime.py or test_defaults.py or test_jobqueue.py or test_applicationbuilder.py or test_ratelimiter.py or test_updater.py or test_callbackdatacache.py or test_request.py"
pytest -v --cov -k "${TO_TEST}" --junit-xml=.test_report_no_optionals_junit.xml
opt_dep_status=$?
# Test the rest
export TEST_WITH_OPT_DEPS='true'
# need to manually install pytz here, because it's no longer in the optional reqs
pip install .[all] pytz
pip install .[all]
# `-n auto --dist worksteal` uses pytest-xdist to run tests on multiple CPU
# workers. Increasing number of workers has little effect on test duration, but it seems
# to increase flakyness.
@@ -0,0 +1,5 @@
other = "Add Python 3.14 Beta To Test Matrix. *Python 3.14 is not officially supported by PTB yet!*"
[[pull_requests]]
uid = "4825"
author_uid = "harshil21"
closes_threads = []
+14 -2
View File
@@ -36,6 +36,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"httpx >=0.27,<0.29",
@@ -91,7 +92,7 @@ socks = [
]
webhooks = [
# tornado is rather stable, but let's not allow the next major release without prior testing
"tornado~=6.4",
"tornado~=6.5",
]
[dependency-groups]
@@ -99,7 +100,7 @@ tests = [
# required for building the wheels for releases
"build",
# For the test suite
"pytest==8.3.5",
"pytest==8.4.0",
# needed because pytest doesn't come with native support for coroutines as tests
"pytest-asyncio==0.21.2",
# xdist runs tests in parallel
@@ -111,6 +112,10 @@ tests = [
# For testing with timezones. Might not be needed on all systems, but to ensure that unit tests
# run correctly on all systems, we include it here.
"tzdata",
# We've deprecated support pytz, but we still need it for testing that it works with the library.
"pytz",
# Install coverage:
"pytest-cov"
]
docs = [
"chango~=0.4.0; python_version >= '3.12'",
@@ -123,6 +128,13 @@ docs = [
"sphinx-inline-tabs==2023.4.21",
# Temporary. See #4387
"sphinx-build-compatibility @ git+https://github.com/readthedocs/sphinx-build-compatibility.git@58aabc5f207c6c2421f23d3578adc0b14af57047",
# For python 3.14 support, we need a version of pydantic-core >= 2.35.0, since it upgrades the
# rust toolchain, required for building the project. But there isn't a version of pydantic
# which allows that pydantic-core version yet, so we use the latest commit on the
# pydantic repository, which has the required version of pydantic-core.
# This should ideally be done in `chango`'s dependencies. We can remove this once a new pydantic
# version is released.
"pydantic @ git+https://github.com/pydantic/pydantic ; python_version >= '3.14'"
]
all = ["pre-commit", { include-group = "tests" }, { include-group = "docs" }]
+1 -1
View File
@@ -42,7 +42,7 @@ such that tests marked with ``@pytest.mark.xdist_group("name")`` are run on the
.. code-block:: bash
$ pytest -n auto --dist=loadgroup
$ pytest -n auto --dist=worksteal
This will result in a significant speedup, but may cause some tests to fail. If you want to run
the failed tests in isolation, you can use the ``--lf`` flag:
+4 -1
View File
@@ -18,6 +18,7 @@
# along with this program. If not, see [http://www.gnu.org/licenses/].
import datetime as dtm
import inspect
import platform
import re
import pytest
@@ -711,7 +712,9 @@ class TestFilters:
assert not filters.Document.WAV.check_update(update)
assert not filters.Document.AUDIO.check_update(update)
update.message.document.mime_type = "audio/x-wav"
update.message.document.mime_type = (
"audio/x-wav" if int(platform.python_version_tuple()[1]) < 14 else "audio/vnd.wave"
)
assert filters.Document.WAV.check_update(update)
assert filters.Document.AUDIO.check_update(update)
assert not filters.Document.XML.check_update(update)