Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
183cfc0
Fix pyright errors when checking lib/
srittau Apr 28, 2026
2ce9c39
Revert "Fix pyright errors when checking lib/"
srittau Apr 28, 2026
299eabf
Irrelevant change to trigger CI
srittau Apr 28, 2026
fdb7f35
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 28, 2026
0eee459
Require newer version of pathspec for better type checking
srittau Apr 28, 2026
ae395cb
Specialize PathSpec
srittau Apr 28, 2026
c7e5424
Force type of `data` to not include `Unknown`
srittau Apr 28, 2026
08de8c3
Actually use tomllib for reading metadata
srittau Apr 28, 2026
a86a1ec
Revert "Actually use tomllib for reading metadata"
srittau Apr 28, 2026
a2f6f97
Fix comments
srittau Apr 28, 2026
df8607d
Turn `obsolete-since` into a structured table
srittau Apr 28, 2026
94303d1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 28, 2026
9f21ada
Type fixes
srittau Apr 28, 2026
0bff8a5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 28, 2026
666c163
Merge branch 'main' into structured-obsolete-since
srittau May 2, 2026
7d676be
Revert import reordering
srittau May 2, 2026
c2214bb
Merge branch 'main' into structured-obsolete-since
srittau May 8, 2026
9ea2b02
Fix auth0-python field
srittau May 8, 2026
f35a63e
Merge branch 'main' into structured-obsolete-since
srittau May 18, 2026
7261f10
Fix requests and decorator
srittau May 18, 2026
116c003
Merge remote-tracking branch 'upstream/main' into structured-obsolete…
srittau Jun 8, 2026
744b4cb
Flask-Cors
srittau Jun 8, 2026
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
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ supported:
This defaults to `types-<distribution>` and should only be set in special
cases.
* `upstream-repository` (recommended): The URL of the upstream repository.
* `obsolete-since` (optional): This field is part of our process for
* `obsolete-since` (optional): This table is part of our process for
[removing obsolete third-party libraries](#third-party-library-removal-policy).
It contains the first version of the corresponding library that ships
its own `py.typed` file.
its own `py.typed` file, and the date when that version was released.
* `no-longer-updated` (optional): This field is set to `true` before removing
stubs for other reasons than the upstream library shipping with type
information.
Expand Down
16 changes: 9 additions & 7 deletions lib/ts_utils/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import tomlkit
from packaging.requirements import Requirement
from packaging.specifiers import Specifier
from tomlkit.items import String

from .paths import PYPROJECT_PATH, STUBS_PATH, distribution_path

Expand Down Expand Up @@ -298,12 +297,15 @@ def read_metadata(distribution: str) -> StubMetadata:
assert num_url_path_parts == 2, bad_github_url_msg

obsolete_since = data.get("obsolete-since")
assert isinstance(obsolete_since, (String, type(None)))
if obsolete_since:
comment = obsolete_since.trivia.comment
since_date_string = comment.removeprefix("# Released on ")
since_date = datetime.date.fromisoformat(since_date_string)
obsolete = ObsoleteMetadata(since_version=obsolete_since, since_date=since_date)
assert isinstance(obsolete_since, (dict, type(None)))
if obsolete_since is not None:
obsolete_table: dict[str, object] = obsolete_since
obsolete_since_version = obsolete_table.get("version")
obsolete_since_date = obsolete_table.get("date")
assert isinstance(obsolete_since_version, str)
assert isinstance(obsolete_since_date, str)
since_date = datetime.date.fromisoformat(obsolete_since_date)
obsolete = ObsoleteMetadata(since_version=obsolete_since_version, since_date=since_date)
else:
obsolete = None
no_longer_updated = data.get("no-longer-updated", False)
Expand Down
8 changes: 4 additions & 4 deletions scripts/stubsabot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from dataclasses import dataclass, field
from http import HTTPStatus
from pathlib import Path
from typing import Annotated, Any, ClassVar, Literal, NamedTuple, TypeAlias, TypedDict, TypeVar
from typing import Annotated, Any, ClassVar, Literal, NamedTuple, TypeAlias, TypedDict, TypeVar, cast
from typing_extensions import Self

if sys.version_info >= (3, 11):
Expand Down Expand Up @@ -906,9 +906,9 @@ async def suggest_typeshed_obsolete(obsolete: Obsolete, session: aiohttp.ClientS
async with _repo_lock:
branch_name = f"{BRANCH_PREFIX}/{normalize(obsolete.distribution)}"
subprocess.check_call(["git", "checkout", "-B", branch_name, "origin/main"])
obs_string = tomlkit.string(obsolete.obsolete_since_version)
obs_string.comment(f"Released on {obsolete.obsolete_since_date.date().isoformat()}")
update_metadata(obsolete.distribution, obsolete_since=obs_string)
obsolete_t = cast(dict[str, object], tomlkit.inline_table())
obsolete_t.update({"version": obsolete.obsolete_since_version, "date": obsolete.obsolete_since_date.date().isoformat()})
update_metadata(obsolete.distribution, obsolete_since=obsolete_t)
body = "\n".join(f"{k}: {v}" for k, v in obsolete.links.items())
subprocess.check_call(["git", "commit", "--all", "-m", f"{title}\n\n{body}"])
if action_level <= ActionLevel.local:
Expand Down
2 changes: 1 addition & 1 deletion stubs/Flask-Cors/METADATA.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ version = "6.0.3"
upstream-repository = "https://github.com/corydolphin/flask-cors"
# Requires a version of flask with a `py.typed` file
dependencies = ["Flask>=2.0.0"]
obsolete-since = "6.0.4" # Released on 2026-06-07
obsolete-since = { version = "6.0.4", date = "2026-06-07" }
2 changes: 1 addition & 1 deletion stubs/auth0-python/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "4.10.*"
upstream-repository = "https://github.com/auth0/auth0-python"
dependencies = ["cryptography", "types-requests"]
obsolete-since = "5.4.0" # Released on 2026-05-04
obsolete-since = { version = "5.4.0", date = "2026-05-04" }
2 changes: 1 addition & 1 deletion stubs/binaryornot/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = "0.4.*"
upstream-repository = "https://github.com/binaryornot/binaryornot"
obsolete-since = "0.5.0" # Released on 2026-03-07
obsolete-since = { version = "0.5.0", date = "2026-03-07" }
2 changes: 1 addition & 1 deletion stubs/decorator/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = "5.2.*"
upstream-repository = "https://github.com/micheles/decorator"
obsolete-since = "5.3.0" # Released on 2026-05-17
obsolete-since = { version = "5.3.0", date = "2026-05-17" }
2 changes: 1 addition & 1 deletion stubs/fpdf2/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version = "2.8.4"
upstream-repository = "https://github.com/py-pdf/fpdf2"
dependencies = ["Pillow>=10.3.0"]
obsolete-since = "2.8.6" # Released on 2026-02-19
obsolete-since = { version = "2.8.6", date = "2026-02-19" }

[tool.stubtest]
stubtest-dependencies = ["cryptography"]
2 changes: 1 addition & 1 deletion stubs/icalendar/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version = "6.3.2"
upstream-repository = "https://github.com/collective/icalendar"
dependencies = ["types-python-dateutil", "types-pytz"]
obsolete-since = "7.0.0" # Released on 2026-02-11
obsolete-since = { version = "7.0.0", date = "2026-02-11" }

[tool.stubtest]
stubtest-dependencies = ["pytz"]
2 changes: 1 addition & 1 deletion stubs/requests/METADATA.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extra-description = """\
that must also have `urllib3<2` installed into it, \
you will have to use `types-requests<2.31.0.7`.\
"""
obsolete-since = "2.34.0" # Released on 2026-05-11
obsolete-since = { version = "2.34.0", date = "2026-05-11" }

[tool.stubtest]
extras = ["socks"]
Loading