Skip to content

Deprecate pallets stubs #5424

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

Merged
merged 2 commits into from
May 12, 2021
Merged
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
1 change: 1 addition & 0 deletions stubs/Flask/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version = "0.1"
python2 = true
requires = ["types-Jinja2", "types-Werkzeug", "types-click"]
obsolete_since = "2.0"
1 change: 1 addition & 0 deletions stubs/Jinja2/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version = "0.1"
python2 = true
requires = ["types-MarkupSafe"]
obsolete_since = "3.0"
1 change: 1 addition & 0 deletions stubs/MarkupSafe/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
version = "0.1"
python2 = true
obsolete_since = "2.0"
1 change: 1 addition & 0 deletions stubs/Werkzeug/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version = "0.1"
python2 = true
requires = []
obsolete_since = "2.0"
1 change: 1 addition & 0 deletions stubs/click/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
version = "0.1"
python2 = true
obsolete_since = "8.0"
1 change: 1 addition & 0 deletions stubs/itsdangerous/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
version = "0.1"
python2 = true
obsolete_since = "2.0"
5 changes: 2 additions & 3 deletions tests/check_consistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
{"stdlib/@python2/builtins.pyi", "stdlib/@python2/__builtin__.pyi"},
{"stdlib/threading.pyi", "stdlib/_dummy_threading.pyi"},
]
metadata_keys = {"version", "python2", "python3", "requires", "extra_description", "obsolete_since"}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's extra_description? It doesn't seem to be used anywhere else in this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unused at the moment, but I added it in typeshed-internal/stub_uploader#11 for future use.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan to document METADATA.toml, but I need to resolve #5422 first.



def assert_stubs_only(directory):
Expand Down Expand Up @@ -161,9 +162,7 @@ def check_metadata():
major, minor = version.split(".")
assert major.isdigit() and minor.isdigit(), msg
for key in data:
assert key in {
"version", "python2", "python3", "requires"
}, f"Unexpected key {key} for {distribution}"
assert key in metadata_keys, f"Unexpected key {key} for {distribution}"
assert isinstance(data.get("python2", False), bool), f"Invalid python2 value for {distribution}"
assert isinstance(data.get("python3", True), bool), f"Invalid python3 value for {distribution}"
assert isinstance(data.get("requires", []), list), f"Invalid requires value for {distribution}"
Expand Down