From 2a888cbdf434064675767f5bb6f10a702920a6ce Mon Sep 17 00:00:00 2001 From: cutecutecat Date: Sat, 7 Oct 2023 20:53:18 +0800 Subject: [PATCH] refactor docs Signed-off-by: cutecutecat --- .github/workflows/python-check.yml | 9 ++++++--- docs/source/api.rst | 3 --- docs/source/index.rst | 5 +++-- docs/source/openapi.rst | 5 +++++ pdm.lock | 10 +++++----- pyproject.toml | 1 + 6 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 docs/source/openapi.rst diff --git a/.github/workflows/python-check.yml b/.github/workflows/python-check.yml index 990f8ae..bba5e78 100644 --- a/.github/workflows/python-check.yml +++ b/.github/workflows/python-check.yml @@ -35,14 +35,17 @@ jobs: python-version: "3.10" - name: Install dependencies run: | - pdm sync -d -G lint + pdm sync -d -G lint -G generate -G doc - name: Lint run: | pdm run lint --exclude openapi - - name: Verify openapi generate + - name: Verify OpenAPI generate run: | - make generate && git add * && + pdm run generate && git add openapi && git diff --cached --exit-code || (echo 'Please run "make generate" to verify generate' && exit 1) + - name: Verify docs generate + run: | + pdm run docs test: runs-on: ${{ matrix.os }} diff --git a/docs/source/api.rst b/docs/source/api.rst index 14bab06..7169b9e 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -8,7 +8,4 @@ Python SDK interface :members: .. autoclass:: modelz.openapi_client.DeploymentClient - :members: - -.. automodule:: openapi.sdk.models :members: \ No newline at end of file diff --git a/docs/source/index.rst b/docs/source/index.rst index 2211845..c957f5a 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -7,12 +7,13 @@ Welcome to modelz's documentation! ===================================== .. toctree:: - :maxdepth: 2 + :maxdepth: 3 :caption: Reference: :hidden: - api cli + api + openapi ``modelz`` is a Python package for calling model prediction and management APIs that are on the modelz_ platform. We provide both Python SDK and CLI interface. diff --git a/docs/source/openapi.rst b/docs/source/openapi.rst new file mode 100644 index 0000000..1808734 --- /dev/null +++ b/docs/source/openapi.rst @@ -0,0 +1,5 @@ +OpenAPI DataClass +==================================== + +.. automodule:: openapi.sdk.models + :members: \ No newline at end of file diff --git a/pdm.lock b/pdm.lock index da70474..1bbc490 100644 --- a/pdm.lock +++ b/pdm.lock @@ -6,7 +6,7 @@ groups = ["default", "doc", "generate", "lint", "test"] cross_platform = true static_urls = false lock_version = "4.3" -content_hash = "sha256:257a975ef1c3abdc123a4c5584207b7b0e700f13074a01cc41c4b6a405b0b48d" +content_hash = "sha256:0880a1f844740c2ac194b520f38367a8e09ac8f9d71f573fe6dd00446259f2c1" [[package]] name = "alabaster" @@ -20,15 +20,15 @@ files = [ [[package]] name = "annotated-types" -version = "0.5.0" -requires_python = ">=3.7" +version = "0.6.0" +requires_python = ">=3.8" summary = "Reusable constraint types to use with typing.Annotated" dependencies = [ "typing-extensions>=4.0.0; python_version < \"3.9\"", ] files = [ - {file = "annotated_types-0.5.0-py3-none-any.whl", hash = "sha256:58da39888f92c276ad970249761ebea80ba544b77acddaa1a4d6cf78287d45fd"}, - {file = "annotated_types-0.5.0.tar.gz", hash = "sha256:47cdc3490d9ac1506ce92c7aaa76c579dc3509ff11e098fc867e5130ab7be802"}, + {file = "annotated_types-0.6.0-py3-none-any.whl", hash = "sha256:0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43"}, + {file = "annotated_types-0.6.0.tar.gz", hash = "sha256:563339e807e53ffd9c267e99fc6d9ea23eb8443c08f112651963e24e22f84a5d"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 7cab3f8..412aafb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,7 @@ black = "black --check modelz" ruff = "ruff check ." lint = {composite = ["black", "ruff"]} doc = "make docs" +generate = "make generate" [tool.pdm.dev-dependencies] lint = [ "ruff>=0.0.252",