add hook to make orekit_jpype pyinstallable
This adds a Pyinstaller hook to the orekit_jpype
library, so that users can more easily package their Python app depending on Orekit as an executable. This is necessary because the jar files are by default not packaged.
Documentation was added to README.md.
A test case is available (which builds the executable and runs a minimal test) and can be run with python -m PyInstaller.utils.run_tests --include_only orekit_jpype._pyinstaller -v
. TODO: when the CI pipeline is operational, add this test to the pipeline.
A similar merge request is proposed for the orekit data repository.
Heavily inspired from a similar hook for the jpype
jars in https://github.com/jpype-project/jpype/pull/877
Merge request reports
Activity
mentioned in merge request orekit/orekit-data!5
Note: I just tested this on Windows and it seems the executable requires JDK to be installed on the system. Looking at jpype's documentation, it looks like JDK is not packaged with jpype and is required on the system.
IIRC, in the Orekit JCC wrapper, there was no need for installing JDK on the system, an OpenJDK8 was installed via conda, right?
If it is the case, I'll look into using
jdk4py
to avoid the need for installing JDK on the system.Edited by Clément JonglezUpdate: I tried packaging jdk4py into the pyinstaller executable. It worked in Linux but in Windows, I got the same issues as these jpype users: https://github.com/jpype-project/jpype/issues/1151
However, I think it is still safe to merge this merge request as it works well when the user already has JDK installed on their system. We are now using pyinstaller at TU Berlin to package our orekit project into a single executable which is easier to deploy on student computers.
Edited by Clément Jonglez
added 11 commits
-
68b47db0...a829028f - 7 commits from branch
master
- 719a286f - add hook to make orekit_jpype pyinstallable
- 9d017edd - maybe not needed: add pyinstaller to conda environment
- 4b8b32d6 - document usage of pyinstaller for orekit and orekit data
- 4f109fe3 - If orekit-data merge request accepted: no need for extra argument to collect the orekitdata lib
Toggle commit list-
68b47db0...a829028f - 7 commits from branch
mentioned in commit 6e002578