From b5849731dd53a279af56abbebe116415071512fa Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 25 Jun 2024 14:26:42 -0400 Subject: [PATCH] Cast name and version to strings. --- twine/package.py | 2 +- twine/repository.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/twine/package.py b/twine/package.py index 885b5dad..0845105b 100644 --- a/twine/package.py +++ b/twine/package.py @@ -88,7 +88,7 @@ def __init__( self.metadata = metadata self.python_version = python_version self.filetype = filetype - self.safe_name = _safe_name(metadata.name) + self.safe_name = _safe_name(cast(str, metadata.name)) self.signed_filename = self.filename + ".asc" self.signed_basefilename = self.basefilename + ".asc" self.gpg_signature: Optional[Tuple[str, bytes]] = None diff --git a/twine/repository.py b/twine/repository.py index 6b9397f9..32c54702 100644 --- a/twine/repository.py +++ b/twine/repository.py @@ -223,7 +223,7 @@ def package_is_uploaded( releases = {} self._releases_json_data[safe_name] = releases - packages = releases.get(package.metadata.version, []) + packages = releases.get(cast(str, package.metadata.version), []) for uploaded_package in packages: if uploaded_package["filename"] == package.basefilename: