Skip to content

Commit

Permalink
Merge branch 'main' into release/0.6
Browse files Browse the repository at this point in the history
# Conflicts:
#	examples/07-EMIT/EMIT_Example.py
  • Loading branch information
maxcapodi78 authored and maxcapodi78 committed Aug 30, 2023
2 parents 834f792 + 1f766bd commit fc1ae13
Show file tree
Hide file tree
Showing 248 changed files with 55,210 additions and 7,192 deletions.
4 changes: 0 additions & 4 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@ dependencies:
- requirements/**/*
testing:
- _unittest/conftest.py
- _unittest/launch_desktop_tests.py
- _unittest_ironpython/generate_tests.py
- _unittest_ironpython/conf_unittest.py
- _unittest_ironpython/run_unittests.py
- _unittest_ironpython/run_unittests_batchmode.cmd
- _unittest_ironpython/run_unittests_batchmode_linux.cmd
3 changes: 2 additions & 1 deletion .github/workflows/cpython_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,14 @@ jobs:
python -c "import pyaedt; print('Imported pyaedt')"
- name: 'Unit testing'
timeout-minutes: 30
timeout-minutes: 120
run: |
export ANS_NODEPCHECK=1
export ANSYSEM_ROOT231=/apps/AnsysEM/v231/Linux64
export LD_LIBRARY_PATH=$ANSYSEM_ROOT231/common/mono/Linux64/lib64:$ANSYSEM_ROOT231/Delcross:$LD_LIBRARY_PATH
source .pyaedt_test_env/bin/activate
pytest --tx 6*popen --durations=50 --dist loadfile -v _unittest
pytest --durations=50 --dist loadfile -v _unittest_solvers
- name: Upload pytest test results
uses: actions/upload-artifact@v3
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/full_documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ env:
python.venv: 'testvenv'
DOCUMENTATION_CNAME: 'aedt.docs.pyansys.com'
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
MEILISEARCH_HOST_URL: https://backend.search.pyansys.com
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
Expand Down Expand Up @@ -77,6 +78,13 @@ jobs:
path: doc/_build/html
retention-days: 7

- name: Upload HTML documentation artifact
uses: actions/upload-artifact@v3
with:
name: documentation-html-edb
path: doc/_build/html/EDBAPI
retention-days: 7

doc-deploy-stable:
name: Deploy stable documentation
runs-on: ubuntu-latest
Expand All @@ -89,3 +97,54 @@ jobs:
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@v4
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- uses: actions/checkout@v3

- 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 }}
pymeilisearchopts: --stop_urls \"EDBAPI\" # Add EDB API as another index.

- name: "Deploy the stable documentation index for EDB API"
uses: ansys/actions/doc-deploy-index@v4
with:
cname: ${{ env.DOCUMENTATION_CNAME }}/version/${{ env.VERSION }}/EDBAPI/
index-name: pyedb-v${{ env.VERSION_MEILI }}
host-url: ${{ vars.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}
doc-artifact-name: documentation-html-edb # Add only EDB API as page in this index.

27 changes: 3 additions & 24 deletions .github/workflows/ironpython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,10 @@ jobs:
- name: 'Run Unit Tests in Ironpython'
timeout-minutes: 60
run: |
Remove-Item d:\Temp\* -Recurse -Force
Set-Item -Path env:ANS_MESHER_PROC_DUMP_PREPOST_BEND_SM3 -Value "1"
Set-Item -Path env:ANSYSEM_FEATURE_SF6694_NON_GRAPHICAL_COMMAND_EXECUTION_ENABLE -Value "1"
Set-Item -Path env:ANSYSEM_FEATURE_SF159726_SCRIPTOBJECT_ENABLE -Value "1"
Set-Item -Path env:ANSYSEM_FEATURE_SF222134_CABLE_MODELING_ENHANCEMENTS_ENABLE -Value "1"
Set-Item -Path env:ANSYSEM_FEATURE_F395486_RIGID_FLEX_BENDING_ENABLE -Value "1"
Set-Item -Path env:ANSYSEM_FEATURE_S432616_LAYOUT_COMPONENT_IN_3D_ENABLE -Value "1"
$processA = start-process 'cmd' -ArgumentList '/c .\_unittest_ironpython\run_unittests_batchmode.cmd --test-filter test_0*.py' -PassThru
$processB = start-process 'cmd' -ArgumentList '/c .\_unittest_ironpython\run_unittests_batchmode.cmd --test-filter test_1*.py' -PassThru
$processC = start-process 'cmd' -ArgumentList '/c .\_unittest_ironpython\run_unittests_batchmode.cmd --test-filter test_2*.py' -PassThru
$processD = start-process 'cmd' -ArgumentList '/c .\_unittest_ironpython\run_unittests_batchmode.cmd --test-filter test_3*.py' -PassThru
$processE = start-process 'cmd' -ArgumentList '/c .\_unittest_ironpython\run_unittests_batchmode.cmd --test-filter test_4*.py' -PassThru
$processF = start-process 'cmd' -ArgumentList '/c .\_unittest_ironpython\run_unittests_batchmode.cmd --test-filter test_9*.py' -PassThru
$processC.WaitForExit()
$processD.WaitForExit()
$processE.WaitForExit()
$processA = start-process 'cmd' -ArgumentList '/c .\_unittest_ironpython\run_unittests_batchmode.cmd' -PassThru
$processA.WaitForExit()
$processB.WaitForExit()
$processF.WaitForExit()
get-content .\_unittest_ironpython\runner_unittest.log
$test_errors_failures = Select-String -Path .\_unittest_ironpython\runner_unittest.log -Pattern "TextTestResult errors="
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
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ jobs:
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/pyansys/pyaedt/pulls?q=label%3Abug+)
- [documentation](https://github.com/pyansys/pyaedt/pulls?q=label%3Adocumentation+)
- [enhancement](https://github.com/pyansys/pyaedt/pulls?q=label%3Aenhancement+)
- [good first issue](https://github.com/pyansys/pyaedt/pulls?q=label%3Agood+first+issue)
- [maintenance](https://github.com/pyansys/pyaedt/pulls?q=label%3Amaintenance+)
- [release](https://github.com/pyansys/pyaedt/pulls?q=label%3Arelease+)
- [testing](https://github.com/pyansys/pyaedt/pulls?q=label%Atesting+)
- [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+)
38 changes: 38 additions & 0 deletions .github/workflows/nightly-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
env:
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 }}
Expand Down Expand Up @@ -44,6 +45,13 @@ jobs:
path: doc/_build/html
retention-days: 7

- name: Upload HTML documentation artifact
uses: actions/upload-artifact@v3
with:
name: documentation-html-edb
path: doc/_build/html/EDBAPI
retention-days: 7

docs_upload:
needs: docs_build
runs-on: ubuntu-latest
Expand All @@ -55,6 +63,36 @@ jobs:
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@v3

- 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 }}
pymeilisearchopts: --stop_urls \"EDBAPI\" # Add EDB API as another index to show it in dropdown button

- name: "Deploy the dev documentation index for EDB API"
uses: ansys/actions/doc-deploy-index@v4
with:
cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev/EDBAPI/
index-name: pyedb-vdev
host-url: ${{ vars.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}
doc-artifact-name: documentation-html-edb # Add only EDB API to index

# docstring_testing:
# runs-on: Windows

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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.
# 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
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
run: |
testenv\Scripts\Activate.ps1
Set-Item -Path env:PYTHONMALLOC -Value "malloc"
pytest --tx 8*popen --durations=50 --dist loadfile -v --cov=pyaedt --cov-report=xml --junitxml=junit/test-results.xml --cov-report=html _unittest
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@v3
if: matrix.python-version == '3.10'
Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/unit_tests_solvers.yml
Original file line number Diff line number Diff line change
@@ -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-latest, 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@v3
- 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 }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ dist/
/coverage.xml
/_unittest/coverage.xml
/_unittest/local_config.json
/_unittest_solvers/coverage.xml
/_unittest_solvers/local_config.json
test-results.xml
test-output.xml

Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ repos:
args: ['--force-single-line-imports', '--profile', 'black']

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
args:
Expand All @@ -52,15 +52,15 @@ repos:

# validate GitHub workflow files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.3
rev: 0.26.3
hooks:
- id: check-github-workflows

- repo: https://github.com/asottile/blacken-docs
rev: 1.15.0
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.1.0]
additional_dependencies: [black==23.7.0]

# - repo: https://github.com/pycqa/pydocstyle
# rev: 6.1.1
Expand All @@ -69,4 +69,4 @@ repos:
# additional_dependencies: [toml]
# files: ^pyaedt/
# args:
# - --ignore=D412,D413,D213,D101,D107,D203,D102, D205
# - --ignore=D412,D413,D213,D101,D107,D203,D102, D205
Loading

0 comments on commit fc1ae13

Please sign in to comment.