You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create the program by running python setup.py build
Expected behavior lib/library.zip should not contain the "pytest-6.2.5.dist-info" folder
Desktop (please complete the following information):
Platform information (e.g. Ubuntu Linux 16.04): Windows 10 20H2
OS architecture (e.g. amd64): amd64
cx_Freeze version [e.g. 6.6]: 6.8.2
Python version [e.g. 3.9]: 3.9
Additional context
I spent some tracing down the exact source of this issue. It appears to be in freezer.py, specifically the Freezer._write_modules() method. Starting around line 569, the program gets the distribution file metadata that was cached, and copies it all into the zip file, however, it does not check to see if any of the cached metadata is for a package that was excluded.
The text was updated successfully, but these errors were encountered:
This behavior is by design. At least for a while.
If a package specifies that it requires another, I can exclude that package that I know won't be used, but the metadata has that information. Then the dist-info of the required package will have to be kept.
Sorry for taking a little while to respond. What I don't understand is why it still includes the metadata folder even if the package itself is not included.
In my case, I am working on a program that has an option to print out all of the libraries that are bundled with it along with their licenses. Since cx_freeze is still including the metadata folders for some packages (in my case, zipp.dist-info and importlib-metadata.dist-info), the program improperly reports that they are included.
For the time being, I have worked around this by adding my own functionality to my setup.py script that removes the .dist-info folders from library.zip for explicitly excluded packages, but it would be nice for this functionality to be integrated into cx_Freeze
Describe the bug
The distribution info (the *.dist-info folders) for packages that are specified with the
excludes
are still added to library.zipTo Reproduce
Note: I am using pytest as an example, but it works with any package
Create a simple dummy module (containing just
__main__.py
and__init__.py
) to build into a program.Create a virtual environment with cx_Freeze and pytest installed.
Create the following
setup.py
file for cx_freeze:Create the program by running
python setup.py build
Expected behavior
lib/library.zip should not contain the "pytest-6.2.5.dist-info" folder
Desktop (please complete the following information):
Additional context
I spent some tracing down the exact source of this issue. It appears to be in freezer.py, specifically the
Freezer._write_modules()
method. Starting around line 569, the program gets the distribution file metadata that was cached, and copies it all into the zip file, however, it does not check to see if any of the cached metadata is for a package that was excluded.The text was updated successfully, but these errors were encountered: