-
-
Notifications
You must be signed in to change notification settings - Fork 639
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
Collect submodules without follow imports in them. #2384
Comments
Code is not data files. Data file options ignore DLLs, extension modules and Python code. You can specify a pattern to force it to include code files, but then you are on your own when you try to use them in any way. |
I am not sure, I like the collect approach. But ever after I added no-auto-follow to the Yaml, plugins now get told which package wants to include a module, and the decision is actually limited to that module, and so Nuitka actually is capable of doing what you say you want here. But I somehow feel you are probably just confused, and tell me a technical mechanism that you believe to be the solution, rather than what the actual problem is. |
Yes as simple as adding few lines.
As I said in description above, by this way, without need I did it in linked PR, actually currently it implemented only for interpreter deps. |
The PR changes are not general, they only affect the stdlib packages require for startup. Also I need to review it, but encodings are already included by default, it seemed to be done that way. Not sure, why Maybe you are encoutering a bug that needs a resolution? The noautofollow is being used in stdlib a lot these days, e.g. we are doing these.
So, if I get you correctly, you have something like an external Python application, that you want to include, and have or not have its dependencies included. You do not want or know to use |
If this is about how only needed stdlib is included, e.g. with The yaml package configuration e.g. has this
I believe command line patterns do that as well, I recall using it recently like that for a customer. It will however, not work to use I do not see, where your change comes in handy in any of that. Not including all of stdlib anymore, seems to be a problem for you, and I can see how that is bad. I could see how we add that as an option back, but I am not fond of doing that, happy to have gotten rid of that. |
Yes partly included, some submodules excluded by conditions.
Assume I'll want to manually put submodules in app dir, but the current approach blocking that bcz of multiple search path!
I guess you misunderstood, Let me tell more obvious example: import mypack.mysub
exec(input("> "))
try create standalone of import mypack.extra run
here |
Correct, I tried all of these and yaml file before. yaml file process per module, I want that |
Its WIP and only did on interpreter deps to show that works fine in the base code. |
So, do you want to specify what to include, or do you imagine including all modules that you have in your Python installation? You could still do that externally by building a command line, but surely it will explode due to length issues on even the more forgiving OSes, or project options which do not have that kind of limit. Plugins can at this time not contribute to the list of root modules, which arguably is an omission, and ought to be easy to add. You would walk there with I am not sure, what you said so far really requires core changes. Accepting patterns for the inclusion options like |
I guess with 07140a6 and 474d96e, this is now more understandable. (
We can do both:
We don't need |
It seems you are re-implementing
The point where stdlib is scanned, these decisions should be asked, and used. That is actually a bug to not do it, that makes e.g. Including all of stdlib would be an include option, that make the decision function always return yes. Following is not including, so a The stdlib scan has historically 2 phases, one where it picks technically needed stuff, plus one picking up the stdlib module names for inclusion generally even without anything else using it, where the later is based on a file system scan. |
I have a similar issue with |
@ArtBIT can you open a new issue with a minimal reproducible example? thank you. |
This issue never gave any fruit. From my understanding, it was attempted to have an extra implementation of how to decide recursion rather than using a plugin. |
in standalone mode currently it is blocking to add package folder manually after partial of package included in final executable.
Actually, I need
--collect-submodules
that will include other module files without checking for imports in them, what currently--include-package
doing is also includes what's imported inside submodules.This will prevent multiple import search paths (one in binary and one in directory):
here
app.py
only importsA.a
and nuitka only collects this.app.py
also in the future would dynamically importA.b
.if try to create folder
A
and putb.py
in executable dir, still you cannot import it, bcz namespaceA
already exists inside of executable (first path insys.path
).I tried
--include-package-data
, I was expecting to include.py
files, but it didn't.The text was updated successfully, but these errors were encountered: