diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index d5f4a1d4706..1e7d14d7669 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -13,7 +13,7 @@ on: env: ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} - MAIN_PYTHON_VERSION: '3.10' + MAIN_PYTHON_VERSION: '3.13' PACKAGE_NAME: 'PyAEDT' DOCUMENTATION_CNAME: 'aedt.docs.pyansys.com' ON_CI: True @@ -237,14 +237,7 @@ jobs: - name: Install pyaedt and tests dependencies run: | .venv\Scripts\Activate.ps1 - pip install .[tests] - - - name: Install CI dependencies (e.g. vtk-osmesa) - run: | - .venv\Scripts\Activate.ps1 - # Uninstall conflicting dependencies - pip uninstall --yes vtk - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1 + pip install .[tests] -U - name: Run tests marked with 'solvers' env: @@ -300,7 +293,7 @@ jobs: run: | export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT251 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH source .venv/bin/activate - pip install .[tests] + pip install .[tests] -U - name: Run tests marked with 'solvers' run: | @@ -330,6 +323,9 @@ jobs: needs: [integration-tests] if: github.event.pull_request.draft == false runs-on: [ self-hosted, Windows, pyaedt ] + env: + PYVISTA_OFF_SCREEN: true + VTK_DEFAULT_RENDER_WINDOW: "osmesa" steps: - name: Install Git and checkout project uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -339,6 +335,9 @@ jobs: with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + - name: Set up headless display + uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2 + - name: Create virtual environment run: | python -m venv .venv @@ -350,14 +349,7 @@ jobs: - name: Install pyaedt and tests dependencies run: | .venv\Scripts\Activate.ps1 - pip install .[tests] - - - name: Install CI dependencies (e.g. vtk-osmesa) - run: | - .venv\Scripts\Activate.ps1 - # Uninstall conflicting dependencies - pip uninstall --yes vtk - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1 + pip install .[tests] -U - name: Run tests marked with 'general' uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 @@ -396,6 +388,8 @@ jobs: env: ANSYSEM_ROOT251: '/opt/AnsysEM/v251/AnsysEM' ANS_NODEPCHECK: '1' + PYVISTA_OFF_SCREEN: true + VTK_DEFAULT_RENDER_WINDOW: "osmesa" steps: - name: Install Git and checkout project uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -405,6 +399,9 @@ jobs: with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + - name: Set up headless display + uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2 + - name: Create virtual environment run: | export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT251 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH @@ -418,14 +415,7 @@ jobs: run: | export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT251 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH source .venv/bin/activate - pip install .[tests] - - - name: Install CI dependencies (e.g. vtk-osmesa) - run: | - source .venv/bin/activate - # Uninstall conflicting dependencies - pip uninstall --yes vtk - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1 + pip install .[tests] -U - name: Run tests marked with 'general' uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 @@ -463,6 +453,8 @@ jobs: runs-on: [ self-hosted, Windows, pyaedt ] env: MPLBACKEND: 'Agg' + PYVISTA_OFF_SCREEN: true + VTK_DEFAULT_RENDER_WINDOW: "osmesa" steps: - name: Install Git and checkout project uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -472,6 +464,9 @@ jobs: with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + - name: Set up headless display + uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2 + - name: Create virtual environment run: | python -m venv .venv @@ -483,14 +478,7 @@ jobs: - name: Install pyaedt and tests dependencies run: | .venv\Scripts\Activate.ps1 - pip install .[tests] - - - name: Install CI dependencies (e.g. vtk-osmesa) - run: | - .venv\Scripts\Activate.ps1 - # Uninstall conflicting dependencies - pip uninstall --yes vtk - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1 + pip install .[tests] -U - name: Run tests marked with 'visualization' uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 @@ -530,6 +518,8 @@ jobs: ANSYSEM_ROOT251: '/opt/AnsysEM/v251/AnsysEM' ANS_NODEPCHECK: '1' MPLBACKEND: 'Agg' + PYVISTA_OFF_SCREEN: true + VTK_DEFAULT_RENDER_WINDOW: "osmesa" steps: - name: Install Git and checkout project uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -539,6 +529,9 @@ jobs: with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + - name: Set up headless display + uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2 + - name: Create virtual environment run: | export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT251 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH @@ -552,14 +545,7 @@ jobs: run: | export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT251 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH source .venv/bin/activate - pip install .[tests] - - - name: Install CI dependencies (e.g. vtk-osmesa) - run: | - source .venv/bin/activate - # Uninstall conflicting dependencies - pip uninstall --yes vtk - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1 + pip install .[tests] -U - name: Run tests marked with 'visualization' uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 @@ -594,6 +580,9 @@ jobs: needs: [integration-tests] if: github.event.pull_request.draft == false runs-on: [ self-hosted, Windows, pyaedt ] + env: + PYVISTA_OFF_SCREEN: true + VTK_DEFAULT_RENDER_WINDOW: "osmesa" steps: - name: Install Git and checkout project uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -603,6 +592,9 @@ jobs: with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + - name: Set up headless display + uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2 + - name: Create virtual environment run: | python -m venv .venv @@ -614,14 +606,7 @@ jobs: - name: Install pyaedt and tests dependencies run: | .venv\Scripts\Activate.ps1 - pip install .[tests] - - - name: Install CI dependencies (e.g. vtk-osmesa) - run: | - .venv\Scripts\Activate.ps1 - # Uninstall conflicting dependencies - pip uninstall --yes vtk - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1 + pip install .[tests] -U - name: Run tests marked with 'extensions' uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 @@ -660,6 +645,8 @@ jobs: env: ANSYSEM_ROOT251: '/opt/AnsysEM/v251/AnsysEM' ANS_NODEPCHECK: '1' + PYVISTA_OFF_SCREEN: true + VTK_DEFAULT_RENDER_WINDOW: "osmesa" steps: - name: Install Git and checkout project uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -678,18 +665,14 @@ jobs: python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org wheel setuptools -U python -c "import sys; print(sys.executable)" + - name: Set up headless display + uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2 + - name: Install pyaedt and tests dependencies run: | export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT251 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH source .venv/bin/activate - pip install .[tests] - - - name: Install CI dependencies (e.g. vtk-osmesa) - run: | - source .venv/bin/activate - # Uninstall conflicting dependencies - pip uninstall --yes vtk - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1 + pip install .[tests] -U - name: "Install X Virtual Frame Buffer" run: | @@ -749,14 +732,7 @@ jobs: - name: Install pyaedt and tests dependencies run: | .venv\Scripts\Activate.ps1 - pip install .[tests] - - - name: Install CI dependencies (e.g. vtk-osmesa) - run: | - .venv\Scripts\Activate.ps1 - # Uninstall conflicting dependencies - pip uninstall --yes vtk - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1 + pip install .[tests] -U - name: Run tests marked with 'filter_solutions' uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 diff --git a/.github/workflows/manual_draft.yml b/.github/workflows/manual_draft.yml index eca3eeca674..66355d8e071 100644 --- a/.github/workflows/manual_draft.yml +++ b/.github/workflows/manual_draft.yml @@ -42,6 +42,9 @@ jobs: name: Testing solvers and coverage (Windows) if: github.event.inputs.test-solvers-windows == 'yes' runs-on: [ self-hosted, Windows, pyaedt ] + env: + PYVISTA_OFF_SCREEN: true + VTK_DEFAULT_RENDER_WINDOW: "osmesa" steps: - name: Install Git and checkout project uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -51,6 +54,9 @@ jobs: with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + - name: Set up headless display + uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2 + - name: Create virtual environment run: | python -m venv .venv @@ -63,14 +69,6 @@ jobs: run: | .venv\Scripts\Activate.ps1 pip install .[tests] - pip install pytest-azurepipelines - - - name: Install CI dependencies (e.g. vtk-osmesa) - run: | - .venv\Scripts\Activate.ps1 - # Uninstall conflicting dependencies - pip uninstall --yes vtk - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1 - name: Run tests marked with 'solvers' env: @@ -99,6 +97,8 @@ jobs: env: ANSYSEM_ROOT251: '/opt/AnsysEM/v251/AnsysEM' ANS_NODEPCHECK: '1' + PYVISTA_OFF_SCREEN: true + VTK_DEFAULT_RENDER_WINDOW: "osmesa" steps: - name: Install Git and checkout project uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -122,7 +122,6 @@ jobs: export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT251 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH source .venv/bin/activate pip install .[tests] - pip install pytest-azurepipelines - name: Run tests marked with 'solvers' run: | @@ -147,6 +146,9 @@ jobs: name: Testing general and coverage (Windows) if: github.event.inputs.test-general-windows == 'yes' runs-on: [ self-hosted, Windows, pyaedt ] + env: + PYVISTA_OFF_SCREEN: true + VTK_DEFAULT_RENDER_WINDOW: "osmesa" steps: - name: Install Git and checkout project uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -156,6 +158,9 @@ jobs: with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + - name: Set up headless display + uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2 + - name: Create virtual environment run: | python -m venv .venv @@ -168,14 +173,6 @@ jobs: run: | .venv\Scripts\Activate.ps1 pip install .[tests] - pip install pytest-azurepipelines - - - name: Install CI dependencies (e.g. vtk-osmesa) - run: | - .venv\Scripts\Activate.ps1 - # Uninstall conflicting dependencies - pip uninstall --yes vtk - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1 - name: Run tests marked with 'general' uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 @@ -209,6 +206,8 @@ jobs: env: ANSYSEM_ROOT251: '/opt/AnsysEM/v251/AnsysEM' ANS_NODEPCHECK: '1' + PYVISTA_OFF_SCREEN: true + VTK_DEFAULT_RENDER_WINDOW: "osmesa" steps: - name: Install Git and checkout project uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -218,6 +217,9 @@ jobs: with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + - name: Set up headless display + uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2 + - name: Create virtual environment run: | export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT251 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH @@ -232,14 +234,6 @@ jobs: export LD_LIBRARY_PATH=${{ env.ANSYSEM_ROOT251 }}/common/mono/Linux64/lib64:$LD_LIBRARY_PATH source .venv/bin/activate pip install .[tests] - pip install pytest-azurepipelines - - - name: Install CI dependencies (e.g. vtk-osmesa) - run: | - source .venv/bin/activate - # Uninstall conflicting dependencies - pip uninstall --yes vtk - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1 - name: Run tests marked with 'general' uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2 diff --git a/doc/Makefile b/doc/Makefile index d0252ec59ed..91eb26b9f93 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -16,34 +16,27 @@ help: .PHONY: help Makefile -.install-deps: - @pip freeze | grep -q "vtk-osmesa" && is_vtk_osmesa_installed="yes" || is_vtk_osmesa_installed="no" - @if [ "${ON_CI}" = "True" ] && [ "$$is_vtk_osmesa_installed" != "yes" ]; then \ - @echo "Removing package(s) to avoid conflicts with package(s) needed for CI/CD"; \ - pip uninstall --yes vtk; \ - @echo "Installing CI/CD required package(s)"; \ - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1; \ - fi +# .install-deps: +# @pip freeze | grep -q "vtk-osmesa" && is_vtk_osmesa_installed="yes" || is_vtk_osmesa_installed="no" +# @if [ "${ON_CI}" = "True" ] && [ "$$is_vtk_osmesa_installed" != "yes" ]; then \ +# @echo "Removing package(s) to avoid conflicts with package(s) needed for CI/CD"; \ +# pip uninstall --yes vtk; \ +# @echo "Installing CI/CD required package(s)"; \ +# pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1; \ +# fi # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: .install-deps Makefile +%: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -clean: .install-deps +clean: @echo "Cleaning everything." rm -rf $(BUILDDIR)/* rm -rf examples/ find . -type d -name "_autosummary" -exec rm -rf {} + -# FIXME: currently linkcheck freezes and further investigation must be performed -# linkcheck: -# @echo "Checking links." -# @$(SPHINXBUILD) -M linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(LINKCHECKOPTS) -vv -# @echo -# @echo "Check finished. Report is in $(LINKCHECKDIR)." - -html: .install-deps +html: @echo "Building HTML pages." @# FIXME: currently linkcheck freezes and further investigation must be performed @# @$(SPHINXBUILD) -M linkcheck "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(LINKCHECKOPTS) $(O) @@ -51,7 +44,7 @@ html: .install-deps @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)." -pdf: .install-deps +pdf: @echo "Building PDF pages." @$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true diff --git a/doc/changelog.d/6466.maintenance.md b/doc/changelog.d/6466.maintenance.md new file mode 100644 index 00000000000..1d39cc4aa2a --- /dev/null +++ b/doc/changelog.d/6466.maintenance.md @@ -0,0 +1 @@ +Update graphics dependencies and inner code \ No newline at end of file diff --git a/doc/make.bat b/doc/make.bat index 02412be1705..d1700605447 100644 --- a/doc/make.bat +++ b/doc/make.bat @@ -15,15 +15,6 @@ set BUILDDIR=_build set LINKCHECKDIR=\%BUILDDIR%\linkcheck set LINKCHECKOPTS=-d %BUILDDIR%\.doctrees -W --keep-going --color -REM This LOCs are used to uninstall and install specific package(s) during CI/CD -for /f %%i in ('pip freeze ^| findstr /c:"vtk-osmesa"') do set is_vtk_osmesa_installed=%%i -if NOT "%is_vtk_osmesa_installed%" == "vtk-osmesa" if "%ON_CI%" == "True" ( - echo "Removing package(s) to avoid conflicts with package(s) needed for CI/CD" - pip uninstall --yes vtk - echo "Installing CI/CD required package(s)" - pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.3.1) -REM End of CICD dedicated setup - if "%1" == "" goto help if "%1" == "clean" goto clean if "%1" == "html" goto html diff --git a/pyproject.toml b/pyproject.toml index e90a73d5aa3..5c17a2d7a03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,7 +66,7 @@ tests = [ "pytest-xdist>=3.5.0,<3.9", "pyvista[io]>=0.38.0,<0.46", "scikit-rf>=0.30.0,<1.9", - "tables", + "tables>=3.10.0,<3.11", ] dotnet = [ "ansys-pythonnet>=3.1.0rc3", @@ -89,9 +89,9 @@ doc = [ ] graphics = [ "ansys-tools-visualization-interface", - "pyvista[io]>=0.38.0,<0.45", + "pyvista[io]>=0.38.0,<0.46", "matplotlib>=3.5.0,<3.11", - "vtk>=9.0,<9.4", + "vtk>=9.0,<9.6", ] jupyter = [ "jupyterlab>=3.6.0,<4.5", @@ -116,7 +116,7 @@ examples = [ "openpyxl>=3.1.0,<3.3", "osmnx>=1.1.0,<2.1", "pandas>=1.1.0,<2.4", - "pyvista>=0.38.0,<0.45", + "pyvista>=0.38.0,<0.46", "fast-simplification>=0.1.7", "joblib>=1.4.0,<1.6", "plotly>=6.0,<6.3", diff --git a/tests/system/conftest.py b/tests/system/conftest.py new file mode 100644 index 00000000000..c0b9cd840d9 --- /dev/null +++ b/tests/system/conftest.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +try: + from ansys.aedt.core.internal.checks import check_graphics_available + + check_graphics_available() + + import pyvista as pv + + import ansys.tools.visualization_interface as viz_interface + + pv.OFF_SCREEN = True + viz_interface.TESTING_MODE = True + pv.global_theme.window_size = [600, 600] + +except ImportError: + pass