From 03d5df9d674b2cc0ff4ce86f779a1c174b400cc6 Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Fri, 19 Apr 2024 10:21:46 +0200 Subject: [PATCH 01/24] Update make files --- doc/Makefile | 18 +++++++++++++----- doc/make.bat | 20 ++++++++++++++++++-- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index e9ada5fa..b9920308 100755 --- a/doc/Makefile +++ b/doc/Makefile @@ -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: @@ -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 \ No newline at end of file diff --git a/doc/make.bat b/doc/make.bat index 6247f7e2..1bd5d668 100644 --- a/doc/make.bat +++ b/doc/make.bat @@ -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 ( @@ -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 \ No newline at end of file From 94c74abe9788d3f8f168011b2651115e3792a2ee Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Fri, 19 Apr 2024 10:25:02 +0200 Subject: [PATCH 02/24] Use doc build action --- .github/workflows/ci_cd.yml | 51 +++++-------------------------------- 1 file changed, 6 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index ce9500c8..3fd2046a 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -35,54 +35,15 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} doc-build: - name: Build Documentation + name: Documentation Build (mock examples) 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 - 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 + - name: "Run Ansys documentation building action" + uses: ansys/actions/doc-build@v5 with: - name: documentation-pdf - path: doc/build/latex/*.pdf - retention-days: 7 + check-links: false + dependencies: "pandoc" + sphinxopts: "-j 1 -n -W --keep-going" smoke-tests: name: "Build wheelhouse for latest Python versions" From 72bfc57c4bb6dfa67e65ec440845ebde33c00fa6 Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Fri, 19 Apr 2024 10:30:34 +0200 Subject: [PATCH 03/24] Rename dependency group to match action expectation --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 38b59b1e..019c7a05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,10 +69,10 @@ types-python-dateutil = { version = "*" } requests_auth = { version = "*" } keyring = { version = "*" } -[tool.poetry.group.docs] +[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" } From 5dd52b3fc8e8d18bfb8fecc9609ba5474dfb319a Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Fri, 19 Apr 2024 10:37:59 +0200 Subject: [PATCH 04/24] Remove pandoc --- .github/workflows/ci_cd.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 3fd2046a..a8a503c0 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -42,7 +42,6 @@ jobs: uses: ansys/actions/doc-build@v5 with: check-links: false - dependencies: "pandoc" sphinxopts: "-j 1 -n -W --keep-going" smoke-tests: From e1ec089cf84bdb08c703cbc56f23184bb37165a1 Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Fri, 19 Apr 2024 10:47:50 +0200 Subject: [PATCH 05/24] Add requests-kerberos to doc group --- poetry.lock | 6 +++--- pyproject.toml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index a281ac23..a2fdf7eb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -725,7 +725,7 @@ testing = ["pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "py name = "krb5" version = "0.5.1" description = "Kerberos API bindings for Python" -optional = true +optional = false python-versions = ">=3.7" files = [ {file = "krb5-0.5.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e51c700cf148e63fef60bc4b2c453018218a3170dedbfe2840f122aee5a453e7"}, @@ -1286,7 +1286,7 @@ testing = ["pyjwt (==2.*)", "pytest-cov (==4.*)", "pytest-responses (==0.5.*)"] name = "requests-kerberos" version = "0.13.0" description = "A Kerberos authentication handler for python-requests" -optional = true +optional = false python-versions = ">=3.6" files = [ {file = "requests-kerberos-0.13.0.tar.gz", hash = "sha256:477e153773cc430c514d0a679e1f5ea89a0e675ac2342c413866e03d1e82a817"}, @@ -1749,4 +1749,4 @@ oidc = ["keyring", "requests_auth"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "5873031e53ed990c3449b40089b66031966dfee83c0bac39525ed61432c967ba" +content-hash = "a455f3f13502a2aa8aff9e1340bb501758ed459da2b501235c4ac67563ea19a8" diff --git a/pyproject.toml b/pyproject.toml index 019c7a05..81e5890b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,6 +79,8 @@ numpydoc = { version = "1.7.0" } sphinx = { version = "7.3.7" } sphinx-notfound-page = { version = "1.0.0" } sphinx-copybutton = { version = "0.5.2" } +# Duplicate extra - required to use ansys/actions/doc-build +requests-kerberos = {version = "^0.13", markers = "sys_platform == 'linux'" } [tool.poetry.extras] oidc = [ From 7765995f6fbfd8366315738fd9392fa492a57690 Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Fri, 19 Apr 2024 10:55:15 +0200 Subject: [PATCH 06/24] Install krb5 --- .github/workflows/ci_cd.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index a8a503c0..b5d4fd69 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -38,6 +38,10 @@ jobs: name: Documentation Build (mock examples) runs-on: ubuntu-latest steps: + - name: "Install system dependencies" + run: | + sudo apt-get update && sudo apt-get install libkrb5-dev + - name: "Run Ansys documentation building action" uses: ansys/actions/doc-build@v5 with: From cd4cc3c599a740c1f5a75915dc05108ab4ffeec0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 08:56:10 +0000 Subject: [PATCH 07/24] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .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 b5d4fd69..78703863 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -40,7 +40,7 @@ jobs: steps: - name: "Install system dependencies" run: | - sudo apt-get update && sudo apt-get install libkrb5-dev + sudo apt-get update && sudo apt-get install libkrb5-dev - name: "Run Ansys documentation building action" uses: ansys/actions/doc-build@v5 From 57cb4c4132cbf20c075438149afa81dc63a442c1 Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Fri, 19 Apr 2024 11:01:46 +0200 Subject: [PATCH 08/24] Disable nitpicky --- .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 78703863..e0182a9c 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -46,7 +46,7 @@ jobs: uses: ansys/actions/doc-build@v5 with: check-links: false - sphinxopts: "-j 1 -n -W --keep-going" + sphinxopts: "-j 1 -W --keep-going" smoke-tests: name: "Build wheelhouse for latest Python versions" From 08b03ff2e8079f9fdc90447d4dfa960931993baf Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Fri, 19 Apr 2024 11:08:55 +0200 Subject: [PATCH 09/24] Disable custom engine --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 27c93320..cfef7310 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -180,7 +180,7 @@ "Engineering Software", ), ] -latex_engine = "xelatex" +# latex_engine = "xelatex" # -- Options for Epub output ------------------------------------------------- From 8c0c1d9afa6f7af67b44dec8dbb82fdd0c49abaa Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Fri, 19 Apr 2024 11:19:13 +0200 Subject: [PATCH 10/24] Remove any tex config --- .github/workflows/ci_cd.yml | 2 +- doc/source/conf.py | 68 ------------------------------------- 2 files changed, 1 insertion(+), 69 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index e0182a9c..0e1f0201 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -35,7 +35,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} doc-build: - name: Documentation Build (mock examples) + name: Documentation build runs-on: ubuntu-latest steps: - name: "Install system dependencies" diff --git a/doc/source/conf.py b/doc/source/conf.py index cfef7310..a664d0f9 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -130,71 +130,3 @@ # 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"] From 9e3e7fa80c5d9a8194f1c4eee6e48ce080a689a2 Mon Sep 17 00:00:00 2001 From: Doug Addy Date: Thu, 2 May 2024 11:39:21 +0100 Subject: [PATCH 11/24] Fix lock file --- poetry.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/poetry.lock b/poetry.lock index a2fdf7eb..5146965e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. [[package]] name = "accessible-pygments" @@ -1749,4 +1749,4 @@ oidc = ["keyring", "requests_auth"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "a455f3f13502a2aa8aff9e1340bb501758ed459da2b501235c4ac67563ea19a8" +content-hash = "ee241e499dec7d09657fd502d357fb473c2d19b60edd34e95bf6187be7f74908" From 024e593232dc6f1d421d404c719a1fffd37b95ad Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot Date: Thu, 2 May 2024 10:39:59 +0000 Subject: [PATCH 12/24] Adding changelog entry: 555.dependencies.md --- doc/changelog.d/555.dependencies.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/555.dependencies.md diff --git a/doc/changelog.d/555.dependencies.md b/doc/changelog.d/555.dependencies.md new file mode 100644 index 00000000..a755a1bb --- /dev/null +++ b/doc/changelog.d/555.dependencies.md @@ -0,0 +1 @@ +Use ansys standard actions \ No newline at end of file From b2c7f6cdc491ce493755a23f870ced6981d8ffa8 Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Thu, 2 May 2024 13:56:17 +0200 Subject: [PATCH 13/24] Use Ansys doc deploy actions --- .github/workflows/ci_cd.yml | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 0e1f0201..71810641 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -14,6 +14,7 @@ on: env: MAIN_PYTHON_VERSION: '3.10' LIBRARY_NAME: 'ansys-openapi-common' + DOCUMENTATION_CNAME: 'https://ansys.github.io/openapi-common/' jobs: code-style: @@ -138,6 +139,18 @@ jobs: 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') @@ -174,25 +187,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 + - uses: ansys/actions/doc-deploy-stable@v6 with: - application_id: ${{ secrets.BOT_APPLICATION_ID }} - application_private_key: ${{ secrets.BOT_APPLICATION_PRIVATE_KEY }} - - - uses: actions/download-artifact@v4 - 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 }} From 73f2b27511f42487bc5273f6351ffe6b6a7f5cab Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Thu, 2 May 2024 13:59:46 +0200 Subject: [PATCH 14/24] Add version switcher to docs --- doc/source/conf.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index a664d0f9..738ba7f8 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -2,7 +2,7 @@ import os import sys -from ansys_sphinx_theme import pyansys_logo_black +from ansys_sphinx_theme import pyansys_logo_black, get_version_match from ansys.openapi import common @@ -114,6 +114,8 @@ # -- Options for HTML output ------------------------------------------------- +cname = os.getenv("DOCUMENTATION_CNAME", "https://ansys.github.io/openapi-common/") + html_theme = "ansys_sphinx_theme" html_logo = pyansys_logo_black html_theme_options = { @@ -124,6 +126,11 @@ ("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 --------------------------------------------- From 371db268c8adfdaf1e51dcfbffa43ebd20f947a1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 12:01:47 +0000 Subject: [PATCH 15/24] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 738ba7f8..bbd22811 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -2,7 +2,7 @@ import os import sys -from ansys_sphinx_theme import pyansys_logo_black, get_version_match +from ansys_sphinx_theme import get_version_match, pyansys_logo_black from ansys.openapi import common From d42cf11c2910120d860fe9363759a8d2b82c303f Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Thu, 2 May 2024 14:25:05 +0200 Subject: [PATCH 16/24] Remove protocol in CNAME --- .github/workflows/ci_cd.yml | 2 +- doc/source/conf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 71810641..b103d7a3 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -14,7 +14,7 @@ on: env: MAIN_PYTHON_VERSION: '3.10' LIBRARY_NAME: 'ansys-openapi-common' - DOCUMENTATION_CNAME: 'https://ansys.github.io/openapi-common/' + DOCUMENTATION_CNAME: 'ansys.github.io/openapi-common/' jobs: code-style: diff --git a/doc/source/conf.py b/doc/source/conf.py index bbd22811..f66af2cd 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -114,7 +114,7 @@ # -- Options for HTML output ------------------------------------------------- -cname = os.getenv("DOCUMENTATION_CNAME", "https://ansys.github.io/openapi-common/") +cname = os.getenv("DOCUMENTATION_CNAME", "ansys.github.io/openapi-common/") html_theme = "ansys_sphinx_theme" html_logo = pyansys_logo_black From a389b72233e845b67b70ad3b4747186695bc209c Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Thu, 2 May 2024 15:00:06 +0200 Subject: [PATCH 17/24] Remove docs unnecessary deps --- .github/workflows/ci_cd.yml | 4 ---- poetry.lock | 8 ++++---- pyproject.toml | 2 -- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index b103d7a3..af262577 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -39,10 +39,6 @@ jobs: name: Documentation build runs-on: ubuntu-latest steps: - - name: "Install system dependencies" - run: | - sudo apt-get update && sudo apt-get install libkrb5-dev - - name: "Run Ansys documentation building action" uses: ansys/actions/doc-build@v5 with: diff --git a/poetry.lock b/poetry.lock index 5146965e..cc8aac51 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "accessible-pygments" @@ -725,7 +725,7 @@ testing = ["pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "py name = "krb5" version = "0.5.1" description = "Kerberos API bindings for Python" -optional = false +optional = true python-versions = ">=3.7" files = [ {file = "krb5-0.5.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e51c700cf148e63fef60bc4b2c453018218a3170dedbfe2840f122aee5a453e7"}, @@ -1286,7 +1286,7 @@ testing = ["pyjwt (==2.*)", "pytest-cov (==4.*)", "pytest-responses (==0.5.*)"] name = "requests-kerberos" version = "0.13.0" description = "A Kerberos authentication handler for python-requests" -optional = false +optional = true python-versions = ">=3.6" files = [ {file = "requests-kerberos-0.13.0.tar.gz", hash = "sha256:477e153773cc430c514d0a679e1f5ea89a0e675ac2342c413866e03d1e82a817"}, @@ -1749,4 +1749,4 @@ oidc = ["keyring", "requests_auth"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "ee241e499dec7d09657fd502d357fb473c2d19b60edd34e95bf6187be7f74908" +content-hash = "20f6bf32a75c2469a58217216ad2718c71ec6c44e6c017002c586c86e687998c" diff --git a/pyproject.toml b/pyproject.toml index 81e5890b..019c7a05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,8 +79,6 @@ numpydoc = { version = "1.7.0" } sphinx = { version = "7.3.7" } sphinx-notfound-page = { version = "1.0.0" } sphinx-copybutton = { version = "0.5.2" } -# Duplicate extra - required to use ansys/actions/doc-build -requests-kerberos = {version = "^0.13", markers = "sys_platform == 'linux'" } [tool.poetry.extras] oidc = [ From aedda61f40e2a3849a5ce6141461f1d41e31a74c Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Thu, 2 May 2024 15:21:54 +0200 Subject: [PATCH 18/24] Make dev deps optional --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 019c7a05..7fa6bb29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,9 @@ keyring = { version = ">=22,<26", optional = true } # Packages for linux-kerberos extra requests-kerberos = {version = "^0.13", markers = "sys_platform == 'linux'", optional = true } +[tool.poetry.group.dev] +optional = true + [tool.poetry.group.dev.dependencies] # Test packages pytest = { version = "*" } From 4b9803144586e799b5cb1189ab52fc2d98a40627 Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Thu, 2 May 2024 15:24:21 +0200 Subject: [PATCH 19/24] Poetry lock --- poetry.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index cc8aac51..0cf8aca5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1749,4 +1749,4 @@ oidc = ["keyring", "requests_auth"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "20f6bf32a75c2469a58217216ad2718c71ec6c44e6c017002c586c86e687998c" +content-hash = "d5d00b7a18e7ad774603392d63792de035f60db6b1d443929e79d9831a778f8f" From 73f9c006c63bf2a5dc1569fc643b785ad6458c80 Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Thu, 2 May 2024 15:34:10 +0200 Subject: [PATCH 20/24] Add mypy dependency in pre-commit config --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f7842b6..d3e150e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -48,6 +48,7 @@ repos: types: [python] require_serial: true files: "^(src/)" + additional_dependencies: ["mypy==1.8.0"] - repo: https://github.com/ansys/pre-commit-hooks rev: v0.3.1 From 35db4af722ea74e9f0686d041a1bf6a2a7de33b1 Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Thu, 2 May 2024 15:37:55 +0200 Subject: [PATCH 21/24] Fix mypy config --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3e150e9..f981e82b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,8 +43,8 @@ repos: hooks: - id: mypy-code name: "mypy: checks on code" - entry: "python -m mypy" - language: system + entry: mypy + language: python types: [python] require_serial: true files: "^(src/)" From 5555aef31b29b033a623b3bcb57effc6f9ed1854 Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Thu, 2 May 2024 16:02:36 +0200 Subject: [PATCH 22/24] Revert commits This reverts commit 4b9803144586e799b5cb1189ab52fc2d98a40627. Revert "Make dev deps optional" This reverts commit aedda61f40e2a3849a5ce6141461f1d41e31a74c. Revert "Add mypy dependency in pre-commit config" This reverts commit 73f9c006c63bf2a5dc1569fc643b785ad6458c80. Revert "Fix mypy config" This reverts commit 35db4af722ea74e9f0686d041a1bf6a2a7de33b1. --- .pre-commit-config.yaml | 5 ++--- poetry.lock | 2 +- pyproject.toml | 3 --- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f981e82b..9f7842b6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -43,12 +43,11 @@ repos: hooks: - id: mypy-code name: "mypy: checks on code" - entry: mypy - language: python + entry: "python -m mypy" + language: system types: [python] require_serial: true files: "^(src/)" - additional_dependencies: ["mypy==1.8.0"] - repo: https://github.com/ansys/pre-commit-hooks rev: v0.3.1 diff --git a/poetry.lock b/poetry.lock index 0cf8aca5..cc8aac51 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1749,4 +1749,4 @@ oidc = ["keyring", "requests_auth"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "d5d00b7a18e7ad774603392d63792de035f60db6b1d443929e79d9831a778f8f" +content-hash = "20f6bf32a75c2469a58217216ad2718c71ec6c44e6c017002c586c86e687998c" diff --git a/pyproject.toml b/pyproject.toml index 7fa6bb29..019c7a05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,9 +52,6 @@ keyring = { version = ">=22,<26", optional = true } # Packages for linux-kerberos extra requests-kerberos = {version = "^0.13", markers = "sys_platform == 'linux'", optional = true } -[tool.poetry.group.dev] -optional = true - [tool.poetry.group.dev.dependencies] # Test packages pytest = { version = "*" } From 3d903ee9b650ddc33b5ff18773ad02e31abd38d1 Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Thu, 2 May 2024 16:08:37 +0200 Subject: [PATCH 23/24] Move linux deps to new optional group --- poetry.lock | 2 +- pyproject.toml | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/poetry.lock b/poetry.lock index cc8aac51..c84b2fdb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1749,4 +1749,4 @@ oidc = ["keyring", "requests_auth"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "20f6bf32a75c2469a58217216ad2718c71ec6c44e6c017002c586c86e687998c" +content-hash = "86685655396271a7871b9212dc3f80dc996b973ea8c0a061a03e38c2691bdf4e" diff --git a/pyproject.toml b/pyproject.toml index 019c7a05..6cbad85b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,13 +62,19 @@ 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.dev-linux] +optional = true + +[tool.poetry.group.dev-linux.dependencies] +asgi_gssapi = { version = "*", markers = "sys_platform == 'linux'" } + [tool.poetry.group.doc] optional = true @@ -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 From 1a94ad76011a755559ddb64bcd8223b77e5fceca Mon Sep 17 00:00:00 2001 From: Ludovic Steinbach Date: Thu, 2 May 2024 16:20:13 +0200 Subject: [PATCH 24/24] Remove kerberos headers install --- .github/workflows/ci_cd.yml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index af262577..15f5c23d 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -54,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 }} @@ -125,11 +119,6 @@ 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 }}