Giter VIP home page Giter VIP logo

Comments (4)

kayhayen avatar kayhayen commented on May 19, 2024

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.

mjscosta avatar mjscosta commented on May 19, 2024

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.

kayhayen avatar kayhayen commented on May 19, 2024

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.

mjscosta avatar mjscosta commented on May 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.