GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — metadata: remove Distribution._local by FFY00 · Pull Request #354 · python/importlib_metadata

Conversation

@FFY00

@FFY00 FFY00 commented Oct 30, 2021

Copy link
Copy Markdown
Member

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 [email protected]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

layday reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@FFY00
metadata: remove Distribution._local
ff1bb2e
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 <[email protected]>
@FFY00
FFY00 force-pushed the remove-distribution-local branch from b5c483a to ff1bb2e Compare October 30, 2021 16:33
@jaraco

jaraco commented Nov 14, 2021

Copy link
Copy Markdown
Member

Unfortunately, it doesn't look like build.util.project_wheel_metadata obviates this behavior. For example, the 'metadata' returned only includes the field-based metadata. It doesn't include other files in the metadata such as entry points. It's a lot more difficult to construct the full metadata because it requires multiple files, and to achieve that, pep517 constructs an in-memory zipfile.

Also a bit of a nitpick, but I don't see how "wheel" is relevant to all of these functions. A wheel isn't generated; only the project metadata. I'd like to see a function that doesn't involve irrelevant words like util and wheel to get the metadata.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jaraco
👹 Feed the hobgoblins (delint).
54c0860
@FFY00

FFY00 commented Nov 14, 2021

Copy link
Copy Markdown
Member Author

Unfortunately, it doesn't look like build.util.project_wheel_metadata obviates this behavior. For example, the 'metadata' returned only includes the field-based metadata. It doesn't include other files in the metadata such as entry points. It's a lot more difficult to construct the full metadata because it requires multiple files, and to achieve that, pep517 constructs an in-memory zipfile.

We can introduce further helpers to make that possible.

Also a bit of a nitpick, but I don't see how "wheel" is relevant to all of these functions. A wheel isn't generated; only the project metadata. I'd like to see a function that doesn't involve irrelevant words like util and wheel to get the metadata.

It is the metadata that is generated for the wheel. The name comes from PEP 517.

https://www.python.org/dev/peps/pep-0517/#prepare-metadata-for-build-wheel

A wheel is actually generated as a fallback if the backend does not implement the metadata hook, as recommended.

sdists also contain metadata, which may be different from the wheel, and there is no guarantee that further binary formats that may be introduced in the future must have the same metadata as the wheel.
One way I can imagine this happening is introducing a new format that also takes care of binary dependencies for eg., where we would most likely have different metadata under certain scenarios.

I know I am being a bit conservative about the naming and origin of the data, but I didn't feel like it containing "wheel" in the name really hurt anything. Maybe I am an outlier, but my first questing after seeing a function named "project_metadata" would be "which metadata? from where?", as there are multiple metadata sources.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jaraco added 2 commits December 17, 2021 21:54
@jaraco
Remove filtered warnings, addressed upstream.
eca1c4c
@jaraco
Merge https://github.com/jaraco/skeleton
5ad9047
@jaraco

jaraco commented Dec 20, 2021

Copy link
Copy Markdown
Member

Oh! I see that pep517 already provides this same functionality. Let's get rid of it here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jaraco added 3 commits December 19, 2021 21:34
@jaraco
Remove pep517 dependency and LocalPackage fixture, no longer used.
e59f3b6
@jaraco
Update changelog.
4a2f7d5
@jaraco
Merge branch 'main' into remove-distribution-local
1f6fe1e
@jaraco
jaraco merged commit 9491ef9 into python:main Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@FFY00 @jaraco
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.