diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index ff2899d7..9672fc59 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -77,9 +77,9 @@ jobs: issue-number: ${{ github.event.pull_request.number }} body: | Please add one of the following labels to add this contribution to the Release Notes :point_down: - - [bug](https://github.com/pyansys/pyproduct-library/pulls?q=label%3Abug+) - - [documentation](https://github.com/pyansys/pyproduct-library/pulls?q=label%3Adocumentation+) - - [enhancement](https://github.com/pyansys/pyproduct-library/pulls?q=label%3Aenhancement+) - - [good first issue](https://github.com/pyansys/pyproduct-library/pulls?q=label%3Agood+first+issue) - - [maintenance](https://github.com/pyansys/pyproduct-library/pulls?q=label%3Amaintenance+) - - [release](https://github.com/pyansys/pyproduct-library/pulls?q=label%3Arelease+) + - [bug](https://github.com/ansys/pyproduct-library/pulls?q=label%3Abug+) + - [documentation](https://github.com/ansys/pyproduct-library/pulls?q=label%3Adocumentation+) + - [enhancement](https://github.com/ansys/pyproduct-library/pulls?q=label%3Aenhancement+) + - [good first issue](https://github.com/ansys/pyproduct-library/pulls?q=label%3Agood+first+issue) + - [maintenance](https://github.com/ansys/pyproduct-library/pulls?q=label%3Amaintenance+) + - [release](https://github.com/ansys/pyproduct-library/pulls?q=label%3Arelease+) diff --git a/README.rst b/README.rst index 9cfa6cbd..c81aba52 100644 --- a/README.rst +++ b/README.rst @@ -7,8 +7,8 @@ Ansys Python Manager (QT) :target: https://docs.pyansys.com/ :alt: PyAnsys -.. |GH-CI| image:: https://github.com/pyansys/python-installer-qt-gui/actions/workflows/ci_cd.yml/badge.svg - :target: https://github.com/pyansys/python-installer-qt-gui/actions/workflows/ci_cd.yml +.. |GH-CI| image:: https://github.com/ansys/python-installer-qt-gui/actions/workflows/ci_cd.yml/badge.svg + :target: https://github.com/ansys/python-installer-qt-gui/actions/workflows/ci_cd.yml :alt: GH-CI .. |MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg @@ -19,8 +19,8 @@ Ansys Python Manager (QT) :target: https://github.com/psf/black :alt: Black -.. |pre-commit-ci| image:: https://results.pre-commit.ci/badge/github/pyansys/python-installer-qt-gui/main.svg - :target: https://results.pre-commit.ci/latest/github/pyansys/python-installer-qt-gui/main +.. |pre-commit-ci| image:: https://results.pre-commit.ci/badge/github/ansys/python-installer-qt-gui/main.svg + :target: https://results.pre-commit.ci/latest/github/ansys/python-installer-qt-gui/main :alt: pre-commit.ci status .. readme_start @@ -37,7 +37,7 @@ you can use to install Python and (optional) PyAnsys packages. Installation ~~~~~~~~~~~~ Visit the `Releases -`__ page and pull +`__ page and pull down the latest installer. This is a simple application you can use to install Python and manage your Python environment. @@ -48,7 +48,7 @@ You can be up and running with four lines of code: .. code:: bash - git clone https://github.com/pyansys/python-installer-qt-gui + git clone https://github.com/ansys/python-installer-qt-gui cd python-installer-qt-gui pip install pip -U pip install -e . @@ -71,7 +71,7 @@ guide`_. You will need to follow these steps: .. code:: bash - git clone https://github.com/pyansys/python-installer-qt-gui + git clone https://github.com/ansys/python-installer-qt-gui #. Create a fresh-clean Python environment and activate it. Refer to the official `venv`_ documentation if you require further information: @@ -175,12 +175,12 @@ Distributing ------------ This project is vectored to be an open-source project. For the time being, feel free to distribute it internally, but direct users to visit the `Releases -`__ page +`__ page Security -------- The versions that are still supported for security updates can be found at -the `Security guidelines `_ +the `Security guidelines `_ site. Information on how to report vulenrabilities is also found. diff --git a/SECURITY.md b/SECURITY.md index 32de140e..e401f5cb 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -14,5 +14,5 @@ currently being supported with security updates. ## Reporting a Vulnerability If you detect a vulnerability, please refer to the -[Issues](https://github.com/pyansys/python-installer-qt-gui/issues) +[Issues](https://github.com/ansys/python-installer-qt-gui/issues) section of this repository and open an issue. diff --git a/doc/source/conf.py b/doc/source/conf.py index f2d88290..5f25067b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -23,7 +23,7 @@ # specify the location of your github repo html_context = { - "github_user": "pyansys", + "github_user": "ansys", "github_repo": "python-installer-qt-gui", "github_version": "main", "doc_path": "doc/source", @@ -34,13 +34,12 @@ "version_match": switcher_version, }, "check_switcher": False, - "github_url": "https://github.com/pyansys/python-installer-qt-gui", + "github_url": "https://github.com/ansys/python-installer-qt-gui", "show_prev_next": False, "show_breadcrumbs": True, "additional_breadcrumbs": [ ("PyAnsys", "https://docs.pyansys.com/"), ], - "github_url": "https://github.com/pyansys/python-installer-qt-gui", } # Sphinx extensions diff --git a/doc/source/installer.rst b/doc/source/installer.rst index 34ea51ad..b6f20079 100644 --- a/doc/source/installer.rst +++ b/doc/source/installer.rst @@ -6,7 +6,7 @@ Installing the ``Ansys Python Manager`` First step is installing the ``Ansys Python Manager``. In order to do so, follow the next steps. -#. Download the necessary installer from the `latest available release `_. +#. Download the necessary installer from the `latest available release `_. The file should be named ``Ansys-Python-Manager-Setup-v*.exe``. #. Execute the installer. diff --git a/doc/styles/Vocab/ANSYS/accept.txt b/doc/styles/Vocab/ANSYS/accept.txt index ba5d98b7..f12aecd2 100644 --- a/doc/styles/Vocab/ANSYS/accept.txt +++ b/doc/styles/Vocab/ANSYS/accept.txt @@ -4,6 +4,7 @@ Ansys Python Manager ansys metapackage miniforge +PyAnsys Python python Spyder diff --git a/pyproject.toml b/pyproject.toml index b07d39e2..db506351 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,7 +68,11 @@ freeze = [ name = "ansys.tools.installer" [project.urls] -Source = "https://github.com/pyansys/python-installer-qt-gui" +Source = "https://github.com/ansys/python-installer-qt-gui" +Issues = "https://github.com/ansys/python-installer-qt-gui/issues" +Discussions = "https://github.com/ansys/python-installer-qt-gui/discussions" +Documentation = "https://installer.docs.pyansys.com/" +Releases = "https://github.com/ansys/python-installer-qt-gui/releases" [project.scripts] ansys_python_installer = "ansys.tools.installer:open_gui" diff --git a/src/ansys/tools/installer/VERSION b/src/ansys/tools/installer/VERSION index ad8b28c2..b9f93fda 100644 --- a/src/ansys/tools/installer/VERSION +++ b/src/ansys/tools/installer/VERSION @@ -1 +1 @@ -0.3.dev0 +0.3.dev0 \ No newline at end of file diff --git a/src/ansys/tools/installer/auto_updater.py b/src/ansys/tools/installer/auto_updater.py index e8606583..a7bf37af 100644 --- a/src/ansys/tools/installer/auto_updater.py +++ b/src/ansys/tools/installer/auto_updater.py @@ -28,7 +28,7 @@ def query_gh_latest_release(token=None): """ gh = Github(login_or_token=token) - repo = gh.get_repo(f"pyansys/python-installer-qt-gui") + repo = gh.get_repo(f"ansys/python-installer-qt-gui") # Get the latest release and its tag name latest_release = repo.get_latest_release() diff --git a/src/ansys/tools/installer/common.py b/src/ansys/tools/installer/common.py index e76d221d..e4c51c75 100644 --- a/src/ansys/tools/installer/common.py +++ b/src/ansys/tools/installer/common.py @@ -83,12 +83,16 @@ def get_pkg_versions(pkg_name): """ session = requests.Session() session.verify = False - url = f"https://pypi.python.org/pypi/{pkg_name}/json" - releases = json.loads(requests.get(url).content)["releases"] - all_versions = sorted(releases, key=parse_version, reverse=True) - if pkg_name == "pyansys": - all_versions = [x for x in all_versions if int(x.split(".")[0]) > 0] + + try: + releases = json.loads(requests.get(url).content)["releases"] + all_versions = sorted(releases, key=parse_version, reverse=True) + if pkg_name == "pyansys": + all_versions = [x for x in all_versions if int(x.split(".")[0]) > 0] + except requests.exceptions.SSLError: + LOG.warning(f"Cannot connect to {url}... No version listed.") + all_versions = [""] session.verify = True diff --git a/src/ansys/tools/installer/constants.py b/src/ansys/tools/installer/constants.py index b98bfbe2..4254bab7 100644 --- a/src/ansys/tools/installer/constants.py +++ b/src/ansys/tools/installer/constants.py @@ -11,12 +11,18 @@ ABOUT_TEXT = f"""

Ansys Python Installer {__version__}

Created by the PyAnsys Team.

-

If you have any questions or issues, please open an issue in python-installer-qt-gui Issues page.

+

If you have any questions or issues, please open an issue in python-installer-qt-gui Issues page.

Alternatively, you can contact us at pyansys.core@ansys.com.

Your use of this software is governed by the MIT License. In addition, this installer allows you to access and install software that is licensed under separate terms ("Separately Licensed Software"). If you chose to install such Separately Licensed Software, you acknowledge that you are responsible for complying with any associated terms and conditions.

Copyright 2023 ANSYS, Inc. All rights reserved.

""" +UNABLE_TO_RETRIEVE_LATEST_VERSION_TEXT = f""" +

Ansys Python Installer cannot verify whether it is up-to-date or not. This might be due to a permissions issue.

+

Currently installed version is {__version__}.

+

To check for the latest released version, visit the latest release site.

+""" + PYANSYS_DOCS_TEXT = f"""

PyAnsys Documentation

Access the documentation for the different PyAnsys projects by selecting your desired project and clicking on the 'Open Website' button.

Users are then redirected to the documentation websites for each of the projects.

diff --git a/src/ansys/tools/installer/installed_table.py b/src/ansys/tools/installer/installed_table.py index 1aa08d2a..fe2ca32d 100644 --- a/src/ansys/tools/installer/installed_table.py +++ b/src/ansys/tools/installer/installed_table.py @@ -351,7 +351,12 @@ def install_pyansys_packages(self): """Install PyAnsys - chosen packages.""" chosen_pkg = self.packages_combo.currentText() chosen_ver = self.versions_combo.currentText() - cmd = f"pip install {PYANSYS_LIBS[chosen_pkg]}=={chosen_ver} && timeout 3 && exit || echo Failed to install this PyAnsys Library. Try reinstalling it with pip install {PYANSYS_LIBS[chosen_pkg]}=={chosen_ver} --force-reinstall" + pck_ver = ( + f"{PYANSYS_LIBS[chosen_pkg]}=={chosen_ver}" + if chosen_ver + else f"{PYANSYS_LIBS[chosen_pkg]}" + ) + cmd = f"pip install {pck_ver} && timeout 3 && exit || echo Failed to install this PyAnsys Library. Try reinstalling it with pip install {pck_ver} --force-reinstall" self._update_pck_mnger() self.launch_cmd(cmd) diff --git a/src/ansys/tools/installer/main.py b/src/ansys/tools/installer/main.py index dbfdc3f5..efcf5ce3 100644 --- a/src/ansys/tools/installer/main.py +++ b/src/ansys/tools/installer/main.py @@ -21,6 +21,7 @@ INSTALL_TEXT, LOG, PYTHON_VERSION_TEXT, + UNABLE_TO_RETRIEVE_LATEST_VERSION_TEXT, ) from ansys.tools.installer.create_virtual_environment import CreateVenvTab from ansys.tools.installer.installed_table import InstalledTab @@ -247,13 +248,34 @@ def _close(self): def check_for_updates(self): """Check for Ansys Python Manager application updates.""" LOG.debug("Checking for updates") - (ver, url) = query_gh_latest_release() + try: + (ver, url) = query_gh_latest_release() + except: + LOG.info("Problem requesting version... ") + ver = None + cur_ver = version.parse(__version__) LOG.debug(f"Currently installed version: {cur_ver}") LOG.debug(f"Latest version: {ver}") - if ver > cur_ver: + if not ver: + # Error occurred while requesting version... update check + # cannot be automated. Referring to source. + LOG.debug( + "Update check cannot be automatically performed. Showing info message." + ) + msgBox = QtWidgets.QMessageBox( + QtWidgets.QMessageBox.Information, + "Information", + UNABLE_TO_RETRIEVE_LATEST_VERSION_TEXT, + QtWidgets.QMessageBox.Ok, + ) + msgBox.setWindowIcon(QtGui.QIcon(ANSYS_FAVICON)) + pixmap = QPixmap(ANSYS_FAVICON).scaledToHeight(32, Qt.SmoothTransformation) + msgBox.setIconPixmap(pixmap) + msgBox.exec_() + elif ver > cur_ver: LOG.debug("Update available.") pixmap = QPixmap(ANSYS_FAVICON).scaledToHeight(32, Qt.SmoothTransformation) @@ -297,7 +319,7 @@ def visit_website(self): def report_issue(self): """Access the Ansys Python Manager issues tracker.""" - url = QtCore.QUrl("https://github.com/pyansys/python-installer-qt-gui/issues") + url = QtCore.QUrl("https://github.com/ansys/python-installer-qt-gui/issues") QtGui.QDesktopServices.openUrl(url) def show_about_dialog(self):