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

Fixing DynamicScrapper #198

Merged
merged 43 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
df78fc0
maitn: updating cicd
clatapie Oct 2, 2023
c4ebb78
maint: update ci_cd.yml
clatapie Oct 2, 2023
6d45e6f
maint: delete doc/_static directory
clatapie Oct 2, 2023
7e04c1a
test: modifying the cicd
clatapie Oct 5, 2023
04e6dee
Merge branch 'main' into doc/fix-dynamicscrapper
clatapie Oct 5, 2023
18c6484
maint: removing -W in sphinxopts
clatapie Oct 5, 2023
80997ea
maint: testing from where the issue is coming from
clatapie Oct 5, 2023
20f6aca
maint: trying to fix cicd
clatapie Oct 5, 2023
7e6b106
maint: cleaning cicd and readding caches
clatapie Oct 5, 2023
781134a
maint: fixing cache
clatapie Oct 5, 2023
7bd5c7e
maint: fixing cache
clatapie Oct 5, 2023
7a80e84
maint: deploy dev doc
clatapie Oct 5, 2023
124410a
maint: fixing cache
clatapie Oct 5, 2023
7a5feb1
maint: removing all caches
clatapie Oct 5, 2023
5097d1a
maint: fixing cicd
clatapie Oct 5, 2023
6ee2044
maint: fixing dependencies
clatapie Oct 5, 2023
ee9c2ca
maint: trying to fix DynamicScrapper
clatapie Oct 6, 2023
6742654
maint: attempt to fix cicd
clatapie Oct 6, 2023
fb436a2
fix: typo in cicd
clatapie Oct 6, 2023
5aa74ab
maint: installing `ansys-math-core` before validating MAPDL service
clatapie Oct 6, 2023
4ca17b3
maint: removing ansys/actions
clatapie Oct 6, 2023
03594e3
maint: adding doc requirements in cicd
clatapie Oct 6, 2023
8d64694
maint: readding caches
clatapie Oct 6, 2023
9e46c39
fix: resetting caches
clatapie Oct 6, 2023
bd30457
Merge branch 'main' into doc/fix-dynamicscrapper
clatapie Oct 9, 2023
aaff535
Merge branch 'main' into doc/fix-dynamicscrapper
clatapie Nov 20, 2023
906f8e3
maint: updating PyVista dependency
clatapie Feb 21, 2024
cff62bc
Merge branch 'main' into doc/fix-dynamicscrapper
clatapie Feb 21, 2024
ddcfbc3
fix: typo in CICD
clatapie Feb 21, 2024
d9669b2
fix: `actions/upload-artifact` to v4
clatapie Feb 21, 2024
eb6e549
maint: readding `DynamicScraper` in `conf.py`
clatapie Feb 21, 2024
1242367
fix: adding `sphinx-design` dependency
clatapie Feb 21, 2024
99be27f
maint: resetting caches
clatapie Feb 21, 2024
151e2b6
maint: removing `pyvista.FIGURE_PATH`
clatapie Feb 21, 2024
96de5eb
maint: cleaning up CICD
clatapie Feb 21, 2024
e0c28b3
maint: resetting caches
clatapie Feb 21, 2024
0330c97
maint: updating actions/doc-build to `v5`
clatapie Feb 21, 2024
24a3de0
Update .github/workflows/ci_cd.yml
clatapie Feb 21, 2024
62118c0
maint: reverting some changes in CICD
clatapie Feb 21, 2024
5b00d5f
Merge branch 'doc/fix-dynamicscrapper' of https://github.com/ansys/py…
clatapie Feb 21, 2024
21a9ec6
maint: fix version output
clatapie Feb 21, 2024
47399a9
fix: CICD
clatapie Feb 21, 2024
732edff
fix: CICD typo
clatapie Feb 21, 2024
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
61 changes: 27 additions & 34 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ env:
PYMAPDL_START_INSTANCE: FALSE
PYMAPDL_PORT: 21000 # default won't work on GitHub runners
PYMAPDL_DB_PORT: 21001 # default won't work on GitHub runners
RESET_PIP_CACHE: 0
RESET_AUTOSUMMARY_CACHE: 0
RESET_EXAMPLES_CACHE: 0
RESET_DOC_BUILD_CACHE: 0
RESET_PIP_CACHE: 0

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -45,14 +45,14 @@ jobs:
name: "Documentation Style Check"
runs-on: ubuntu-latest
steps:
- name: PyAnsys documentation style checks
- name: "PyAnsys documentation style checks"
uses: ansys/actions/doc-style@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}


