Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
03d5df9
Update make files
ludovicsteinbach Apr 19, 2024
94c74ab
Use doc build action
ludovicsteinbach Apr 19, 2024
72bfc57
Rename dependency group
ludovicsteinbach Apr 19, 2024
5dd52b3
Remove pandoc
ludovicsteinbach Apr 19, 2024
e1ec089
Add requests-kerberos to doc group
ludovicsteinbach Apr 19, 2024
7765995
Install krb5
ludovicsteinbach Apr 19, 2024
cd4cc3c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 19, 2024
57cb4c4
Disable nitpicky
ludovicsteinbach Apr 19, 2024
08b03ff
Disable custom engine
ludovicsteinbach Apr 19, 2024
8c0c1d9
Remove any tex config
ludovicsteinbach Apr 19, 2024
9e3e7fa
Fix lock file
da1910 May 2, 2024
024e593
Adding changelog entry: 555.dependencies.md
pyansys-ci-bot May 2, 2024
b2c7f6c
Use Ansys doc deploy actions
ludovicsteinbach May 2, 2024
73f2b27
Add version switcher to docs
ludovicsteinbach May 2, 2024
371db26
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 2, 2024
d42cf11
Remove protocol in CNAME
ludovicsteinbach May 2, 2024
a389b72
Remove docs unnecessary deps
ludovicsteinbach May 2, 2024
aedda61
Make dev deps optional
ludovicsteinbach May 2, 2024
4b98031
Poetry lock
ludovicsteinbach May 2, 2024
73f9c00
Add mypy dependency in pre-commit config
ludovicsteinbach May 2, 2024
35db4af
Fix mypy config
ludovicsteinbach May 2, 2024
5555aef
Revert commits
ludovicsteinbach May 2, 2024
3d903ee
Move linux deps to new optional group
ludovicsteinbach May 2, 2024
1a94ad7
Remove kerberos headers install
ludovicsteinbach May 2, 2024
b821e63
Merge branch 'main' into ci/use-ansys-actions
ludovicsteinbach May 3, 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
98 changes: 21 additions & 77 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
env:
MAIN_PYTHON_VERSION: '3.10'
LIBRARY_NAME: 'ansys-openapi-common'
DOCUMENTATION_CNAME: 'ansys.github.io/openapi-common/'

jobs:
code-style:
Expand All @@ -35,54 +36,14 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

doc-build:
name: Build Documentation
name: Documentation build
runs-on: ubuntu-latest
needs: doc-style

steps:
- name: "Checkout the repository"
uses: actions/checkout@v4

- name: "Set up Python"
uses: actions/setup-python@v5
- name: "Run Ansys documentation building action"
uses: ansys/actions/doc-build@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: "Install system dependencies"
run: |
sudo apt-get update && sudo apt-get install pandoc libkrb5-dev

- name: "Install Python dependencies"
run: |
python -m pip install --upgrade pip tox
python -m pip install poetry~=1.7.0

- name: Install library
run: |
poetry install --with docs --extras "oidc linux-kerberos"

- name: Build HTML
run: make -C doc html SPHINXOPTS="-W"

- name: Build PDF Documentation
run: |
sudo apt update
sudo apt-get install -y texlive-latex-extra latexmk texlive-xetex fonts-freefont-otf xindy
make -C doc latexpdf

- name: Upload HTML Documentation
uses: actions/upload-artifact@v4
with:
name: documentation-html
path: doc/build/html
retention-days: 7

