diff --git a/Applications/Python/ogs/_internal/provide_ogs_cli_tools_via_wheel.py b/Applications/Python/ogs/_internal/provide_ogs_cli_tools_via_wheel.py index de6e2c4a06c..e6de6c64909 100644 --- a/Applications/Python/ogs/_internal/provide_ogs_cli_tools_via_wheel.py +++ b/Applications/Python/ogs/_internal/provide_ogs_cli_tools_via_wheel.py @@ -6,10 +6,6 @@ from . import OGS_USE_PATH -# Here, we assume that this script is installed, e.g., in a virtual environment -# alongside a "bin" directory. -OGS_BIN_DIR = Path(__file__).parent.parent.parent / "bin" - binaries_list = [ "addDataToRaster", "AddElementQuality", @@ -112,6 +108,12 @@ def ogs_with_args(argv): if "PEP517_BUILD_BACKEND" not in os.environ: + # Here, we assume that this script is installed, e.g., in a virtual environment + # alongside a "bin" directory. + OGS_BIN_DIR = Path(__file__).parent.parent.parent / "bin" # installed wheel + if not OGS_BIN_DIR.exists(): + OGS_BIN_DIR = OGS_BIN_DIR.parent # build directory + if platform.system() == "Windows": os.add_dll_directory(OGS_BIN_DIR) diff --git a/Applications/Python/ogs/_internal/wrap_cli_tools.py b/Applications/Python/ogs/_internal/wrap_cli_tools.py index c571b025d1a..98cd7d53de6 100644 --- a/Applications/Python/ogs/_internal/wrap_cli_tools.py +++ b/Applications/Python/ogs/_internal/wrap_cli_tools.py @@ -6,7 +6,9 @@ # Here, we assume that this script is installed, e.g., in a virtual environment # alongside a "bin" directory. -OGS_BIN_DIR = Path(__file__).parent.parent.parent / "bin" +OGS_BIN_DIR = Path(__file__).parent.parent.parent / "bin" # installed wheel +if not OGS_BIN_DIR.exists(): + OGS_BIN_DIR = OGS_BIN_DIR.parent # build directory class CLI: