Skip to content

Commit

Permalink
metadata: remove Distribution._local
Browse files Browse the repository at this point in the history
Importing an external module is anti-pattern and very unexpected
behavior. Furthermore, the specific builder implementation we are using
will provision an isolated virtual environmnent and perform the build
there, which is unwanted in various scenarious.

Perhaps there was a time this helper was needed, but we can now
remove this in favor of build.util.project_wheel_metadata[1].

[1] https://github.com/pypa/build/blob/82051d509a87124a46f3766134c11fc8aee9b86a/src/build/util.py#L27

Signed-off-by: Filipe Laíns <lains@riseup.net>
  • Loading branch information
FFY00 committed Oct 30, 2021
1 parent df5e617 commit b5c483a
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions importlib_metadata/__init__.py
Expand Up @@ -576,18 +576,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(zipp.Path(meta.build_as_zip(builder)))

@property
def metadata(self) -> _meta.PackageMetadata:
"""Return the parsed metadata for this Distribution.
Expand Down

0 comments on commit b5c483a

Please sign in to comment.