From ef577e73a5b4b2c2318ad29dffa9ac2e0e03eefe Mon Sep 17 00:00:00 2001 From: Matt Green Date: Thu, 14 Nov 2024 12:01:01 -0800 Subject: [PATCH] update python docs action --- .github/workflows/python-docs.yml | 21 ++++++++++++------- py-denormalized/pyproject.toml | 7 ++++++- .../python/denormalized/feast_data_stream.py | 2 ++ py-denormalized/uv.lock | 12 ++++++++--- 4 files changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-docs.yml b/.github/workflows/python-docs.yml index fbb40e1..b761d2b 100644 --- a/.github/workflows/python-docs.yml +++ b/.github/workflows/python-docs.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: py-denormalized + working-directory: ./py-denormalized steps: - uses: actions/checkout@v4 @@ -29,13 +29,20 @@ jobs: with: version: "0.5.1" enable-cache: true - cache-dependency-glob: "uv.lock" + cache-dependency-glob: "py-denormalized/uv.lock" + + - name: "Set up Python" + uses: actions/setup-python@v5 + with: + python-version-file: "py-denormalized/pyproject.toml" - - name: Set up Python - run: uv python install - name: Install the project - run: uv sync --all-extras --dev - - run: pdoc -t pdocs/ python/denormalized/ -o pdocs/_build + run: uv sync --no-dev --group docs --extra feast + + - name: Configure Virtual Environment + run: | + source .venv/bin/activate + pdoc -t pdocs/ python/denormalized/ -o pdocs/_build - uses: actions/upload-pages-artifact@v3 with: @@ -48,7 +55,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: py-denormalized + working-directory: ./py-denormalized permissions: pages: write id-token: write diff --git a/py-denormalized/pyproject.toml b/py-denormalized/pyproject.toml index 681a610..b8fb1af 100644 --- a/py-denormalized/pyproject.toml +++ b/py-denormalized/pyproject.toml @@ -13,6 +13,9 @@ dependencies = [ "datafusion>=40.1.0", ] +[project.optional-dependencies] +feast = ["feast"] + [dependency-groups] dev = [ "pdoc>=15.0.0", @@ -25,7 +28,9 @@ dev = [ "pdoc>=15.0.0", "pip>=24.3.1", ] -feast = ["feast"] +docs = [ + "pdoc>=15.0.0", +] [tool.maturin] python-source = "python" diff --git a/py-denormalized/python/denormalized/feast_data_stream.py b/py-denormalized/python/denormalized/feast_data_stream.py index f381972..395f63f 100644 --- a/py-denormalized/python/denormalized/feast_data_stream.py +++ b/py-denormalized/python/denormalized/feast_data_stream.py @@ -66,6 +66,8 @@ class FeastDataStream(DataStream, metaclass=FeastDataStreamMeta): This class extends DataStream to provide integration with Feast feature stores and related functionality. + + You must install with the extra 'feast': `pip install denormalized[feast]` """ def __init__(self, stream: Union[PyDataStream, DataStream]) -> None: diff --git a/py-denormalized/uv.lock b/py-denormalized/uv.lock index 961f0c9..7503e9d 100644 --- a/py-denormalized/uv.lock +++ b/py-denormalized/uv.lock @@ -377,6 +377,11 @@ dependencies = [ { name = "pyarrow" }, ] +[package.optional-dependencies] +feast = [ + { name = "feast" }, +] + [package.dev-dependencies] dev = [ { name = "ipython" }, @@ -388,13 +393,14 @@ dev = [ { name = "pyarrow-stubs" }, { name = "pytest" }, ] -feast = [ - { name = "feast" }, +docs = [ + { name = "pdoc" }, ] [package.metadata] requires-dist = [ { name = "datafusion", specifier = ">=40.1.0" }, + { name = "feast", marker = "extra == 'feast'" }, { name = "pyarrow", specifier = ">=17.0.0" }, ] @@ -409,7 +415,7 @@ dev = [ { name = "pyarrow-stubs", specifier = ">=17.11" }, { name = "pytest", specifier = ">=8.3.2" }, ] -feast = [{ name = "feast" }] +docs = [{ name = "pdoc", specifier = ">=15.0.0" }] [[package]] name = "dill"