indygreg / PyOxidizer

A modern Python application packaging and distribution tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to exclude `{package}-{version}.dist-info` folders in packaging results?

WankkoRee opened this issue · comments

I set policy.resources_location = "filesystem-relative:prefix".

And then I found that it will adding extra file {package}-{version}.dist-info folders to prefix/.

image

image

But I don't need these folders. Beacuse I try to delete them and try to open my exe again, it still worked.

solved by policy.register_resource_callback(resource_callback).

def resource_callback(policy, resource):
    res_type = type(resource)
    if res_type == "PythonPackageDistributionResource":
        # exclude all `.dist-info` folders
        resource.add_include = False