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
A way to exclude a individual files from a module/package #8128
Comments
Yeah, it'd be nice to have an That said, in your specific case, if a hidden import pulls in an unnecessary large zip file, this means that we have a hook for that package (either here, or in contributed hooks repository) that does this collection, and should be optimized. I.e., either the data collection part should be split into a sub-hook for the module that actually requires that data file (if any), or the data collection part should be optimized a bit. So, can you tell us which package it is, and which is the problematic zip file? |
I'm for this, but there's some things to consider:
|
My current idea is that I imagine the filter would need to be applied at several different stages; first, after initial So exclusion takes precedence over anything added via |
Is your feature request related to a problem? Please describe.
In my specific use case I need to add a Python package as a hidden import, which pulls all the files from the package. This particular packages come with a large zip file that is not needed for my application, so I would like to exclude it from the build.
So, I was looking for a way to "exclude" individual files. The
excludes
option is for Python packages/modules, so that won't work for individual files.This kind of feature would also help in situations like this, where a lot of .so files (maybe dlls as well?) are included, which might not be needed:
Describe the solution you'd like
Something silimar to the
--exclude-module
flag orAnalysis(excludes=...)
option for the spec files but for individual files. Perhaps a--exclude-file
/Analysis(exclude-files=...)
version?Describe alternatives you've considered
At the moment a workaround can be to manipulate the output of
a = Analysis(...)
in the spec file, where we can create a new tuple without some of the created entries and used that to replacea.datas
.Additional context
N/A.
The text was updated successfully, but these errors were encountered: