Skip to content

Commit 7a8b2e1

Browse files
fix: Comments
1 parent b21491b commit 7a8b2e1

File tree

19 files changed

+73
-105
lines changed

19 files changed

+73
-105
lines changed

.github/workflows/ci_cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
release:
122122
name: "Release project"
123123
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
124-
needs: [code-style]
124+
needs: [docs-build, tests]
125125
runs-on: ubuntu-latest
126126
steps:
127127
- name: Checkout code

.pre-commit-config.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,28 @@ repos:
66
additional_dependencies: [black==23.12.1]
77

88
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v4.5.0
9+
rev: v4.6.0
1010
hooks:
1111
- id: check-merge-conflict
1212
- id: debug-statements
1313
- id: check-yaml
1414
- id: trailing-whitespace
1515

1616
- repo: https://github.com/python-jsonschema/check-jsonschema
17-
rev: 0.27.3
17+
rev: 0.29.1
1818
hooks:
1919
- id: check-github-workflows
2020

2121

2222
- repo: https://github.com/astral-sh/ruff-pre-commit
23-
rev: v0.5.5
23+
rev: v0.5.7
2424
hooks:
2525
- id: ruff
2626
args: [--fix]
27+
- id: ruff-format
2728

2829
- repo: https://github.com/ansys/pre-commit-hooks
29-
rev: v0.3.1
30+
rev: v0.4.3
3031
hooks:
3132
- id: add-license-headers
3233
files: '(src|examples|tests|docker)/.*\.(py)|\.(proto)'

doc/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,4 @@ pdf:
3333

3434
# Build HTML files and generate examples as .py files
3535
html:
36-
pip uninstall vtk -y
37-
pip install --extra-index-url https://wheels.vtk.org vtk-osmesa
3836
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

doc/source/conf.py

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22

33
from datetime import datetime
44
import os
5-
from pathlib import Path
65

76
from allie.flowkit import __version__
87
from ansys_sphinx_theme import (
98
ansys_favicon,
109
ansys_logo_white,
1110
ansys_logo_white_cropped,
12-
get_autoapi_templates_dir_relative_path,
1311
get_version_match,
1412
latex,
15-
pyansys_logo_black,
1613
watermark,
1714
)
1815
from sphinx.builders.latex import LaTeXBuilder
@@ -28,7 +25,6 @@
2825
switcher_version = get_version_match(__version__)
2926

3027
# Select desired logo, theme, and declare the html title
31-
html_logo = pyansys_logo_black
3228
html_theme = "ansys_sphinx_theme"
3329
html_short_title = html_title = "Allie Flowkit Python"
3430
html_baseurl = f"https://{cname}/version/stable"
@@ -41,6 +37,7 @@
4137
"doc_path": "doc/source",
4238
}
4339
html_theme_options = {
40+
"logo": "pyansys",
4441
"switcher": {
4542
"json_url": f"https://{cname}/versions.json",
4643
"version_match": switcher_version,
@@ -65,9 +62,29 @@
6562
"url": f"https://{cname}/version/{switcher_version}/_static/assets/download/allie-flowkit-python.pdf", # noqa: E501
6663
"icon": "fa fa-file-pdf fa-fw",
6764
},
68-
]
65+
],
66+
"ansys_sphinx_theme_autoapi": {
67+
"project": "Allie Flowkit Python",
68+
"output": "api",
69+
"use_implicit_namespaces": True,
70+
"directory": "src",
71+
"keep_files": True,
72+
"own_page_level": "class",
73+
"type": "python",
74+
"options": [
75+
"members",
76+
"undoc-members",
77+
"show-inheritance",
78+
"show-module-summary",
79+
"special-members",
80+
],
81+
"class_content": "class",
82+
},
6983
}
7084

85+
suppress_warnings = ["autoapi.python_import_resolution", "design.grid", "config.cache", "autoapi.not_readable"]
86+
87+
7188
# Sphinx extensions
7289
extensions = [
7390
"sphinx.ext.intersphinx",
@@ -76,6 +93,7 @@
7693
"sphinx_jinja",
7794
"autoapi.extension",
7895
"numpydoc",
96+
"ansys_sphinx_theme.extension.autoapi",
7997
]
8098

8199
nbsphinx_execute = "always"
@@ -148,46 +166,6 @@
148166
# The master toctree document.
149167
master_doc = "index"
150168

