[python] Use new Python module structure of dune-common MR 960
Merge request reports
Activity
@samuel.burbulla Could you have a look at this?
- Resolved by Timo Koch
@tkoch does this work? I would have thought the subpackage folder
python/dune/foamgrid
needs a__init__.py
(onlydune
itself is not allowed to have an__init__.py
file using the newer namespace package syntax). But perhaps I am wrong here.I would rename
foamgrid.py
into__init__.py
anyway (or have an__init__.py
with anfrom foamgrid import *
so that you don't have to writefrom dune.foamgrid.foamgrid import ...
in your own script.Another thing: you shouldn't need the
setup.py.in
except if you are doing something special there. Or is this included to make the code work with both core and release branch of core. In that case you might need to include__init__.py
indune/python
(although @samuel.burbulla said that using release core worked withdune-mmsh
so possibly it's okay). If it is needed you will need to guard theadd_python_targets
with the version ofdune-common
.
added 1 commit
- 80493690 - [python] Use new Python module structure of dune-common MR 960
The problem might simply be that if there is a
python
subfolder in a given module and python bindings are turned on then that module is treated as having python bindings and the system will try to include that module in the installation process. So if dumux has python bindings turned on and uses dune-foamgrid then the dune-foamgrid bindings have to comply with the structure expected in 'dune-common'.In the last dev meeting it was decided that python bindings were so new that a break in the way python bindings are handled was acceptable. The issue that you are seeing was not foreseen at the time.
Samuel said he got his module to work with both master and release of dune-common so it must be possible. It might require including the 'setup.py.in' and the 'python/dune/init.py' but have the corresponding lines in 'CMakeLists.txt' guarded by an 'if' statement that checks if 'dune-common' has major version 2.8.
added 5 commits
-
80493690...b171eaac - 4 commits from branch
master
- cacc0292 - [python] Use new Python module structure of dune-common MR 960
-
80493690...b171eaac - 4 commits from branch
added 1 commit
- 88b5deee - [ci] Enable Python bindings manually for dune 2.8
added 1 commit
- a3f97872 - [python][cmake] Differentiate >= 2.9 and earlier.
- Resolved by Timo Koch
@simon.praetorius Any idea why alberta grid linker errors break the CI? Something to do with enable shared libs?
mentioned in commit 76995033