-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Always copy metadata, on a best-effort basis #5814
Comments
Honestly I have mixed opinions on this one.
With those in mind, the only real usage for a package's metadata that I see is entry points. These can now be collected easily via Part of the problem is that it isn't FWIW: I've just started working on an automatic metadata feature similar to what we use for That all said, par the loss of speed, I don't think there's really anything lost in always copying metadata. |
I totally agree with this, having just ripped such code out of my project... Because it was breaking pyinstaller, leading to me submitting this issue.
I guess increased expectations from users on the availability of metadata could be called a loss. |
I suppose I wouldn't be opposed to automatic collection of all metadata belonging to collected packages (or rather, their distribution), provided we can reliably map those packages to their distributions. It would certainly remove the need for The metadata collection probably wouldn't do much for the license compliance (especially in As for the downsides; I suppose the added size of the collected metadata shouldn't be that much of an issue, but all those extra directories probably won't look very pretty in |
Would that handle the case when the distribution name is passed via variable, e.g., inside a loop? |
I think we definitely need to up the metadata included. I think @bwoodsend's code scanning solution is probably a good one, at least to start with. I'd be hesitant to do an automatic full-metadata collection for every package until we figure out some reliable + efficient way to do it. |
No chance. But it'll do |
Is your feature request related to a problem? Please describe.
Many applications packaged by Pyinstaller will include packages from Pypi, which will tend to include metadata according to PEP 566 / core metadata specification (v2.1). So this metadata is often (not universally) available, but never included by default by Pyinstaller.
Describe the solution you'd like
Include the result of
copy_metadata
by default as if it had been run within a hook asDescribe alternatives you've considered
The current solution would be to specify a hook for every package, or use
--copy-metadata
repeatedly, or specify the metadata you care about manually indatas
.Additional context
This should be changed because it causes the following issues:
__version__ = importlib.metadata.version("package")
is a fairly common pattern that is suggested in thesetuptools_scm
readme, leading to a continual stream of requests for trivial hooks that simply callcopy_metadata
: PackageNotFoundError: importlib_metadata with Pluggy 0.12.0 #4258, Pyinstaller Broken Module Import with Infinisdk pyinstaller-hooks-contrib#509.This would be sort of a first step for #4881, I suppose. However, recent work in #5774 should relieve concerns about the known problems. I think this feature request could be included/implemented without having to fully resolve #4881.
The text was updated successfully, but these errors were encountered: