Skip to content

Commit

Permalink
pkginfo has published types, fix resulting errors
Browse files Browse the repository at this point in the history
includes a change to the format of cached information held about
individual packages
  • Loading branch information
dimbleby committed Jan 6, 2023
1 parent ef89e90 commit a5e2529
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 19 deletions.
16 changes: 8 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ lockfile = "^0.12.2"
# packaging uses calver, so version is unclamped
packaging = ">=20.4"
pexpect = "^4.7.0"
pkginfo = "^1.5"
pkginfo = "^1.9.4"
platformdirs = "^2.5.2"
requests = "^2.18"
requests-toolbelt = ">=0.9.1,<0.11.0"
Expand Down Expand Up @@ -174,7 +174,6 @@ module = [
'cachecontrol.*',
'lockfile.*',
'pexpect.*',
'pkginfo.*',
'requests_toolbelt.*',
'shellingham.*',
'virtualenv.*',
Expand Down
7 changes: 1 addition & 6 deletions src/poetry/inspection/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ def __init__(
name: str | None = None,
version: str | None = None,
summary: str | None = None,
platform: str | None = None,
requires_dist: list[str] | None = None,
requires_python: str | None = None,
files: list[dict[str, str]] | None = None,
Expand All @@ -84,7 +83,6 @@ def __init__(
self.name = name
self.version = version
self.summary = summary
self.platform = platform
self.requires_dist = requires_dist
self.requires_python = requires_python
self.files = files or []
Expand All @@ -102,7 +100,6 @@ def update(self, other: PackageInfo) -> PackageInfo:
self.name = other.name or self.name
self.version = other.version or self.version
self.summary = other.summary or self.summary
self.platform = other.platform or self.platform
self.requires_dist = other.requires_dist or self.requires_dist
self.requires_python = other.requires_python or self.requires_python
self.files = other.files or self.files
Expand All @@ -117,7 +114,6 @@ def asdict(self) -> dict[str, Any]:
"name": self.name,
"version": self.version,
"summary": self.summary,
"platform": self.platform,
"requires_dist": self.requires_dist,
"requires_python": self.requires_python,
"files": self.files,
Expand Down Expand Up @@ -262,7 +258,6 @@ def _from_distribution(
name=dist.name,
version=dist.version,
summary=dist.summary,
platform=dist.supported_platforms,
requires_dist=requirements,
requires_python=dist.requires_python,
)
Expand Down Expand Up @@ -423,6 +418,7 @@ def from_metadata(cls, path: Path) -> PackageInfo | None:
else:
directories = list(cls._find_dist_info(path=path))

dist: pkginfo.BDist | pkginfo.SDist | pkginfo.Wheel
for directory in directories:
try:
if directory.suffix == ".egg-info":
Expand Down Expand Up @@ -460,7 +456,6 @@ def from_package(cls, package: Package) -> PackageInfo:
name=package.name,
version=str(package.version),
summary=package.description,
platform=package.platform,
requires_dist=list(requires),
requires_python=package.python_versions,
files=package.files,
Expand Down
2 changes: 1 addition & 1 deletion src/poetry/repositories/cached_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


class CachedRepository(Repository, ABC):
CACHE_VERSION = parse_constraint("1.1.0")
CACHE_VERSION = parse_constraint("2.0.0")

def __init__(
self, name: str, disable_cache: bool = False, config: Config | None = None
Expand Down
1 change: 0 additions & 1 deletion src/poetry/repositories/legacy_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ def _get_release_info(
name=name,
version=version.text,
summary="",
platform=None,
requires_dist=[],
requires_python=None,
files=[],
Expand Down
1 change: 0 additions & 1 deletion src/poetry/repositories/pypi_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ def _get_release_info(
name=info["name"],
version=info["version"],
summary=info["summary"],
platform=info["platform"],
requires_dist=info["requires_dist"],
requires_python=info["requires_python"],
files=info.get("files", []),
Expand Down

0 comments on commit a5e2529

Please sign in to comment.