Skip to content

CI: try Python 3.15 release candidate (DRAFT — hold until 3.15 GA) - #15105

Draft
priya-sundaram-dev wants to merge 2 commits into
TheAlgorithms:masterfrom
priya-sundaram-dev:python-3.15
Draft

CI: try Python 3.15 release candidate (DRAFT — hold until 3.15 GA)#15105
priya-sundaram-dev wants to merge 2 commits into
TheAlgorithms:masterfrom
priya-sundaram-dev:python-3.15

Conversation

@priya-sundaram-dev

Copy link
Copy Markdown
Contributor

Part of the maintenance experiments requested in #15081.

What this does

Points the CI workflows at the Python 3.15 release candidate (python-version: 3.15, with allow-prereleases: true, which was already enabled) and adds the Programming Language :: Python :: 3.15 trove classifier.

Status: DRAFT until 3.15 GA

Per the request, this stays in DRAFT until Python 3.15 has a production release (early October) — it should not merge before then.

Intentionally minimal

  • requires-python stays >=3.14 (still accurate) and [tool.mypy] python_version stays 3.14 for now, so mypy keeps type-checking against the current stable target. Bumping those is a separate decision for after 3.15 GA.
  • The goal here is to let CI tell us which dependencies don't yet publish cp315 wheels and which tests break on the RC. I'll record the specific failures as comments on this PR as CI reports them.

@algorithms-keeper

Copy link
Copy Markdown

Closing this pull request as invalid

@priya-sundaram-dev, this pull request is being closed as none of the checkboxes have been marked. It is important that you go through the checklist and mark the ones relevant to this pull request. Please read the Contributing guidelines.

If you're facing any problem on how to mark a checkbox, please read the following instructions:

  • Read a point one at a time and think if it is relevant to the pull request or not.
  • If it is, then mark it by putting a x between the square bracket like so: [x]

NOTE: Only [x] is supported so if you have put any other letter or symbol between the brackets, that will be marked as invalid. If that is the case then please open a new pull request with the appropriate changes.

@cclauss

cclauss commented Aug 28, 2026

Copy link
Copy Markdown
Member

algorithms-keeper is a bit strict about its checkboxes!

@cclauss cclauss reopened this Aug 28, 2026
@cclauss cclauss removed the invalid label Aug 28, 2026
@cclauss

cclauss commented Aug 28, 2026

Copy link
Copy Markdown
Member

Pytest says:

ERROR machine_learning/automatic_differentiation.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/crawl_google_results.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/crawl_google_scholar_citation.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/daily_horoscope.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/download_images_from_google_query.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/fetch_jobs.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/fetch_well_rx_price.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/get_amazon_product_data.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/get_imdb_top_250_movies_csv.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/instagram_crawler.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/instagram_pic.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/open_google_results.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/random_anime_character.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'
ERROR web_programming/world_covid19_stats.py - AttributeError: module 'typing' has no attribute 'no_type_check_decorator'

Let's fix those files in this PR to see if we can get our tests to pass.

@priya-sundaram-dev

Copy link
Copy Markdown
Contributor Author

I dug into this one and I don't think the fix lives in those files — here's what I found:

  • grep -rln no_type_check_decorator . across the whole repo returns nothing. None of our code references the removed symbol.
  • All 10 failing modules share the same two third-party imports: httpx and bs4 (BeautifulSoup). That's the common denominator — every failing file imports both, and the AttributeError fires at import time, before any of our code runs.

So this is an upstream dependency reaching for typing.no_type_check_decorator, which 3.15 removed (python/cpython#106309). Editing our web_programming files won't clear it — we'd just be patching the messenger.

Two honest paths, and I'd like your call:

  1. Pin/wait — identify the exact culprit in the httpx/bs4 dep tree and pin to a version that's 3.15-clean (or wait for its release). To pin it down precisely I'd add a one-line diagnostic to this DRAFT's job — python -Ic "import httpx, bs4" with full traceback — so CI prints the offending package + frame instead of just the summary line. That names the fix in one run.
  2. Quarantine for now--ignore=web_programming in the 3.15 job so the rest of the suite reports real 3.15 signal, then lift it once the dep ships a fix.

I lean (1) first to get the culprit's name on record (it's likely one shared transitive dep, so a single pin probably clears all 10), then (2) only if the fix isn't out yet. Want me to push the diagnostic import so we can see exactly which package it is?

