From f392b91554788774ba25de4381be253847aeba76 Mon Sep 17 00:00:00 2001 From: Camille <78221213+clatapie@users.noreply.github.com> Date: Wed, 29 May 2024 11:57:46 +0200 Subject: [PATCH 1/7] maint: cicd --- .github/workflows/ci_cd.yml | 44 ++++++++++++++----------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 381eb26a..4413d411 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -34,37 +34,27 @@ permissions: jobs: - style: - name: Code style + code-style: + name: "Code style" runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - name: PyAnsys code style checks + uses: ansys/actions/code-style@v6 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip tox - - 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@v6 + 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 }} @@ -74,7 +64,7 @@ jobs: 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 @@ -106,14 +96,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 @@ -172,7 +162,7 @@ jobs: folder: doc/_build/html clean: true single-commit: true - + - name: "Display Docker files structures" if: always() env: @@ -180,7 +170,7 @@ jobs: LOG_NAMES: logs-build-docs run: | .ci/display_logs.sh - + - name: "Collect MAPDL logs on failure" if: always() env: @@ -189,14 +179,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 From 38bea79651cb3011d41150e914d22fe24c2ca8a3 Mon Sep 17 00:00:00 2001 From: Camille <78221213+clatapie@users.noreply.github.com> Date: Wed, 29 May 2024 12:04:23 +0200 Subject: [PATCH 2/7] fix: updating package layout for `ansys/actions/doc-style` v6 --- doc/.vale.ini | 8 +++++--- doc/styles/.gitignore | 4 ---- doc/styles/config/.gitignore | 4 ++++ .../{Vocab => config/vocabularies}/ANSYS/accept.txt | 0 .../{Vocab => config/vocabularies}/ANSYS/reject.txt | 0 5 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 doc/styles/.gitignore create mode 100644 doc/styles/config/.gitignore rename doc/styles/{Vocab => config/vocabularies}/ANSYS/accept.txt (100%) rename doc/styles/{Vocab => config/vocabularies}/ANSYS/reject.txt (100%) diff --git a/doc/.vale.ini b/doc/.vale.ini index 31122983..1a9fbbaa 100644 --- a/doc/.vale.ini +++ b/doc/.vale.ini @@ -26,9 +26,11 @@ Vocab = ANSYS # Apply the following styles BasedOnStyles = Vale, Google - -TokenIgnores = (:(func|class|meth|attr|py):`(?:.|\n)*?`)|(<.*>)|(.. (code|jupyter-execute)::.*\n| .*) +Vale.Terms = NO # Removing Google-specific rule - Not applicable under some circumstances +Google.WordList = NO Google.Colons = NO -Google.Headings = NO + +# By default, `class` and `func` are ignored +TokenIgnores = (:class:`.*`|:func:`.*`) diff --git a/doc/styles/.gitignore b/doc/styles/.gitignore deleted file mode 100644 index 080f12aa..00000000 --- a/doc/styles/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -* -!Vocab -!Vocab/** -!.gitignore \ No newline at end of file diff --git a/doc/styles/config/.gitignore b/doc/styles/config/.gitignore new file mode 100644 index 00000000..f98a973c --- /dev/null +++ b/doc/styles/config/.gitignore @@ -0,0 +1,4 @@ +* +!vocabularies +!vocabularies/** +!.gitignore \ No newline at end of file diff --git a/doc/styles/Vocab/ANSYS/accept.txt b/doc/styles/config/vocabularies/ANSYS/accept.txt similarity index 100% rename from doc/styles/Vocab/ANSYS/accept.txt rename to doc/styles/config/vocabularies/ANSYS/accept.txt diff --git a/doc/styles/Vocab/ANSYS/reject.txt b/doc/styles/config/vocabularies/ANSYS/reject.txt similarity index 100% rename from doc/styles/Vocab/ANSYS/reject.txt rename to doc/styles/config/vocabularies/ANSYS/reject.txt From 971401ffc9ff17316b8e1d6f0c09ac866822b4d2 Mon Sep 17 00:00:00 2001 From: Camille <78221213+clatapie@users.noreply.github.com> Date: Wed, 29 May 2024 12:06:42 +0200 Subject: [PATCH 3/7] fix: typo in cicd --- .github/workflows/ci_cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 4413d411..cdfcec86 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -208,7 +208,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 From 1e961e303e47e7c19ee7b2255762c4262fca6083 Mon Sep 17 00:00:00 2001 From: Camille <78221213+clatapie@users.noreply.github.com> Date: Mon, 1 Jul 2024 17:15:27 +0200 Subject: [PATCH 4/7] fix: code style action --- .github/workflows/ci_cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 3ea540dd..cecb92c1 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -42,6 +42,7 @@ jobs: uses: ansys/actions/code-style@v6 with: python-version: ${{ env.MAIN_PYTHON_VERSION }} + skip-install: true doc-style: name: "Documentation Style Check" From a4d795bf73db90c3b83d147f9d7ba76a4741f74e Mon Sep 17 00:00:00 2001 From: Camille <78221213+clatapie@users.noreply.github.com> Date: Mon, 1 Jul 2024 17:25:25 +0200 Subject: [PATCH 5/7] fix: codespell --- .codespellrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index 89a83fe3..34ade19d 100644 --- a/.codespellrc +++ b/.codespellrc @@ -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" \ No newline at end of file From 8b32b9268e8fa7fd2c5f515f82dce88228b6da63 Mon Sep 17 00:00:00 2001 From: Camille <78221213+clatapie@users.noreply.github.com> Date: Mon, 1 Jul 2024 17:26:46 +0200 Subject: [PATCH 6/7] fix: code style action --- .github/workflows/ci_cd.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index cecb92c1..61ac7ec5 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -38,6 +38,8 @@ jobs: name: "Code style" runs-on: ubuntu-latest steps: + - name: "Checkout code" + uses: actions/checkout@v4 - name: PyAnsys code style checks uses: ansys/actions/code-style@v6 with: From 1f975aa5e68a80ef2f0cc359ce5d5c923358fbb9 Mon Sep 17 00:00:00 2001 From: Camille <78221213+clatapie@users.noreply.github.com> Date: Tue, 2 Jul 2024 10:23:23 +0200 Subject: [PATCH 7/7] fix: vale --- .github/workflows/ci_cd.yml | 1 + doc/.vale.ini | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 61ac7ec5..eaea7e59 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -54,6 +54,7 @@ jobs: uses: ansys/actions/doc-style@v6 with: token: ${{ secrets.GITHUB_TOKEN }} + vale-version: "3.3.0" doc-build: name: "Documentation building" diff --git a/doc/.vale.ini b/doc/.vale.ini index 1a9fbbaa..dde25999 100644 --- a/doc/.vale.ini +++ b/doc/.vale.ini @@ -22,15 +22,14 @@ Packages = Google # Define the Ansys vocabulary Vocab = ANSYS -[*.{md,rst}] - # Apply the following styles +[*.{rst}] BasedOnStyles = Vale, Google Vale.Terms = NO -# Removing Google-specific rule - Not applicable under some circumstances -Google.WordList = NO -Google.Colons = NO - # By default, `class` and `func` are ignored TokenIgnores = (:class:`.*`|:func:`.*`) + +# Removing Google-specific rule - Not applicable under some circumstances +Google.WordList = NO +Google.Colons = NO \ No newline at end of file