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 imageio from requirements #4905

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
21 changes: 12 additions & 9 deletions doc/source/Resources/pyaedt_installer_from_aedt.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,18 @@ def install_pyaedt():

if args.wheel and os.path.exists(args.wheel):
wheel_pyaedt = args.wheel
import zipfile
unzipped_path = os.path.join(os.path.dirname(wheel_pyaedt),
os.path.splitext(os.path.basename(wheel_pyaedt))[0])
if os.path.exists(unzipped_path):
shutil.rmtree(unzipped_path, ignore_errors=True)
with zipfile.ZipFile(wheel_pyaedt, 'r') as zip_ref:
# Extract all contents to a directory. (You can specify a different extraction path if needed.)
zip_ref.extractall(unzipped_path)

if wheel_pyaedt.endswith(".zip"):
import zipfile
unzipped_path = os.path.join(os.path.dirname(wheel_pyaedt),
os.path.splitext(os.path.basename(wheel_pyaedt))[0])
if os.path.exists(unzipped_path):
shutil.rmtree(unzipped_path, ignore_errors=True)
with zipfile.ZipFile(wheel_pyaedt, 'r') as zip_ref:
# Extract all contents to a directory. (You can specify a different extraction path if needed.)
zip_ref.extractall(unzipped_path)
else:
# Extracted folder.
unzipped_path = wheel_pyaedt
if args.version <= "231":
run_command(
'"{}" install --no-cache-dir --no-index --find-links={} pyaedt[all,dotnet]'.format(pip_exe,
Expand Down
1 change: 1 addition & 0 deletions pyaedt/workflows/templates/jupyter.py_build
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def main():
pyaedt_utils.environment_variables(oDesktop)

if is_linux:
pyaedt_utils.set_ansys_em_environment(oDesktop)
if notebook_dir:
command = [jupyter_exe, "lab", target,"--notebook-dir",notebook_dir]
else:
Expand Down
2 changes: 1 addition & 1 deletion pyaedt/workflows/templates/pyaedt_console.py_build
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def main():
term = pyaedt_utils.get_linux_terminal()
if not term:
pyaedt_utils.show_error("No Terminals found.", oDesktop)

pyaedt_utils.set_ansys_em_environment(oDesktop)
command = [
term,
"-e",
Expand Down
6 changes: 6 additions & 0 deletions pyaedt/workflows/templates/pyaedt_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
is_linux = os.name == "posix"


def set_ansys_em_environment(oDesktop):
variable = "ANSYSEM_ROOT{}".format(oDesktop.GetVersion()[2:6].replace(".", ""))
if variable not in os.environ:
os.environ[variable] = oDesktop.GetExeDir()


def sanitize_interpreter_path(interpreter_path, version):
python_version = "3_10" if version > "231" else "3_7"
if version > "231" and python_version not in interpreter_path:
Expand Down
1 change: 1 addition & 0 deletions pyaedt/workflows/templates/run_extension_manager.py_build
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def main():
pyaedt_utils.environment_variables(oDesktop)
# Open extension manager
if is_linux:
pyaedt_utils.set_ansys_em_environment(oDesktop)
command = [
python_exe,
pyaedt_script,
Expand Down
1 change: 1 addition & 0 deletions pyaedt/workflows/templates/run_pyaedt_script.py_build
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def main():
pyaedt_utils.environment_variables(oDesktop)
# Run script
if is_linux:
pyaedt_utils.set_ansys_em_environment(oDesktop)
command = [
python_exe,
pyaedt_script,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def main():
pyaedt_utils.environment_variables(oDesktop)
# Run workflow
if pyaedt_utils.is_linux:
pyaedt_utils.set_ansys_em_environment(oDesktop)
my_env = dict(os.environ.copy())
command = [python_exe, pyaedt_script]
subprocess.Popen(command, env=my_env)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def main():
# Run workflow
my_env = dict(os.environ.copy())
command = [python_exe, pyaedt_script]
pyaedt_utils.set_ansys_em_environment(oDesktop)
subprocess.Popen(command, env=my_env)
except Exception as e:
pyaedt_utils.show_error(str(e), oDesktop)
Expand Down
8 changes: 0 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ dependencies = [

[project.optional-dependencies]
tests = [
"imageio>=2.30.0,<2.35",
"ipython>=7.30.0,<8.27",
"joblib>=1.0.0,<1.5",
"matplotlib>=3.5.0,<3.9",
Expand Down Expand Up @@ -73,11 +72,8 @@ dotnet = [
]
doc = [
"ansys-sphinx-theme>=0.10.0,<0.17",
"imageio>=2.30.0,<2.35",
#"imageio-ffmpeg>=0.4.0,<0.5",
"ipython>=7.34.0; python_version == '3.7'",
"ipython>=8.13.0,<8.27; python_version > '3.7'",
#"ipywidgets>=8.0.0,<8.2",
"joblib>=1.3.0,<1.5",
"jupyterlab>=4.0.0,<4.3",
"matplotlib>=3.5.0,<3.9",
Expand Down Expand Up @@ -107,8 +103,6 @@ doc = [
]
doc-no-examples = [
"ansys-sphinx-theme>=0.10.0,<0.17",
"imageio>=2.30.0,<2.35",
#"imageio-ffmpeg",
"numpydoc>=1.5.0,<1.8",
"recommonmark",
"Sphinx==5.3.0; python_version == '3.7'",
Expand All @@ -126,7 +120,6 @@ doc-no-examples = [
"scikit-rf>=0.30.0,<1.2",
]
all = [
"imageio>=2.30.0,<2.35",
"matplotlib>=3.5.0,<3.9",
"numpy>=1.20.0,<2",
"openpyxl>=3.1.0,<3.3",
Expand All @@ -142,7 +135,6 @@ all = [
"vtk==9.2.6; python_version < '3.12'",
]
installer = [
"imageio>=2.30.0,<2.35",
"matplotlib>=3.5.0,<3.9",
"numpy>=1.20.0,<2",
"openpyxl>=3.1.0,<3.3",
Expand Down
Loading