- name: Upload PDF Documentation
uses: actions/upload-artifact@v4
with:
name: documentation-pdf
path: doc/build/latex/*.pdf
retention-days: 7
check-links: false
sphinxopts: "-j 1 -W --keep-going"

smoke-tests:
name: "Build wheelhouse for latest Python versions"
Expand All @@ -93,12 +54,6 @@ jobs:
os: [ubuntu-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Install kerberos headers
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt install libkrb5-dev

- uses: ansys/actions/build-wheelhouse@v6
with:
library-name: ${{ env.LIBRARY_NAME }}
Expand Down Expand Up @@ -164,16 +119,23 @@ jobs:
runs-on: ubuntu-latest
needs: [ doc-build, tests ]
steps:
- name: Install kerberos headers
run: |
sudo apt-get update
sudo apt install libkrb5-dev

- uses: ansys/actions/build-library@v6
with:
library-name: ${{ env.LIBRARY_NAME }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}

doc-deploy-dev:
name: "Deploy development documentation"
runs-on: ubuntu-latest
needs: [ build-library ]
if: github.event_name == 'push' && !contains(github.ref, 'refs/tags')
steps:
- uses: ansys/actions/doc-deploy-dev@v6
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: documentation-html

update-changelog:
name: "Update CHANGELOG for new tag"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
Expand Down Expand Up @@ -210,25 +172,7 @@ jobs:
needs: release
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4

- name: Get Bot Application Token
id: get_workflow_token
uses: peter-murray/workflow-application-token-action@v3
with:
application_id: ${{ secrets.BOT_APPLICATION_ID }}
application_private_key: ${{ secrets.BOT_APPLICATION_PRIVATE_KEY }}

- uses: actions/download-artifact@v4
- uses: ansys/actions/doc-deploy-stable@v6
with:
name: documentation-html
path: ~/html

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4.6.0
with:
repository-name: pyansys/openapi-common-docs
token: ${{ steps.get_workflow_token.outputs.token }}
BRANCH: gh-pages
FOLDER: ~/html
CLEAN: true
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
18 changes: 13 additions & 5 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = poetry run sphinx-build
SPHINXOPTS = -j auto
SPHINXBUILD = sphinx-build
SOURCEDIR = source
BUILDDIR = build
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
Expand All @@ -19,6 +19,14 @@ help:
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)


# customized clean due to examples gallery
# Customized clean due to examples gallery
clean:
rm -rf build
rm -rf $(BUILDDIR)/*
rm -rf $(SOURCEDIR)/examples
find . -type d -name "_autosummary" -exec rm -rf {} +

# Customized pdf for svg format images
pdf:
@$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true
(test -f $(BUILDDIR)/latex/*.pdf && echo pdf exists) || exit 1
1 change: 1 addition & 0 deletions doc/changelog.d/555.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use ansys standard actions
20 changes: 18 additions & 2 deletions doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set BUILDDIR=_build

if "%1" == "" goto help
if "%1" == "clean" goto clean
if "%1" == "pdf" goto pdf

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
Expand All @@ -28,8 +30,22 @@ if errorlevel 9009 (
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:clean
rmdir /s /q %BUILDDIR% > /NUL 2>&1
for /d /r %SOURCEDIR% %%d in (_autosummary) do @if exist "%%d" rmdir /s /q "%%d"
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:pdf
%SPHINXBUILD% -M latex %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
cd "%BUILDDIR%\latex"
for %%f in (*.tex) do (
pdflatex "%%f" --interaction=nonstopmode)
if NOT EXIST ansys-openapi-common.pdf (
Echo "no pdf generated!"
exit /b 1)
Echo "pdf generated!"
:end
popd
popd
77 changes: 8 additions & 69 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import sys

from ansys_sphinx_theme import pyansys_logo_black
from ansys_sphinx_theme import get_version_match, pyansys_logo_black

from ansys.openapi import common

Expand Down Expand Up @@ -114,6 +114,8 @@


# -- Options for HTML output -------------------------------------------------
cname = os.getenv("DOCUMENTATION_CNAME", "ansys.github.io/openapi-common/")

html_theme = "ansys_sphinx_theme"
html_logo = pyansys_logo_black
html_theme_options = {
Expand All @@ -124,77 +126,14 @@
("PyAnsys Documentation", "https://docs.pyansys.com"),
("Shared Components", "https://shared.docs.pyansys.com"),
],
"switcher": {
"json_url": f"https://{cname}/versions.json",
"version_match": get_version_match(common.__version__),
},
"check_switcher": False,
}

# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = "openapicommondoc"


# -- Options for LaTeX output ------------------------------------------------
latex_elements = {}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
master_doc,
"ansys_openapi_common.tex",
"ansys.openapi.common Documentation",
author,
"manual",
),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(
master_doc,
"ansys.openapi.common",
"ansys.openapi.common Documentation",
[author],
1,
)
]


# -- Options for Texinfo output ----------------------------------------------

# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
master_doc,
"ansys.openapi.common",
"ansys.openapi.common Documentation",
author,
"ansys.openapi.common",
"Common authentication components for pyAnsys REST clients",
"Engineering Software",
),
]
latex_engine = "xelatex"

# -- Options for Epub output -------------------------------------------------

# Bibliographic Dublin Core info.
epub_title = project

# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#
# epub_identifier = ''

# A unique identification for the text.
#
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,23 @@ pydantic = { version = "*" }
requests-mock = { version = "*" }
pytest-mock = { version = "*" }
covertable = { version = "*" }
asgi_gssapi = { version = "*", markers = "sys_platform == 'linux'" }

mypy = "^1.8.0"
types-requests = { version = "*" }
types-python-dateutil = { version = "*" }
requests_auth = { version = "*" }
keyring = { version = "*" }

[tool.poetry.group.docs]
[tool.poetry.group.dev-linux]
optional = true

[tool.poetry.group.dev-linux.dependencies]
asgi_gssapi = { version = "*", markers = "sys_platform == 'linux'" }

[tool.poetry.group.doc]
optional = true

[tool.poetry.group.docs.dependencies]
[tool.poetry.group.doc.dependencies]
# Doc packages
ansys-sphinx-theme = { version = "0.15.2" }
numpydoc = { version = "1.7.0" }
Expand Down Expand Up @@ -108,7 +114,7 @@ python =
[testenv]
whitelist_externals = poetry
commands_pre =
poetry install --no-root --extras "oidc linux-kerberos"
poetry install --no-root --with dev-linux --extras "oidc linux-kerberos"
extras =
oidc
linux-kerberos
Expand Down