Skip to content

Commit

Permalink
Prepare release 2.0.2 (#579)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Doug Addy <[email protected]>
Co-authored-by: pyansys-ci-bot <[email protected]>
  • Loading branch information
4 people authored May 3, 2024
1 parent dd62c39 commit 94dce45
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 160 deletions.
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: 'openapi.docs.pyansys.com'

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

release:
name: "Release"
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
Expand All @@ -198,25 +160,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/[email protected]
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
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", "openapi.docs.pyansys.com")

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"]
4 changes: 2 additions & 2 deletions poetry.lock

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

15 changes: 10 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "ansys-openapi-common"
description = "Provides a helper to create sessions for use with Ansys OpenAPI clients."
version = "2.0.1"
version = "2.0.2"
license = "MIT"
authors = ["ANSYS, Inc. <[email protected]>"]
maintainers = ["ANSYS, Inc. <[email protected]>"]
Expand Down Expand Up @@ -62,17 +62,22 @@ 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.14.0" }
numpydoc = { version = "1.6.0" }
Expand Down Expand Up @@ -108,7 +113,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

0 comments on commit 94dce45

Please sign in to comment.