smoke-tests:
name: Build and Smoke tests
name: "Build and Smoke tests"
runs-on: ${{ matrix.os }}
needs: [code-style]
strategy:
Expand All @@ -69,7 +69,7 @@ jobs:
- should-release: false
os: windows-latest
steps:
- name: Build wheelhouse and perform smoke test
- name: "Build wheelhouse and perform smoke test"
uses: ansys/actions/build-wheelhouse@v5
with:
library-name: ${{ env.PACKAGE_NAME }}
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
restore-keys: |
Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ matrix.mapdl-version }}

- name: Install ansys-mapdl-core
- name: "Install ansys-mapdl-core"
run: |
python -m pip install ansys-mapdl-core

Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
name: ${{ matrix.mapdl-version }}-remote.xml
flags: remote,${{ matrix.mapdl-version }}

- name: Upload coverage artifacts
- name: "Upload coverage artifacts"
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.mapdl-version }}-remote.xml
Expand Down Expand Up @@ -214,15 +214,16 @@ jobs:


doc-build:
name: Doc building
name: "Doc building"
runs-on: ubuntu-latest
needs: [doc-style]
outputs:
ANSYSMATH_VERSION: ${{ steps.version.outputs.ANSYSMATH_VERSION }}
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
steps:
# This checkout is repeated later at the 'doc-build' action. This could be avoided by copything the sh file here, but introduces some code duplicity.
- name: "Install Git and checkout project"
uses: actions/checkout@v4

Expand All @@ -231,11 +232,6 @@ jobs:
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: "Install OS packages"
run: |
sudo apt update
sudo apt install pandoc

- name: "Cache pip"
uses: actions/cache@v4
with:
Expand All @@ -244,9 +240,9 @@ jobs:
restore-keys: |
Python-v${{ env.RESET_PIP_CACHE }}-Linux-${{ env.MAIN_PYTHON_VERSION }}

- name: "Install ansys-math-core"
- name: "Install ansys-math-core and documentation requirements"
run: |
pip install .
pip install .[doc]

- name: "Login in Github container registry"
uses: docker/[email protected]
Expand All @@ -262,57 +258,54 @@ jobs:
MAPDL_IMAGE: '${{ env.DOCKER_PACKAGE }}:${{ env.DOCKER_IMAGE_VERSION_DOCS_BUILD }}'

- name: "Retrieve AnsysMath version"
id: version
run: |
echo "ANSYSMATH_VERSION=$(python -c 'from ansys.math.core import __version__; print(__version__)')" >> $GITHUB_ENV
echo "ANSYSMATH_VERSION=$(python -c 'from ansys.math.core import __version__; print(__version__)')" >> $GITHUB_OUTPUT
echo "AnsysMath version is: $(python -c "from ansys.math.core import __version__; print(__version__)")"

- name: "Cache examples"
uses: actions/cache@v4
with:
path: doc/source/examples
key: Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ env.ANSYSMATH_VERSION }}-${{ github.sha }}
key: Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ steps.version.outputs.ANSYSMATH_VERSION }}-${{ github.sha }}
restore-keys: |
Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ env.ANSYSMATH_VERSION }}
Examples-v${{ env.RESET_EXAMPLES_CACHE }}-${{ steps.version.outputs.ANSYSMATH_VERSION }}

