Skip to content
Merged
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
9 changes: 4 additions & 5 deletions frozen.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import os
import sys

from PyInstaller.utils.hooks import collect_all, collect_submodules, copy_metadata
from ansys.tools.path.misc import is_linux

block_cipher = None

Expand All @@ -15,7 +14,7 @@ except NameError:
THIS_PATH = os.getcwd()

OUT_PATH = 'ansys_python_manager'
APP_NAME = 'ansys_python_manager' if is_linux() else 'Ansys Python Manager'
APP_NAME = 'ansys_python_manager' if os.name == "posix" else 'Ansys Python Manager'

INSTALLER_PATH = os.path.join(THIS_PATH, 'src/ansys/tools/installer')
ASSETS_PATH = os.path.join(INSTALLER_PATH, 'assets')
Expand All @@ -35,12 +34,12 @@ added_files = [
]

# Missing metadata
added_files += copy_metadata('ansys-tools-path')
added_files += copy_metadata('ansys-tools-common')

if is_linux() and os.getenv("ADD_PYTHON_BINARIES","true") == "true":
if os.name == "posix" and os.getenv("ADD_PYTHON_BINARIES","true") == "true":
added_files +=[(os.path.join(ASSETS_PATH, 'python-asset'), 'assets')]

if is_linux():
if os.name == "posix":
added_files +=[(os.path.join(ASSETS_PATH, 'scripts'), 'assets')]

a = Analysis([main_py],
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencies = [
"appdirs",
"requests",
"PySide6",
"ansys-tools-path",
"ansys-tools-common",
"setuptools; python_version >= '3.12'",
]
classifiers = [
Expand All @@ -39,7 +39,7 @@ tests = [
"appdirs==1.4.4",
"requests==2.32.5",
"PySide6==6.10.1",
"ansys-tools-path==0.8.1",
"ansys-tools-common==0.4.2",
"pytest==8.3.5",
"pytest-cov==7.0.0",
"pytest-qt==4.5.0",
Expand All @@ -59,7 +59,7 @@ freeze = [
"appdirs==1.4.4",
"requests==2.32.5",
"PySide6==6.10.1",
"ansys-tools-path==0.8.1",
"ansys-tools-common==0.4.2",
]

[tool.flit.module]
Expand Down
16 changes: 4 additions & 12 deletions src/ansys/tools/installer/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import os
import sys

from ansys.tools.path.misc import is_linux

from ansys.tools.installer import __version__

LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -78,13 +76,13 @@

NAME_FOR_VENV = f"""Provide the name for your virtual environment.

<br><br>Virtual environments are created under user directory /<i>{ANSYS_LINUX_PATH + "/" + ANSYS_VENVS if is_linux() else ANSYS_VENVS}</i> by default. To configure the default path, go to File >> Configure (Ctrl + D) and provide your preferred path.
<br><br>Virtual environments are created under user directory /<i>{ANSYS_LINUX_PATH + "/" + ANSYS_VENVS if os.name == "posix" else ANSYS_VENVS}</i> by default. To configure the default path, go to File >> Configure (Ctrl + D) and provide your preferred path.

If the name provided already exists for another virtual environment, it will not be created. Users will receive a warning informing of the situation. For more details, refer <a href='https://installer.docs.pyansys.com/version/dev/installer.html#create-python-virtual-environment'>here</a>."""

SELECT_VENV_MANAGE_TAB = f"""Choose a virtual environment to manage.

It is recommended to use virtual environments for package management and launching options. Environments which are available under the user directory /<i>{ANSYS_LINUX_PATH + "/" + ANSYS_VENVS if is_linux() else ANSYS_VENVS}</i> are listed by default. To configure this default directory, refer <a href='https://installer.docs.pyansys.com/version/dev/installer.html#managing-python-environments'>here</a>."""
It is recommended to use virtual environments for package management and launching options. Environments which are available under the user directory /<i>{ANSYS_LINUX_PATH + "/" + ANSYS_VENVS if os.name == "posix" else ANSYS_VENVS}</i> are listed by default. To configure this default directory, refer <a href='https://installer.docs.pyansys.com/version/dev/installer.html#managing-python-environments'>here</a>."""

if getattr(sys, "frozen", False):
# If the application is run as a bundle, the PyInstaller bootloader
Expand Down Expand Up @@ -148,13 +146,10 @@
"PyWorkbench": "https://workbench.docs.pyansys.com",
# TOOLS
"Ansys FileTransfer Tool": "https://filetransfer.tools.docs.pyansys.com",
"Ansys Local Product Launcher": "https://local-product-launcher.tools.docs.pyansys.com",
"Ansys Tools Path": "https://path.tools.docs.pyansys.com",
"Ansys Tools Common": "https://tools.docs.pyansys.com",
"Ansys Tools Protobuf Compilation Helper": "https://ansys.github.io/ansys-tools-protoc-helper",
"Ansys Tools Visualization Interface": "https://visualization-interface.tools.docs.pyansys.com",
"PyAnsys Tools Report": "https://report.tools.docs.pyansys.com",
"PyAnsys Tools Variable Interop": "https://variableinterop.docs.pyansys.com",
"PyAnsys Tools Versioning": "https://versioning.tools.docs.pyansys.com",
"PyAnsys Units": "http://units.docs.pyansys.com",
"PyMaterials Manager": "https://manager.materials.docs.pyansys.com",
}
Expand Down Expand Up @@ -206,13 +201,10 @@
"Shared Components": "ansys-openapi-common",
# TOOLS
"Ansys FileTransfer Tool": "ansys-tools-filetransfer",
"Ansys Local Product Launcher": "ansys-tools-local-product-launcher",
"Ansys Tools Path": "ansys-tools-path",
"Ansys Tools Common": "ansys-tools-common",
"Ansys Tools Protobuf Compilation Helper": "ansys-tools-protoc-helper",
"Ansys Tools Visualization Interface": "ansys-tools-visualization-interface",
"PyAnsys Tools Report": "pyansys-tools-report",
"PyAnsys Tools Variable Interop": "pyansys-tools-variableinterop",
"PyAnsys Tools Versioning": "pyansys-tools-versioning",
"PyAnsys Units": "ansys-units",
"PyMaterials Manager": "ansys-materials-manager",
}
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/tools/installer/find_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import os
import subprocess

from ansys.tools.path import get_available_ansys_installations
from ansys.tools.common.path import get_available_ansys_installations

from ansys.tools.installer.configure_json import ConfigureJson
from ansys.tools.installer.constants import ANSYS_SUPPORTED_PYTHON_VERSIONS
Expand Down
8 changes: 1 addition & 7 deletions src/ansys/tools/installer/linux_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import shutil
import subprocess

from ansys.tools.path.misc import is_linux
from github import Github
from packaging import version

Expand Down Expand Up @@ -60,12 +59,7 @@ def is_linux_os():
>>> is_linux_os
True
"""
try:
if is_linux():
return is_linux()
return False
except:
return False
return os.name == "posix"


def get_vanilla_url_and_filename(selected_version):
Expand Down