@cclauss

cclauss commented Aug 28, 2026

Copy link
Copy Markdown
Member

Please rebase to resolve the git conflicts.

Could no_type_check_decorator be hiding in a dependency? Httpx, which is under maintained? Should we swap out httpx for its replacement https://httpx2.pydantic.dev

Point CI workflows at the 3.15 RC (allow-prereleases already enabled)
and add the 3.15 trove classifier, to document which dependencies and
tests are not yet ready. Must stay in DRAFT until Python 3.15 has a
production release (early October). Requested in TheAlgorithms#15081.
@priya-sundaram-dev

Copy link
Copy Markdown
Contributor Author

Rebased onto master — conflicts resolved (they were the same setup-python steps where #15111 switched to python-version-file; I kept python-version: 3.15 + allow-prereleases: true on the four workflows so this lane actually pins the RC).

On the no_type_check_decorator question — I pulled the full traceback from the failed build, and the culprit isn't httpx (or bs4). The AttributeError is raised inside typing_extensions itself:

no_type_check_decorator = typing.no_type_check_decorator
  ...
  File ".../site-packages/typing_extensions.py", ...
    raise AttributeError(f"module {__name__!r} has no attribute {attr!r}")
E   AttributeError: module 'typing' has no attribute 'no_type_check_decorator'

typing.no_type_check_decorator was deprecated in 3.13 and removed in 3.15 (python/cpython#106309). The pinned typing-extensions==4.13.2 (Apr 2025) still eagerly re-exports it, so any import of typing_extensions blows up at import time. That's why all ~10 failures share the same root: our own from typing_extensions import Self in machine_learning/automatic_differentiation.py, and bs4._typing's import of it (which is what web_programming/* hits via from bs4 import BeautifulSoup). httpx just happens to sit next to bs4 in those files' import lists.

So swapping httpx wouldn't fix it — the from typing_extensions import Self and bs4 paths would still fail. The actual fix is upstream and already released: typing-extensions 4.14.0 explicitly stopped re-exporting the removed names — its changelog reads "Do not attempt to re-export names that have been removed from typing, anticipating the removal of typing.no_type_check_decorator in Python 3.15." (latest is 4.16.0).

Concretely: bump the floor to typing-extensions>=4.14.0 in pyproject.toml and refresh uv.lock (currently pins 4.13.2). I expect that alone to clear all ten import failures. Happy to push that here — but since this draft is on hold until 3.15 GA anyway, I'll wait for your go so we don't touch the lock prematurely.

@cclauss

cclauss commented Aug 28, 2026

Copy link
Copy Markdown
Member

from typing_extensions import Self # noqa: UP035

—> from typing import Self

https://docs.python.org/3/library/typing.html#typing.Self was added in Python 3.11.

We should have not been ignoring ruff rule UP035. https://docs.astral.sh/ruff/rules/deprecated-import

Are we using the most current version of bs4?

@priya-sundaram-dev

Copy link
Copy Markdown
Contributor Author

Good catches on both — the real fix isn't a bigger typing-extensions, it's not importing Self from typing_extensions at all.

from typing import Self + un-ignore UP035 — done in #15113 (kept separate from this DRAFT so it can land on master on its own). requires-python is >=3.14, so typing.Self (3.11+) is always there; the file had from typing_extensions import Self # noqa: UP035, and that # noqa was suppressing exactly the deprecated-import rule that would have told us to switch. That file was the only importer of typing_extensions, so #15113 also drops it from the project dependencies (it stays resolved transitively via beautifulsoup4, so the lock's package set is unchanged). Once #15113 is in, the automatic_differentiation.py import path stops being one of the 3.15 breakages here.

bs4 — no, we're a bit behind. pyproject.toml floors it at >=4.12.3 and uv.lock currently resolves 4.13.4; PyPI latest is 4.15.0. I'd suggest bumping the floor to >=4.15.0 and relocking as its own small PR so the diff is reviewable and we can eyeball any parser-behavior changes on the web_programming/* scrapers — happy to open that next if you'd like.

After #15113 lands the only remaining 3.15 import break should be bs4._typing's own from typing_extensions import ..., which is fixed purely by a fresher bs4/typing-extensions in the lock — so the 3.15 bump on this branch stays a lockfile refresh rather than any source change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants