From eb2a5f5bdd090d683936acee29f29861a671051c Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 22 Jan 2025 20:08:14 +0100 Subject: [PATCH 01/28] doc: getting started layout --- doc/source/getting-started.rst | 38 +++++ doc/source/getting-started/about.rst | 45 ++++++ doc/source/getting-started/install.rst | 2 + .../prerequisites.rst} | 46 ++++-- doc/source/getting_started.rst | 136 ------------------ doc/source/index.rst | 2 +- doc/source/links.rst | 17 ++- 7 files changed, 137 insertions(+), 149 deletions(-) create mode 100644 doc/source/getting-started.rst create mode 100644 doc/source/getting-started/about.rst create mode 100644 doc/source/getting-started/install.rst rename doc/source/{supported_versions.rst => getting-started/prerequisites.rst} (74%) delete mode 100644 doc/source/getting_started.rst diff --git a/doc/source/getting-started.rst b/doc/source/getting-started.rst new file mode 100644 index 00000000..1747475e --- /dev/null +++ b/doc/source/getting-started.rst @@ -0,0 +1,38 @@ +Getting started +=============== + +This page helps you quickly get started with PyAnsys. It lists all the +prerequisites and guides you step by step to install the project on your +platform. + +.. grid:: 1 1 3 3 + + .. grid-item-card:: :fa:`info-circle` About PyAnsys + :link: getting-started/about + :link-type: doc + :padding: 2 2 2 2 + + Learn more about PyAnsys and its ecosystem + + .. grid-item-card:: :fa:`tasks` Prerequisites + :link: getting-started/prerequisites + :link-type: doc + :padding: 2 2 2 2 + + What you need prior installing PyAnsys + + .. grid-item-card:: :fa:`download` Install + :link: getting-started/install + :link-type: doc + :padding: 2 2 2 2 + + Guidelines on how to install PyAnsys in your system + +.. toctree:: + :maxdepth: 3 + :hidden: + + About + Prerequisites + Install + diff --git a/doc/source/getting-started/about.rst b/doc/source/getting-started/about.rst new file mode 100644 index 00000000..21793285 --- /dev/null +++ b/doc/source/getting-started/about.rst @@ -0,0 +1,45 @@ +About +##### + +PyAnsys is an ecosystem of tools and libraries for interfacing with `Ansys`_ +products. + +PyAnsys is a collection of Python libraries and tools developed by `ANSYS, Inc.`_ +that provides access to `Ansys products`_, enabling users to perform +engineering simulations, data processing, and automation tasks using Python. + +Key feature of PyAnsys +====================== + +PyAnsys shines in the following areas: + +- **Automation of workflows:** PyAnsys enables users to automate repetitive or + complex simulation tasks. + +- **Integration with the Python ecosystem:** users can leverage the Python + ecosystem, including libraries like `NumPy`_, `SciPy`_, `Pandas`_, and + `Matplotlib`_. + +- **Cross-product functionality:** PyAnsys provides Python APIs for various + Ansys services and products. By allowing users to interact with multiple + products in a single environment, PyAnsys enables users to streamline their + workflows. + +The PyAnsys ecosystem +===================== + +PyAnsys libraries can be classified into wrappers and tools. + +Wrappers +-------- + +These are Python libraries that provide direct access to Ansys products. +Communication between the product and the library uses `gRPC `_. +Therefore, users can have the product installed remotely and connect to that +remote instance. + +Tools +----- + +These are Python libraries that provide additional functionality to the +wrappers. diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst new file mode 100644 index 00000000..89043b88 --- /dev/null +++ b/doc/source/getting-started/install.rst @@ -0,0 +1,2 @@ +Installation +############ diff --git a/doc/source/supported_versions.rst b/doc/source/getting-started/prerequisites.rst similarity index 74% rename from doc/source/supported_versions.rst rename to doc/source/getting-started/prerequisites.rst index 3aaa41c2..c48c475a 100644 --- a/doc/source/supported_versions.rst +++ b/doc/source/getting-started/prerequisites.rst @@ -1,20 +1,36 @@ -.. _supported_versions: +Prerequisites +############# -Python versions +You need to have the following prerequisites to get started with PyAnsys: + +- A valid Python version +- A licensed version of Ansys + +Download Ansys +============== + +Download Ansys software from the `Ansys Customer Portal`_. + +Download Python =============== -The PyAnsys ecosystem follows `SPEC-0`_ for Python version support, -which is also similar to `NEP 29`_. This means: +Download and install the latest stable version of Python from the +`https://www.python.org./downloads`_. + + +Suported Python versions +------------------------ -* PyAnsys packages are expected to drop support for Python versions **3 years** after their - initial release. +The PyAnsys ecosystem follows `SPEC-0`_ for Python version support. This +implies that PyAnsys packages drop support for a Python version three years +after their initial release. You can find below the timeline for the end of support for each Python version according to the SPEC-0 policy as well as a table showing the Python versions supported by each PyAnsys metapackage, which might slightly differ from the SPEC-0 policy but is always aligned with it. -* Grayed out Python versions are no longer supported by the current version of the PyAnsys metapackage. -* Light blue Python versions are currently supported. +* Python versions in gray are no not supported +* Python versions in light blue are currently supported * Dark blue Python versions are upcoming Python releases for which support is expected in the future. Some extra remarks: @@ -38,7 +54,14 @@ Some extra remarks: Python 3.12 :active, des6, 2023-10-02, 3y Python 3.13 : des7, 2024-10-01, 3y -Below you can find a list of the Python versions supported by each PyAnsys metapackage release: +Below you can find a list of the Python versions supported by each PyAnsys +metapackage release: + +.. jinja:: package_version_for_metapackage + + {% for metapackage, (lower, upper) in package_version_for_metapackage %} + metapackage, lower, upper + {% endfor %} +-----------------+----------------------------+ | Package version | Python versions supported | @@ -58,11 +81,12 @@ Below you can find a list of the Python versions supported by each PyAnsys metap .. LINKS -.. _SPEC-0: https://scientific-python.org/specs/spec-0000/ -.. _NEP 29: https://numpy.org/neps/nep-0029-deprecation_policy.html .. _2023.1: https://pypi.org/project/pyansys/2023.1.3/ .. _2023.2: https://pypi.org/project/pyansys/2023.2.11/ .. _2024.1: https://pypi.org/project/pyansys/2024.1.8/ .. _2024.2: https://pypi.org/project/pyansys/2024.2.2/ .. _2025.1: https://pypi.org/project/pyansys/2025.1.0/ .. _development: https://github.com/ansys/pyansys + + + diff --git a/doc/source/getting_started.rst b/doc/source/getting_started.rst deleted file mode 100644 index 41afef4e..00000000 --- a/doc/source/getting_started.rst +++ /dev/null @@ -1,136 +0,0 @@ -Getting started -=============== - -PyAnsys libraries fall into two categories: - -- Wrappers over products like `MAPDL `_, `Fluent `_, or `AEDT `_ -- Supporting libraries like `DPF `_ - -Most PyAnsys packages require a local installation of Ansys. The version -of Ansys installed dictates the interface and features available to -you. However, PyAnsys libraries use `gRPC `_ to communicate to the -products, you can have the product installed remotely and connect to that -remote instance. This still requires that you need a copy of Ansys installed on -the host machine. - -For more information on getting a licensed copy of Ansys, visit `Ansys -`_. If you are a student, consider installing a student version by -visiting `Ansys for Students `_. - - -************ -Installation -************ - -There are several ways of installing PyAnsys depending on your use case, but -the easiest is simply to run: - -.. code:: bash - - pip install pyansys - -This installs all the PyAnsys libraries for the latest released -version of Ansys, for example, v2023R1. - -You can always install libraries individually by visiting the install page for -each library. For example, for PyAEDT: - -.. code:: bash - - pip install pyaedt - - -User mode installation -^^^^^^^^^^^^^^^^^^^^^^ - -Before installing ``pyansys`` in user mode, ensure that you have the latest -version of `pip`_ with: - -.. code:: bash - - python -m pip install -U pip - -Then, install ``pyansys`` with: - -.. code:: bash - - python -m pip install pyansys - -If you are interested in **installing an extra target** such as ``fluent-all``: - -.. code:: bash - - python -m pip install pyansys[fluent-all] - -If you are interested in **installing a specific version** such as ``2023.1.0``: - -.. code:: bash - - python -m pip install pyansys==2023.1.0 - - -Offline mode installation -^^^^^^^^^^^^^^^^^^^^^^^^^ - -If you lack an internet connection on your installation machine, the -recommended way of installing the ``pyansys`` metapackage is downloading the -wheelhouse archive from the `Releases Page `_ for your -corresponding machine architecture. - -Each wheelhouse archive contains all the Python wheels necessary to install -``pyansys`` metapackage from scratch on Windows, Linux, and MacOS from Python -3.10 to 3.12. You can install this on an isolated system with a fresh Python -installation or on a virtual environment. - -For example, on Linux with Python 3.10, unzip the wheelhouse archive and install -it with the following: - -.. code:: bash - - unzip pyansys-v2025.1.dev0-wheelhouse-Linux-3.10-core.zip wheelhouse - pip install pyansys -f wheelhouse --no-index --upgrade --ignore-installed - -If you're on Windows with Python 3.10, unzip to a wheelhouse directory and install using the same command as above. - -Consider installing using a `virtual environment `_. - - -Versioning system ------------------ - -The ``pyansys`` metapackage follows a semantic-like versioning system, though -it has been adapted to the Ansys product release mechanism. In that sense, the -following kind of versioning system is followed: - -.. code:: bash - - XXXX.Y.ZZ - -Where: - -- ``XXXX`` is the Ansys product release year (for example, 2022) -- ``Y`` is the Ansys product release within the same year (for example, 1, - which relates to R1) -- ``ZZ`` is the patched versions to the ``pyansys`` metapackage, if any. - -Consequently, the first ``pyansys`` metapackage compatible with the 2024 R2 -release would be: - -.. code:: bash - - 2024.2.0 - -And any subsequent patched version of that package would be: - -.. code:: bash - - 2024.2.1 - 2024.2.2 - 2024.2.3 - ... - -You can request for a specific version install when pip installing your package: - -.. code:: bash - - python -m pip install pyansys==2024.2.0 diff --git a/doc/source/index.rst b/doc/source/index.rst index 303189a6..e28d54dc 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -9,7 +9,7 @@ it is now a collection of many Python packages for using Ansys products through :hidden: :maxdepth: 3 - getting_started + getting-started user_guide api examples diff --git a/doc/source/links.rst b/doc/source/links.rst index db61cc7e..504f9561 100644 --- a/doc/source/links.rst +++ b/doc/source/links.rst @@ -1,4 +1,4 @@ -.. #Getting started +.. Getting started .. _mapdl_course: https://www.ansys.com/training-center/course-catalog/structures/ansys-mechanical-advanced-use-of-mapdl-in-mechanical .. _ansys_fluent_page: https://www.ansys.com/products/fluids/ansys-fluent .. _ansys_aedt_page: https://www.ansys.com/products/electronics/ansys-maxwell @@ -9,3 +9,18 @@ .. _pip: https://pypi.org/project/pip/ .. _pyansys_releases: https://github.com/ansys/pyansys/releases .. _venv_docs: https://docs.python.org/3/library/venv.html + +.. ANSYS and products +.. _ANSYS, Inc.: https://ansys.com +.. _Ansys products: https://ansys.com/products + +.. Python libraries +.. _Numpy: https://numpy.org/ +.. _SciPy: https://www.scipy.org/ +.. _Pandas: https://pandas.pydata.org/ +.. _Matplotlib: https://matplotlib.org/ + +.. PEPs, NEPs, and SPECs +.. _NEP 29: https://numpy.org/neps/nep-0029-deprecation_policy.html +.. _SPEC-0: https://scientific-python.org/specs/spec-0000/ + From 67e61402edae3a5eb25fc922987ea491697a37be Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 22 Jan 2025 21:17:07 +0100 Subject: [PATCH 02/28] doc: complete prerequisites --- doc/source/conf.py | 22 +++++- doc/source/getting-started/about.rst | 35 ++++----- doc/source/getting-started/prerequisites.rst | 76 +++++++------------- doc/source/links.rst | 1 + 4 files changed, 63 insertions(+), 71 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 50fbbba5..f07a437f 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,5 +1,6 @@ """Configuration file for docs.pyansys.com landing page.""" + from datetime import datetime import json import os @@ -89,8 +90,27 @@ metadata = Path(__file__).parent.parent.parent / "projects.yaml" +supported_python_versions_for_metapackage = [ + {"version": "2023.1", "python_versions": "Python 3.7 - Python 3.10", "link": "https://pypi.org/project/pyansys/2023.1.3/"}, + {"version": "2023.2", "python_versions": "Python 3.8 - Python 3.11", "link": "https://pypi.org/project/pyansys/2023.2.11/"}, + {"version": "2024.1", "python_versions": "Python 3.9 - Python 3.12", "link": "https://pypi.org/project/pyansys/2024.1.8/"}, + {"version": "2024.2", "python_versions": "Python 3.9 - Python 3.12", "link": "https://pypi.org/project/pyansys/2024.2.2/"}, + {"version": "2025.1", "python_versions": "Python 3.10 - Python 3.12", "link": "https://pypi.org/project/pyansys/2025.1.0/"}, + {"version": "development", "python_versions": "Python 3.10 - Python 3.12", "link": "https://github.com/ansys/pyansys"}, +] + +supported_python_versions_by_metapackage_version = [ + {"version": "2023.1", "python": ("3.7", "3.10"), "pypi": "https://pypi.org/project/pyansys/2023.1.3/"}, + {"version": "2023.2", "python": ("3.8", "3.11"), "pypi": "https://pypi.org/project/pyansys/2023.2.11/"}, + {"version": "2024.1", "python": ("3.9", "3.12"), "pypi": "https://pypi.org/project/pyansys/2024.1.8/"}, + {"version": "2024.2", "python": ("3.9", "3.12"), "pypi": "https://pypi.org/project/pyansys/2024.2.2/"}, + {"version": "2025.1", "python": ("3.10", "3.12"), "pypi": "https://pypi.org/project/pyansys/2025.1.0/"}, + {"version": "development", "python": ("3.10", "3.12"), "pypi": "https://github.com/ansys/pyansys"}, +] + jinja_contexts = { - "project_context": {"projects": yaml.safe_load(metadata.read_text(encoding="utf-8"))} + "project_context": {"projects": yaml.safe_load(metadata.read_text(encoding="utf-8"))}, + "releases": {"table_data": supported_python_versions_by_metapackage_version}, } html_context = { diff --git a/doc/source/getting-started/about.rst b/doc/source/getting-started/about.rst index 21793285..48301256 100644 --- a/doc/source/getting-started/about.rst +++ b/doc/source/getting-started/about.rst @@ -1,15 +1,17 @@ About ##### -PyAnsys is an ecosystem of tools and libraries for interfacing with `Ansys`_ -products. +PyAnsys is a collection of Python libraries and tools developed by `ANSYS, +Inc.`_ It provides access to `Ansys products`_ by using a Python interface, +enabling users to perform engineering simulations, data processing, and +automation tasks. -PyAnsys is a collection of Python libraries and tools developed by `ANSYS, Inc.`_ -that provides access to `Ansys products`_, enabling users to perform -engineering simulations, data processing, and automation tasks using Python. +To ease the installation of the libraries and tools, PyAnsys provides a +metapackage. Its goal is to simplify the installation process of the PyAnsys +ecosystem and ensure compatibility between its projects. -Key feature of PyAnsys -====================== +Key features of PyAnsys +======================= PyAnsys shines in the following areas: @@ -17,8 +19,7 @@ PyAnsys shines in the following areas: complex simulation tasks. - **Integration with the Python ecosystem:** users can leverage the Python - ecosystem, including libraries like `NumPy`_, `SciPy`_, `Pandas`_, and - `Matplotlib`_. + ecosystem. - **Cross-product functionality:** PyAnsys provides Python APIs for various Ansys services and products. By allowing users to interact with multiple @@ -30,16 +31,10 @@ The PyAnsys ecosystem PyAnsys libraries can be classified into wrappers and tools. -Wrappers --------- +**Wrappers** are Python libraries that provide direct access to Ansys products. +Communication between the product and the library is performed via `gRPC +`_. Therefore, users can have the product installed remotely and connect +to that remote instance. -These are Python libraries that provide direct access to Ansys products. -Communication between the product and the library uses `gRPC `_. -Therefore, users can have the product installed remotely and connect to that -remote instance. - -Tools ------ - -These are Python libraries that provide additional functionality to the +**Tools** are Python libraries that provide additional functionality to the wrappers. diff --git a/doc/source/getting-started/prerequisites.rst b/doc/source/getting-started/prerequisites.rst index c48c475a..77e95a73 100644 --- a/doc/source/getting-started/prerequisites.rst +++ b/doc/source/getting-started/prerequisites.rst @@ -6,37 +6,24 @@ You need to have the following prerequisites to get started with PyAnsys: - A valid Python version - A licensed version of Ansys -Download Ansys -============== +Download and install Ansys +========================== -Download Ansys software from the `Ansys Customer Portal`_. +Download Ansys software from the `Ansys Customer Portal`_. Ensure you have a +license to use the software. -Download Python -=============== +Download and install Python +=========================== Download and install the latest stable version of Python from the -`https://www.python.org./downloads`_. - +`https://www.python.org/downloads `_. Suported Python versions ------------------------ The PyAnsys ecosystem follows `SPEC-0`_ for Python version support. This implies that PyAnsys packages drop support for a Python version three years -after their initial release. - -You can find below the timeline for the end of support for each Python version according to the SPEC-0 policy -as well as a table showing the Python versions supported by each PyAnsys metapackage, which might slightly -differ from the SPEC-0 policy but is always aligned with it. - -* Python versions in gray are no not supported -* Python versions in light blue are currently supported -* Dark blue Python versions are upcoming Python releases for which support is expected in the future. - -Some extra remarks: - -* The length of the Python version boxes is indicative of the support duration according to the `SPEC-0`_ policy. -* The color of the Python version boxes is indicative of the PyAnsys metapackage current support. +after their initial release: .. mermaid:: :caption: Python versions supported by SPEC-0 policy (red line) and PyAnsys Python versions supported (color coded) @@ -54,39 +41,28 @@ Some extra remarks: Python 3.12 :active, des6, 2023-10-02, 3y Python 3.13 : des7, 2024-10-01, 3y -Below you can find a list of the Python versions supported by each PyAnsys -metapackage release: - -.. jinja:: package_version_for_metapackage +In previous diagram: - {% for metapackage, (lower, upper) in package_version_for_metapackage %} - metapackage, lower, upper - {% endfor %} +* Python versions in gray are no not supported +* Python versions in light blue are supported +* Python versions in dark blue will be supported in the future -+-----------------+----------------------------+ -| Package version | Python versions supported | -+=================+============================+ -| `2023.1`_ | Python 3.7 - Python 3.10 | -+-----------------+----------------------------+ -| `2023.2`_ | Python 3.8 - Python 3.11 | -+-----------------+----------------------------+ -| `2024.1`_ | Python 3.9 - Python 3.12 | -+-----------------+----------------------------+ -| `2024.2`_ | Python 3.9 - Python 3.12 | -+-----------------+----------------------------+ -| `2025.1`_ | Python 3.10 - Python 3.12 | -+-----------------+----------------------------+ -| `development`_ | Python 3.10 - Python 3.12 | -+-----------------+----------------------------+ +.. note:: + Adoption and deprecation of Python versions in the PyAnsys ecosystem are + tentative. Delays may occur due to third party dependencies. -.. LINKS -.. _2023.1: https://pypi.org/project/pyansys/2023.1.3/ -.. _2023.2: https://pypi.org/project/pyansys/2023.2.11/ -.. _2024.1: https://pypi.org/project/pyansys/2024.1.8/ -.. _2024.2: https://pypi.org/project/pyansys/2024.2.2/ -.. _2025.1: https://pypi.org/project/pyansys/2025.1.0/ -.. _development: https://github.com/ansys/pyansys +Below you can find a list of the Python versions supported by each PyAnsys +metapackage release: +.. jinja:: releases + .. list-table:: Supported Package Versions + :header-rows: 1 + * - PyAnsys metapackage version + - Supported Python versions + {% for release in table_data %} + * - `{{ release.version }} `_ + - From Python {{ release.python[0] }} up to Python {{ release.python[1] }} + {% endfor %} diff --git a/doc/source/links.rst b/doc/source/links.rst index 504f9561..42c8a9e7 100644 --- a/doc/source/links.rst +++ b/doc/source/links.rst @@ -13,6 +13,7 @@ .. ANSYS and products .. _ANSYS, Inc.: https://ansys.com .. _Ansys products: https://ansys.com/products +.. _Ansys Customer Portal: https://download.ansys.com .. Python libraries .. _Numpy: https://numpy.org/ From f016688060ed1b52ac3aa79badfd06adb1593ead Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 20:18:40 +0000 Subject: [PATCH 03/28] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/source/conf.py | 73 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 60 insertions(+), 13 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index f07a437f..007576c1 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,6 +1,5 @@ """Configuration file for docs.pyansys.com landing page.""" - from datetime import datetime import json import os @@ -91,21 +90,69 @@ metadata = Path(__file__).parent.parent.parent / "projects.yaml" supported_python_versions_for_metapackage = [ - {"version": "2023.1", "python_versions": "Python 3.7 - Python 3.10", "link": "https://pypi.org/project/pyansys/2023.1.3/"}, - {"version": "2023.2", "python_versions": "Python 3.8 - Python 3.11", "link": "https://pypi.org/project/pyansys/2023.2.11/"}, - {"version": "2024.1", "python_versions": "Python 3.9 - Python 3.12", "link": "https://pypi.org/project/pyansys/2024.1.8/"}, - {"version": "2024.2", "python_versions": "Python 3.9 - Python 3.12", "link": "https://pypi.org/project/pyansys/2024.2.2/"}, - {"version": "2025.1", "python_versions": "Python 3.10 - Python 3.12", "link": "https://pypi.org/project/pyansys/2025.1.0/"}, - {"version": "development", "python_versions": "Python 3.10 - Python 3.12", "link": "https://github.com/ansys/pyansys"}, + { + "version": "2023.1", + "python_versions": "Python 3.7 - Python 3.10", + "link": "https://pypi.org/project/pyansys/2023.1.3/", + }, + { + "version": "2023.2", + "python_versions": "Python 3.8 - Python 3.11", + "link": "https://pypi.org/project/pyansys/2023.2.11/", + }, + { + "version": "2024.1", + "python_versions": "Python 3.9 - Python 3.12", + "link": "https://pypi.org/project/pyansys/2024.1.8/", + }, + { + "version": "2024.2", + "python_versions": "Python 3.9 - Python 3.12", + "link": "https://pypi.org/project/pyansys/2024.2.2/", + }, + { + "version": "2025.1", + "python_versions": "Python 3.10 - Python 3.12", + "link": "https://pypi.org/project/pyansys/2025.1.0/", + }, + { + "version": "development", + "python_versions": "Python 3.10 - Python 3.12", + "link": "https://github.com/ansys/pyansys", + }, ] supported_python_versions_by_metapackage_version = [ - {"version": "2023.1", "python": ("3.7", "3.10"), "pypi": "https://pypi.org/project/pyansys/2023.1.3/"}, - {"version": "2023.2", "python": ("3.8", "3.11"), "pypi": "https://pypi.org/project/pyansys/2023.2.11/"}, - {"version": "2024.1", "python": ("3.9", "3.12"), "pypi": "https://pypi.org/project/pyansys/2024.1.8/"}, - {"version": "2024.2", "python": ("3.9", "3.12"), "pypi": "https://pypi.org/project/pyansys/2024.2.2/"}, - {"version": "2025.1", "python": ("3.10", "3.12"), "pypi": "https://pypi.org/project/pyansys/2025.1.0/"}, - {"version": "development", "python": ("3.10", "3.12"), "pypi": "https://github.com/ansys/pyansys"}, + { + "version": "2023.1", + "python": ("3.7", "3.10"), + "pypi": "https://pypi.org/project/pyansys/2023.1.3/", + }, + { + "version": "2023.2", + "python": ("3.8", "3.11"), + "pypi": "https://pypi.org/project/pyansys/2023.2.11/", + }, + { + "version": "2024.1", + "python": ("3.9", "3.12"), + "pypi": "https://pypi.org/project/pyansys/2024.1.8/", + }, + { + "version": "2024.2", + "python": ("3.9", "3.12"), + "pypi": "https://pypi.org/project/pyansys/2024.2.2/", + }, + { + "version": "2025.1", + "python": ("3.10", "3.12"), + "pypi": "https://pypi.org/project/pyansys/2025.1.0/", + }, + { + "version": "development", + "python": ("3.10", "3.12"), + "pypi": "https://github.com/ansys/pyansys", + }, ] jinja_contexts = { From 4d450f8190f6e65998032715ac8b0cce085e77cb Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Thu, 23 Jan 2025 09:02:15 +0100 Subject: [PATCH 04/28] doc: use datatables --- doc/source/conf.py | 47 +++--------------- doc/source/getting-started/about.rst | 5 +- doc/source/getting-started/prerequisites.rst | 50 +++++++++++++++----- 3 files changed, 47 insertions(+), 55 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 007576c1..cd72cf3e 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -89,72 +89,39 @@ metadata = Path(__file__).parent.parent.parent / "projects.yaml" -supported_python_versions_for_metapackage = [ +supported_python_versions_by_metapackage_version = [ { "version": "2023.1", - "python_versions": "Python 3.7 - Python 3.10", + "python": {"lower": "3.7", "upper": "3.10"}, "link": "https://pypi.org/project/pyansys/2023.1.3/", }, { "version": "2023.2", - "python_versions": "Python 3.8 - Python 3.11", + "python": {"lower": "3.8", "upper": "3.11"}, "link": "https://pypi.org/project/pyansys/2023.2.11/", }, { "version": "2024.1", - "python_versions": "Python 3.9 - Python 3.12", + "python": {"lower": "3.9", "upper": "3.12"}, "link": "https://pypi.org/project/pyansys/2024.1.8/", }, { "version": "2024.2", - "python_versions": "Python 3.9 - Python 3.12", + "python": {"lower": "3.9", "upper": "3.12"}, "link": "https://pypi.org/project/pyansys/2024.2.2/", }, { "version": "2025.1", - "python_versions": "Python 3.10 - Python 3.12", + "python": {"lower": "3.10", "upper": "3.12"}, "link": "https://pypi.org/project/pyansys/2025.1.0/", }, { "version": "development", - "python_versions": "Python 3.10 - Python 3.12", + "python": {"lower": "3.10", "upper": "3.12"}, "link": "https://github.com/ansys/pyansys", }, ] -supported_python_versions_by_metapackage_version = [ - { - "version": "2023.1", - "python": ("3.7", "3.10"), - "pypi": "https://pypi.org/project/pyansys/2023.1.3/", - }, - { - "version": "2023.2", - "python": ("3.8", "3.11"), - "pypi": "https://pypi.org/project/pyansys/2023.2.11/", - }, - { - "version": "2024.1", - "python": ("3.9", "3.12"), - "pypi": "https://pypi.org/project/pyansys/2024.1.8/", - }, - { - "version": "2024.2", - "python": ("3.9", "3.12"), - "pypi": "https://pypi.org/project/pyansys/2024.2.2/", - }, - { - "version": "2025.1", - "python": ("3.10", "3.12"), - "pypi": "https://pypi.org/project/pyansys/2025.1.0/", - }, - { - "version": "development", - "python": ("3.10", "3.12"), - "pypi": "https://github.com/ansys/pyansys", - }, -] - jinja_contexts = { "project_context": {"projects": yaml.safe_load(metadata.read_text(encoding="utf-8"))}, "releases": {"table_data": supported_python_versions_by_metapackage_version}, diff --git a/doc/source/getting-started/about.rst b/doc/source/getting-started/about.rst index 48301256..0c335084 100644 --- a/doc/source/getting-started/about.rst +++ b/doc/source/getting-started/about.rst @@ -6,9 +6,8 @@ Inc.`_ It provides access to `Ansys products`_ by using a Python interface, enabling users to perform engineering simulations, data processing, and automation tasks. -To ease the installation of the libraries and tools, PyAnsys provides a -metapackage. Its goal is to simplify the installation process of the PyAnsys -ecosystem and ensure compatibility between its projects. +To ease the installation of the libraries and tools, PyAnsys provides a Python +metapackage. This ensures compatibility between its projects. Key features of PyAnsys ======================= diff --git a/doc/source/getting-started/prerequisites.rst b/doc/source/getting-started/prerequisites.rst index 77e95a73..e4fad353 100644 --- a/doc/source/getting-started/prerequisites.rst +++ b/doc/source/getting-started/prerequisites.rst @@ -27,7 +27,7 @@ after their initial release: .. mermaid:: :caption: Python versions supported by SPEC-0 policy (red line) and PyAnsys Python versions supported (color coded) - :alt: Python versions supported by SPEC-0 policy (red line) and PyAnsys Python versions supported (color coded) + :alt: Current Python versions supported by the PyAnsys metapackage :align: center gantt @@ -43,8 +43,8 @@ after their initial release: In previous diagram: -* Python versions in gray are no not supported -* Python versions in light blue are supported +* Python versions in gray are no longer supported +* Python versions in light blue are currently supported * Python versions in dark blue will be supported in the future .. note:: @@ -57,12 +57,38 @@ metapackage release: .. jinja:: releases - .. list-table:: Supported Package Versions - :header-rows: 1 - - * - PyAnsys metapackage version - - Supported Python versions - {% for release in table_data %} - * - `{{ release.version }} `_ - - From Python {{ release.python[0] }} up to Python {{ release.python[1] }} - {% endfor %} + .. raw:: html + + + + + + + + + + + + + + + + + + + + + {% for release in table_data %} + + + + + + + {% endfor %} + +
PyAnsys versionMin. Python versionMax. Python versionDownload
{{ release.version }}{{ release.python.lower }}{{ release.python.upper }}{{ release.link }}
From 8bd3bb9d1e32e718071fd4e7a50a0fbb1885dc3a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 08:03:17 +0000 Subject: [PATCH 05/28] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/source/getting-started/prerequisites.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/source/getting-started/prerequisites.rst b/doc/source/getting-started/prerequisites.rst index e4fad353..5e07f2ab 100644 --- a/doc/source/getting-started/prerequisites.rst +++ b/doc/source/getting-started/prerequisites.rst @@ -58,19 +58,19 @@ metapackage release: .. jinja:: releases .. raw:: html - + - + - + From ef825edeca4cb5237c914f5e8ff2a76cf6f8e44e Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Thu, 23 Jan 2025 11:37:35 +0100 Subject: [PATCH 06/28] doc: install --- doc/source/conf.py | 22 ++++ doc/source/getting-started/install.rst | 104 ++++++++++++++++++- doc/source/getting-started/prerequisites.rst | 4 +- doc/source/links.rst | 1 + 4 files changed, 127 insertions(+), 4 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index cd72cf3e..662ebe86 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -122,9 +122,31 @@ }, ] +def read_dependencies_from_pyproject(): + pyproject = Path(__file__).parent.parent.parent / "pyproject.toml" + if not pyproject.exists(): + raise ValueError(f"The file {pyproject} does not exist.") + + pyproject_content = toml.loads(pyproject.read_text(encoding="utf-8")) + dependencies = pyproject_content["project"]["dependencies"] + return {pkg.split("==")[0]: pkg.split("==")[1] for pkg in dependencies} + +def read_optional_dependencies_from_pyproject(): + pyproject = Path(__file__).parent.parent.parent / "pyproject.toml" + if not pyproject.exists(): + raise ValueError(f"The file {pyproject} does not exist.") + + pyproject_content = toml.loads(pyproject.read_text(encoding="utf-8")) + optional_dependencies = pyproject_content["project"]["optional-dependencies"] + return optional_dependencies + +read_optional_dependencies_from_pyproject() + jinja_contexts = { "project_context": {"projects": yaml.safe_load(metadata.read_text(encoding="utf-8"))}, "releases": {"table_data": supported_python_versions_by_metapackage_version}, + "dependencies": {"dependencies": read_dependencies_from_pyproject()}, + "optional_dependencies": {"optional_dependencies": read_optional_dependencies_from_pyproject()}, } html_context = { diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst index 89043b88..c8a45034 100644 --- a/doc/source/getting-started/install.rst +++ b/doc/source/getting-started/install.rst @@ -1,2 +1,102 @@ -Installation -############ +Install PyAnsys +############### + +.. raw:: html + + + + + + +Installing the PyAnsys metapackage is as simple as installing any Python +library. However, you must have a licensed copy of `Ansys `_ to use it. + +Online installation +=================== + +Download and install PyAnsys from `PyPI`_: + +.. tab-set:: + + .. tab-item:: :fab:`windows` **Windows** + + .. code-block:: bash + + python -m pip install pyansys + + .. tab-item:: :fab:`apple` **MacOS** + + .. code-block:: bash + + python -m pip install pyansys + + .. tab-item:: :fab:`linux` **Linux** + + .. code-block:: bash + + python -m pip install pyansys + +The PyAnsys |version| metapackage installs the following projects: + +.. jinja:: dependencies + + .. raw:: html + + + + + +
+ + + + + + + + {% for project, version in dependencies.items() %} + + + + + {% endfor %} + +
PyAnsys projectVersion
{{ project }}{{ version }}
+ +Additional targets +------------------ + + + + +Offline installation +==================== + +Download the artifacts for your platform: + +.. tab-set:: + + .. tab-item:: :fab:`windows` **Windows** + + .. code-block:: bash + + python -m pip install pyansys + + .. tab-item:: :fab:`apple` **MacOS** + + .. code-block:: bash + + python -m pip install pyansys + + .. tab-item:: :fab:`linux` **Linux** + + .. code-block:: bash + + python -m pip install pyansys + + diff --git a/doc/source/getting-started/prerequisites.rst b/doc/source/getting-started/prerequisites.rst index 5e07f2ab..f4ef62f3 100644 --- a/doc/source/getting-started/prerequisites.rst +++ b/doc/source/getting-started/prerequisites.rst @@ -67,12 +67,12 @@ metapackage release: - +
diff --git a/doc/source/links.rst b/doc/source/links.rst index 42c8a9e7..306cf55c 100644 --- a/doc/source/links.rst +++ b/doc/source/links.rst @@ -16,6 +16,7 @@ .. _Ansys Customer Portal: https://download.ansys.com .. Python libraries +.. _PyPI: https://pypi.org/ .. _Numpy: https://numpy.org/ .. _SciPy: https://www.scipy.org/ .. _Pandas: https://pandas.pydata.org/ From dae1beb1ed581bc3194fbc27bb262f3def5b70e4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:38:26 +0000 Subject: [PATCH 07/28] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/source/conf.py | 3 +++ doc/source/getting-started/install.rst | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 662ebe86..026da116 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -122,6 +122,7 @@ }, ] + def read_dependencies_from_pyproject(): pyproject = Path(__file__).parent.parent.parent / "pyproject.toml" if not pyproject.exists(): @@ -131,6 +132,7 @@ def read_dependencies_from_pyproject(): dependencies = pyproject_content["project"]["dependencies"] return {pkg.split("==")[0]: pkg.split("==")[1] for pkg in dependencies} + def read_optional_dependencies_from_pyproject(): pyproject = Path(__file__).parent.parent.parent / "pyproject.toml" if not pyproject.exists(): @@ -140,6 +142,7 @@ def read_optional_dependencies_from_pyproject(): optional_dependencies = pyproject_content["project"]["optional-dependencies"] return optional_dependencies + read_optional_dependencies_from_pyproject() jinja_contexts = { diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst index c8a45034..0d1ca8a7 100644 --- a/doc/source/getting-started/install.rst +++ b/doc/source/getting-started/install.rst @@ -42,14 +42,14 @@ The PyAnsys |version| metapackage installs the following projects: .. jinja:: dependencies .. raw:: html - + - +
PyAnsys version
From cb643c8d02b736012b926445b5d26a50d78a8e42 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Thu, 23 Jan 2025 14:17:32 +0100 Subject: [PATCH 08/28] doc: additional targets --- doc/source/conf.py | 10 +++-- doc/source/getting-started/install.rst | 51 +++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 026da116..208a9369 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -139,12 +139,14 @@ def read_optional_dependencies_from_pyproject(): raise ValueError(f"The file {pyproject} does not exist.") pyproject_content = toml.loads(pyproject.read_text(encoding="utf-8")) - optional_dependencies = pyproject_content["project"]["optional-dependencies"] + exclude_targets = ["doc"] + optional_dependencies = { + target: {pkg.split("==")[0]: pkg.split("==")[1] for pkg in deps} + for target, deps in pyproject_content["project"]["optional-dependencies"].items() + if target not in exclude_targets + } return optional_dependencies - -read_optional_dependencies_from_pyproject() - jinja_contexts = { "project_context": {"projects": yaml.safe_load(metadata.read_text(encoding="utf-8"))}, "releases": {"table_data": supported_python_versions_by_metapackage_version}, diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst index 0d1ca8a7..8b3759f9 100644 --- a/doc/source/getting-started/install.rst +++ b/doc/source/getting-started/install.rst @@ -37,7 +37,7 @@ Download and install PyAnsys from `PyPI`_: python -m pip install pyansys -The PyAnsys |version| metapackage installs the following projects: +The PyAnsys |version| metapackage includes the following projects: .. jinja:: dependencies @@ -71,7 +71,54 @@ The PyAnsys |version| metapackage installs the following projects: Additional targets ------------------ - +The PyAnsys metapackage contains various targets for installing additional +libraries and tools. + +.. jinja:: optional_dependencies + + .. tab-set:: + + {% for target, dependencies in optional_dependencies.items() %} + + .. tab-item:: {{ target }} + + Install by running: + + .. code-block:: bash + + python -m pip install pyansys[{{ target }}] + + .. raw:: html + + + + + +
+ + + + + + + + {% for project, version in dependencies.items() %} + + + + + {% endfor %} + +
PyAnsys projectVersion
{{ project }}{{ version }}
+ + + + + {% endfor %} Offline installation From f8c86895ec17e81bf52386d7cd7b5560c36f97ed Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 13:18:56 +0000 Subject: [PATCH 09/28] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/source/conf.py | 7 ++++--- doc/source/getting-started/install.rst | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 208a9369..6f8dc75c 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -141,12 +141,13 @@ def read_optional_dependencies_from_pyproject(): pyproject_content = toml.loads(pyproject.read_text(encoding="utf-8")) exclude_targets = ["doc"] optional_dependencies = { - target: {pkg.split("==")[0]: pkg.split("==")[1] for pkg in deps} - for target, deps in pyproject_content["project"]["optional-dependencies"].items() - if target not in exclude_targets + target: {pkg.split("==")[0]: pkg.split("==")[1] for pkg in deps} + for target, deps in pyproject_content["project"]["optional-dependencies"].items() + if target not in exclude_targets } return optional_dependencies + jinja_contexts = { "project_context": {"projects": yaml.safe_load(metadata.read_text(encoding="utf-8"))}, "releases": {"table_data": supported_python_versions_by_metapackage_version}, diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst index 8b3759f9..6f8a8e40 100644 --- a/doc/source/getting-started/install.rst +++ b/doc/source/getting-started/install.rst @@ -87,16 +87,16 @@ libraries and tools. .. code-block:: bash python -m pip install pyansys[{{ target }}] - + .. raw:: html - + - + @@ -117,7 +117,7 @@ libraries and tools. - + {% endfor %} From f640467428268964fed0886c89f28f36fe311453 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Thu, 23 Jan 2025 15:05:41 +0100 Subject: [PATCH 10/28] doc: offline --- doc/source/conf.py | 11 ++++++- doc/source/getting-started/install.rst | 43 ++++++++++++-------------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 6f8dc75c..5cf61871 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -147,12 +147,21 @@ def read_optional_dependencies_from_pyproject(): } return optional_dependencies - +jinja_globals = { + "VERSION": version, + "SUPPORTED_PYTHON_VERSIONS": ["3.10", "3.11", "3.12"], + "SUPPORTED_PLATFORMS": ["Windows", "macOS", "Linux"], +} jinja_contexts = { "project_context": {"projects": yaml.safe_load(metadata.read_text(encoding="utf-8"))}, "releases": {"table_data": supported_python_versions_by_metapackage_version}, "dependencies": {"dependencies": read_dependencies_from_pyproject()}, "optional_dependencies": {"optional_dependencies": read_optional_dependencies_from_pyproject()}, + "wheelhouse": { + "wheelhouse": { + platform: icon + for platform, icon in zip(["Windows", "macOS", "Linux"], ["windows", "apple", "linux"])} + } } html_context = { diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst index 6f8a8e40..dc2d5c61 100644 --- a/doc/source/getting-started/install.rst +++ b/doc/source/getting-started/install.rst @@ -124,26 +124,23 @@ libraries and tools. Offline installation ==================== -Download the artifacts for your platform: - -.. tab-set:: - - .. tab-item:: :fab:`windows` **Windows** - - .. code-block:: bash - - python -m pip install pyansys - - .. tab-item:: :fab:`apple` **MacOS** - - .. code-block:: bash - - python -m pip install pyansys - - .. tab-item:: :fab:`linux` **Linux** - - .. code-block:: bash - - python -m pip install pyansys - - +Start by downloading the wheelhouse artifact for your platform: + +.. jinja:: wheelhouse + + .. csv-table:: + :header-rows: 1 + :widths: 16, 28, 28, 28 + + :fas:`laptop` Platform, + {%- for python in SUPPORTED_PYTHON_VERSIONS -%} + :fab:`python` Python {{ python }} + {%- if not loop.last -%},{%- endif -%} + {% endfor %} + {% for platform, icon in wheelhouse.items() -%} + :fab:`{{ icon }}` {{ platform }}, + {%- for python in SUPPORTED_PYTHON_VERSIONS -%} + `Download wheelhouse `__ + {%- if not loop.last -%},{%- endif -%} + {% endfor %} + {% endfor %} From 9a5f0c4dc550eba6906fbd54438ecfea096d8eb0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:07:27 +0000 Subject: [PATCH 11/28] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/source/conf.py | 8 +++++--- doc/source/getting-started/install.rst | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 5cf61871..c2aeffc2 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -147,6 +147,7 @@ def read_optional_dependencies_from_pyproject(): } return optional_dependencies + jinja_globals = { "VERSION": version, "SUPPORTED_PYTHON_VERSIONS": ["3.10", "3.11", "3.12"], @@ -159,9 +160,10 @@ def read_optional_dependencies_from_pyproject(): "optional_dependencies": {"optional_dependencies": read_optional_dependencies_from_pyproject()}, "wheelhouse": { "wheelhouse": { - platform: icon - for platform, icon in zip(["Windows", "macOS", "Linux"], ["windows", "apple", "linux"])} - } + platform: icon + for platform, icon in zip(["Windows", "macOS", "Linux"], ["windows", "apple", "linux"]) + } + }, } html_context = { diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst index dc2d5c61..b27abebf 100644 --- a/doc/source/getting-started/install.rst +++ b/doc/source/getting-started/install.rst @@ -131,7 +131,7 @@ Start by downloading the wheelhouse artifact for your platform: .. csv-table:: :header-rows: 1 :widths: 16, 28, 28, 28 - + :fas:`laptop` Platform, {%- for python in SUPPORTED_PYTHON_VERSIONS -%} :fab:`python` Python {{ python }} From f839d8ffd79ff5b33b8b5a2d93e6fe300139f30d Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Thu, 23 Jan 2025 15:11:39 +0100 Subject: [PATCH 12/28] doc: wheelhouse --- doc/source/getting-started/install.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst index b27abebf..5157dc63 100644 --- a/doc/source/getting-started/install.rst +++ b/doc/source/getting-started/install.rst @@ -144,3 +144,15 @@ Start by downloading the wheelhouse artifact for your platform: {%- if not loop.last -%},{%- endif -%} {% endfor %} {% endfor %} + +Next, decompress the artifacts: + +.. code-block:: bash + + unzip wheelhouse + +Finally, install the PyAnsys metapackage using previously downloaded wheelhouse: + +.. code-block:: bash + + python -m pip install pyansys -f wheelhouse --no-index --upgrade --ignore-installed From cb3bdd2d209ea82461e63b8aaac1e12e4addb274 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 14:14:11 +0000 Subject: [PATCH 13/28] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/source/getting-started/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst index 5157dc63..fbcc4c2b 100644 --- a/doc/source/getting-started/install.rst +++ b/doc/source/getting-started/install.rst @@ -153,6 +153,6 @@ Next, decompress the artifacts: Finally, install the PyAnsys metapackage using previously downloaded wheelhouse: -.. code-block:: bash +.. code-block:: bash python -m pip install pyansys -f wheelhouse --no-index --upgrade --ignore-installed From cf7c3bcf66338fe6443f772afed53d6e51639133 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 11 Feb 2025 14:06:51 +0100 Subject: [PATCH 14/28] fix: remove unnecessary files --- doc/source/index.rst | 2 -- doc/source/package_versions/.gitignore | 2 -- 2 files changed, 4 deletions(-) delete mode 100644 doc/source/package_versions/.gitignore diff --git a/doc/source/index.rst b/doc/source/index.rst index 855237d4..65057d80 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -13,8 +13,6 @@ it is now a collection of many Python packages for using Ansys products through user_guide api examples - supported_versions - package_versions/index tools/index .. jinja:: project_context diff --git a/doc/source/package_versions/.gitignore b/doc/source/package_versions/.gitignore deleted file mode 100644 index c96a04f0..00000000 --- a/doc/source/package_versions/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file From 646e843b704f845d56c852c8b0bee6f639de94e2 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 11 Feb 2025 14:13:58 +0100 Subject: [PATCH 15/28] fix: links --- doc/source/conf.py | 68 --------------------------- doc/source/links.rst | 2 + doc/source/tools/standalone/index.rst | 5 +- 3 files changed, 4 insertions(+), 71 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index c2aeffc2..08eec687 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -252,37 +252,6 @@ def read_optional_dependencies_from_pyproject(): # file for the minor versions of the PyAnsys metapackage release branches. -def generate_rst_files(versions: list[str], tables: dict[str, list[str]]): - """Generate the .rst files for the package versions.""" - # Create Jinja2 environment - jinja_env = jinja2.Environment(loader=jinja2.BaseLoader()) - - # Compile the template - template = jinja_env.from_string(VERSIONS_TEMPLATE) - - # Generate an .rst file for each version entry - for version in versions: - # Generate the content of the .rst file using the Jinja template - rendered_content = template.render( - version=version, - table=tables[version], - ) - - # Define the output path for the generated file - output_filename = GENERATED_DIR / f"version_{version}.rst" - - # Write the rendered content to the file - output_filename.write_text(rendered_content, encoding="utf-8") - - # Generate the index.rst file - index_template = jinja_env.from_string(INDEX_TEMPLATE) - rendered_index = index_template.render(versions=versions) - - # Write the rendered content to the file - output_filename = GENERATED_DIR / "index.rst" - output_filename.write_text(rendered_index, encoding="utf-8") - - def get_documentation_link_from_pypi(library: str, version: str) -> str: """Get the documentation link from PyPI for a specific library and version.""" # Get the PyPI metadata for the library @@ -413,32 +382,6 @@ def build_versions_table(branch: str) -> list[str]: return table - -def get_release_branches_in_metapackage(): - """Retrieve the release branches in the PyAnsys metapackage.""" - # Get the PyAnsys metapackage repository - g = github.Github(os.getenv("GITHUB_TOKEN", None)) - github_repo = g.get_repo("ansys/pyansys") - - # Get the branches - branches = github_repo.get_branches() - - # Get the branches that are release branches + main - release_branches = [] - versions = [] - for branch in branches: - if branch.name.startswith("release"): - release_branches.append(branch.name) - versions.append(branch.name.split("/")[-1]) - - # Sort the release branches and versions: from newest to oldest - release_branches.reverse() - versions.reverse() - - # Return the dev/main branch and the release branches (and versions) - return ["main"] + release_branches, ["dev"] + versions - - ########################################################################### # Adapting thumbnails to the documentation ########################################################################### @@ -512,16 +455,6 @@ def revert_thumbnails(app: sphinx.application.Sphinx, exception): subprocess.run(["git", "checkout", "--", thumbnail_dir]) - -def package_versions_table(app: sphinx.application.Sphinx): - """Generate the package_versions directory.""" - branches, versions = get_release_branches_in_metapackage() - generate_rst_files( - versions, - {version: build_versions_table(branch) for version, branch in zip(versions, branches)}, - ) - - def convert_yaml_to_json(app: sphinx.application.Sphinx): """ Convert a YAML file to a JSON file. @@ -559,7 +492,6 @@ def setup(app: sphinx.application.Sphinx): # At the beginning of the build process - update the version in cheatsheet app.connect("builder-inited", convert_yaml_to_json) app.connect("builder-inited", resize_thumbnails) - app.connect("builder-inited", package_versions_table) # Reverting the thumbnails - no local changes app.connect("build-finished", revert_thumbnails) diff --git a/doc/source/links.rst b/doc/source/links.rst index 306cf55c..8cbd4e51 100644 --- a/doc/source/links.rst +++ b/doc/source/links.rst @@ -21,6 +21,8 @@ .. _SciPy: https://www.scipy.org/ .. _Pandas: https://pandas.pydata.org/ .. _Matplotlib: https://matplotlib.org/ +.. _PyVista: https://docs.pyvista.org/ +.. _Pydata Sphinx Theme: https://pydata-sphinx-theme.readthedocs.io/en/stable/ .. PEPs, NEPs, and SPECs .. _NEP 29: https://numpy.org/neps/nep-0029-deprecation_policy.html diff --git a/doc/source/tools/standalone/index.rst b/doc/source/tools/standalone/index.rst index f8b98bc3..7cf91cd6 100644 --- a/doc/source/tools/standalone/index.rst +++ b/doc/source/tools/standalone/index.rst @@ -110,9 +110,8 @@ Documentation :link: https://sphinxdocs.ansys.com/version/stable :class-title: pyansys-card-title - Extension of the popular `PyData Sphinx theme `_ - that is used by `numpy `_, `pandas `_, - `pyvista `_, and many more scientific Python packages + Extension of the popular `PyData Sphinx Theme`_ that is used by `Numpy`_, + `Pandas`_, `PyVista`_, and many more scientific Python packages .. grid-item-card:: PyMeilisearch :img-top: ../../_static/thumbnails/intro.png From 3ea53079faa1606e04985de3de6b691c96a2f58e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 13:15:26 +0000 Subject: [PATCH 16/28] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/source/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 08eec687..2705d5b0 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -7,8 +7,6 @@ import subprocess from ansys_sphinx_theme import ansys_favicon, get_version_match -import github -import jinja2 from PIL import Image import requests import sphinx @@ -382,6 +380,7 @@ def build_versions_table(branch: str) -> list[str]: return table + ########################################################################### # Adapting thumbnails to the documentation ########################################################################### @@ -455,6 +454,7 @@ def revert_thumbnails(app: sphinx.application.Sphinx, exception): subprocess.run(["git", "checkout", "--", thumbnail_dir]) + def convert_yaml_to_json(app: sphinx.application.Sphinx): """ Convert a YAML file to a JSON file. From 2810f1824c018126cb6773f78f3fcadd6d6f3a81 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 11 Feb 2025 14:37:03 +0100 Subject: [PATCH 17/28] fix: links --- doc/source/links.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/links.rst b/doc/source/links.rst index 8cbd4e51..0931262d 100644 --- a/doc/source/links.rst +++ b/doc/source/links.rst @@ -4,7 +4,6 @@ .. _ansys_aedt_page: https://www.ansys.com/products/electronics/ansys-maxwell .. _dpf_post_gh: https://github.com/ansys/pydpf-post .. _grpc: https://grpc.io/ -.. _ansys: https://www.ansys.com/ .. _ansys_students: https://www.ansys.com/academic/students .. _pip: https://pypi.org/project/pip/ .. _pyansys_releases: https://github.com/ansys/pyansys/releases From ab36d2c81a3614b58f9549dd868068f6cfb1abd5 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Tue, 11 Feb 2025 14:52:05 +0100 Subject: [PATCH 18/28] fix: add link to pypi --- doc/source/getting-started/install.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst index fbcc4c2b..a8bcb048 100644 --- a/doc/source/getting-started/install.rst +++ b/doc/source/getting-started/install.rst @@ -62,7 +62,7 @@ The PyAnsys |version| metapackage includes the following projects: {% for project, version in dependencies.items() %} - + {% endfor %} @@ -109,7 +109,7 @@ libraries and tools. {% for project, version in dependencies.items() %} - + {% endfor %} From 60265c0d3272aa220ad432a93645ffa4b4655ac9 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 12 Feb 2025 16:02:42 +0100 Subject: [PATCH 19/28] fix: typo --- doc/source/getting-started/prerequisites.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/getting-started/prerequisites.rst b/doc/source/getting-started/prerequisites.rst index f4ef62f3..88718566 100644 --- a/doc/source/getting-started/prerequisites.rst +++ b/doc/source/getting-started/prerequisites.rst @@ -18,8 +18,8 @@ Download and install Python Download and install the latest stable version of Python from the `https://www.python.org/downloads `_. -Suported Python versions ------------------------- +Supported Python versions +------------------------- The PyAnsys ecosystem follows `SPEC-0`_ for Python version support. This implies that PyAnsys packages drop support for a Python version three years From 586aa5f6fba1e13a0ca4eafce702f7ede1aabf65 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 12 Feb 2025 16:03:26 +0100 Subject: [PATCH 20/28] fix: avoid using will --- doc/source/getting-started/prerequisites.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/getting-started/prerequisites.rst b/doc/source/getting-started/prerequisites.rst index 88718566..b0dc9e1d 100644 --- a/doc/source/getting-started/prerequisites.rst +++ b/doc/source/getting-started/prerequisites.rst @@ -45,7 +45,7 @@ In previous diagram: * Python versions in gray are no longer supported * Python versions in light blue are currently supported -* Python versions in dark blue will be supported in the future +* Python versions in dark blue are not supported yet .. note:: From 7e6b4f4ed9f5c4d739382539850f59eb6d0893e0 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 12 Feb 2025 16:08:05 +0100 Subject: [PATCH 21/28] fix: missing function docstrings --- doc/source/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 2705d5b0..0eb4ef36 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -122,6 +122,7 @@ def read_dependencies_from_pyproject(): + """Read the dependencies declared in the project file.""" pyproject = Path(__file__).parent.parent.parent / "pyproject.toml" if not pyproject.exists(): raise ValueError(f"The file {pyproject} does not exist.") @@ -132,6 +133,7 @@ def read_dependencies_from_pyproject(): def read_optional_dependencies_from_pyproject(): + """Read the extra dependencies declared in the project file.""" pyproject = Path(__file__).parent.parent.parent / "pyproject.toml" if not pyproject.exists(): raise ValueError(f"The file {pyproject} does not exist.") From 4e0965e5c188cf5b8270aa4c9024bca3058d8ae0 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Wed, 12 Feb 2025 16:20:27 +0100 Subject: [PATCH 22/28] fix: remove unnecessary CSS and JS --- doc/source/conf.py | 8 ++++++++ doc/source/getting-started/install.rst | 7 ------- doc/source/getting-started/prerequisites.rst | 9 ++------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 0eb4ef36..da4b1b92 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -171,6 +171,14 @@ def read_optional_dependencies_from_pyproject(): "github_repo": "pyansys", "github_version": "main", "doc_path": "doc/source", + "page_assets": { + "getting-started/prerequisites": { + "needs_datatables": True, + }, + "getting-started/install": { + "needs_datatables": True, + }, + }, } html_theme_options = { diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst index a8bcb048..c0360ccc 100644 --- a/doc/source/getting-started/install.rst +++ b/doc/source/getting-started/install.rst @@ -1,13 +1,6 @@ Install PyAnsys ############### -.. raw:: html - - - - - - Installing the PyAnsys metapackage is as simple as installing any Python library. However, you must have a licensed copy of `Ansys `_ to use it. diff --git a/doc/source/getting-started/prerequisites.rst b/doc/source/getting-started/prerequisites.rst index b0dc9e1d..3e622bf3 100644 --- a/doc/source/getting-started/prerequisites.rst +++ b/doc/source/getting-started/prerequisites.rst @@ -59,20 +59,15 @@ metapackage release: .. raw:: html - - - - - -
{{ project }}{{ version }}{{ version }}
{{ project }}{{ version }}{{ version }}
+
From 46bf0781e6b0b5c3609adbc97f6f5fc773cc7a46 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Thu, 13 Feb 2025 09:12:25 +0100 Subject: [PATCH 23/28] fix: logic for extracting metadata --- doc/source/conf.py | 82 +++++++++++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 34 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index da4b1b92..df2761f8 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -7,6 +7,7 @@ import subprocess from ansys_sphinx_theme import ansys_favicon, get_version_match +import github from PIL import Image import requests import sphinx @@ -87,39 +88,6 @@ metadata = Path(__file__).parent.parent.parent / "projects.yaml" -supported_python_versions_by_metapackage_version = [ - { - "version": "2023.1", - "python": {"lower": "3.7", "upper": "3.10"}, - "link": "https://pypi.org/project/pyansys/2023.1.3/", - }, - { - "version": "2023.2", - "python": {"lower": "3.8", "upper": "3.11"}, - "link": "https://pypi.org/project/pyansys/2023.2.11/", - }, - { - "version": "2024.1", - "python": {"lower": "3.9", "upper": "3.12"}, - "link": "https://pypi.org/project/pyansys/2024.1.8/", - }, - { - "version": "2024.2", - "python": {"lower": "3.9", "upper": "3.12"}, - "link": "https://pypi.org/project/pyansys/2024.2.2/", - }, - { - "version": "2025.1", - "python": {"lower": "3.10", "upper": "3.12"}, - "link": "https://pypi.org/project/pyansys/2025.1.0/", - }, - { - "version": "development", - "python": {"lower": "3.10", "upper": "3.12"}, - "link": "https://github.com/ansys/pyansys", - }, -] - def read_dependencies_from_pyproject(): """Read the dependencies declared in the project file.""" @@ -155,7 +123,6 @@ def read_optional_dependencies_from_pyproject(): } jinja_contexts = { "project_context": {"projects": yaml.safe_load(metadata.read_text(encoding="utf-8"))}, - "releases": {"table_data": supported_python_versions_by_metapackage_version}, "dependencies": {"dependencies": read_dependencies_from_pyproject()}, "optional_dependencies": {"optional_dependencies": read_optional_dependencies_from_pyproject()}, "wheelhouse": { @@ -490,6 +457,52 @@ def convert_yaml_to_json(app: sphinx.application.Sphinx): json.dump(yaml_content, json_file, indent=4) print(f"JSON file successfully written to {json_path}") +def fetch_release_branches_and_python_limits(app: sphinx.application.Sphinx): + """Retrieve the release branches in the PyAnsys metapackage.""" + # Get the PyAnsys metapackage repository + g = github.Github(os.getenv("GITHUB_TOKEN", None)) + repository = g.get_repo("ansys/pyansys") + + # Get the branches + branches = repository.get_branches() + + supported_python_versions_by_metapackage_version = [] + for branch in branches: + if not branch.name.startswith("release") and not branch.name.startswith("main"): + continue + + # Inspect the pyproject.toml file to get the Python limits + pyproject = repository.get_contents("pyproject.toml", ref=branch.name) + content = toml.loads(pyproject.decoded_content.decode("utf-8")) + + # Extract the latest version and the Python limits + branch_name = branch.name + metapackage_version = branch_name.split("/")[-1] + try: + pypi_version = content["project"]["version"] + python_limits = content["project"]["requires-python"].split(",") + except KeyError: + pypi_version = content["tool"]["poetry"]["version"] + python_limits = content["tool"]["poetry"]["dependencies"]["python"].split(",") + + + if pypi_version.split(".")[-1].startswith("dev"): + link = repository.html_url + else: + link = f"https://pypi.org/project/pyansys/{pypi_version}" + + supported_python_versions_by_metapackage_version.append ({ + "version": metapackage_version, + "python": {"lower": python_limits[0], "upper": python_limits[1]}, + "link": link, + }) + + print(supported_python_versions_by_metapackage_version) + + jinja_contexts["releases"] = { + "table_data": supported_python_versions_by_metapackage_version + } + def setup(app: sphinx.application.Sphinx): """Run different hook functions during the documentation build. @@ -502,6 +515,7 @@ def setup(app: sphinx.application.Sphinx): # At the beginning of the build process - update the version in cheatsheet app.connect("builder-inited", convert_yaml_to_json) app.connect("builder-inited", resize_thumbnails) + app.connect("builder-inited", fetch_release_branches_and_python_limits) # Reverting the thumbnails - no local changes app.connect("build-finished", revert_thumbnails) From 337f5f40a07830fd1f46fe4ce96d5d38039d5433 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 08:13:46 +0000 Subject: [PATCH 24/28] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/source/conf.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index df2761f8..5039fca8 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -457,6 +457,7 @@ def convert_yaml_to_json(app: sphinx.application.Sphinx): json.dump(yaml_content, json_file, indent=4) print(f"JSON file successfully written to {json_path}") + def fetch_release_branches_and_python_limits(app: sphinx.application.Sphinx): """Retrieve the release branches in the PyAnsys metapackage.""" # Get the PyAnsys metapackage repository @@ -471,11 +472,11 @@ def fetch_release_branches_and_python_limits(app: sphinx.application.Sphinx): if not branch.name.startswith("release") and not branch.name.startswith("main"): continue - # Inspect the pyproject.toml file to get the Python limits + # Inspect the pyproject.toml file to get the Python limits pyproject = repository.get_contents("pyproject.toml", ref=branch.name) content = toml.loads(pyproject.decoded_content.decode("utf-8")) - # Extract the latest version and the Python limits + # Extract the latest version and the Python limits branch_name = branch.name metapackage_version = branch_name.split("/")[-1] try: @@ -485,23 +486,22 @@ def fetch_release_branches_and_python_limits(app: sphinx.application.Sphinx): pypi_version = content["tool"]["poetry"]["version"] python_limits = content["tool"]["poetry"]["dependencies"]["python"].split(",") - if pypi_version.split(".")[-1].startswith("dev"): link = repository.html_url else: link = f"https://pypi.org/project/pyansys/{pypi_version}" - supported_python_versions_by_metapackage_version.append ({ - "version": metapackage_version, - "python": {"lower": python_limits[0], "upper": python_limits[1]}, - "link": link, - }) + supported_python_versions_by_metapackage_version.append( + { + "version": metapackage_version, + "python": {"lower": python_limits[0], "upper": python_limits[1]}, + "link": link, + } + ) print(supported_python_versions_by_metapackage_version) - jinja_contexts["releases"] = { - "table_data": supported_python_versions_by_metapackage_version - } + jinja_contexts["releases"] = {"table_data": supported_python_versions_by_metapackage_version} def setup(app: sphinx.application.Sphinx): From 5b7765a028c94d7b4d2abc505bbe016851feaf94 Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Thu, 13 Feb 2025 09:22:24 +0100 Subject: [PATCH 25/28] fix: ignore link to customer portal --- doc/source/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index 5039fca8..f6a95f7c 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -204,6 +204,7 @@ def read_optional_dependencies_from_pyproject(): r"https://www.ansys.com/.*", rf"https://pypi.org/project/pyansys/{switcher_version}.*", r"https://ansunits.docs.*", + r"https://download.ansys.com", ] # User agent From 4748667c73dfe00bfef279775999a8e5f6d196ed Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Thu, 13 Feb 2025 10:09:11 +0100 Subject: [PATCH 26/28] fix: ignore links --- doc/source/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index f6a95f7c..c60b8afe 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -204,7 +204,8 @@ def read_optional_dependencies_from_pyproject(): r"https://www.ansys.com/.*", rf"https://pypi.org/project/pyansys/{switcher_version}.*", r"https://ansunits.docs.*", - r"https://download.ansys.com", + r"https://download.ansys.com/.*", + r"https://github.com/ansys/pyansys/releases/download/*", ] # User agent From da2a503cb2ecf2bcdfd3f45cfc003b02ac908bee Mon Sep 17 00:00:00 2001 From: Jorge Martinez Date: Thu, 13 Feb 2025 14:07:17 +0100 Subject: [PATCH 27/28] fix: broken link --- doc/source/getting-started/install.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst index c0360ccc..edf4b197 100644 --- a/doc/source/getting-started/install.rst +++ b/doc/source/getting-started/install.rst @@ -1,9 +1,8 @@ Install PyAnsys ############### -Installing the PyAnsys metapackage is as simple as installing any Python -library. However, you must have a licensed copy of `Ansys `_ to use it. +The PyAnsys metapackage is distributed as a Python library. Its installation +follows the standard Python package installation process. Online installation =================== From bf06df3205191c550ff2d8e1b605f27035d20147 Mon Sep 17 00:00:00 2001 From: Roberto Pastor Muela <37798125+RobPasMue@users.noreply.github.com> Date: Fri, 14 Feb 2025 10:08:28 +0100 Subject: [PATCH 28/28] fix: lincheck issues --- doc/source/conf.py | 15 ++++++++++++++- doc/source/getting-started/install.rst | 4 ++++ doc/source/links.rst | 4 ++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index c60b8afe..a0731b27 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -116,7 +116,20 @@ def read_optional_dependencies_from_pyproject(): return optional_dependencies +def get_last_metapackage_release(): + """Retrieve the last release of the metapackage.""" + # Get the PyAnsys metapackage repository + g = github.Github(os.getenv("GITHUB_TOKEN", None)) + repository = g.get_repo("ansys/pyansys") + + # Get the last release + last_release = repository.get_latest_release() + + return last_release.tag_name + + jinja_globals = { + "LAST_RELEASE": get_last_metapackage_release(), "VERSION": version, "SUPPORTED_PYTHON_VERSIONS": ["3.10", "3.11", "3.12"], "SUPPORTED_PLATFORMS": ["Windows", "macOS", "Linux"], @@ -201,7 +214,7 @@ def read_optional_dependencies_from_pyproject(): # Ignore certain URLs linkcheck_ignore = [ - r"https://www.ansys.com/.*", + r"https://www.ansys.com.*", rf"https://pypi.org/project/pyansys/{switcher_version}.*", r"https://ansunits.docs.*", r"https://download.ansys.com/.*", diff --git a/doc/source/getting-started/install.rst b/doc/source/getting-started/install.rst index edf4b197..0c52ec4f 100644 --- a/doc/source/getting-started/install.rst +++ b/doc/source/getting-started/install.rst @@ -132,7 +132,11 @@ Start by downloading the wheelhouse artifact for your platform: {% for platform, icon in wheelhouse.items() -%} :fab:`{{ icon }}` {{ platform }}, {%- for python in SUPPORTED_PYTHON_VERSIONS -%} + {%- if "dev" in VERSION -%} + `Download wheelhouse `__ + {%- else -%} `Download wheelhouse `__ + {%- endif -%} {%- if not loop.last -%},{%- endif -%} {% endfor %} {% endfor %} diff --git a/doc/source/links.rst b/doc/source/links.rst index 0931262d..ca80fa85 100644 --- a/doc/source/links.rst +++ b/doc/source/links.rst @@ -10,8 +10,8 @@ .. _venv_docs: https://docs.python.org/3/library/venv.html .. ANSYS and products -.. _ANSYS, Inc.: https://ansys.com -.. _Ansys products: https://ansys.com/products +.. _ANSYS, Inc.: https://www.ansys.com +.. _Ansys products: https://www.ansys.com/products .. _Ansys Customer Portal: https://download.ansys.com .. Python libraries
PyAnsys version