10000 bpo-46474: sync with importlib_metadata 4.10.0 by jaraco · Pull Request #30802 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-46474: sync with importlib_metadata 4.10.0 #30802

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 1 commit into from
Jan 23, 2022
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
bpo-46474: Apply changes from importlib_metadata 4.10.0
  • Loading branch information
jaraco committed Jan 22, 2022
commit 8f720d014037afd54cd514ab4b7db3b0f9704954
12 changes: 0 additions & 12 deletions Lib/importlib/metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,18 +571,6 @@ def _discover_resolvers():
)
return filter(None, declared)

@classmethod
def _local(cls, root='.'):
from pep517 import build, meta

system = build.compat_system(root)
builder = functools.partial(
meta.build,
source_dir=root,
system=system,
)
return PathDistribution(zipfile.Path(meta.build_as_zip(builder)))

@property
def metadata(self) -> _meta.PackageMetadata:
"""Return the parsed metadata for this Distribution.
Expand Down
17 changes: 1 addition & 16 deletions Lib/test/test_importlib/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from typing import Dict, Union

try:
from importlib import resources
from importlib import resources # type: ignore

getattr(resources, 'files')
getattr(resources, 'as_file')
Expand Down Expand Up @@ -232,21 +232,6 @@ def setUp(self):
build_files(EggInfoFile.files, prefix=self.site_dir)


class LocalPackage:
files: FilesDef = {
"setup.py": """
import setuptools
setuptools.setup(name="local-pkg", version="2.0.1")
""",
}

def setUp(self):
self.fixtures = contextlib.ExitStack()
self.addCleanup(self.fixtures.close)
self.fixtures.enter_context(tempdir_as_cwd())
build_files(self.files)


def build_files(file_defs, prefix=pathlib.Path()):
"""Build a set of files/directories, as described by the

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Removed private method from ``importlib.metadata.Path``. Sync with
importlib_metadata 4.10.0.
0