Note that there are some explanatory texts on larger screens.

plurals
  1. POpython distutils not include the SWIG generated module
    text
    copied!<p>I am using distutils to create an rpm from my project. I have this directory tree:</p> <pre><code>project/ my_module/ data/file.dat my_module1.py my_module2.py src/ header1.h header2.h ext_module1.cpp ext_module2.cpp swig_module.i setup.py MANIFEST.in MANIFEST </code></pre> <p>my <code>setup.py</code>:</p> <pre><code>from distutils.core import setup, Extension module1 = Extension('my_module._module', sources=['src/ext_module1.cpp', 'src/ext_module2.cpp', 'src/swig_module.i'], swig_opts=['-c++', '-py3'], include_dirs=[...], runtime_library_dirs=[...], libraries=[...], extra_compile_args=['-Wno-write-strings']) setup( name = 'my_module', version = '0.6', author = 'microo8', author_email = 'magyarvladimir@gmail.com', description = '', license = 'GPLv3', url = '', platforms = ['x86_64'], ext_modules = [module1], packages = ['my_module'], package_dir = {'my_module': 'my_module'}, package_data = {'my_module': ['data/*.dat']} ) </code></pre> <p>my <code>MANIFEST.in</code> file:</p> <pre><code>include src/header1.h include src/header2.h </code></pre> <p>the <code>MANIFEST</code> file is automatically generated by <code>python3 setup.py sdist</code>. And when i run <code>python3 setup.py bdist_rpm</code> it compiles and creates correct rpm packages. But the problem is that when im running SWIG on a C++ source, it creates a <code>module.py</code> file that wraps the binary <code>_module.cpython32-mu.so</code> file, it is created with the <code>module_wrap.cpp</code> file, and it isnt copied to the <code>my_module</code> directory.</p> <p>What I must write to the <code>setup.py</code> file to automatically copy the SWIG generated python modules?</p> <p>And also I have another question: When I install the rpm package, I want that an executable will be created, in <code>/usr/bin</code> or so, to run the application (for example if the <code>my_module/my_module1.py</code> is the start script of the application then I can run in bash: <code>$ my_module1</code>).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload