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

maint: styling actions in CICD #252

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[codespell]
skip = *.pyc,*.xml,*.txt,*.gif,*.png,*.jpg,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,./doc/build/*,./doc/images/*,./dist/*,*~,.hypothesis*,*cover,*.dat,*.mac
quiet-level = 3
ignore-words = doc/styles/Vocab/ANSYS/accept.txt
ignore-words = doc/styles/config/vocabularies/ANSYS/accept.txt
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[flake8]
exclude = venv, __init__.py, doc/_build, .venv
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E231, E301, E303, E501, F401, F403
select = W191, W291, W293, W391, E115, E117, E122, E124, E125, E225, E301, E303, E501, F401, F403
count = True
max-complexity = 10
max-line-length = 100
Expand Down
41 changes: 19 additions & 22 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ permissions:

jobs:

style:
name: Code style
code-style:
name: "Code style"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -49,32 +49,29 @@ jobs:
- name: Test with tox
run: tox -e style


doc-style:
name: Documentation Style Check
name: "Documentation Style Check"
runs-on: ubuntu-latest
steps:
# TODO - Fix codestyle issues
# - name: PyAnsys documentation style checks
# uses: ansys/actions/doc-style@v4
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# vale-version: "2.29.6"
- name : TODO - Reactivate code style
run : sleep 1
- name: "PyAnsys documentation style checks"
uses: ansys/actions/doc-style@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}

doc-build:
name: "Documentation building"
needs: [style, doc-style]
needs: [code-style, doc-style]
timeout-minutes: 60
outputs:
PYMAPDL_VERSION: ${{ steps.version.outputs.PYMAPDL_VERSION }}
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
PYMAPDL_PORT: 21000 # default won't work on GitHub runners
PYMAPDL_DB_PORT: 21001 # default won't work on GitHub runners
PYMAPDL_START_INSTANCE: FALSE
ON_DOCUMENTATION: TRUE

steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v4
Expand Down Expand Up @@ -106,14 +103,14 @@ jobs:
run: |
sudo apt-get update
sudo apt install zip pandoc libgl1-mesa-glx xvfb texlive-latex-extra latexmk graphviz texlive-xetex libgomp1

- name: "Set up Python using cache"
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
cache: 'pip'
cache-dependency-path: 'requirements/requirements_doc.txt'

- name: "Install Python requirements"
run: |
pip uninstall ansys-mapdl-core
Expand Down Expand Up @@ -153,7 +150,7 @@ jobs:
.ci/waiting_services.sh

- name: "Run Ansys documentation building action"
uses: ansys/actions/doc-build@v6
uses: ansys/actions/doc-build@v8
with:
requires-xvfb: true
python-version: ${{ env.MAIN_PYTHON_VERSION }}
Expand All @@ -172,15 +169,15 @@ jobs:
folder: doc/_build/html
clean: true
single-commit: true

- name: "Display Docker files structures"
if: always()
env:
MAPDL_INSTANCE: MAPDL_0
LOG_NAMES: logs-build-docs
run: |
.ci/display_logs.sh

- name: "Collect MAPDL logs on failure"
if: always()
env:
Expand All @@ -189,14 +186,14 @@ jobs:
LOG_NAMES: logs-build-docs
run: |
.ci/collect_mapdl_logs.sh

- name: "Tar logs"
if: always()
run: |
cp -f doc/_build/latex/*.log ./logs-build-docs/
cp log.txt ./logs-build-docs/
tar cvzf ./logs-build-docs.tgz ./logs-build-docs

- name: "Upload logs to GitHub"
if: always()
uses: actions/upload-artifact@v4
Expand All @@ -218,7 +215,7 @@ jobs:

release:
if: github.event_name == 'refs/heads/main' && !contains(github.ref, 'refs/tags')
needs: [style, doc-build] #docs-style
needs: [code-style, doc-build] #docs-style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
- id: flake8

- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
rev: v2.2.6
hooks:
- id: codespell

Expand Down
11 changes: 6 additions & 5 deletions doc/.vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ Packages = Google
# Define the Ansys vocabulary
Vocab = ANSYS

[*.{md,rst}]
# Section styles
# ==============
[*.{rst}]

# Apply the following styles
BasedOnStyles = Vale, Google
BasedOnStyles = Vale

TokenIgnores = (:(func|class|meth|attr|py):`(?:.|\n)*?`)|(<.*>)|(.. (code|jupyter-execute)::.*\n| .*)
TokenIgnores = (:(func|class|meth|attr|py):`(?:.|\n)*?`)|(<.*>)

# Removing Google-specific rule - Not applicable under some circumstances
Google.Colons = NO
Google.Headings = NO
Vale.Terms = NO
4 changes: 0 additions & 4 deletions doc/styles/.gitignore

This file was deleted.

6 changes: 6 additions & 0 deletions doc/styles/config/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*
!config
!config/vocabularies
!config/vocabularies/ANSYS
!config/vocabularies/ANSYS/**
!.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Lanczos
Mahoney
MAPDL
Matplotlib
mecanic
midplane
midside
Mises
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down Expand Up @@ -40,7 +40,7 @@
- Static Analysis ``ANTYPE=0``

Element type(s):
- 2-D 4-Node Sructural Solid Elements (PLANE182)
- 2-D 4-Node Structural Solid Elements (PLANE182)
- 2-D 8-Node Structural Solid Elements (PLANE183)

.. image:: ../_static/vm5_setup.png
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-006-pinched_cylinder.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-008-parametric_calculation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-010-bending_of_a_t-shaped_beam.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-011-residual-stress-problem.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-013.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-014.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-015.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-016.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-018.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-020.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-021.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-025.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-291.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-295.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
2 changes: 1 addition & 1 deletion examples/verif-manual/vm-299.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2022 - 2024 ANSYS, Inc. and/or its affiliates.
# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
Expand Down
32 changes: 16 additions & 16 deletions requirements/requirements_doc.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#PyMAPDL dependencies
git+https://github.com/ansys/pymapdl@main
numpy==1.26.4
numpy==2.2.2
nest-asyncio==1.6.0
pandas==2.2.2
plotly==5.22.0
pandas==2.2.3
plotly==6.0.0
pythreejs==2.4.2
pyvista[jupyter]==0.44.0
vtk==9.3.1
pyvista[jupyter]!=0.44.2
vtk==9.4.1

# Documentation dependencies
Sphinx==7.4.0
numpydoc==1.7.0
ansys-sphinx-theme==0.16.6
Sphinx==8.1.3
numpydoc==1.8.0
ansys-sphinx-theme==1.2.6
sphinx-copybutton==0.5.2
jupyter_sphinx==0.5.3
jupyterlab>=3.2.8
jupyterlab>=4.3.4
sphinxemoji==0.3.1
sphinx-gallery==0.15.0
sphinx-autobuild==2024.4.16
sphinx-autodoc-typehints==2.2.2
sphinx-design==0.6.0
sphinx-notfound-page==1.0.2
panel==1.4.4
pypandoc==1.13
sphinx-gallery==0.18.0
sphinx-autobuild==2024.10.3
sphinx-autodoc-typehints==3.0.1
sphinx-design==0.6.1
sphinx-notfound-page==1.1.0
panel==1.6.0
pypandoc==1.15
Loading