mirror of
https://github.com/brentvollebregt/auto-py-to-exe.git
synced 2026-04-25 03:35:58 +03:00
[GH-ISSUE #534] Add option to exclude files & folders being copied to output (prevent whole Qt from being copied) #410
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ganego on GitHub (Jul 25, 2025).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/534
Originally assigned to: @brentvollebregt on GitHub.
I'm aware that in the help file there is a paragraph about venv, but that will hot help because I can exclude packages already with the options given.
My program uses Qt and PIL and for example 80 MB of Qt libraries get added of which I can easily delete 50 MB without interfering with my code. Same with PIL where I simply don't need parts of it. Or the
win32com,pywin32_system32,Pythonwinfolders seem to be unnecessary.I propose options to be added to exclude whole folders and an option to exclude single files from being copied over to the output folder.
Thank you
@github-actions[bot] commented on GitHub (Jul 25, 2025):
👋 Hi, just a reminder that if you haven't read the help post yet, give it a read to see if your issue is covered in it and make sure to follow the debugging section.
Also please note, as stated in the README, if your issue is only associated with your application and not auto-py-to-exe itself, please do not create an issue in this repository - instead, comment on the help post, video or create a new discussion.
@brentvollebregt commented on GitHub (Jul 25, 2025):
I understand you're point and get why it might be a good feature to be in auto-py-to-exe.
Just off the top of my head:
If something like this was to go into auto-py-to-exe, it would only work with directory outputs (as opposed to one-file outputs). This is because we have no control over the package process and only get a single executable out at the end.
Of course you could have some "post processing" script to remove the files for you, but I understand if you are using the auto-py-to-exe config files and how it would be nice all in one place.
@ganego commented on GitHub (Jul 25, 2025):
That would indeed be the cherry on top if pyinstaller could properly detect only the needed libraries, but that probably won't happen.
Yes this is how I do it, though the scope of my program isn't that big (it's an image viewer tailored to my needs).
Indeed. I can write a script to go over the files and delete them, but it would just be a nice 'all in one package' if it could be done directly.
Thinking about implementation, a file/directory chooser cannot really be used as it needs to be relative to the output folder anyway, so only relative paths to the
_internalfolder would make sense.I very much like in your UI that you have single lines for each item with those "+" buttons and we don't have to add everything in one giant csv-string or so. It could be added in a way that if the entry ends on a path separator it will recursively delete the whole folder, else, just remove the file.
@brentvollebregt commented on GitHub (Jul 25, 2025):
Yep, that makes sense.
We can use pathlib to get a path reference, validate that it exists and then check if it's a file or directory using that. That allows for validation and should mostly work without much fuss.
nonPyinstallerOptionsin the config would be a good place - maybe under something likepostBundlePathsToDelete(a list of strings). The UI would sit in the "Settings" section under a new heading "Post Bundle Operations" between "Manually Provide Options" and "Configuration". Under the heading, "Paths To Delete" seems like a good label and it will use the same plus/minus setup used for other inputs.I can't promise when I can get this in right now, but if you are open to making some changes, I can look at the PR.