Skip to content
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

Add backports.zoneinfo to allowed dependencies #145

Merged
merged 4 commits into from
Oct 2, 2024
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
3 changes: 2 additions & 1 deletion stub_uploader/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def verify_typeshed_req(req: Requirement) -> None:
"Pillow",
"Werkzeug",
"arrow",
"backports.zoneinfo", # Remove after we drop Python 3.8 support.
"click",
"cryptography",
"django-stubs",
Expand Down Expand Up @@ -289,7 +290,7 @@ def verify_external_req(

if req.name not in EXTERNAL_REQ_ALLOWLIST and not _unsafe_ignore_allowlist:
raise InvalidRequires(
f"Expected dependency {req} to be present in the allowlist"
f"Expected dependency {req.name} to be present in the stub_uploader allowlist"
)

resp = requests.get(f"https://pypi.org/pypi/{upstream_distribution}/json")
Expand Down
4 changes: 3 additions & 1 deletion tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ def test_verify_external_req() -> None:
Requirement("mypy-extensions"), "mypy", _unsafe_ignore_allowlist=True
)

with pytest.raises(InvalidRequires, match="to be present in the allowlist"):
with pytest.raises(
InvalidRequires, match="to be present in the stub_uploader allowlist"
):
verify_external_req(Requirement("typing-extensions"), "mypy")

m = Metadata("pandas", {"version": "0.1", "requires": ["numpy"]})
Expand Down