From 525a61c47e250af86d759a29ca1ddbbf9412346a Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Wed, 29 Nov 2023 14:32:25 +0100 Subject: [PATCH 1/6] BUGFIX: remove non existing settings attribute --- src/pyedb/legacy/edb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyedb/legacy/edb.py b/src/pyedb/legacy/edb.py index 91c6ed4680..a5cff828c2 100644 --- a/src/pyedb/legacy/edb.py +++ b/src/pyedb/legacy/edb.py @@ -175,7 +175,7 @@ def __init__( os.path.dirname(edbpath), "pyedb_" + os.path.splitext(os.path.split(edbpath)[-1])[0] + ".log" ) - if isaedtowned and (inside_desktop or settings.remote_api or settings.remote_rpc_session): + if isaedtowned and (inside_desktop or settings.remote_rpc_session): self.open_edb_inside_aedt() elif edbpath[-3:] in ["brd", "mcm", "gds", "xml", "dxf", "tgz"]: self.edbpath = edbpath[:-4] + ".aedb" From 71d9d649c996d51ca0442ef23d39b7fae9f1f878 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Wed, 29 Nov 2023 14:34:55 +0100 Subject: [PATCH 2/6] MAINT: change vtk version Version 9.3.0 does not interact well with pyvista and our tests. Moving back to 9.2.6 fixes it. --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 1b02656ff9..eefd353155 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -113,6 +113,7 @@ full = [ "osmnx", "pyvista==0.42.2; python_version > '3.7'", "pyvista==0.38.0; python_version <= '3.7'", + "vtk==9.2.6", "SRTM.py", "utm", "scikit-rf", From 6757ea76e4acccd3bd6fbb189fb2c0402f5cb8a7 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Wed, 29 Nov 2023 14:52:56 +0100 Subject: [PATCH 3/6] CI: add workflow to test pyaedt using pyedb This workflow leverages a branch in pyaedt that has been written to use pyedb as a dependency. This branch might need to be updated from time to time. --- .github/workflows/test_pyaedt.yml | 81 +++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 .github/workflows/test_pyaedt.yml diff --git a/.github/workflows/test_pyaedt.yml b/.github/workflows/test_pyaedt.yml new file mode 100644 index 0000000000..7d4f7a9c03 --- /dev/null +++ b/.github/workflows/test_pyaedt.yml @@ -0,0 +1,81 @@ +name: Test pyedb as pyaedt dependency + +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 + +env: + ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }} + PYEDB_USE_LEGACY: '1' + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + + pyaedt-test: + name: "Check pyaedt tests when pyedb is used as a dependency" + runs-on: [ windows, pyedb, self-hosted ] + steps: + - name: Install Git and clone project + uses: actions/checkout@v4 + + - name: Set up Python + uses: ansys/actions/_setup-python@main + with: + python-version: '3.10' + use-cache: false + + - name: Create Python venv + run: | + python -m venv .venv + .\.venv\Scripts\Activate.ps1 + + - name: "Update pip" + run: | + .\.venv\Scripts\Activate.ps1 + python -m pip install -U pip + + - name: "Install Pyedb" + run: | + .\.venv\Scripts\Activate.ps1 + pip install --no-cache-dir . + + - name: "Clone pyaedt on specific branch" + uses: actions/checkout@v4 + with: + repository: ansys/pyaedt + path: "external/pyaedt" + ref: "maint/use_pyedb" + + - name: "Install Pyaedt" + run: | + .\.venv\Scripts\Activate.ps1 + pip install --no-cache-dir external/pyaedt[full] + + - name: "Install Pyaedt test dependencies" + run: | + .\.venv\Scripts\Activate.ps1 + pip install --no-cache-dir external/pyaedt[tests] + + - name: "Install specific vtk version with OSMesa bundled" + run: | + pip uninstall vtk -y + # Note: the vtk-osmesa used is 9.2.X as 9.3.0 is not working + # well with the use of pyvista in our tests atm. + # TODO: update once a stable versio is working + pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==9.2.20230527.dev0 + + - name: 'Pyaedt tests' + run: | + .\.venv\Scripts\Activate.ps1 + Set-Item -Path env:PYTHONMALLOC -Value "malloc" + pytest -n 6 --dist loadfile --durations=50 -vv --cov=pyaedt --cov-report=xml --cov-report=html --junitxml=junit/test-results.xml external\pyaedt\_unittest From 2a19c9822b00bd9a6ab993da558933239550ef71 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Thu, 30 Nov 2023 10:01:41 +0100 Subject: [PATCH 4/6] CI: fix wrong vtk install --- .github/workflows/test_pyaedt.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_pyaedt.yml b/.github/workflows/test_pyaedt.yml index 7d4f7a9c03..ed835cdbd6 100644 --- a/.github/workflows/test_pyaedt.yml +++ b/.github/workflows/test_pyaedt.yml @@ -68,6 +68,7 @@ jobs: - name: "Install specific vtk version with OSMesa bundled" run: | + .\.venv\Scripts\Activate.ps1 pip uninstall vtk -y # Note: the vtk-osmesa used is 9.2.X as 9.3.0 is not working # well with the use of pyvista in our tests atm. From 7298780c0a3b03d5746ccb3701c31a0bcf1f18c5 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Thu, 30 Nov 2023 10:58:24 +0100 Subject: [PATCH 5/6] CI: schedule nigthly test pyaedt --- .github/workflows/test_pyaedt.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_pyaedt.yml b/.github/workflows/test_pyaedt.yml index ed835cdbd6..a7975ef584 100644 --- a/.github/workflows/test_pyaedt.yml +++ b/.github/workflows/test_pyaedt.yml @@ -1,14 +1,9 @@ name: Test pyedb as pyaedt dependency 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 ] + # Schedule this workflow every day at UTC 3:00. + schedule: + - cron: '0 3 * * *' concurrency: group: ${{ github.workflow }}-${{ github.ref }} From 1c2611fe319e5efd6cc68af68e851f850243a945 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Thu, 30 Nov 2023 11:01:14 +0100 Subject: [PATCH 6/6] CI: rename nightly workflow --- .github/workflows/{test_pyaedt.yml => nightly-test-pyaedt.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{test_pyaedt.yml => nightly-test-pyaedt.yml} (100%) diff --git a/.github/workflows/test_pyaedt.yml b/.github/workflows/nightly-test-pyaedt.yml similarity index 100% rename from .github/workflows/test_pyaedt.yml rename to .github/workflows/nightly-test-pyaedt.yml