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

BUILD: Remove dotnetcore2 dependency #840

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies = [
"cffi>=1.16.0,<1.18; platform_system=='Linux'",
"pywin32 >= 303;platform_system=='Windows'",
"ansys-pythonnet >= 3.1.0rc3",
"dotnetcore2 ==3.1.23;platform_system=='Linux'",
"numpy>=1.20.0,<2",
"pandas>=1.1.0,<2.3",
"pydantic>=2.6.4,<2.10",
Expand Down
24 changes: 4 additions & 20 deletions src/pyedb/dotnet/clr_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,17 @@

if is_linux and cpython: # pragma: no cover
try:
if os.environ.get("DOTNET_ROOT") is None:
runtime = None
try:
import dotnet

runtime = os.path.join(os.path.dirname(dotnet.__path__))
except:
import dotnetcore2

runtime = os.path.join(os.path.dirname(dotnetcore2.__file__), "bin")
finally:
os.environ["DOTNET_ROOT"] = runtime

from pythonnet import load

if pyedb_path is not None:
json_file = os.path.abspath(os.path.join(pyedb_path, "misc", "pyedb.runtimeconfig.json"))
load("coreclr", runtime_config=json_file, dotnet_root=os.environ["DOTNET_ROOT"])
load("coreclr")
print("DotNet Core correctly loaded.")
if "mono" not in os.getenv("LD_LIBRARY_PATH", ""):
warnings.warn("LD_LIBRARY_PATH needs to be setup to use pyedb.")
warnings.warn("export ANSYSEM_ROOT232=/path/to/AnsysEM/v232/Linux64")
warnings.warn("export ANSYSEM_ROOT242=/path/to/AnsysEM/v242/Linux64")
msg = "export LD_LIBRARY_PATH="
msg += "$ANSYSEM_ROOT232/common/mono/Linux64/lib64:$LD_LIBRARY_PATH"
msg += (
"If PyEDB will run on AEDT<2023.2 then $ANSYSEM_ROOT222/Delcross should be added to LD_LIBRARY_PATH"
)
msg += "$ANSYSEM_ROOT242/common/mono/Linux64/lib64:$LD_LIBRARY_PATH"
msg += "On AEDT<2023.2, $ANSYSEM_ROOT222/Delcross should also be added to the LD_LIBRARY_PATH."
warnings.warn(msg)
is_clr = True
else:
Expand Down
Loading