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
12 changes: 6 additions & 6 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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+)
18 changes: 9 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -37,7 +37,7 @@ you can use to install Python and (optional) PyAnsys packages.
Installation
~~~~~~~~~~~~
Visit the `Releases
<https://github.com/pyansys/python-installer-qt-gui/releases>`__ page and pull
<https://github.com/ansys/python-installer-qt-gui/releases>`__ page and pull
down the latest installer. This is a simple application you can use to install
Python and manage your Python environment.

Expand All @@ -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 .
Expand All @@ -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:
Expand Down Expand Up @@ -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
<https://github.com/pyansys/python-installer-qt-gui/releases>`__ page
<https://github.com/ansys/python-installer-qt-gui/releases>`__ page

Security
--------
The versions that are still supported for security updates can be found at
the `Security guidelines <https://github.com/pyansys/python-installer-qt-gui/blob/main/SECURITY.md>`_
the `Security guidelines <https://github.com/ansys/python-installer-qt-gui/blob/main/SECURITY.md>`_
site. Information on how to report vulenrabilities is also found.


Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
5 changes: 2 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doc/source/installer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/pyansys/python-installer-qt-gui/releases/latest>`_.
#. Download the necessary installer from the `latest available release <https://github.com/ansys/python-installer-qt-gui/releases/latest>`_.
The file should be named ``Ansys-Python-Manager-Setup-v*.exe``.

#. Execute the installer.
Expand Down
1 change: 1 addition & 0 deletions doc/styles/Vocab/ANSYS/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Ansys Python Manager
ansys
metapackage
miniforge
PyAnsys
Python
python
Spyder
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/tools/installer/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.dev0
0.3.dev0
2 changes: 1 addition & 1 deletion src/ansys/tools/installer/auto_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
14 changes: 9 additions & 5 deletions src/ansys/tools/installer/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion src/ansys/tools/installer/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@

ABOUT_TEXT = f"""<h2>Ansys Python Installer {__version__}</h2>
<p>Created by the PyAnsys Team.</p>
<p>If you have any questions or issues, please open an issue in <a href='https://github.com/pyansys/python-installer-qt-gui/issues'>python-installer-qt-gui Issues</a> page.</p>
<p>If you have any questions or issues, please open an issue in <a href='https://github.com/ansys/python-installer-qt-gui/issues'>python-installer-qt-gui Issues</a> page.</p>
<p>Alternatively, you can contact us at <a href='mailto:[email protected]'>[email protected]</a>.</p>
<p>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.</p>
<p>Copyright 2023 ANSYS, Inc. All rights reserved.</p>
"""

UNABLE_TO_RETRIEVE_LATEST_VERSION_TEXT = f"""
<p>Ansys Python Installer cannot verify whether it is up-to-date or not. This might be due to a permissions issue.</p>
<p>Currently installed version is {__version__}.</p>
<p>To check for the latest released version, visit the <a href='https://github.com/ansys/python-installer-qt-gui/releases/latest'> latest release</a> site.</p>
"""

PYANSYS_DOCS_TEXT = f"""<h2>PyAnsys Documentation</h2>
<p>Access the documentation for the different PyAnsys projects by selecting your desired project and clicking on the 'Open Website' button.</p>
<p>Users are then redirected to the documentation websites for each of the projects.</p>
Expand Down
7 changes: 6 additions & 1 deletion src/ansys/tools/installer/installed_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
28 changes: 25 additions & 3 deletions src/ansys/tools/installer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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):
Expand Down