Skip to content

Replace the remaining uses of pkg_resources with packaging and importlib_metadata. #736

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 19 commits into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
🧎‍♀️ Genuflect to the types.
Suppress typecheck failures in importlib_metadata.
  • Loading branch information
jaraco committed Feb 28, 2021
commit 0a2111fe4587da1bcf0d43e272fc738e45cdb081
2 changes: 1 addition & 1 deletion twine/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def list_dependencies_and_versions() -> List[Tuple[str, str]]:
"requests-toolbelt",
"tqdm",
)
return [(dep, version(dep)) for dep in deps]
return [(dep, version(dep)) for dep in deps] # type: ignore


def dep_versions() -> str:
Expand Down
4 changes: 3 additions & 1 deletion twine/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ def from_filename(cls, filename: str, comment: Optional[str]) -> "PackageFile":

py_version: Optional[str]
if dtype == "bdist_egg":
(dist,) = importlib_metadata.Distribution.discover(path=[filename])
(dist,) = importlib_metadata.Distribution.discover(
path=[filename]
) # type: ignore
py_version = dist.metadata["Version"]
elif dtype == "bdist_wheel":
py_version = meta.py_version
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy