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 integration tests #282

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/ansys/optislang/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@
from ansys.optislang.core.osl_process import OslServerProcess, ServerNotification

# Provide examples directory path
examples = "ansys.optislang.core.examples"
if spec := importlib.util.find_spec(examples):
EXAMPLES_MODULE = "ansys.optislang.core.examples"
if spec := importlib.util.find_spec(EXAMPLES_MODULE):
if spec.origin:
os.environ["OSL_EXAMPLES"] = os.path.dirname(spec.origin)
else:
LOG.logger.warning(f"Could not set path to examples. Missing spec for module {examples}.")
LOG.logger.warning(
f"Could not set path to examples. Missing spec for module {EXAMPLES_MODULE}."
)
else:
LOG.logger.warning(f"Could not set path to examples. Missing origin for module {examples}.")
LOG.logger.warning(
f"Could not set path to examples. Missing origin for module {EXAMPLES_MODULE}."
)
Loading