Skip to content
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

Fix/py action build only one shared library #4029

Merged

Conversation

lisajulia
Copy link
Contributor

This PR builds on #4017.

This PR removes the creation of an embedded python module.

@lisajulia
Copy link
Contributor Author

jenkins build this opm-simulators=5306 please

@lisajulia lisajulia force-pushed the fix/pyAction-build-only-one-shared-library branch from 9f25cb7 to 70e0b9b Compare April 25, 2024 14:12
@lisajulia
Copy link
Contributor Author

jenkins build this opm-simulators=5306 please

@lisajulia lisajulia marked this pull request as ready for review April 25, 2024 14:13
@lisajulia lisajulia force-pushed the fix/pyAction-build-only-one-shared-library branch 2 times, most recently from cd99c27 to f2c0ab7 Compare April 26, 2024 11:19
@lisajulia
Copy link
Contributor Author

jenkins build this please

@lisajulia lisajulia added this to the Release 2024.04 milestone Apr 26, 2024
@lisajulia
Copy link
Contributor Author

jenkins build this please

@lisajulia lisajulia mentioned this pull request Apr 26, 2024
python/cxx/export.cpp Outdated Show resolved Hide resolved
@lisajulia lisajulia force-pushed the fix/pyAction-build-only-one-shared-library branch from 683543e to dcd7e87 Compare April 26, 2024 12:29
@lisajulia
Copy link
Contributor Author

jenkins build this please

@lisajulia lisajulia force-pushed the fix/pyAction-build-only-one-shared-library branch from dcd7e87 to e519ef9 Compare April 26, 2024 13:32
@lisajulia
Copy link
Contributor Author

jenkins build this please

CMakeLists.txt Outdated Show resolved Hide resolved
opm/input/eclipse/Python/PythonInterp.cpp Show resolved Hide resolved
python/cxx/export.cpp Outdated Show resolved Hide resolved
@lisajulia lisajulia force-pushed the fix/pyAction-build-only-one-shared-library branch from e519ef9 to 987e677 Compare April 29, 2024 06:44
@lisajulia
Copy link
Contributor Author

jenkins build this please

@lisajulia lisajulia force-pushed the fix/pyAction-build-only-one-shared-library branch from 987e677 to e38826f Compare April 29, 2024 07:37
@lisajulia
Copy link
Contributor Author

jenkins build this please

Copy link
Member

@blattms blattms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one I now also tested with python3.12 and it works.

Concerning the *.pyi files. I really think we should install them somewhere. I am no expert with this but it seems like they usually should lie next to the *.py files.

Would be cool if you would try this option with VSCode (without setting any variable besides PYTHONPATH):

  • rename it to init.pyi and put it into <build-dir>/python/opm_embedded (and install it)`

python/README.md Outdated Show resolved Hide resolved
python/README.md Outdated
For embedding python, see the [documentation](https://opm-project.org/?page_id=1454).

To enable tooltips for opm_embedded on VSCode (embedded python code): Copy the file "<opm-common-folder>/python/opm_embedded.pyi" in the folder at "python.analysis.stubPath" of VS Code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should read:
opm_embedded in VSCode ... to the folder defined in variable ...

opm/input/eclipse/Python/PythonInterp.cpp Outdated Show resolved Hide resolved
@lisajulia lisajulia force-pushed the fix/pyAction-build-only-one-shared-library branch from e38826f to cb2a857 Compare April 30, 2024 10:27
@lisajulia
Copy link
Contributor Author

jenkins build this please

@lisajulia lisajulia force-pushed the fix/pyAction-build-only-one-shared-library branch 2 times, most recently from 25a5810 to 185b7fb Compare April 30, 2024 10:53
@lisajulia
Copy link
Contributor Author

jenkins build this please

@lisajulia lisajulia force-pushed the fix/pyAction-build-only-one-shared-library branch from 185b7fb to 8224d69 Compare April 30, 2024 11:30
@lisajulia lisajulia force-pushed the fix/pyAction-build-only-one-shared-library branch from 8224d69 to 7937503 Compare April 30, 2024 11:31
…tomatically taken from the globally installed python

There are two reasons for this change:
- Avoid a duplicate module creation
- The code in OPM_EMBEDDED is a copy of PYBIND11_EMBEDDED_MODULE - without the following check:
	if (Py_IsInitialized() != 0) {
            //pybind11_fail("Can't add new modules after the interpreter has been initialized");
        }
  This is causing problems for Python 3.12 and is likely to cause further problems in the future
@lisajulia lisajulia force-pushed the fix/pyAction-build-only-one-shared-library branch from 7937503 to 2b017ba Compare April 30, 2024 11:40
@lisajulia
Copy link
Contributor Author

jenkins build this please

@lisajulia
Copy link
Contributor Author

@bska @hakonhagland @akva2 @blattms: If there are no further wishes on this PR, can it be merged to master? I'd like to include this in the 2024.04 release :) Thanks!

@hakonhagland
Copy link
Contributor

can it be merged to master?

@lisajulia Yes, it looks good to me.

Copy link
Member

@blattms blattms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, merging.

@blattms blattms merged commit 6af6865 into OPM:master Apr 30, 2024
1 check passed
@lisajulia lisajulia deleted the fix/pyAction-build-only-one-shared-library branch April 30, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants