Comments (4)
Did you check out "Use Case 3 - Package compilation" in the User Manual ? It should be exactly that what you are doing.
For factory branch I updated the manual a bit, because --recurse-directory is about file system, and we are moving to --include-package/module options, which will work with names of packages/modules instead. The use case you have works right now and is supposed to become even simpler.
Yours,
Kay
from nuitka.
Thanks for your reply,
Actually I've omitted a detail, that is, one of the submodules of a subpackage is a swig module:
├── python_path_root
│ └── package1
│ ├── __init__.py
│ ├── module1.py
│ ├── module2.py
│ ├── packaging
│ │ ├── __init__.py
│ │ └── pyinstaller_specs.py
│ ├── subpackage1
│ │ ├── __init__.py
│ │ └── submodule11.py
│ ├── subpackage2
│ │ ├── __init__.py
│ │ └── submodule21.py
│ └── subpackage3
│ ├── __init__.py
│ └── swigpkg
│ ├── CMakeLists.txt
│ ├── __init__.py
│ ├── myswig_module.cpp
│ ├── myswig_module.h
│ ├── myswig_module.i
│ ├── myswig_module.py
│ ├── myswig_modulePYTHON_wrap.cxx
│ └── _myswig_module.so
I'll check the factory version for the new doc and updates.
Best,
Mario
from nuitka.
Ah, that ".so" can of course not be included in the package. Compile with Nuitka as described, and produce a directory structure (yourself) like this:
package1.so
package1/swigpkg/_myswig_module.so
Nuitka will use the directory for loading stuff. It at least works for standalone mode, where it has to, and I think it will for package mode too. Please confirm to me if this works indeed.
from nuitka.
Hi Kay,
I've tested with:
0.5.29.4 (from pip), and following the "Use Case 3", with nuitka --module package1 --recurse-directory=package1
I've got this warning, but it works properly, with and without swig.
Nuitka:WARNING:Recursed to package 'package1' at 'package1' twice.
Nuitka:WARNING:Not recursing to 'package1.subpackage1.submodule11' (/home/.../test_nuitka/output3/package1/subpackage1/submodule11.py), please specify --recurse-none (do not warn), --recurse-all (recurse to all), --recurse-not-to=package1.subpackage1.submodule11 (ignore it), --recurse-to=package1.subpackage1.submodule11 (recurse to it) to change.
factory branch (nuitka v 0.5.30rc4), the option --include-package/module does not seem to be present, and using nuitka --recurse-to=package1 --recurse-to=subpackage1 --module package1
does not seem to recurse into the subpackages.
I've setup a set o examples/tests to test nuitka, before applying to a real more complex scenario, I've also build a directory walker script that helps me building single modules recursively, cleaning build stuff and .py/.pyc and avoid compiling swig modules with nuitka.
You can checkout from here:
https://github.com/mjscosta/nuitka_testcases
Note that the test case numbering is not related with the use cases from nuitka manual.
from nuitka.
Related Issues (20)
- Downloaded MinGW64 is not usable when home directory path is non-DOS HOT 3
- Unable to open project after converting QML file to pyd and compiling with UPX HOT 1
- Standalone: Standard library scan can crash with .git folders present HOT 5
- Error while compiling project with Yaml config file HOT 4
- RecursiveScriptModule' has no attribute '_construct HOT 1
- Virus total 29/72 antiviruses say my program compiled with Nuitka has virus HOT 5
- ModuleNotFoundError: No module named `scipy.special._cdflib` with `SciPy-1.13.0` HOT 4
- supoortability of @Slot(name="xxx") HOT 1
- Nuitka scanning for executables does not ignore directories of the same name (was locating GCC wrong) HOT 7
- get RuntimeError when use getattr() to get a non-exist attribute on asgiref.local.Local HOT 6
- Build imgui-bundle example successfully into excutable, but crashed at getting windows WndProc hook HOT 14
- compile standalone, incorrect __file__ variable HOT 7
- SetConsoleCtrlHandler not working with console HOT 7
- Nuitka-Scons: Non downloaded winlibs-gcc 'H:\MinGW\bin\gcc.exe' is being ignored, Nuitka is very dependent on the precise one. HOT 4
- Packaging mlc-llm HOT 3
- Are Nuitka compiled files actually binaries ? HOT 1
- Problem error ModuleNotFoundError: No module named 'sspilib.raw._text' HOT 9
- [ERROR] Failed to add resources to file 'myUiExample.exe' HOT 1
- ImportError: Could not find library zaber-motion-lib-windows-amd64.dll in bindings HOT 17
- ModuleNotFoundError: No module named 'aspose.threed.formats'; 'aspose.threed' is not a package HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nuitka.