Skip to content
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

Include package metadata and expose it through packaging tools #216

Closed
anthony-tuininga opened this issue Dec 9, 2016 · 8 comments
Closed

Comments

@anthony-tuininga
Copy link
Collaborator

Originally reported by: Jason R. Coombs (Bitbucket: jaraco, GitHub: jaraco)


In my involvement with this ticket in the mock project, it came to my attention that cx_freeze apparently excludes the package metadata (egg-info, dist-info, etc) when freezing. While some metadata may not be applicable in a frozen application, I can certainly see applications making use of introspection to detect and report versions or expose functionality via plugins.

I suggest that cx_freeze could (a) copy/include metadata exposed by the package and (b) provide a mechanism in pkg_resources to serve that metadata just as it does for other forms of installation.

By doing so, it would eliminate the incentive for packages to avoid use of this functionality in order to retain compatibility with cx_Freeze.

I unfortunately won't be able to contribute this feature, but I'll happily help guide someone willing to help contribute, especially with implementing the pkg_resources functionality.


@nicoddemus
Copy link

nicoddemus commented Mar 4, 2017

Is there a mechanism in place to extend pkg_resources to serve that metadata?

@nicoddemus
Copy link

cc @jaraco

@jaraco
Copy link

jaraco commented Mar 9, 2017

I don't believe there's a plugin mechanism, but pkg_resources could itself be extended to support additional file types or structures in a file type (such as zip files), especially if such a format is well-specified, such as with a PEP or other consensus.

@henryborchers
Copy link

Any progress on this?

@jaraco
Copy link

jaraco commented Feb 5, 2018

A little more detail - pkg_resources defines an IMetadataProvider, which defines the abstract interface for a provider of metadata.

The NullProvider and DefaultProvider are implementations that provide metadata based on files in the file system. The ZipProvider is an implementation for resolving the metadata based on zip files (including eggs).

I'm not yet sure how these metadata providers are selected, but if there was a metadata provider that matched when the module's loader is one provided by cx_Freeze, I imagine that could be integrated to resolve metadata for cx_Freeze applications.

I'd start with the docs and then focus on the pkg_resources code and try to follow the logic to implement a suitable provider for cx_Freeze.

@xavfaure
Copy link

xavfaure commented Oct 9, 2018

Dear jaraco,
I'm trying to make a standalone application using cx-freeze. I use PyQt5 with mayavi, traitsui, tvtk and some other. I've encountered the pkg_resource pb : qt4 xxx.toolkit not found while lauching the xe file....lauching the main.py works perfrectly in a prompt console. along your doc, I didn't manage to point out what shall I do to solve this issue. Would you mind give me some first setps ? thanks in advance :)

@jaraco
Copy link

jaraco commented Nov 2, 2018

Hi @xavfaure.

At this point, I'm considering pkg_resources soft-deprecated and I've been pushing users to instead rely on entrypoints, importlib_resources, and importlib_metadata. In fact, keyring (referenced above) already uses entrypoints to load its entrypoints. pmxbot will soon too.

Therefore, I recommend first that you work with the Qt and related packages to first see if they can update to the newer package metadata tools. Once they've done that, if the necessary metadata still isn't available in the cxFreeze environment, you'll want to submit a bug report (and ideally a pull request) to the relevant project (probably entrypoints) describing the deficiency and what you're trying to achieve.

@marcelotduarte
Copy link
Owner

PR #608 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants