diff --git a/.github/workflows/test-local.yml b/.github/workflows/test-local.yml index a519dce1d6e..bce0a912d94 100644 --- a/.github/workflows/test-local.yml +++ b/.github/workflows/test-local.yml @@ -250,7 +250,7 @@ jobs: echo "ON_UBUNTU: $ON_UBUNTU" echo "ON_STUDENT: $ON_STUDENT" - # Because there is no 'ansys-tools-path' we need to input the + # Because there is no 'ansys-tools-common' we need to input the # executable path with the env var: PYMAPDL_MAPDL_EXEC. if [[ "${MAPDL_VERSION}" == *"latest-ubuntu"* ]] ; then diff --git a/doc/changelog.d/4307.maintenance.md b/doc/changelog.d/4307.maintenance.md new file mode 100644 index 00000000000..b3718bdb5c5 --- /dev/null +++ b/doc/changelog.d/4307.maintenance.md @@ -0,0 +1 @@ +Migrate ansys-tools-path -> ansys-tools-common diff --git a/doc/source/api/launcher.rst b/doc/source/api/launcher.rst index 00b2978a768..245d1ed16b0 100644 --- a/doc/source/api/launcher.rst +++ b/doc/source/api/launcher.rst @@ -4,7 +4,7 @@ Launcher ======== Various PyMAPDL specific launcher commands. Most of these commands are called from the -library `ansys-tools-path `_. +library `ansys-tools-common.path `_. .. currentmodule:: ansys.mapdl.core.launcher @@ -18,10 +18,10 @@ library `ansys-tools-path `_. close_all_local_instances -``ansys-tools-path`` functions ------------------------------- +``ansys-tools-common.path`` functions +-------------------------------------- -.. currentmodule:: ansys.tools.path +.. currentmodule:: ansys.tools.common.path .. autosummary:: :toctree: _autosummary diff --git a/doc/source/conf.py b/doc/source/conf.py index 67cf729a9b0..79dd33206e4 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -125,7 +125,7 @@ "pypim": ("https://pypim.docs.pyansys.com/version/dev/", None), "ansys-dpf-core": ("https://dpf.docs.pyansys.com/version/stable/", None), "ansys-math-core": ("https://math.docs.pyansys.com/version/stable/", None), - "ansys-tools-path": ("https://path.tools.docs.pyansys.com/version/stable/", None), + "ansys-tools-common": ("https://tools.docs.pyansys.com/version/stable/", None), "pytwin": ("https://twin.docs.pyansys.com/version/stable/", None), } diff --git a/doc/source/links.rst b/doc/source/links.rst index 1b70f23beaf..a1c7b77903a 100644 --- a/doc/source/links.rst +++ b/doc/source/links.rst @@ -14,7 +14,7 @@ .. _dpf_post_docs: https://post.docs.pyansys.com .. _legacy_reader_docs: https://reader.docs.pyansys.com/ .. _example_data_repo: https://github.com/ansys/example-data -.. _ansys_tools_path: http://path.tools.docs.pyansys.com/ +.. _ansys_tools_path: https://tools.docs.pyansys.com/version/stable/user_guide/ansys_tools_path.html .. _pyansys_math: https://math.docs.pyansys.com/version/stable/ .. _pyansys_math_api: https://math.docs.pyansys.com/version/stable/api/index.html .. _pytwin_docs: https://twin.docs.pyansys.com diff --git a/doc/source/user_guide/troubleshoot.rst b/doc/source/user_guide/troubleshoot.rst index 3bbdf326f5d..f91e056c606 100644 --- a/doc/source/user_guide/troubleshoot.rst +++ b/doc/source/user_guide/troubleshoot.rst @@ -725,7 +725,7 @@ If you want to see which Ansys installations PyMAPDL has detected, use: Student versions are provided as **negative** versions because the Python dictionary does not accept two equal keys. The result of the -:func:`get_available_ansys_installations() ` +:func:`get_available_ansys_installations() ` method lists higher versions first and student versions last. .. warning:: diff --git a/pyproject.toml b/pyproject.toml index 5ed60ca4dc3..95f31d1f92b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ dependencies = [ "ansys-mapdl-reader>=0.51.7", "ansys-math-core>=0.1.2", "ansys-platform-instancemanagement~=1.0", - "ansys-tools-path>=0.3.1", + "ansys-tools-common>=0.2.1", "click>=8.1.3", # for CLI interface "grpcio>=1.30.0", # tested up to grpcio==1.35 "numpy>=1.14.0,<3.0.0", diff --git a/src/ansys/mapdl/core/__init__.py b/src/ansys/mapdl/core/__init__.py index 845a112ec70..ed7ef34c4d4 100644 --- a/src/ansys/mapdl/core/__init__.py +++ b/src/ansys/mapdl/core/__init__.py @@ -27,7 +27,6 @@ import logging import os from typing import Dict, List, Tuple -from warnings import warn from platformdirs import user_data_dir @@ -64,7 +63,8 @@ MINIMUM_PYTHON_VERSION: Tuple[int, int] = (3, 10) # Import related globals -_HAS_ATP: bool = is_installed("ansys.tools.path") +_HAS_ATC: bool = is_installed("ansys.tools.common") +_HAS_ATP: bool = _HAS_ATC # Backward compatibility alias _HAS_CLICK: bool = is_installed("click") _HAS_DPF: bool = is_installed("ansys.dpf.core") _HAS_MATPLOTLIB: bool = is_installed("matplotlib") @@ -128,8 +128,8 @@ # ================== # # For compatibility with other versions or for convenience -if _HAS_ATP: - from ansys.tools.path.path import ( +if _HAS_ATC: + from ansys.tools.common.path import ( change_default_ansys_path, find_mapdl, get_available_ansys_installations, diff --git a/src/ansys/mapdl/core/cli/start.py b/src/ansys/mapdl/core/cli/start.py index e0383336733..2ef5a88595b 100644 --- a/src/ansys/mapdl/core/cli/start.py +++ b/src/ansys/mapdl/core/cli/start.py @@ -165,7 +165,7 @@ "--version", default=None, type=str, - help="Version of MAPDL to launch. If ``None``, the latest version is used. Versions can be provided as integers (i.e. ``version=222``) or floats (i.e. ``version=22.2``). To retrieve the available installed versions, use the function :meth:`ansys.tools.path.path.get_available_ansys_installations`.", + help="Version of MAPDL to launch. If ``None``, the latest version is used. Versions can be provided as integers (i.e. ``version=222``) or floats (i.e. ``version=22.2``). To retrieve the available installed versions, use the function :meth:`ansys.tools.common.path.get_available_ansys_installations`.", ) def start( exec_file: str, diff --git a/src/ansys/mapdl/core/launcher.py b/src/ansys/mapdl/core/launcher.py index c1ef7877e61..df0e4704827 100644 --- a/src/ansys/mapdl/core/launcher.py +++ b/src/ansys/mapdl/core/launcher.py @@ -52,7 +52,7 @@ import psutil from ansys.mapdl import core as pymapdl -from ansys.mapdl.core import _HAS_ATP, _HAS_PIM, LOG # type: ignore +from ansys.mapdl.core import _HAS_ATC, _HAS_PIM, LOG # type: ignore from ansys.mapdl.core._version import SUPPORTED_ANSYS_VERSIONS from ansys.mapdl.core.errors import ( LockFileException, @@ -77,8 +77,8 @@ if _HAS_PIM: import ansys.platform.instancemanagement as pypim # type: ignore -if _HAS_ATP: - from ansys.tools.path import version_from_path as _version_from_path +if _HAS_ATC: + from ansys.tools.common.path import version_from_path as _version_from_path @wraps(_version_from_path) def version_from_path(*args: Any, **kwargs: Any) -> int | None: @@ -919,7 +919,7 @@ def get_default_ansys() -> Union[Tuple[str, float], Tuple[Literal[""], Literal[" >>> get_default_ansys() (/usr/ansys_inc/v211/ansys/bin/ansys211, 21.1) """ - from ansys.tools.path import find_mapdl + from ansys.tools.common.path import find_mapdl return find_mapdl(supported_versions=SUPPORTED_ANSYS_VERSIONS) @@ -976,11 +976,11 @@ def get_default_ansys_version(): def check_valid_ansys() -> bool: """Checks if a valid version of ANSYS is installed and preconfigured""" - if not _HAS_ATP: + if not _HAS_ATC: raise ModuleNotFoundError( - "The package 'ansys-tools-path' is required to use this function." + "The package 'ansys-tools-common' is required to use this function." ) - from ansys.tools.path import get_mapdl_path + from ansys.tools.common.path import get_mapdl_path ansys_bin = get_mapdl_path(allow_input=False) # type: ignore if ansys_bin is not None: @@ -1041,11 +1041,11 @@ def set_MPI_additional_switches( # known issues with distributed memory parallel (DMP) if os.name == "nt" and "smp" not in add_sw_lower_case: # pragma: no cover - if _HAS_ATP: + if _HAS_ATC: condition = not force_intel and version and (222 > version >= 210) else: warnings.warn( - "Because 'ansys-tools-path' is not installed, PyMAPDL cannot check\n" + "Because 'ansys-tools-common' is not installed, PyMAPDL cannot check\n" "if this Ansys version requires the MPI fix, so if you are on Windows,\n" "the fix is applied by default.\n" "Use 'force_intel=True' to not apply the fix." @@ -1388,7 +1388,7 @@ def launch_mapdl( Versions can be provided as integers (i.e. ``version=222``) or floats (i.e. ``version=22.2``). To retrieve the available installed versions, use the function - :func:`ansys.tools.path.get_available_ansys_installations`. + :func:`ansys.tools.common.path.get_available_ansys_installations`. You can also provide this value through the environment variable :envvar:`PYMAPDL_MAPDL_VERSION`. For instance: @@ -2457,7 +2457,7 @@ def get_version( if not version: # verify version - if exec_file and _HAS_ATP: + if exec_file and _HAS_ATC: version = version_from_path("mapdl", exec_file, launch_on_hpc=launch_on_hpc) if version and version < 202: raise VersionError( @@ -2571,7 +2571,7 @@ def get_exec_file(args: Dict[str, Any]) -> None: Raises ------ ModuleNotFoundError - 'ansys-tools-path' library could not be found + 'ansys-tools-common' library could not be found FileNotFoundError Invalid exec_file path or cannot load cached MAPDL path. FileNotFoundError @@ -2585,13 +2585,13 @@ def get_exec_file(args: Dict[str, Any]) -> None: return if args["exec_file"] is None: - if not _HAS_ATP: + if not _HAS_ATC: raise ModuleNotFoundError( - "If you don't have 'ansys-tools-path' library installed, you need " + "If you don't have 'ansys-tools-common' library installed, you need " "to input the executable path ('exec_file' argument) or use the " "'PYMAPDL_MAPDL_EXEC' environment variable." ) - from ansys.tools.path import get_mapdl_path + from ansys.tools.common.path import get_mapdl_path if args.get("_debug_no_launch", False): args["exec_file"] = "" diff --git a/src/ansys/mapdl/core/licensing.py b/src/ansys/mapdl/core/licensing.py index 2924678b8bd..5ebcb25ec48 100644 --- a/src/ansys/mapdl/core/licensing.py +++ b/src/ansys/mapdl/core/licensing.py @@ -31,12 +31,12 @@ import time from typing import Iterator, Literal -from ansys.mapdl.core import _HAS_ATP, LOG +from ansys.mapdl.core import _HAS_ATC, LOG from ansys.mapdl.core.errors import LicenseServerConnectionError from ansys.mapdl.core.misc import threaded_daemon -if _HAS_ATP: - from ansys.tools.path import get_mapdl_path, version_from_path +if _HAS_ATC: + from ansys.tools.common.path import get_mapdl_path, version_from_path LOCALHOST = "127.0.0.1" LIC_PATH_ENVAR = "ANSYSLIC_DIR" @@ -150,7 +150,7 @@ def start(self, license_file: bool = True, checkout_license: bool = False): Start the checkout license thread. By default this is disabled. """ - if license_file and _HAS_ATP: + if license_file and _HAS_ATC: self._lic_file_thread = self.check_license_file() if checkout_license: self._checkout_thread = self.checkout_license() diff --git a/src/ansys/mapdl/core/mapdl_core.py b/src/ansys/mapdl/core/mapdl_core.py index b5c03d0c446..613a2a3a633 100644 --- a/src/ansys/mapdl/core/mapdl_core.py +++ b/src/ansys/mapdl/core/mapdl_core.py @@ -1745,7 +1745,7 @@ def open_gui( exec_file: str, optional Path to the MAPDL executable. If not provided, it will try to obtain - it using the `ansys.tools.path` package. If this package is not + it using the `ansys.tools.common` package. If this package is not available, it will use the same executable as the current MAPDL instance. @@ -1778,7 +1778,7 @@ def open_gui( >>> mapdl.eplot() """ # lazy load here to avoid circular import - from ansys.mapdl.core import _HAS_ATP + from ansys.mapdl.core import _HAS_ATC if not self._local: raise MapdlRuntimeError( @@ -1857,7 +1857,7 @@ def open_gui( os.chdir(run_dir) if not exec_file: - if _HAS_ATP: + if _HAS_ATC: from ansys.mapdl.core import get_mapdl_path exec_file_ = get_mapdl_path(allow_input=False) diff --git a/src/ansys/mapdl/core/pool.py b/src/ansys/mapdl/core/pool.py index f57db0d60f6..fc2f0451d78 100755 --- a/src/ansys/mapdl/core/pool.py +++ b/src/ansys/mapdl/core/pool.py @@ -29,7 +29,7 @@ import warnings import weakref -from ansys.mapdl.core import _HAS_ATP, _HAS_TQDM, LOG, launch_mapdl +from ansys.mapdl.core import _HAS_ATC, _HAS_TQDM, LOG, launch_mapdl from ansys.mapdl.core.errors import MapdlDidNotStart, MapdlRuntimeError, VersionError from ansys.mapdl.core.launcher import ( LOCALHOST, @@ -40,8 +40,8 @@ ) from ansys.mapdl.core.misc import create_temp_dir, threaded, threaded_daemon -if _HAS_ATP: - from ansys.tools.path import get_mapdl_path, version_from_path +if _HAS_ATC: + from ansys.tools.common.path import get_mapdl_path, version_from_path if _HAS_TQDM: from tqdm import tqdm @@ -276,12 +276,12 @@ def __init__( exec_file = kwargs.get("exec_file", exec_file) if not exec_file: # get default executable - if _HAS_ATP: + if _HAS_ATC: exec_file = get_mapdl_path() else: raise ValueError( "Please use 'exec_file' argument to specify the location of the ansys installation.\n" - "Alternatively, PyMAPDL can detect your ansys installation if you install 'ansys-tools-path' library." + "Alternatively, PyMAPDL can detect your ansys installation if you install 'ansys-tools-common' library." ) if exec_file is None: @@ -292,7 +292,7 @@ def __init__( ) # Checking version - if _HAS_ATP: + if _HAS_ATC: if version_from_path("mapdl", exec_file) < 211: raise VersionError("MapdlPool requires MAPDL 2021R1 or later.") diff --git a/src/ansys/mapdl/core/report.py b/src/ansys/mapdl/core/report.py index 48230f2972e..dc7ad19a94a 100644 --- a/src/ansys/mapdl/core/report.py +++ b/src/ansys/mapdl/core/report.py @@ -23,13 +23,13 @@ """Module for report features""" import os -from ansys.mapdl.core import _HAS_ATP, _HAS_PYANSYS_REPORT, _HAS_PYVISTA +from ansys.mapdl.core import _HAS_ATC, _HAS_PYANSYS_REPORT, _HAS_PYVISTA if _HAS_PYANSYS_REPORT: import ansys.tools.report as pyansys_report -if _HAS_ATP: - from ansys.tools.path import get_available_ansys_installations +if _HAS_ATC: + from ansys.tools.common.path import get_available_ansys_installations ANSYS_ENV_VARS = [ "PYMAPDL_START_INSTANCE", @@ -152,7 +152,7 @@ def mapdl_info(self): # List installed Ansys lines = ["", "Ansys Environment Report", "-" * 79] lines = ["\n", "Ansys Installation", "******************"] - if _HAS_ATP: + if _HAS_ATC: mapdl_install = get_available_ansys_installations() if not mapdl_install: @@ -165,7 +165,7 @@ def mapdl_info(self): else: mapdl_install = None lines.append( - "Unable to locate any Ansys installations because 'ansys-tools-path is not installed." + "Unable to locate any Ansys installations because 'ansys-tools-common' is not installed." ) install_info = "\n".join(lines) diff --git a/tests/common.py b/tests/common.py index 4866534bbb1..c735817030a 100644 --- a/tests/common.py +++ b/tests/common.py @@ -74,7 +74,7 @@ def is_on_local(): os.environ.get("PYMAPDL_START_INSTANCE").lower() != "false" ) # default is false - from ansys.tools.path import find_mapdl + from ansys.tools.common.path import find_mapdl _, rver = find_mapdl() @@ -109,7 +109,7 @@ def has_grpc(): return True try: - from ansys.tools.path import find_mapdl + from ansys.tools.common.path import find_mapdl except ModuleNotFoundError: return True diff --git a/tests/conftest.py b/tests/conftest.py index 6114b1f4d99..06d0b9a2066 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -209,8 +209,8 @@ def requires_dependency(dependency: str): # ------------------ # -if has_dependency("ansys-tools-path"): - from ansys.tools.path import find_mapdl +if has_dependency("ansys-tools-common"): + from ansys.tools.common.path import find_mapdl if has_dependency("pyvista"): diff --git a/tests/test_inprocess.py b/tests/test_inprocess.py index 35b5d69023a..57ac484f2b6 100644 --- a/tests/test_inprocess.py +++ b/tests/test_inprocess.py @@ -52,7 +52,7 @@ def exec_path(self) -> str: self._exec_path = os.getenv("PYMAPDL_MAPDL_EXEC") if self._exec_path is None: - from ansys.tools.path import get_mapdl_path + from ansys.tools.common.path import get_mapdl_path version: float | None = ( float(os.getenv("PYMAPDL_MAPDL_VERSION", 0)) or None diff --git a/tests/test_launcher.py b/tests/test_launcher.py index f8a15bdad8e..29e0d7d2de4 100644 --- a/tests/test_launcher.py +++ b/tests/test_launcher.py @@ -43,7 +43,7 @@ VersionError, ) from ansys.mapdl.core.launcher import ( - _HAS_ATP, + _HAS_ATC, LOCALHOST, _is_ubuntu, check_mapdl_launch_on_hpc, @@ -88,7 +88,7 @@ ) try: - from ansys.tools.path import ( + from ansys.tools.common.path import ( find_mapdl, get_available_ansys_installations, version_from_path, @@ -174,14 +174,14 @@ def test_validate_sw(): assert "msmpi" in add_sw and "INTELMPI" not in add_sw -@requires("ansys-tools-path") +@requires("ansys-tools-common") @pytest.mark.parametrize("path_data", paths) def test_version_from_path(path_data): exec_file, version = path_data assert version_from_path("mapdl", exec_file) == version -@requires("ansys-tools-path") +@requires("ansys-tools-common") def test_catch_version_from_path(): with pytest.raises(RuntimeError): version_from_path("mapdl", "abc") @@ -199,12 +199,12 @@ def test_catch_version_from_path(): ["/ansysinc/v242/ansys/bin/mapdl", 24.2, ValueError], ], ) -@requires("ansys-tools-path") +@requires("ansys-tools-common") def test_find_mapdl_linux(my_fs, path, version, raises): my_fs.os = OSType.LINUX my_fs.create_file(path) - from ansys.tools.path import find_mapdl + from ansys.tools.common.path import find_mapdl bin_file, ver = find_mapdl() @@ -218,7 +218,7 @@ def test_find_mapdl_linux(my_fs, path, version, raises): assert ver == version -@requires("ansys-tools-path") +@requires("ansys-tools-common") @patch("psutil.cpu_count", lambda *args, **kwargs: 2) @patch("ansys.mapdl.core.launcher._is_ubuntu", lambda *args, **kwargs: True) @patch("ansys.mapdl.core.launcher.get_process_at_port", lambda *args, **kwargs: None) @@ -235,7 +235,7 @@ def test_invalid_mode(mapdl, my_fs, cleared, monkeypatch): ) -@requires("ansys-tools-path") +@requires("ansys-tools-common") @pytest.mark.parametrize("version", [120, 170, 190]) @patch("psutil.cpu_count", lambda *args, **kwargs: 2) @patch("ansys.mapdl.core.launcher._is_ubuntu", lambda *args, **kwargs: True) @@ -260,7 +260,7 @@ def test_old_version_not_version(mapdl, my_fs, cleared, monkeypatch, version): ) -@requires("ansys-tools-path") +@requires("ansys-tools-common") @pytest.mark.parametrize("version", [203, 213, 351]) @patch("psutil.cpu_count", lambda *args, **kwargs: 2) @patch("ansys.mapdl.core.launcher._is_ubuntu", lambda *args, **kwargs: True) @@ -283,7 +283,7 @@ def test_not_valid_versions(mapdl, my_fs, cleared, monkeypatch, version): ) -@requires("ansys-tools-path") +@requires("ansys-tools-common") @requires("local") @requires("linux") @requires("console") @@ -294,7 +294,7 @@ def test_failed_console(): pymapdl.launch_mapdl(exec_file, mode="console", start_timeout=start_timeout) -@requires("ansys-tools-path") +@requires("ansys-tools-common") @requires("local") @requires("console") @requires("linux") @@ -307,7 +307,7 @@ def test_launch_console(version): @requires("local") @requires("nostudent") -@requires("ansys-tools-path") +@requires("ansys-tools-common") @pytest.mark.parametrize("license_name", LICENSES) def test_license_type_keyword_names(monkeypatch, license_name): exec_file = find_mapdl()[0] @@ -327,7 +327,7 @@ def test_license_type_additional_switch(license_name): @stack(*PATCH_MAPDL_START) -@requires("ansys-tools-path") +@requires("ansys-tools-common") def test_license_type_dummy(mapdl, cleared): dummy_license_type = "dummy" with pytest.warns( @@ -518,7 +518,7 @@ def test__verify_version_latest(): assert get_version("latest") is None -@requires("ansys-tools-path") +@requires("ansys-tools-common") @requires("local") def test_find_ansys(mapdl, cleared): assert find_mapdl() is not None @@ -562,7 +562,7 @@ def test_is_ubuntu(): assert _is_ubuntu() -@requires("ansys-tools-path") +@requires("ansys-tools-common") @requires("local") def test_get_default_ansys(): assert get_default_ansys() is not None @@ -886,7 +886,7 @@ def test_get_start_instance_envvar(monkeypatch, start_instance, context): @requires("local") -@requires("ansys-tools-path") +@requires("ansys-tools-common") @pytest.mark.parametrize("start_instance", [True, False]) def test_launcher_start_instance(monkeypatch, start_instance): if "PYMAPDL_START_INSTANCE" in os.environ: @@ -919,11 +919,11 @@ def test_ip_and_start_instance( monkeypatch.setenv("PYMAPDL_IP", str(ip_envvar)) # Skip if PyMAPDL cannot detect where MAPDL is installed. - if not _HAS_ATP and not os.environ.get("PYMAPDL_MAPDL_EXEC"): + if not _HAS_ATC and not os.environ.get("PYMAPDL_MAPDL_EXEC"): # if start_instance and not ip: with pytest.raises( ModuleNotFoundError, - match="If you don't have 'ansys-tools-path' library installed, you need", + match="If you don't have 'ansys-tools-common' library installed, you need", ): options = launch_mapdl( exec_file=None, @@ -1118,7 +1118,7 @@ def test_generate_start_parameters_console(): assert "timeout" not in new_args -@patch("ansys.mapdl.core.launcher._HAS_ATP", False) +@patch("ansys.mapdl.core.launcher._HAS_ATC", False) def test_get_exec_file(monkeypatch): monkeypatch.delenv("PYMAPDL_MAPDL_EXEC", False) @@ -1141,8 +1141,8 @@ def _get_application_path(*args, **kwargs): return None -@requires("ansys-tools-path") -@patch("ansys.tools.path.path._get_application_path", _get_application_path) +@requires("ansys-tools-common") +@patch("ansys.tools.common.path.path._get_application_path", _get_application_path) def test_get_exec_file_not_found_two(monkeypatch): monkeypatch.delenv("PYMAPDL_MAPDL_EXEC", False) args = {"exec_file": None, "start_instance": True} @@ -1424,12 +1424,12 @@ def test_exit_job(mock_popen, mapdl, cleared): mock_popen.assert_called_once_with(1001) -@requires("ansys-tools-path") +@requires("ansys-tools-common") @patch( - "ansys.tools.path.path._get_application_path", + "ansys.tools.common.path.path._get_application_path", lambda *args, **kwargs: "path/to/mapdl/executable", ) -@patch("ansys.tools.path.path._version_from_path", lambda *args, **kwargs: 242) +@patch("ansys.tools.common.path.path._version_from_path", lambda *args, **kwargs: 242) @stack(*PATCH_MAPDL_START) @patch("ansys.mapdl.core.launcher.launch_grpc") @patch("ansys.mapdl.core.launcher.send_scontrol") @@ -1767,11 +1767,12 @@ def fake_proc(*args, **kwargs): assert batchhost_ip == "111.22.33.44" -@requires("ansys-tools-path") +@requires("ansys-tools-common") @patch( - "ansys.tools.path.path._version_from_path", side_effect=lambda *args, **kwargs: 201 + "ansys.tools.common.path.path._version_from_path", + side_effect=lambda *args, **kwargs: 201, ) -@patch("ansys.mapdl.core._HAS_ATP", True) +@patch("ansys.mapdl.core._HAS_ATC", True) def test_get_version_version_error(monkeypatch): monkeypatch.delenv("PYMAPDL_MAPDL_VERSION", False) @@ -1981,12 +1982,12 @@ def return_everything(*arg, **kwags): assert kwargs["env"] == envvars -@requires("ansys-tools-path") +@requires("ansys-tools-common") @patch( - "ansys.tools.path.path._get_application_path", + "ansys.tools.common.path.path._get_application_path", lambda *args, **kwargs: "path/to/mapdl/executable", ) -@patch("ansys.tools.path.path._version_from_path", lambda *args, **kwargs: 242) +@patch("ansys.tools.common.path.path._version_from_path", lambda *args, **kwargs: 242) @stack(*PATCH_MAPDL) @pytest.mark.parametrize( "arg,value,method", diff --git a/tests/test_licensing.py b/tests/test_licensing.py index 3bd1bbfd77a..5457fbdfeae 100644 --- a/tests/test_licensing.py +++ b/tests/test_licensing.py @@ -261,7 +261,7 @@ def test_check_license_file_exception(license_checker): license_checker._check_license_file(0.01) -@requires("ansys-tools-path") +@requires("ansys-tools-common") def test_license_wait(): license_checker = licensing.LicenseChecker() assert not license_checker._lic_file_thread @@ -296,7 +296,7 @@ def test_license_check(): license_checker.check() -@requires("ansys-tools-path") +@requires("ansys-tools-common") def test_stop_license_checker(): license_checker = licensing.LicenseChecker() diff --git a/tests/test_mapdl.py b/tests/test_mapdl.py index 7d619894664..f94bccd1dbf 100644 --- a/tests/test_mapdl.py +++ b/tests/test_mapdl.py @@ -3165,12 +3165,12 @@ def test_muted(mapdl, prop): assert not mapdl.mute -@requires("ansys-tools-path") +@requires("ansys-tools-common") @patch( - "ansys.tools.path.path._get_application_path", + "ansys.tools.common.path.path._get_application_path", lambda *args, **kwargs: "path/to/mapdl/executable", ) -@patch("ansys.tools.path.path._version_from_path", lambda *args, **kwargs: 242) +@patch("ansys.tools.common.path.path._version_from_path", lambda *args, **kwargs: 242) @stack(*PATCH_MAPDL) @pytest.mark.parametrize("set_no_abort", [True, False, None]) @pytest.mark.parametrize("start_instance", [True, False]) diff --git a/tests/test_pool.py b/tests/test_pool.py index 0621290fe3b..6b2c45e1486 100644 --- a/tests/test_pool.py +++ b/tests/test_pool.py @@ -30,8 +30,8 @@ from conftest import ON_LOCAL, ON_STUDENT, has_dependency -if has_dependency("ansys-tools-path"): - from ansys.tools.path import find_mapdl +if has_dependency("ansys-tools-common"): + from ansys.tools.common.path import find_mapdl EXEC_FILE = find_mapdl()[0]