- name: "Cache docs build directory"
uses: actions/cache@v4
with:
path: doc/_build
key: doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ env.ANSYSMATH_VERSION }}-${{ github.sha }}
key: doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ steps.version.outputs.ANSYSMATH_VERSION }}-${{ github.sha }}
restore-keys: |
doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ env.ANSYSMATH_VERSION }}
doc-build-v${{ env.RESET_DOC_BUILD_CACHE }}-${{ steps.version.outputs.ANSYSMATH_VERSION }}


- name: "Cache autosummary"
uses: actions/cache@v4
with:
path: doc/source/**/_autosummary/*.rst
key: autosummary-v${{ env.RESET_AUTOSUMMARY_CACHE }}-${{ env.ANSYSMATH_VERSION }}-${{ github.sha }}
key: autosummary-v${{ env.RESET_AUTOSUMMARY_CACHE }}-${{ steps.version.outputs.ANSYSMATH_VERSION }}-${{ github.sha }}
restore-keys: |
autosummary-v${{ env.RESET_AUTOSUMMARY_CACHE }}-${{ env.ANSYSMATH_VERSION }}

- name: "Install docs build requirements"
run: |
pip install .[doc]

- name: List
run: pip list
autosummary-v${{ env.RESET_AUTOSUMMARY_CACHE }}-${{ steps.version.outputs.ANSYSMATH_VERSION }}

- name: "Run Ansys documentation building action"
uses: ansys/actions/doc-build@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
checkout: false
skip-install: true
sphinxopts: -j auto
checkout: false
sphinxopts: -j auto --keep-going
requires-xvfb: true
skip-json-build: true
dependencies: pandoc


package:
name: Package library
name: "Package library"
needs: [doc-build, build-test]
runs-on: ubuntu-latest
steps:
- name: Build library source and wheel artifacts
- name: "Build library source and wheel artifacts"
uses: ansys/actions/build-library@v5
with:
library-name: ${{ env.PACKAGE_NAME }}
Expand Down
File renamed without changes.
Empty file removed doc/source/_static/README.rst
Empty file.
9 changes: 3 additions & 6 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from ansys_sphinx_theme import ansys_favicon, get_version_match, pyansys_logo_black
import numpy as np
import pyvista
from pyvista.plotting.utilities.sphinx_gallery import DynamicScraper
from sphinx_gallery.sorting import FileNameSortKey

from ansys.math.core import __version__
Expand All @@ -18,11 +19,6 @@
# must be less than or equal to the XVFB window size
pyvista.global_theme.window_size = np.array([1024, 768])

# Save figures in specified directory
pyvista.FIGURE_PATH = os.path.join(os.path.abspath("./images/"), "auto-generated/")
if not os.path.exists(pyvista.FIGURE_PATH):
os.makedirs(pyvista.FIGURE_PATH)

# necessary when building the sphinx gallery
pyvista.BUILDING_GALLERY = True
pymath.BUILDING_GALLERY = True
Expand Down Expand Up @@ -92,6 +88,7 @@
"sphinx.ext.coverage",
"sphinx.ext.intersphinx",
"sphinx_copybutton",
"sphinx_design",
"sphinx_gallery.gen_gallery",
"pyvista.ext.viewer_directive",
]
Expand All @@ -114,7 +111,7 @@
"backreferences_dir": None,
# Modules for which function level galleries are created. In
"doc_module": "ansys-math-core",
"image_scrapers": ("pyvista", "matplotlib"),
"image_scrapers": (DynamicScraper(), "matplotlib"),
"ignore_pattern": "flycheck*",
"thumbnail_size": (350, 350),
}
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ doc = [
"sphinx-autobuild==2024.2.4",
"sphinx-autodoc-typehints==2.0.0",
"sphinx-copybutton==0.5.2",
"sphinx-design==0.5.0",
"sphinx-notfound-page==1.0.0",
"sphinx-gallery==0.15.0",
"trame==3.5.2",
Expand Down
Loading