151-
# Configuration for Sphinx autoapi
152-
autoapi_type = "python"
153-
autoapi_dirs = ["../../src"]
154-
autoapi_root = "api"
155-
autoapi_template_dir = get_autoapi_templates_dir_relative_path(Path(__file__))
156-
suppress_warnings = ["autoapi.python_import_resolution", "design.grid", "config.cache", "autoapi.not_readable"]
157-
autoapi_python_use_implicit_namespaces = True
158-
autoapi_keep_files = True
159-
autoapi_own_page_level = "class"
160-
autoapi_add_toctree_entry = False
161-
# Examples gallery customization
162-
nbsphinx_execute = "always"
163-
164-
nbsphinx_epilog = """
165-
----
166-
167-
.. admonition:: Download this example
168-
169-
Download this example as a `Jupyter Notebook <{cname_pref}/{ipynb_file_loc}>`_
170-
or as a `Python script <{cname_pref}/{py_file_loc}>`_.
171-
172-
""".format(
173-
cname_pref=f"https://{cname}/version/{switcher_version}",
174-
ipynb_file_loc="{{ env.docname }}.ipynb",
175-
py_file_loc="{{ env.docname }}.py",
176-
)
177-
178-
nbsphinx_prolog = """
179-
180-
.. admonition:: Download this example
181-
182-
Download this example as a `Jupyter Notebook <{cname_pref}/{ipynb_file_loc}>`_
183-
or as a `Python script <{cname_pref}/{py_file_loc}>`_.
184-
185-
----
186-
""".format(
187-
cname_pref=f"https://{cname}/version/{switcher_version}",
188-
ipynb_file_loc="{{ env.docname }}.ipynb",
189-
py_file_loc="{{ env.docname }}.py",
190-
)
191169

192170
typehints_defaults = "comma"
193171
simplify_optional_unions = False
@@ -200,9 +178,7 @@
200178
latex_elements = {"preamble": latex.generate_preamble(html_title)}
201179

202180
linkcheck_exclude_documents = ["index", "getting_started/local/index", "assets"]
203-
linkcheck_ignore = [
204-
"https://github.com/ansys/allie-flowkit-python/"
205-
]
181+
linkcheck_ignore = ["https://github.com/ansys/allie-flowkit-python/"]
206182
# -- Declare the Jinja context -----------------------------------------------
207183
exclude_patterns = [
208184
"examples/**/*.ipynb",

doc/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ The Allie Flowkit Python offers these main features:
6565
getting_started/index
6666
user_guide/index
6767
{% if build_api %}
68-
api/src/allie/flowkit/index
68+
api/index
6969
{% endif %}
7070
{% if build_examples %}
7171
examples/index

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ COPY app/ ./src/allie/flowkit/
77
COPY configs/config.yaml .
88

99
# Install dependencies
10-
RUN pip install --no-cache-dir .
10+
RUN pip install --no-cache-dir .[all]
1111

1212
EXPOSE 8000
1313

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ tests = [
4343
"pytest-asyncio >= 0.23.8,<1",
4444
]
4545
doc = [
46-
"ansys-sphinx-theme==0.16.6",
47-
"jupyter_sphinx==0.5.3",
48-
"jupytext==1.16.4",
49-
"nbsphinx==0.9.4",
46+
"ansys-sphinx-theme==1.0.3",
5047
"numpydoc==1.7.0",
5148
"sphinx==8.0.2",
5249
"sphinx-autoapi==3.2.1",
@@ -108,7 +105,6 @@ ignore = ["D416"]
108105

109106
[tool.ruff.format]
110107
quote-style = "double"
111-
indent-style = "tab"
112108
line-ending = "auto"
113109

114110
[tool.ruff.lint.isort]

src/allie/flowkit/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# SOFTWARE.
2222

2323
"""App package responsible for creating the FastAPI app."""
24+
2425
import importlib.metadata as importlib_metadata
2526

2627
__version__ = importlib_metadata.version(__name__.replace(".", "-") + "-python")

src/allie/flowkit/__main__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@
2121
# SOFTWARE.
2222

2323
"""Main module for the FlowKit service."""
24+
2425
try:
2526
import uvicorn
2627
except ImportError:
27-
raise ImportError(
28-
"Please install uvicorn to run the service: pip install allie-flowkit-python[all]"
29-
)
28+
raise ImportError("Please install uvicorn to run the service: pip install allie-flowkit-python[all]")
3029
import argparse
3130

3231

3332
def main():
3433
"""Run entrypoint for the FlowKit service."""
35-
parse = argparse.ArgumentParser()
34+
parse = argparse.ArgumentParser()
3635
parse.add_argument("--host", type=str, default="0.0.0.0", help="The host to run the service on. By default 0.0.0.0")
3736
parse.add_argument("--port", type=int, default=8000, help="The port to run the service on. By default 8000")
3837
parse.add_argument("--workers", type=int, default=4, help="The number of workers to use. By default 4")
3938
args = parse.parse_args()
4039
uvicorn.run("allie.flowkit:flowkit_service", host=args.host, port=args.port, workers=args.workers)
4140

41+
4242
if __name__ == "__main__":
4343
main()

src/allie/flowkit/config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222

2323
"""Configuration package for the application."""
2424

25-
from allie.flowkit.config._config import CONFIG # noqa F401
25+
from allie.flowkit.config._config import CONFIG # noqa F401

0 commit comments

Comments
 (0)