Skip to content

Commit

Permalink
[py] Fix OGS_BIN_DIR.
Browse files Browse the repository at this point in the history
  • Loading branch information
bilke committed Aug 14, 2024
1 parent f561d24 commit 4e9d192
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 3 additions & 1 deletion Applications/Python/ogs/_internal/wrap_cli_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4e9d192

Please sign in to comment.