From d9d67ab6970d73e72f28a53fba885cdefe6f4f66 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Mon, 18 Mar 2024 11:15:39 +0100 Subject: [PATCH 1/8] MAINT: Update dependencies with ranges --- pyproject.toml | 194 ++++++++++++++++++++++++------------------------- 1 file changed, 94 insertions(+), 100 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a436e44504c..0a6f55e819f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,131 +26,125 @@ classifiers = [ ] dependencies = [ - "rpyc==6.0.0", - "psutil", "fpdf2", "jsonschema", - "pytomlpp; python_version < '3.12'", - "pyedb==0.4.0; python_version == '3.7'", + "psutil", + "pyedb>=0.4.0,<0.5; python_version == '3.7'", "pyedb>=0.5.0,<0.6; python_version > '3.7'", + "pytomlpp; python_version < '3.12'", + "rpyc>=6.0.0,<6.1", ] [project.optional-dependencies] tests = [ - "ipython==8.13.0; python_version < '3.9'", - "ipython==8.22.2; python_version >= '3.9'", - "imageio==2.31.5", - "joblib==1.3.2", - "matplotlib==3.5.3; python_version == '3.7'", - "matplotlib==3.7.3; python_version == '3.8'", - "matplotlib==3.8.3; python_version > '3.8'", - "numpy==1.21.6; python_version <= '3.9'", - "numpy==1.26.4; python_version > '3.9'", - "mock", - "openpyxl==3.1.2", - "osmnx", - "pandas==1.3.5; python_version == '3.7'", - "pandas==2.0.3; python_version == '3.8'", - "pandas==2.2.1; python_version > '3.9'", - "pyedb==0.4.0; python_version == '3.7'", + "imageio>=2.30.0,<2.34", + "ipython>=7.30.0,<8.23", + "joblib>=1.0.0,<1.4", + "matplotlib>=3.5.0,<3.9", + "mock>=5.1.0,<5.2", + "numpy>=1.20.0,<2", + "openpyxl>=3.1.0,<3.3", + "osmnx>=1.1.0,<1.10", + "pandas>=1.1.0,<2.3", + "pytest>=7.4.0,<8.2", + "pytest-cov>=4.0.0,<4.2", + "pytest-xdist>=3.5.0,<3.6", + "pyedb>=0.4.0,<0.5; python_version == '3.7'", "pyedb>=0.5.0,<0.6; python_version > '3.7'", - "pytest==8.0.2", - "pytest-cov==4.1.0", - "pytest-xdist==3.5.0", - "vtk==9.2.6", - "pyvista==0.38.0; python_version <= '3.7'", - "pyvista==0.43.3; python_version > '3.7'", - "scikit-learn==1.3.0; python_version == '3.7'", - "scikit-learn==1.3.1; python_version > '3.7'", + "pyvista>=0.38.0,<0.44", + "scikit-learn>=1.0.0,<1.5", + "scikit-rf>=0.30.0,<0.33", "SRTM.py", "utm", - "scikit-rf==0.31.0", + "vtk==9.2.6", ] dotnet = [ - "cffi == 1.15.1;platform_system=='Linux' and python_version == '3.7'", - "cffi == 1.16.0;platform_system=='Linux' and python_version > '3.7'", - "pywin32 >= 303;platform_system=='Windows'", "ansys-pythonnet>=3.1.0rc3", - "dotnetcore2 ==3.1.23;platform_system=='Linux'", + "cffi==1.15.1; platform_system=='Linux' and python_version == '3.7'", + "cffi>=1.16.0,<1.17; platform_system=='Linux' and python_version > '3.7'", + "dotnetcore2==3.1.23; platform_system=='Linux'", + "pywin32>=303; platform_system=='Windows'", ] doc = [ - "ansys-sphinx-theme==0.14.0", - "imageio==2.31.5", - "imageio-ffmpeg==0.4.9", - "ipython==8.13.0; python_version < '3.9'", - "ipython==8.22.2; python_version >= '3.9'", - "ipywidgets==8.1.1", - "joblib==1.3.2", - "jupyterlab==4.0.6", - "matplotlib==3.5.3; python_version == '3.7'", - "matplotlib==3.7.3; python_version == '3.8'", - "matplotlib==3.8.3; python_version > '3.8'", - "nbsphinx==0.9.3", - "numpydoc==1.5.0; python_version == '3.7'", - "numpydoc==1.6.0; python_version > '3.7'", - "osmnx", - "pypandoc==1.13", - "pytest-sphinx==0.5.0", - "vtk==9.2.6", - "pyvista==0.43.3; python_version > '3.7'", - "pyvista==0.38.0; python_version <= '3.7'", - "recommonmark==0.7.1", - "scikit-learn==1.3.0; python_version == '3.7'", - "scikit-learn==1.3.1; python_version > '3.7'", - "Sphinx==7.1.2; python_version <= '3.9'", - "Sphinx==7.2.6; python_version >= '3.9'", - "sphinx-autobuild==2024.2.4", - "sphinx-autodoc-typehints==1.24.0", - "sphinx-copybutton==0.5.2", - "sphinx-gallery==0.14.0", - "sphinx-notfound-page==1.0.0", - "sphinxcontrib-websupport==1.2.4; python_version <= '3.9'", - "sphinxcontrib-websupport==1.2.5; python_version <= '3.7'", + "ansys-sphinx-theme>=0.10.0,<0.15", + "imageio>=2.30.0,<2.35", + #"imageio-ffmpeg>=0.4.0,<0.5", + "ipython>=7.34.0; python_version == '3.7'", + "ipython>=8.13.0<8.23; python_version > '3.7'", + #"ipywidgets>=8.0.0,<8.2", + "joblib>=1.3.0,<1.4", + "jupyterlab>=4.0.0,<4.3", + "matplotlib>=3.5.0,<3.9", + "nbsphinx>=0.9.0,<0.10", + "numpydoc>=1.5.0,<1.7", + "openpyxl>=3.0.0,<3.2", + "osmnx>=1.1.0,<1.10", + "pypandoc>=1.10.0,<1.14", + #"pytest-sphinx", + "pyvista>=0.38.0,<0.44", + #"recommonmark", + #"scikit-learn", + "scikit-rf>=0.30.0,<0.33", + "Sphinx==5.3.0; python_version == '3.7'", + "Sphinx>=7.1.0,<7.3; python_version > '3.7'", + "sphinx-autobuild==2021.3.14; python_version == '3.7'", + "sphinx-autobuild==2021.3.14; python_version == '3.8'", + "sphinx-autobuild==2024.2.4; python_version > '3.8'", + #"sphinx-autodoc-typehints", + "sphinx-copybutton>=0.5.0,<0.6", + "sphinx-gallery>=0.14.0,<0.16", + "sphinx-jinja>=2.0,<2.1", + #"sphinx-notfound-page", + "sphinx_design>=0.4.0,<0.6", + #"sphinxcontrib-websupport", "SRTM.py", "utm", - "scikit-rf==0.31.0", - "openpyxl==3.1.2", - "sphinx_design", - "sphinx_jinja", + "vtk==9.2.6", +] +doc-noexamples = [ + "ansys-sphinx-theme>=0.10.0,<0.15", + "imageio>=2.30.0,<2.35", + #"imageio-ffmpeg", + "numpydoc>=1.5.0,<1.7", + # "recommonmark", + "Sphinx==5.3.0; python_version == '3.7'", + "Sphinx>=7.1.0,<7.3; python_version > '3.7'", + "sphinx-autobuild==2021.3.14; python_version == '3.7'", + "sphinx-autobuild==2021.3.14; python_version == '3.8'", + "sphinx-autobuild==2024.2.4; python_version > '3.8'", + #"sphinx-autodoc-typehints", + "sphinx-copybutton>=0.5.0,<0.6", + "sphinx-gallery>=0.14.0,<0.16", + #"sphinx-notfound-page", + #"sphinxcontrib-websupport", + "sphinx_design>=0.4.0,<0.6", + "sphinx-jinja>=2.0,<2.1", ] full = [ - "imageio", - "matplotlib==3.5.3; python_version == '3.7'", - "matplotlib==3.7.3; python_version == '3.8'", - "matplotlib==3.8.3; python_version > '3.8'", - "numpy==1.21.6; python_version <= '3.9'", - "numpy==1.26.4; python_version > '3.9'", - "pandas==1.3.5; python_version == '3.7'", - "pandas==2.0.3; python_version == '3.8'", - "pandas==2.2.1; python_version > '3.9'", - "osmnx", - "vtk==9.2.6", - "pyvista==0.43.3; python_version > '3.7'", - "pyvista==0.38.0; python_version <= '3.7'", + "imageio>=2.30.0,<2.35", + "matplotlib>=3.5.0,<3.9", + "numpy>=1.20.0,<2", + "openpyxl>=3.1.0,<3.3", + "osmnx>=1.1.0,<1.10", + "pandas>=1.1.0,<2.3", + "pyvista>=0.38.0,<0.44", + "scikit-rf>=0.30.0,<0.33", "SRTM.py", "utm", - "scikit-rf==0.31.0", - "openpyxl==3.1.2", + "vtk==9.2.6", ] all = [ - "imageio", - "matplotlib==3.5.3; python_version == '3.7'", - "matplotlib==3.7.3; python_version == '3.8'", - "matplotlib==3.8.3; python_version > '3.8'", - "numpy==1.21.6; python_version <= '3.9'", - "numpy==1.26.4; python_version > '3.9'", - "pandas==1.3.5; python_version == '3.7'", - "pandas==2.0.3; python_version == '3.9'", - "pandas==2.0.3; python_version == '3.8'", - "pandas==2.2.1; python_version > '3.9'", - "osmnx", - "vtk==9.2.6", - "pyvista==0.43.3; python_version > '3.7'", - "pyvista==0.38.0; python_version <= '3.7'", + "imageio>=2.30.0,<2.35", + "matplotlib>=3.5.0,<3.9", + "numpy>=1.20.0,<2", + "openpyxl>=3.1.0,<3.3", + "osmnx>=1.1.0,<1.10", + "pandas>=1.1.0,<2.3", + "pyvista>=0.38.0,<0.44", + "scikit-rf>=0.30.0,<0.33", "SRTM.py", "utm", - "scikit-rf==0.31.0", - "openpyxl==3.1.2", + "vtk==9.2.6", ] [tool.flit.module] From 1da8ed3de9c1d3220cf4a4a1799465f634750e0d Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Mon, 18 Mar 2024 11:23:25 +0100 Subject: [PATCH 2/8] DOC: remove deprecated extension recommonmark --- doc/source/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index a072c1cf724..93a99524d57 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -129,7 +129,6 @@ def setup(app): "sphinx_copybutton", "sphinx_design", "sphinx_jinja", - "recommonmark", "sphinx.ext.graphviz", "sphinx.ext.mathjax", "sphinx.ext.inheritance_diagram", From 26d2dcb2dd0f764bb5048fd7329d3aae1c6cc08e Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Mon, 18 Mar 2024 12:04:59 +0100 Subject: [PATCH 3/8] WIP: Test all python version --- .github/workflows/build_documentation.yml | 99 ------------ .github/workflows/cpython_linux.yml | 92 ----------- .github/workflows/full_documentation.yml | 155 ------------------ .github/workflows/ironpython.yml | 42 ----- .github/workflows/label.yml | 91 ----------- .github/workflows/nightly-docs.yml | 117 -------------- .github/workflows/test_python_version.yml | 54 +++++++ .github/workflows/unit_test_prerelease.yml | 89 ----------- .github/workflows/unit_tests.yml | 173 --------------------- .github/workflows/unit_tests_solvers.bkp | 103 ------------ .github/workflows/wheelhouse.yml | 90 ----------- .github/workflows/wheelhouse_linux.yml | 89 ----------- 12 files changed, 54 insertions(+), 1140 deletions(-) delete mode 100644 .github/workflows/build_documentation.yml delete mode 100644 .github/workflows/cpython_linux.yml delete mode 100644 .github/workflows/full_documentation.yml delete mode 100644 .github/workflows/ironpython.yml delete mode 100644 .github/workflows/label.yml delete mode 100644 .github/workflows/nightly-docs.yml create mode 100644 .github/workflows/test_python_version.yml delete mode 100644 .github/workflows/unit_test_prerelease.yml delete mode 100644 .github/workflows/unit_tests.yml delete mode 100644 .github/workflows/unit_tests_solvers.bkp delete mode 100644 .github/workflows/wheelhouse.yml delete mode 100644 .github/workflows/wheelhouse_linux.yml diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml deleted file mode 100644 index 5dfbb3d0d84..00000000000 --- a/.github/workflows/build_documentation.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: Documentation Build - -on: [pull_request, workflow_dispatch] - -env: - # Following env vars when changed will "reset" the mentioned cache, - # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... - # You should go up in number, if you go down (or repeat a previous value) - # you might end up reusing a previous cache if it haven't been deleted already. - # It applies 7 days retention policy by default. - RESET_EXAMPLES_CACHE: 3 - RESET_DOC_BUILD_CACHE: 3 - RESET_AUTOSUMMARY_CACHE: 3 - - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - docs-style: - name: "Check documentation style" - runs-on: ubuntu-latest - steps: - - name: "Check documentation style" - uses: ansys/actions/doc-style@v5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - vale-config: "doc/.vale.ini" - vale-version: "2.29.6" - - docs_build: - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Update pip - run: | - pip install --upgrade pip - - - name: Install pyaedt - run: | - pip install .[doc] - - - name: Verify pyaedt can be imported - run: python -c "import pyaedt" - - - name: Retrieve PyAEDT version - id: version - run: | - echo "PYAEDT_VERSION=$(python -c 'from pyaedt import __version__; print(__version__)')" >> $GITHUB_OUTPUT - echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")" - - # - name: Cache docs build directory - # uses: actions/cache@v3 - # with: - # path: doc/build - # key: doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ steps.version.outputs.PYAEDT_VERSION }}-${{ github.sha }} - # restore-keys: | - # doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ steps.version.outputs.PYAEDT_VERSION }} - # - name: Cache autosummary - # uses: actions/cache@v3 - # with: - # path: doc/source/**/_autosummary/*.rst - # key: autosummary-v${{ env.RESET_AUTOSUMMARY_CACHE }}-${{ steps.version.outputs.PYAEDT_VERSION }}-${{ github.sha }} - # restore-keys: | - # autosummary-v${{ env.RESET_AUTOSUMMARY_CACHE }}-${{ steps.version.outputs.PYAEDT_VERSION }} - - - name: Install doc build requirements - run: | - sudo apt install graphviz - - # run doc build, without creating the examples directory - # note that we have to add the examples file here since it won't - # be created as gallery is disabled on linux. - - name: Documentation Build - run: | - make -C doc clean - mkdir doc/source/examples -p - echo $'Examples\n========' > doc/source/examples/index.rst - make -C doc html SPHINXOPTS="-j auto -w build_errors.txt -N" - - # Verify that sphinx generates no warnings - - name: Check for warnings - run: | - python doc/print_errors.py - -# - name: Upload Documentation -# uses: actions/upload-artifact@v4 -# with: -# name: Documentation -# path: doc/_build/html -# retention-days: 7 diff --git a/.github/workflows/cpython_linux.yml b/.github/workflows/cpython_linux.yml deleted file mode 100644 index 5d9313e5765..00000000000 --- a/.github/workflows/cpython_linux.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Linux_CPython_UnitTests - -env: - ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} - python.version: '3.10' - python.venv: 'testvenv' - # Following env vars when changed will "reset" the mentioned cache, - # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... - # You should go up in number, if you go down (or repeat a previous value) - # you might end up reusing a previous cache if it haven't been deleted already. - # It applies 7 days retention policy by default. - RESET_PIP_CACHE: 0 - PACKAGE_NAME: PyAEDT - - -on: - workflow_dispatch: - inputs: - logLevel: - description: 'Log level' - required: true - default: 'warning' - tags: - description: 'Linux CPython daily' - schedule: # UTC at 0100 - - cron: '0 1 * * *' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - test: - runs-on: [Linux, pyaedt] - strategy: - matrix: - python-version: [ '3.10' ] - steps: - - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - architecture: 'x86' - - - name: 'Install pyaedt' - run: | - python -m venv .pyaedt_test_env - export ANSYSEM_ROOT241=/apps/AnsysEM/v241/Linux64 - export LD_LIBRARY_PATH=$ANSYSEM_ROOT241/common/mono/Linux64/lib64:$LD_LIBRARY_PATH - source .pyaedt_test_env/bin/activate - python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U - 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)" - pip install .[tests] - pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pytest-azurepipelines - python -c "import pyaedt; print('Imported pyaedt')" - - - name: 'Unit testing' - uses: nick-fields/retry@v3 - with: - max_attempts: 3 - retry_on: error - timeout_minutes: 60 - command: | - export ANS_NODEPCHECK=1 - export ANSYSEM_ROOT241=/apps/AnsysEM/v241/Linux64 - export LD_LIBRARY_PATH=$ANSYSEM_ROOT241/common/mono/Linux64/lib64:$LD_LIBRARY_PATH - source .pyaedt_test_env/bin/activate - pytest --tx 6*popen --durations=50 --dist loadfile -v _unittest - - - name: 'Unit testing Solvers' - continue-on-error: true - uses: nick-fields/retry@v3 - with: - max_attempts: 3 - retry_on: error - timeout_minutes: 60 - command: | - export ANS_NODEPCHECK=1 - export ANSYSEM_ROOT241=/apps/AnsysEM/v241/Linux64 - export LD_LIBRARY_PATH=$ANSYSEM_ROOT241/common/mono/Linux64/lib64:$LD_LIBRARY_PATH - source .pyaedt_test_env/bin/activate - pytest --tx 2*popen --durations=50 --dist loadfile -v _unittest_solvers - - - name: Upload pytest test results - uses: actions/upload-artifact@v4 - with: - name: pytest-results - path: junit/test-results.xml - if: ${{ always() }} diff --git a/.github/workflows/full_documentation.yml b/.github/workflows/full_documentation.yml deleted file mode 100644 index 0a114fa3635..00000000000 --- a/.github/workflows/full_documentation.yml +++ /dev/null @@ -1,155 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: FullDocumentation - -env: - ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} - python.version: '3.10' - python.venv: 'testvenv' - DOCUMENTATION_CNAME: 'aedt.docs.pyansys.com' - MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} - MEILISEARCH_HOST_URL: https://backend.search.pyansys.com - MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - tags: - - v* - workflow_dispatch: - inputs: - logLevel: - description: 'Log level' - required: true - default: 'warning' - tags: - description: 'Test scenario tags' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - full_documentation: - # The type of runner that the job will run on - name: full_documentation - runs-on: [Windows, self-hosted, pyaedt] - timeout-minutes: 720 - strategy: - matrix: - python-version: ['3.10'] - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: 'Create virtual env' - run: | - python -m venv testenv - testenv\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: 'Install pyaedt' - run: | - testenv\Scripts\Activate.ps1 - pip install .[doc] - Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv\Lib\site-packages\vtkmodules" -Force - - - name: Retrieve PyAEDT version - id: version - run: | - testenv\Scripts\Activate.ps1 - echo "PYAEDT_VERSION=$(python -c 'from pyaedt import __version__; print(__version__)')" >> $GITHUB_OUTPUT - echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")" - - - name: Create HTML Documentations - run: | - testenv\Scripts\Activate.ps1 - sphinx-build -j auto --color -b html -a doc/source doc/_build/html - -# - name: Create PDF Documentations -# run: | -# testenv\Scripts\Activate.ps1 -# .\doc\make.bat pdf - - - name: Upload HTML documentation artifact - uses: actions/upload-artifact@v3 - with: - name: documentation-html - path: doc/_build/html - retention-days: 7 - -# - name: Upload PDF documentation artifact -# uses: actions/upload-artifact@v4 -# with: -# name: documentation-pdf -# path: doc/_build/pdf -# retention-days: 7 - -# - name: Release -# uses: softprops/action-gh-release@v1 -# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') -# with: -# generate_release_notes: true -# files: | -# doc/_build/pdf - - doc-deploy-stable: - name: Deploy stable documentation - runs-on: ubuntu-latest - needs: full_documentation - if: github.event_name == 'push' && contains(github.ref, 'refs/tags') - steps: - - name: Deploy the stable documentation - uses: ansys/actions/doc-deploy-stable@v4 - with: - cname: ${{ env.DOCUMENTATION_CNAME }} - token: ${{ secrets.GITHUB_TOKEN }} - python-version: ${{ matrix.python-version }} - - - doc-index-stable: - name: "Deploy stable docs index" - if: github.event_name == 'push' && contains(github.ref, 'refs/tags') - runs-on: ubuntu-latest - needs: doc-deploy-stable - - steps: - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ env.MAIN_PYTHON_VERSION }} - - - uses: actions/checkout@v4 - - - uses: actions/download-artifact@v3 - - - name: Display structure of downloaded files - run: ls -R - - - name: Install the package requirements - run: pip install -e . - - - name: Get the version to PyMeilisearch - run: | - VERSION=$(python -c "from pyaedt import __version__; print('.'.join(__version__.split('.')[:2]))") - VERSION_MEILI=$(python -c "from pyaedt import __version__; print('-'.join(__version__.split('.')[:2]))") - echo "Calculated VERSION: $VERSION" - echo "Calculated VERSION_MEILI: $VERSION_MEILI" - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo "VERSION_MEILI=$VERSION_MEILI" >> $GITHUB_ENV - - - name: "Deploy the stable documentation index for PyAEDT API" - uses: ansys/actions/doc-deploy-index@v4 - with: - cname: ${{ env.DOCUMENTATION_CNAME }}/version/${{ env.VERSION }} - index-name: pyaedt-v${{ env.VERSION_MEILI }} - host-url: ${{ vars.MEILISEARCH_HOST_URL }} - api-key: ${{ env.MEILISEARCH_API_KEY }} diff --git a/.github/workflows/ironpython.yml b/.github/workflows/ironpython.yml deleted file mode 100644 index 0fb334beaaa..00000000000 --- a/.github/workflows/ironpython.yml +++ /dev/null @@ -1,42 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: CI_Ironpython - -env: - ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: [Windows, self-hosted, pyaedt] - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - uses: actions/checkout@v4 - - - name: 'Run Unit Tests in Ironpython' - timeout-minutes: 60 - run: | - $processA = start-process 'cmd' -ArgumentList '/c .\_unittest_ironpython\run_unittests_batchmode.cmd' -PassThru - $processA.WaitForExit() - get-content .\_unittest_ironpython\pyaedt_unit_test_ironpython.log - $test_errors_failures = Select-String -Path .\_unittest_ironpython\pyaedt_unit_test_ironpython.log -Pattern "TextTestResult errors=" - if ($test_errors_failures -ne $null) - { - exit 1 - } - else - { - exit 0 - } diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml deleted file mode 100644 index 596cace4c8f..00000000000 --- a/.github/workflows/label.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Labeler -on: - pull_request: - push: - branches: [ main ] - paths: - - '../labels.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - - label-syncer: - name: Syncer - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: micnncim/action-label-syncer@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - labeler: - name: Set labels - needs: [label-syncer] - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - # Label based on modified files - - name: Label based on changed files - uses: actions/labeler@v5 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - - # Label based on branch name - - uses: actions-ecosystem/action-add-labels@v1 - if: | - startsWith(github.event.pull_request.head.ref, 'doc') || - startsWith(github.event.pull_request.head.ref, 'docs') - with: - labels: documentation - - - uses: actions-ecosystem/action-add-labels@v1 - if: | - startsWith(github.event.pull_request.head.ref, 'maint') || - startsWith(github.event.pull_request.head.ref, 'no-ci') || - startsWith(github.event.pull_request.head.ref, 'ci') - with: - labels: maintenance - - - uses: actions-ecosystem/action-add-labels@v1 - if: startsWith(github.event.pull_request.head.ref, 'feat') - with: - labels: | - enhancement - - - uses: actions-ecosystem/action-add-labels@v1 - if: | - startsWith(github.event.pull_request.head.ref, 'fix') || - startsWith(github.event.pull_request.head.ref, 'patch') - with: - labels: bug - - - uses: actions-ecosystem/action-add-labels@v1 - if: | - startsWith(github.event.pull_request.head.ref, 'test') - with: - labels: testing - - commenter: - runs-on: ubuntu-latest - steps: - - name: Suggest to add labels - uses: peter-evans/create-or-update-comment@v4 - # Execute only when no labels have been applied to the pull request - if: toJSON(github.event.pull_request.labels.*.name) == '{}' - with: - 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/ansys/pyaedt/pulls?q=label%3Abug+) - - [documentation](https://github.com/ansys/pyaedt/pulls?q=label%3Adocumentation+) - - [enhancement](https://github.com/ansys/pyaedt/pulls?q=label%3Aenhancement+) - - [good first issue](https://github.com/ansys/pyaedt/pulls?q=label%3Agood+first+issue) - - [maintenance](https://github.com/ansys/pyaedt/pulls?q=label%3Amaintenance+) - - [release](https://github.com/ansys/pyaedt/pulls?q=label%3Arelease+) - - [testing](https://github.com/ansys/pyaedt/pulls?q=label%Atesting+) diff --git a/.github/workflows/nightly-docs.yml b/.github/workflows/nightly-docs.yml deleted file mode 100644 index 68031a4bc57..00000000000 --- a/.github/workflows/nightly-docs.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: Nightly Documentation Build - -on: - workflow_dispatch: - schedule: # UTC at 0400 - - cron: '0 4 * * *' - -env: - ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} - DOCUMENTATION_CNAME: 'aedt.docs.pyansys.com' - MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} - MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - docs_build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.10" - - - name: Install pyaedt - run: | - pip install . - - - name: Install doc build requirements - run: | - pip install .[doc] - - - name: Full Documentation Build - run: | - make -C doc phtml - - - name: Upload documentation HTML artifact - uses: actions/upload-artifact@v4 - with: - name: documentation-html - path: doc/_build/html - retention-days: 7 - - - docs_upload: - needs: docs_build - runs-on: ubuntu-latest - steps: - - - name: Deploy development documentation - uses: ansys/actions/doc-deploy-dev@v4 - with: - cname: ${{ env.DOCUMENTATION_CNAME }} - token: ${{ secrets.GITHUB_TOKEN }} - - doc-index-dev: - name: "Deploy dev docs index" - runs-on: ubuntu-latest - needs: docs_upload - steps: - - uses: actions/checkout@v4 - - - uses: actions/download-artifact@v3 - - - name: Display structure of downloaded files - run: ls -R - - - name: "Deploy the dev documentation index for PyAEDT API" - uses: ansys/actions/doc-deploy-index@v4 - with: - cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev - index-name: pyaedt-vdev - host-url: ${{ vars.MEILISEARCH_HOST_URL }} - api-key: ${{ env.MEILISEARCH_API_KEY }} - - # docstring_testing: - # runs-on: Windows - - # steps: - # - uses: actions/checkout@v4 - - # - name: Setup Python - # uses: actions/setup-python@v2 - # with: - # python-version: 3.8 - - # - name: 'Create virtual env' - # run: | - # python -m venv testenv - # testenv\Scripts\Activate.ps1 - # python -m pip install pip -U - # python -m pip install wheel setuptools -U - # python -c "import sys; print(sys.executable)" - - # - name: 'Install pyaedt' - # run: | - # testenv\Scripts\Activate.ps1 - # pip install . --use-feature=in-tree-build - # cd _unittest - # python -c "import pyaedt; print('Imported pyaedt')" - - # - name: Install testing requirements - # run: | - # testenv\Scripts\Activate.ps1 - # pip install -r requirements/requirements_test.txt - # pip install pytest-azurepipelines - - # - name: Docstring testing - # run: | - # testenv\Scripts\Activate.ps1 - # pytest -v pyaedt/desktop.py pyaedt/icepak.py - # pytest -v pyaedt/desktop.py pyaedt/hfss.py diff --git a/.github/workflows/test_python_version.yml b/.github/workflows/test_python_version.yml new file mode 100644 index 00000000000..54bb88cfe02 --- /dev/null +++ b/.github/workflows/test_python_version.yml @@ -0,0 +1,54 @@ +name: Documentation Build + +on: [pull_request, workflow_dispatch] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + smoke-tests-with-install-target: + name: Tests | Python ${{ matrix.python-version }} | Target ${{ matrix.install_target}}) + runs-on: [Windows, self-hosted, pyaedt] + strategy: + fail-fast: false + matrix: + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + steps: + - name: "Install Git and clone project" + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: 'Create virtual env' + run: | + python -m venv .venv + .venv\Scripts\Activate.ps1 + python -m pip install pip -U + python -m pip install wheel setuptools -U + python -c "import sys; print(sys.executable)" + + - name: 'Install pyaedt' + run: | + .venv\Scripts\Activate.ps1 + pip install . + pip install .[tests] + Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv_s\Lib\site-packages\vtkmodules" -Force + python -c "import pyaedt; print('Imported pyaedt')" + + - name: 'Unit testing' + uses: nick-fields/retry@v3 + with: + max_attempts: 3 + retry_on: error + timeout_minutes: 40 + command: | + .venv\Scripts\Activate.ps1 + Set-Item -Path env:PYTHONMALLOC -Value "malloc" + pytest --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers + diff --git a/.github/workflows/unit_test_prerelease.yml b/.github/workflows/unit_test_prerelease.yml deleted file mode 100644 index a15f6c2091c..00000000000 --- a/.github/workflows/unit_test_prerelease.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: CI_PreRelease - -env: - python.version: '3.8' - python.venv: 'testvenv' - # Following env vars when changed will "reset" the mentioned cache, - # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... - # You should go up in number, if you go down (or repeat a previous value) - # you might end up reusing a previous cache if it haven't been deleted already. - # It applies 7 days retention policy by default. - RESET_PIP_CACHE: 0 - PACKAGE_NAME: PyAEDT -# Controls when the workflow will run -on: - workflow_dispatch: - inputs: - logLevel: - description: 'Log level' - required: true - default: 'warning' - tags: - description: 'Linux CPython daily' - schedule: # UTC at 0300 - - cron: '0 3 * * *' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: [pre_release] - strategy: - matrix: - python-version: ['3.8'] - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: 'Create virtual env' - run: | - python -m venv testenv - testenv\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: 'Install pyaedt' - run: | - testenv\Scripts\Activate.ps1 - pip install .[tests] - pip install pytest-azurepipelines - Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv\Lib\site-packages\vtkmodules" -Force - Copy-Item -Path "C:\actions-runner\local_config.json" -Destination "_unittest" -Force - mkdir tmp - cd tmp - python -c "import pyaedt; print('Imported pyaedt')" - - # - name: "Check licences of packages" - # uses: pyansys/pydpf-actions/check-licenses@v2.0 - - - name: 'Unit testing' - timeout-minutes: 60 - run: | - testenv\Scripts\Activate.ps1 - Set-Item -Path env:PYTHONMALLOC -Value "malloc" - pytest --tx 6*popen --durations=50 --dist loadfile -v --cov=pyaedt --cov-report=xml --junitxml=junit/test-results.xml --cov-report=html _unittest - - - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - if: matrix.python-version == '3.8' - name: 'Upload coverage to Codecov' - - - name: Upload pytest test results - uses: actions/upload-artifact@v4 - with: - name: pytest-results - path: junit/test-results.xml - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} - diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml deleted file mode 100644 index dd16afa66bf..00000000000 --- a/.github/workflows/unit_tests.yml +++ /dev/null @@ -1,173 +0,0 @@ -name: CI - -env: - ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} - python.version: '3.10' - python.venv: 'testvenv' - # Following env vars when changed will "reset" the mentioned cache, - # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... - # You should go up in number, if you go down (or repeat a previous value) - # you might end up reusing a previous cache if it hasn't been deleted already. - # It applies 7 days retention policy by default. - RESET_PIP_CACHE: 0 - PACKAGE_NAME: PyAEDT -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - tags: - - 'v*' - branches: - - main - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build_solvers: - # The type of runner that the job will run on - runs-on: [Windows, self-hosted, pyaedt] - strategy: - matrix: - python-version: [ '3.10' ] - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: 'Create virtual env' - run: | - Remove-Item D:\Temp\* -Recurse -Force -ErrorAction SilentlyContinue - python -m venv testenv_s - testenv_s\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: 'Install pyaedt' - run: | - testenv_s\Scripts\Activate.ps1 - pip install . - pip install .[tests] - pip install pytest-azurepipelines - Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv_s\Lib\site-packages\vtkmodules" -Force - mkdir tmp - cd tmp - python -c "import pyaedt; print('Imported pyaedt')" - - # - name: "Check licences of packages" - # uses: pyansys/pydpf-actions/check-licenses@v2.0 - - - name: 'Unit testing' - uses: nick-fields/retry@v3 - with: - max_attempts: 3 - retry_on: error - timeout_minutes: 40 - command: | - testenv_s\Scripts\Activate.ps1 - Set-Item -Path env:PYTHONMALLOC -Value "malloc" - pytest --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers - - - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - name: 'Upload coverage to Codecov' - - - name: Upload pytest test results - uses: actions/upload-artifact@v4 - with: - name: pytest-solver-results - path: junit/test-results.xml - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} - - - build: - # The type of runner that the job will run on - runs-on: [Windows, self-hosted, pyaedt] - strategy: - matrix: - python-version: ['3.10'] - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: 'Create virtual env' - run: | - Remove-Item D:\Temp\* -Recurse -Force -ErrorAction SilentlyContinue - python -m venv testenv - testenv\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: 'Install pyaedt' - run: | - testenv\Scripts\Activate.ps1 - pip install . - pip install .[tests] - pip install pytest-azurepipelines - Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv\Lib\site-packages\vtkmodules" -Force - mkdir tmp - cd tmp - python -c "import pyaedt; print('Imported pyaedt')" - - # - name: "Check licences of packages" - # uses: pyansys/pydpf-actions/check-licenses@v2.0 - - - name: 'Unit testing' - uses: nick-fields/retry@v3 - with: - max_attempts: 3 - retry_on: error - timeout_minutes: 50 - command: | - testenv\Scripts\Activate.ps1 - Set-Item -Path env:PYTHONMALLOC -Value "malloc" - pytest -n 6 --dist loadfile --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest - - - uses: codecov/codecov-action@v4 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - name: 'Upload coverage to Codecov' - - - name: Upload pytest test results - uses: actions/upload-artifact@v4 - with: - name: pytest-results - path: junit/test-results.xml - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} - - - name: 'Build and validate source distribution' - run: | - testenv\Scripts\Activate.ps1 - python -m pip install build twine - python -m build - python -m twine check dist/* - - - name: "Builds and uploads to PyPI" - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - run: | - testenv\Scripts\Activate.ps1 - python setup.py sdist - python -m pip install twine - python -m twine upload --skip-existing dist/* - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/unit_tests_solvers.bkp b/.github/workflows/unit_tests_solvers.bkp deleted file mode 100644 index 4d0691a5dab..00000000000 --- a/.github/workflows/unit_tests_solvers.bkp +++ /dev/null @@ -1,103 +0,0 @@ -name: CI_Solvers - -env: - python.version: '3.10' - python.venv: 'testvenv' - # Following env vars when changed will "reset" the mentioned cache, - # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... - # You should go up in number, if you go down (or repeat a previous value) - # you might end up reusing a previous cache if it hasn't been deleted already. - # It applies 7 days retention policy by default. - RESET_PIP_CACHE: 0 - PACKAGE_NAME: PyAEDT -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - tags: - - 'v*' - branches: - - main - pull_request: - branches: [ main ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: [Windows, self-hosted, pyaedt] - strategy: - matrix: - python-version: ['3.10'] - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: 'Create virtual env' - run: | - Remove-Item D:\Temp\* -Recurse -Force - python -m venv testenv_s - testenv_s\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: 'Install pyaedt' - run: | - testenv_s\Scripts\Activate.ps1 - pip install . - pip install .[tests] - pip install pytest-azurepipelines - Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv_s\Lib\site-packages\vtkmodules" -Force - mkdir tmp - cd tmp - python -c "import pyaedt; print('Imported pyaedt')" - - # - name: "Check licences of packages" - # uses: pyansys/pydpf-actions/check-licenses@v2.0 - - - name: 'Unit testing' - timeout-minutes: 40 - run: | - testenv_s\Scripts\Activate.ps1 - Set-Item -Path env:PYTHONMALLOC -Value "malloc" - pytest --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers - - - uses: codecov/codecov-action@v3 - if: matrix.python-version == '3.10' - name: 'Upload coverage to Codecov' - - - name: Upload pytest test results - uses: actions/upload-artifact@v3 - with: - name: pytest-results - path: junit/test-results.xml - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} - - - name: 'Build and validate source distribution' - run: | - testenv_s\Scripts\Activate.ps1 - python -m pip install build twine - python -m build - python -m twine check dist/* - - - name: "Builds and uploads to PyPI" - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - run: | - testenv_s\Scripts\Activate.ps1 - python setup.py sdist - python -m pip install twine - python -m twine upload --skip-existing dist/* - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/wheelhouse.yml b/.github/workflows/wheelhouse.yml deleted file mode 100644 index 600b1c73e9c..00000000000 --- a/.github/workflows/wheelhouse.yml +++ /dev/null @@ -1,90 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: WheelHouse - -env: - python.venv: 'testvenv' - # Following env vars when changed will "reset" the mentioned cache, - # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... - # You should go up in number, if you go down (or repeat a previous value) - # you might end up reusing a previous cache if it haven't been deleted already. - # It applies 7 days retention policy by default. - RESET_PIP_CACHE: 0 - PACKAGE_NAME: PyAEDT -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - tags: - - 'v*' - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: [windows-latest] - strategy: - matrix: - python-version: [ 3.7, 3.8, 3.9, '3.10'] - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: 'Create virtual env' - run: | - python -m venv testenv - testenv\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - pip install .[all,dotnet] - pip install jupyterlab - - - - name: Retrieve PyAEDT version - run: | - testenv\Scripts\Activate.ps1 - echo "PYAEDT_VERSION=$(python -c 'from pyaedt import __version__; print(__version__)')" >> $GITHUB_OUTPUT - echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")" - id: version - - - name: Generate wheelhouse - run: | - testenv\Scripts\Activate.ps1 - $packages=$(pip freeze) - # Iterate over the packages and generate wheels - foreach ($package in $packages) { - echo "Generating wheel for $package" - pip wheel "$package" -w wheelhouse - } - - - name: Zip wheelhouse - uses: vimtor/action-zip@v1 - with: - files: wheelhouse - dest: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-${{ runner.os }}-${{ matrix.python-version }}.zip - - - name: Upload Wheelhouse - uses: actions/upload-artifact@v4 - with: - name: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-${{ runner.os }}-${{ matrix.python-version }} - path: '*.zip' - retention-days: 7 - - - name: Release - uses: softprops/action-gh-release@v2 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - with: - generate_release_notes: true - files: | - ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-${{ runner.os }}-${{ matrix.python-version }}.zip diff --git a/.github/workflows/wheelhouse_linux.yml b/.github/workflows/wheelhouse_linux.yml deleted file mode 100644 index 67458e53f95..00000000000 --- a/.github/workflows/wheelhouse_linux.yml +++ /dev/null @@ -1,89 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: WheelHouse Linux - -env: - python.venv: 'testvenv' - # Following env vars when changed will "reset" the mentioned cache - # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... - # You should go up in number. If you go down (or repeat a previous value), - # you might end up reusing a previous cache if it hasn't been deleted already. - # It applies a 7-day retention policy by default. - RESET_PIP_CACHE: 0 - PACKAGE_NAME: PyAEDT -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the main branch - push: - tags: - - 'v*' - - v* - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-20.04 - strategy: - matrix: - python-version: [ 3.7, 3.8, 3.9, '3.10'] - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Install pyaedt - run: | - pip install .[all,dotnet] - pip install jupyterlab - - - name: Verify pyaedt can be imported - run: python -c "import pyaedt" - - - name: Retrieve PyAEDT version - run: | - echo "PYAEDT_VERSION=$(python -c 'from pyaedt import __version__; print(__version__)')" >> $GITHUB_OUTPUT - echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")" - id: version - - - name: Generate wheelhouse - run: | - pip install wheel setuptools -U - pip install --upgrade pip - pip wheel . -w wheelhouse - export wheellist=$(pip freeze) - for file in $wheellist; do - if [[ $file != *"@"* ]] && [[ $file != *"pyaedt"* ]]; then - pip wheel $file -w wheelhouse - fi - done - continue-on-error: true - - - name: Zip wheelhouse - uses: vimtor/action-zip@v1 - with: - files: wheelhouse - dest: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}.zip - - - name: Upload Wheelhouse - uses: actions/upload-artifact@v4 - with: - name: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }} - path: '*.zip' - retention-days: 7 - - - name: Release - uses: softprops/action-gh-release@v2 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - with: - generate_release_notes: true - files: | - ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}.zip \ No newline at end of file From c885d0a0b7bfe6204a5cde6ec9723aa27259659a Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Mon, 18 Mar 2024 13:44:15 +0100 Subject: [PATCH 4/8] FIX: Wrong virtual env path --- .github/workflows/test_python_version.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_python_version.yml b/.github/workflows/test_python_version.yml index 54bb88cfe02..e8605b0beae 100644 --- a/.github/workflows/test_python_version.yml +++ b/.github/workflows/test_python_version.yml @@ -1,4 +1,4 @@ -name: Documentation Build +name: Use test target with multiple python version on: [pull_request, workflow_dispatch] @@ -10,7 +10,7 @@ concurrency: jobs: smoke-tests-with-install-target: - name: Tests | Python ${{ matrix.python-version }} | Target ${{ matrix.install_target}}) + name: Tests | Python ${{ matrix.python-version }} runs-on: [Windows, self-hosted, pyaedt] strategy: fail-fast: false @@ -38,7 +38,7 @@ jobs: .venv\Scripts\Activate.ps1 pip install . pip install .[tests] - Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv_s\Lib\site-packages\vtkmodules" -Force + Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination ".venv\Lib\site-packages\vtkmodules" -Force python -c "import pyaedt; print('Imported pyaedt')" - name: 'Unit testing' From 265b76adf7214be8aa4ed03b27146fbda3d908ed Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Tue, 19 Mar 2024 11:11:04 +0100 Subject: [PATCH 5/8] FIX: License server --- .github/workflows/test_python_version.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test_python_version.yml b/.github/workflows/test_python_version.yml index e8605b0beae..a622364992b 100644 --- a/.github/workflows/test_python_version.yml +++ b/.github/workflows/test_python_version.yml @@ -2,6 +2,9 @@ name: Use test target with multiple python version on: [pull_request, workflow_dispatch] +env: + ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true From aed68a537d7b565c35c458070e17afdf0943a948 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Tue, 19 Mar 2024 15:43:31 +0100 Subject: [PATCH 6/8] TESTS: Skip emit tests for python 3.7 --- _unittest_solvers/test_26_emit.py | 1 + 1 file changed, 1 insertion(+) diff --git a/_unittest_solvers/test_26_emit.py b/_unittest_solvers/test_26_emit.py index a9355da4b4e..b47a1c132ef 100644 --- a/_unittest_solvers/test_26_emit.py +++ b/_unittest_solvers/test_26_emit.py @@ -28,6 +28,7 @@ def aedtapp(add_app): @pytest.mark.skipif(is_linux, reason="Emit API fails on linux.") +@pytest.mark.skipif(sys.version_info < (3,8), reason="Emit API is only available for Python 3.8+.") class TestClass: @pytest.fixture(autouse=True) From be9342914d69e12713a4c45a8a666a115207f68d Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Mon, 18 Mar 2024 12:04:59 +0100 Subject: [PATCH 7/8] WIP: Put back all workflows --- .github/workflows/test_python_version.yml | 57 ----------------------- 1 file changed, 57 deletions(-) delete mode 100644 .github/workflows/test_python_version.yml diff --git a/.github/workflows/test_python_version.yml b/.github/workflows/test_python_version.yml deleted file mode 100644 index a622364992b..00000000000 --- a/.github/workflows/test_python_version.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Use test target with multiple python version - -on: [pull_request, workflow_dispatch] - -env: - ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - - smoke-tests-with-install-target: - name: Tests | Python ${{ matrix.python-version }} - runs-on: [Windows, self-hosted, pyaedt] - strategy: - fail-fast: false - matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] - steps: - - name: "Install Git and clone project" - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: 'Create virtual env' - run: | - python -m venv .venv - .venv\Scripts\Activate.ps1 - python -m pip install pip -U - python -m pip install wheel setuptools -U - python -c "import sys; print(sys.executable)" - - - name: 'Install pyaedt' - run: | - .venv\Scripts\Activate.ps1 - pip install . - pip install .[tests] - Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination ".venv\Lib\site-packages\vtkmodules" -Force - python -c "import pyaedt; print('Imported pyaedt')" - - - name: 'Unit testing' - uses: nick-fields/retry@v3 - with: - max_attempts: 3 - retry_on: error - timeout_minutes: 40 - command: | - .venv\Scripts\Activate.ps1 - Set-Item -Path env:PYTHONMALLOC -Value "malloc" - pytest --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers - From 7452ce81bfc9baa0cab5d9af7ac362de3fc5a663 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Wed, 20 Mar 2024 09:32:53 +0100 Subject: [PATCH 8/8] Revert "WIP: Test all python version" This reverts commit 26d2dcb2dd0f764bb5048fd7329d3aae1c6cc08e. --- .github/workflows/build_documentation.yml | 99 ++++++++++++ .github/workflows/cpython_linux.yml | 92 +++++++++++ .github/workflows/full_documentation.yml | 155 ++++++++++++++++++ .github/workflows/ironpython.yml | 42 +++++ .github/workflows/label.yml | 91 +++++++++++ .github/workflows/nightly-docs.yml | 117 ++++++++++++++ .github/workflows/unit_test_prerelease.yml | 89 +++++++++++ .github/workflows/unit_tests.yml | 173 +++++++++++++++++++++ .github/workflows/unit_tests_solvers.bkp | 103 ++++++++++++ .github/workflows/wheelhouse.yml | 90 +++++++++++ .github/workflows/wheelhouse_linux.yml | 89 +++++++++++ 11 files changed, 1140 insertions(+) create mode 100644 .github/workflows/build_documentation.yml create mode 100644 .github/workflows/cpython_linux.yml create mode 100644 .github/workflows/full_documentation.yml create mode 100644 .github/workflows/ironpython.yml create mode 100644 .github/workflows/label.yml create mode 100644 .github/workflows/nightly-docs.yml create mode 100644 .github/workflows/unit_test_prerelease.yml create mode 100644 .github/workflows/unit_tests.yml create mode 100644 .github/workflows/unit_tests_solvers.bkp create mode 100644 .github/workflows/wheelhouse.yml create mode 100644 .github/workflows/wheelhouse_linux.yml diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml new file mode 100644 index 00000000000..5dfbb3d0d84 --- /dev/null +++ b/.github/workflows/build_documentation.yml @@ -0,0 +1,99 @@ +name: Documentation Build + +on: [pull_request, workflow_dispatch] + +env: + # Following env vars when changed will "reset" the mentioned cache, + # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... + # You should go up in number, if you go down (or repeat a previous value) + # you might end up reusing a previous cache if it haven't been deleted already. + # It applies 7 days retention policy by default. + RESET_EXAMPLES_CACHE: 3 + RESET_DOC_BUILD_CACHE: 3 + RESET_AUTOSUMMARY_CACHE: 3 + + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + docs-style: + name: "Check documentation style" + runs-on: ubuntu-latest + steps: + - name: "Check documentation style" + uses: ansys/actions/doc-style@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + vale-config: "doc/.vale.ini" + vale-version: "2.29.6" + + docs_build: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Update pip + run: | + pip install --upgrade pip + + - name: Install pyaedt + run: | + pip install .[doc] + + - name: Verify pyaedt can be imported + run: python -c "import pyaedt" + + - name: Retrieve PyAEDT version + id: version + run: | + echo "PYAEDT_VERSION=$(python -c 'from pyaedt import __version__; print(__version__)')" >> $GITHUB_OUTPUT + echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")" + + # - name: Cache docs build directory + # uses: actions/cache@v3 + # with: + # path: doc/build + # key: doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ steps.version.outputs.PYAEDT_VERSION }}-${{ github.sha }} + # restore-keys: | + # doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ steps.version.outputs.PYAEDT_VERSION }} + # - name: Cache autosummary + # uses: actions/cache@v3 + # with: + # path: doc/source/**/_autosummary/*.rst + # key: autosummary-v${{ env.RESET_AUTOSUMMARY_CACHE }}-${{ steps.version.outputs.PYAEDT_VERSION }}-${{ github.sha }} + # restore-keys: | + # autosummary-v${{ env.RESET_AUTOSUMMARY_CACHE }}-${{ steps.version.outputs.PYAEDT_VERSION }} + + - name: Install doc build requirements + run: | + sudo apt install graphviz + + # run doc build, without creating the examples directory + # note that we have to add the examples file here since it won't + # be created as gallery is disabled on linux. + - name: Documentation Build + run: | + make -C doc clean + mkdir doc/source/examples -p + echo $'Examples\n========' > doc/source/examples/index.rst + make -C doc html SPHINXOPTS="-j auto -w build_errors.txt -N" + + # Verify that sphinx generates no warnings + - name: Check for warnings + run: | + python doc/print_errors.py + +# - name: Upload Documentation +# uses: actions/upload-artifact@v4 +# with: +# name: Documentation +# path: doc/_build/html +# retention-days: 7 diff --git a/.github/workflows/cpython_linux.yml b/.github/workflows/cpython_linux.yml new file mode 100644 index 00000000000..5d9313e5765 --- /dev/null +++ b/.github/workflows/cpython_linux.yml @@ -0,0 +1,92 @@ +name: Linux_CPython_UnitTests + +env: + ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} + python.version: '3.10' + python.venv: 'testvenv' + # Following env vars when changed will "reset" the mentioned cache, + # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... + # You should go up in number, if you go down (or repeat a previous value) + # you might end up reusing a previous cache if it haven't been deleted already. + # It applies 7 days retention policy by default. + RESET_PIP_CACHE: 0 + PACKAGE_NAME: PyAEDT + + +on: + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'warning' + tags: + description: 'Linux CPython daily' + schedule: # UTC at 0100 + - cron: '0 1 * * *' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: [Linux, pyaedt] + strategy: + matrix: + python-version: [ '3.10' ] + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + architecture: 'x86' + + - name: 'Install pyaedt' + run: | + python -m venv .pyaedt_test_env + export ANSYSEM_ROOT241=/apps/AnsysEM/v241/Linux64 + export LD_LIBRARY_PATH=$ANSYSEM_ROOT241/common/mono/Linux64/lib64:$LD_LIBRARY_PATH + source .pyaedt_test_env/bin/activate + python -m pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pip -U + 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)" + pip install .[tests] + pip install --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org pytest-azurepipelines + python -c "import pyaedt; print('Imported pyaedt')" + + - name: 'Unit testing' + uses: nick-fields/retry@v3 + with: + max_attempts: 3 + retry_on: error + timeout_minutes: 60 + command: | + export ANS_NODEPCHECK=1 + export ANSYSEM_ROOT241=/apps/AnsysEM/v241/Linux64 + export LD_LIBRARY_PATH=$ANSYSEM_ROOT241/common/mono/Linux64/lib64:$LD_LIBRARY_PATH + source .pyaedt_test_env/bin/activate + pytest --tx 6*popen --durations=50 --dist loadfile -v _unittest + + - name: 'Unit testing Solvers' + continue-on-error: true + uses: nick-fields/retry@v3 + with: + max_attempts: 3 + retry_on: error + timeout_minutes: 60 + command: | + export ANS_NODEPCHECK=1 + export ANSYSEM_ROOT241=/apps/AnsysEM/v241/Linux64 + export LD_LIBRARY_PATH=$ANSYSEM_ROOT241/common/mono/Linux64/lib64:$LD_LIBRARY_PATH + source .pyaedt_test_env/bin/activate + pytest --tx 2*popen --durations=50 --dist loadfile -v _unittest_solvers + + - name: Upload pytest test results + uses: actions/upload-artifact@v4 + with: + name: pytest-results + path: junit/test-results.xml + if: ${{ always() }} diff --git a/.github/workflows/full_documentation.yml b/.github/workflows/full_documentation.yml new file mode 100644 index 00000000000..0a114fa3635 --- /dev/null +++ b/.github/workflows/full_documentation.yml @@ -0,0 +1,155 @@ +# This is a basic workflow to help you get started with Actions + +name: FullDocumentation + +env: + ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} + python.version: '3.10' + python.venv: 'testvenv' + DOCUMENTATION_CNAME: 'aedt.docs.pyansys.com' + MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} + MEILISEARCH_HOST_URL: https://backend.search.pyansys.com + MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + tags: + - v* + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'warning' + tags: + description: 'Test scenario tags' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + full_documentation: + # The type of runner that the job will run on + name: full_documentation + runs-on: [Windows, self-hosted, pyaedt] + timeout-minutes: 720 + strategy: + matrix: + python-version: ['3.10'] + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: 'Create virtual env' + run: | + python -m venv testenv + testenv\Scripts\Activate.ps1 + python -m pip install pip -U + python -m pip install wheel setuptools -U + python -c "import sys; print(sys.executable)" + + - name: 'Install pyaedt' + run: | + testenv\Scripts\Activate.ps1 + pip install .[doc] + Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv\Lib\site-packages\vtkmodules" -Force + + - name: Retrieve PyAEDT version + id: version + run: | + testenv\Scripts\Activate.ps1 + echo "PYAEDT_VERSION=$(python -c 'from pyaedt import __version__; print(__version__)')" >> $GITHUB_OUTPUT + echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")" + + - name: Create HTML Documentations + run: | + testenv\Scripts\Activate.ps1 + sphinx-build -j auto --color -b html -a doc/source doc/_build/html + +# - name: Create PDF Documentations +# run: | +# testenv\Scripts\Activate.ps1 +# .\doc\make.bat pdf + + - name: Upload HTML documentation artifact + uses: actions/upload-artifact@v3 + with: + name: documentation-html + path: doc/_build/html + retention-days: 7 + +# - name: Upload PDF documentation artifact +# uses: actions/upload-artifact@v4 +# with: +# name: documentation-pdf +# path: doc/_build/pdf +# retention-days: 7 + +# - name: Release +# uses: softprops/action-gh-release@v1 +# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') +# with: +# generate_release_notes: true +# files: | +# doc/_build/pdf + + doc-deploy-stable: + name: Deploy stable documentation + runs-on: ubuntu-latest + needs: full_documentation + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + steps: + - name: Deploy the stable documentation + uses: ansys/actions/doc-deploy-stable@v4 + with: + cname: ${{ env.DOCUMENTATION_CNAME }} + token: ${{ secrets.GITHUB_TOKEN }} + python-version: ${{ matrix.python-version }} + + + doc-index-stable: + name: "Deploy stable docs index" + if: github.event_name == 'push' && contains(github.ref, 'refs/tags') + runs-on: ubuntu-latest + needs: doc-deploy-stable + + steps: + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ env.MAIN_PYTHON_VERSION }} + + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v3 + + - name: Display structure of downloaded files + run: ls -R + + - name: Install the package requirements + run: pip install -e . + + - name: Get the version to PyMeilisearch + run: | + VERSION=$(python -c "from pyaedt import __version__; print('.'.join(__version__.split('.')[:2]))") + VERSION_MEILI=$(python -c "from pyaedt import __version__; print('-'.join(__version__.split('.')[:2]))") + echo "Calculated VERSION: $VERSION" + echo "Calculated VERSION_MEILI: $VERSION_MEILI" + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "VERSION_MEILI=$VERSION_MEILI" >> $GITHUB_ENV + + - name: "Deploy the stable documentation index for PyAEDT API" + uses: ansys/actions/doc-deploy-index@v4 + with: + cname: ${{ env.DOCUMENTATION_CNAME }}/version/${{ env.VERSION }} + index-name: pyaedt-v${{ env.VERSION_MEILI }} + host-url: ${{ vars.MEILISEARCH_HOST_URL }} + api-key: ${{ env.MEILISEARCH_API_KEY }} diff --git a/.github/workflows/ironpython.yml b/.github/workflows/ironpython.yml new file mode 100644 index 00000000000..0fb334beaaa --- /dev/null +++ b/.github/workflows/ironpython.yml @@ -0,0 +1,42 @@ +# This is a basic workflow to help you get started with Actions + +name: CI_Ironpython + +env: + ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: [Windows, self-hosted, pyaedt] + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v4 + + - name: 'Run Unit Tests in Ironpython' + timeout-minutes: 60 + run: | + $processA = start-process 'cmd' -ArgumentList '/c .\_unittest_ironpython\run_unittests_batchmode.cmd' -PassThru + $processA.WaitForExit() + get-content .\_unittest_ironpython\pyaedt_unit_test_ironpython.log + $test_errors_failures = Select-String -Path .\_unittest_ironpython\pyaedt_unit_test_ironpython.log -Pattern "TextTestResult errors=" + if ($test_errors_failures -ne $null) + { + exit 1 + } + else + { + exit 0 + } diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 00000000000..596cace4c8f --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,91 @@ +name: Labeler +on: + pull_request: + push: + branches: [ main ] + paths: + - '../labels.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + + label-syncer: + name: Syncer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: micnncim/action-label-syncer@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + labeler: + name: Set labels + needs: [label-syncer] + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + + # Label based on modified files + - name: Label based on changed files + uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + + # Label based on branch name + - uses: actions-ecosystem/action-add-labels@v1 + if: | + startsWith(github.event.pull_request.head.ref, 'doc') || + startsWith(github.event.pull_request.head.ref, 'docs') + with: + labels: documentation + + - uses: actions-ecosystem/action-add-labels@v1 + if: | + startsWith(github.event.pull_request.head.ref, 'maint') || + startsWith(github.event.pull_request.head.ref, 'no-ci') || + startsWith(github.event.pull_request.head.ref, 'ci') + with: + labels: maintenance + + - uses: actions-ecosystem/action-add-labels@v1 + if: startsWith(github.event.pull_request.head.ref, 'feat') + with: + labels: | + enhancement + + - uses: actions-ecosystem/action-add-labels@v1 + if: | + startsWith(github.event.pull_request.head.ref, 'fix') || + startsWith(github.event.pull_request.head.ref, 'patch') + with: + labels: bug + + - uses: actions-ecosystem/action-add-labels@v1 + if: | + startsWith(github.event.pull_request.head.ref, 'test') + with: + labels: testing + + commenter: + runs-on: ubuntu-latest + steps: + - name: Suggest to add labels + uses: peter-evans/create-or-update-comment@v4 + # Execute only when no labels have been applied to the pull request + if: toJSON(github.event.pull_request.labels.*.name) == '{}' + with: + 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/ansys/pyaedt/pulls?q=label%3Abug+) + - [documentation](https://github.com/ansys/pyaedt/pulls?q=label%3Adocumentation+) + - [enhancement](https://github.com/ansys/pyaedt/pulls?q=label%3Aenhancement+) + - [good first issue](https://github.com/ansys/pyaedt/pulls?q=label%3Agood+first+issue) + - [maintenance](https://github.com/ansys/pyaedt/pulls?q=label%3Amaintenance+) + - [release](https://github.com/ansys/pyaedt/pulls?q=label%3Arelease+) + - [testing](https://github.com/ansys/pyaedt/pulls?q=label%Atesting+) diff --git a/.github/workflows/nightly-docs.yml b/.github/workflows/nightly-docs.yml new file mode 100644 index 00000000000..68031a4bc57 --- /dev/null +++ b/.github/workflows/nightly-docs.yml @@ -0,0 +1,117 @@ +name: Nightly Documentation Build + +on: + workflow_dispatch: + schedule: # UTC at 0400 + - cron: '0 4 * * *' + +env: + ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} + DOCUMENTATION_CNAME: 'aedt.docs.pyansys.com' + MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} + MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + docs_build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install pyaedt + run: | + pip install . + + - name: Install doc build requirements + run: | + pip install .[doc] + + - name: Full Documentation Build + run: | + make -C doc phtml + + - name: Upload documentation HTML artifact + uses: actions/upload-artifact@v4 + with: + name: documentation-html + path: doc/_build/html + retention-days: 7 + + + docs_upload: + needs: docs_build + runs-on: ubuntu-latest + steps: + + - name: Deploy development documentation + uses: ansys/actions/doc-deploy-dev@v4 + with: + cname: ${{ env.DOCUMENTATION_CNAME }} + token: ${{ secrets.GITHUB_TOKEN }} + + doc-index-dev: + name: "Deploy dev docs index" + runs-on: ubuntu-latest + needs: docs_upload + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v3 + + - name: Display structure of downloaded files + run: ls -R + + - name: "Deploy the dev documentation index for PyAEDT API" + uses: ansys/actions/doc-deploy-index@v4 + with: + cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev + index-name: pyaedt-vdev + host-url: ${{ vars.MEILISEARCH_HOST_URL }} + api-key: ${{ env.MEILISEARCH_API_KEY }} + + # docstring_testing: + # runs-on: Windows + + # steps: + # - uses: actions/checkout@v4 + + # - name: Setup Python + # uses: actions/setup-python@v2 + # with: + # python-version: 3.8 + + # - name: 'Create virtual env' + # run: | + # python -m venv testenv + # testenv\Scripts\Activate.ps1 + # python -m pip install pip -U + # python -m pip install wheel setuptools -U + # python -c "import sys; print(sys.executable)" + + # - name: 'Install pyaedt' + # run: | + # testenv\Scripts\Activate.ps1 + # pip install . --use-feature=in-tree-build + # cd _unittest + # python -c "import pyaedt; print('Imported pyaedt')" + + # - name: Install testing requirements + # run: | + # testenv\Scripts\Activate.ps1 + # pip install -r requirements/requirements_test.txt + # pip install pytest-azurepipelines + + # - name: Docstring testing + # run: | + # testenv\Scripts\Activate.ps1 + # pytest -v pyaedt/desktop.py pyaedt/icepak.py + # pytest -v pyaedt/desktop.py pyaedt/hfss.py diff --git a/.github/workflows/unit_test_prerelease.yml b/.github/workflows/unit_test_prerelease.yml new file mode 100644 index 00000000000..a15f6c2091c --- /dev/null +++ b/.github/workflows/unit_test_prerelease.yml @@ -0,0 +1,89 @@ +name: CI_PreRelease + +env: + python.version: '3.8' + python.venv: 'testvenv' + # Following env vars when changed will "reset" the mentioned cache, + # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... + # You should go up in number, if you go down (or repeat a previous value) + # you might end up reusing a previous cache if it haven't been deleted already. + # It applies 7 days retention policy by default. + RESET_PIP_CACHE: 0 + PACKAGE_NAME: PyAEDT +# Controls when the workflow will run +on: + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'warning' + tags: + description: 'Linux CPython daily' + schedule: # UTC at 0300 + - cron: '0 3 * * *' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: [pre_release] + strategy: + matrix: + python-version: ['3.8'] + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: 'Create virtual env' + run: | + python -m venv testenv + testenv\Scripts\Activate.ps1 + python -m pip install pip -U + python -m pip install wheel setuptools -U + python -c "import sys; print(sys.executable)" + + - name: 'Install pyaedt' + run: | + testenv\Scripts\Activate.ps1 + pip install .[tests] + pip install pytest-azurepipelines + Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv\Lib\site-packages\vtkmodules" -Force + Copy-Item -Path "C:\actions-runner\local_config.json" -Destination "_unittest" -Force + mkdir tmp + cd tmp + python -c "import pyaedt; print('Imported pyaedt')" + + # - name: "Check licences of packages" + # uses: pyansys/pydpf-actions/check-licenses@v2.0 + + - name: 'Unit testing' + timeout-minutes: 60 + run: | + testenv\Scripts\Activate.ps1 + Set-Item -Path env:PYTHONMALLOC -Value "malloc" + pytest --tx 6*popen --durations=50 --dist loadfile -v --cov=pyaedt --cov-report=xml --junitxml=junit/test-results.xml --cov-report=html _unittest + + - uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + if: matrix.python-version == '3.8' + name: 'Upload coverage to Codecov' + + - name: Upload pytest test results + uses: actions/upload-artifact@v4 + with: + name: pytest-results + path: junit/test-results.xml + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} + diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml new file mode 100644 index 00000000000..dd16afa66bf --- /dev/null +++ b/.github/workflows/unit_tests.yml @@ -0,0 +1,173 @@ +name: CI + +env: + ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} + python.version: '3.10' + python.venv: 'testvenv' + # Following env vars when changed will "reset" the mentioned cache, + # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... + # You should go up in number, if you go down (or repeat a previous value) + # you might end up reusing a previous cache if it hasn't been deleted already. + # It applies 7 days retention policy by default. + RESET_PIP_CACHE: 0 + PACKAGE_NAME: PyAEDT +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + tags: + - 'v*' + branches: + - main + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build_solvers: + # The type of runner that the job will run on + runs-on: [Windows, self-hosted, pyaedt] + strategy: + matrix: + python-version: [ '3.10' ] + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: 'Create virtual env' + run: | + Remove-Item D:\Temp\* -Recurse -Force -ErrorAction SilentlyContinue + python -m venv testenv_s + testenv_s\Scripts\Activate.ps1 + python -m pip install pip -U + python -m pip install wheel setuptools -U + python -c "import sys; print(sys.executable)" + + - name: 'Install pyaedt' + run: | + testenv_s\Scripts\Activate.ps1 + pip install . + pip install .[tests] + pip install pytest-azurepipelines + Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv_s\Lib\site-packages\vtkmodules" -Force + mkdir tmp + cd tmp + python -c "import pyaedt; print('Imported pyaedt')" + + # - name: "Check licences of packages" + # uses: pyansys/pydpf-actions/check-licenses@v2.0 + + - name: 'Unit testing' + uses: nick-fields/retry@v3 + with: + max_attempts: 3 + retry_on: error + timeout_minutes: 40 + command: | + testenv_s\Scripts\Activate.ps1 + Set-Item -Path env:PYTHONMALLOC -Value "malloc" + pytest --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers + + - uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + name: 'Upload coverage to Codecov' + + - name: Upload pytest test results + uses: actions/upload-artifact@v4 + with: + name: pytest-solver-results + path: junit/test-results.xml + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} + + + build: + # The type of runner that the job will run on + runs-on: [Windows, self-hosted, pyaedt] + strategy: + matrix: + python-version: ['3.10'] + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: 'Create virtual env' + run: | + Remove-Item D:\Temp\* -Recurse -Force -ErrorAction SilentlyContinue + python -m venv testenv + testenv\Scripts\Activate.ps1 + python -m pip install pip -U + python -m pip install wheel setuptools -U + python -c "import sys; print(sys.executable)" + + - name: 'Install pyaedt' + run: | + testenv\Scripts\Activate.ps1 + pip install . + pip install .[tests] + pip install pytest-azurepipelines + Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv\Lib\site-packages\vtkmodules" -Force + mkdir tmp + cd tmp + python -c "import pyaedt; print('Imported pyaedt')" + + # - name: "Check licences of packages" + # uses: pyansys/pydpf-actions/check-licenses@v2.0 + + - name: 'Unit testing' + uses: nick-fields/retry@v3 + with: + max_attempts: 3 + retry_on: error + timeout_minutes: 50 + command: | + testenv\Scripts\Activate.ps1 + Set-Item -Path env:PYTHONMALLOC -Value "malloc" + pytest -n 6 --dist loadfile --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest + + - uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + name: 'Upload coverage to Codecov' + + - name: Upload pytest test results + uses: actions/upload-artifact@v4 + with: + name: pytest-results + path: junit/test-results.xml + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} + + - name: 'Build and validate source distribution' + run: | + testenv\Scripts\Activate.ps1 + python -m pip install build twine + python -m build + python -m twine check dist/* + + - name: "Builds and uploads to PyPI" + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + run: | + testenv\Scripts\Activate.ps1 + python setup.py sdist + python -m pip install twine + python -m twine upload --skip-existing dist/* + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/unit_tests_solvers.bkp b/.github/workflows/unit_tests_solvers.bkp new file mode 100644 index 00000000000..4d0691a5dab --- /dev/null +++ b/.github/workflows/unit_tests_solvers.bkp @@ -0,0 +1,103 @@ +name: CI_Solvers + +env: + python.version: '3.10' + python.venv: 'testvenv' + # Following env vars when changed will "reset" the mentioned cache, + # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... + # You should go up in number, if you go down (or repeat a previous value) + # you might end up reusing a previous cache if it hasn't been deleted already. + # It applies 7 days retention policy by default. + RESET_PIP_CACHE: 0 + PACKAGE_NAME: PyAEDT +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + tags: + - 'v*' + branches: + - main + pull_request: + branches: [ main ] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: [Windows, self-hosted, pyaedt] + strategy: + matrix: + python-version: ['3.10'] + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: 'Create virtual env' + run: | + Remove-Item D:\Temp\* -Recurse -Force + python -m venv testenv_s + testenv_s\Scripts\Activate.ps1 + python -m pip install pip -U + python -m pip install wheel setuptools -U + python -c "import sys; print(sys.executable)" + + - name: 'Install pyaedt' + run: | + testenv_s\Scripts\Activate.ps1 + pip install . + pip install .[tests] + pip install pytest-azurepipelines + Copy-Item -Path "C:\actions-runner\opengl32.dll" -Destination "testenv_s\Lib\site-packages\vtkmodules" -Force + mkdir tmp + cd tmp + python -c "import pyaedt; print('Imported pyaedt')" + + # - name: "Check licences of packages" + # uses: pyansys/pydpf-actions/check-licenses@v2.0 + + - name: 'Unit testing' + timeout-minutes: 40 + run: | + testenv_s\Scripts\Activate.ps1 + Set-Item -Path env:PYTHONMALLOC -Value "malloc" + pytest --durations=50 -v --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml _unittest_solvers + + - uses: codecov/codecov-action@v3 + if: matrix.python-version == '3.10' + name: 'Upload coverage to Codecov' + + - name: Upload pytest test results + uses: actions/upload-artifact@v3 + with: + name: pytest-results + path: junit/test-results.xml + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} + + - name: 'Build and validate source distribution' + run: | + testenv_s\Scripts\Activate.ps1 + python -m pip install build twine + python -m build + python -m twine check dist/* + + - name: "Builds and uploads to PyPI" + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + run: | + testenv_s\Scripts\Activate.ps1 + python setup.py sdist + python -m pip install twine + python -m twine upload --skip-existing dist/* + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/wheelhouse.yml b/.github/workflows/wheelhouse.yml new file mode 100644 index 00000000000..600b1c73e9c --- /dev/null +++ b/.github/workflows/wheelhouse.yml @@ -0,0 +1,90 @@ +# This is a basic workflow to help you get started with Actions + +name: WheelHouse + +env: + python.venv: 'testvenv' + # Following env vars when changed will "reset" the mentioned cache, + # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... + # You should go up in number, if you go down (or repeat a previous value) + # you might end up reusing a previous cache if it haven't been deleted already. + # It applies 7 days retention policy by default. + RESET_PIP_CACHE: 0 + PACKAGE_NAME: PyAEDT +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + tags: + - 'v*' + - v* + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: [windows-latest] + strategy: + matrix: + python-version: [ 3.7, 3.8, 3.9, '3.10'] + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: 'Create virtual env' + run: | + python -m venv testenv + testenv\Scripts\Activate.ps1 + python -m pip install pip -U + python -m pip install wheel setuptools -U + python -c "import sys; print(sys.executable)" + pip install .[all,dotnet] + pip install jupyterlab + + + - name: Retrieve PyAEDT version + run: | + testenv\Scripts\Activate.ps1 + echo "PYAEDT_VERSION=$(python -c 'from pyaedt import __version__; print(__version__)')" >> $GITHUB_OUTPUT + echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")" + id: version + + - name: Generate wheelhouse + run: | + testenv\Scripts\Activate.ps1 + $packages=$(pip freeze) + # Iterate over the packages and generate wheels + foreach ($package in $packages) { + echo "Generating wheel for $package" + pip wheel "$package" -w wheelhouse + } + + - name: Zip wheelhouse + uses: vimtor/action-zip@v1 + with: + files: wheelhouse + dest: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-${{ runner.os }}-${{ matrix.python-version }}.zip + + - name: Upload Wheelhouse + uses: actions/upload-artifact@v4 + with: + name: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-${{ runner.os }}-${{ matrix.python-version }} + path: '*.zip' + retention-days: 7 + + - name: Release + uses: softprops/action-gh-release@v2 + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + with: + generate_release_notes: true + files: | + ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-${{ runner.os }}-${{ matrix.python-version }}.zip diff --git a/.github/workflows/wheelhouse_linux.yml b/.github/workflows/wheelhouse_linux.yml new file mode 100644 index 00000000000..67458e53f95 --- /dev/null +++ b/.github/workflows/wheelhouse_linux.yml @@ -0,0 +1,89 @@ +# This is a basic workflow to help you get started with Actions + +name: WheelHouse Linux + +env: + python.venv: 'testvenv' + # Following env vars when changed will "reset" the mentioned cache + # by changing the cache file name. It is rendered as ...-v%RESET_XXX%-... + # You should go up in number. If you go down (or repeat a previous value), + # you might end up reusing a previous cache if it hasn't been deleted already. + # It applies a 7-day retention policy by default. + RESET_PIP_CACHE: 0 + PACKAGE_NAME: PyAEDT +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + tags: + - 'v*' + - v* + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-20.04 + strategy: + matrix: + python-version: [ 3.7, 3.8, 3.9, '3.10'] + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install pyaedt + run: | + pip install .[all,dotnet] + pip install jupyterlab + + - name: Verify pyaedt can be imported + run: python -c "import pyaedt" + + - name: Retrieve PyAEDT version + run: | + echo "PYAEDT_VERSION=$(python -c 'from pyaedt import __version__; print(__version__)')" >> $GITHUB_OUTPUT + echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")" + id: version + + - name: Generate wheelhouse + run: | + pip install wheel setuptools -U + pip install --upgrade pip + pip wheel . -w wheelhouse + export wheellist=$(pip freeze) + for file in $wheellist; do + if [[ $file != *"@"* ]] && [[ $file != *"pyaedt"* ]]; then + pip wheel $file -w wheelhouse + fi + done + continue-on-error: true + + - name: Zip wheelhouse + uses: vimtor/action-zip@v1 + with: + files: wheelhouse + dest: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}.zip + + - name: Upload Wheelhouse + uses: actions/upload-artifact@v4 + with: + name: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }} + path: '*.zip' + retention-days: 7 + + - name: Release + uses: softprops/action-gh-release@v2 + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + with: + generate_release_notes: true + files: | + ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}.zip \ No newline at end of file