Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to test pyedb as pyaedt dependency #70

Merged
merged 6 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/nightly-test-pyaedt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Test pyedb as pyaedt dependency

on:
# Schedule this workflow every day at UTC 3:00.
schedule:
- cron: '0 3 * * *'

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: |
.\.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.
# 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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/pyedb/legacy/edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading