Skip to content

Commit

Permalink
update python docs action
Browse files Browse the repository at this point in the history
  • Loading branch information
emgeee committed Nov 14, 2024
1 parent 381d56f commit d439476
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 20 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/python-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: python-docs

on:
push:
branches: [ "main" ]
branches: ["main"]
paths:
- 'py-denormalized/**'
- "py-denormalized/**"
pull_request:
branches: [ "main" ]
branches: ["main"]
paths:
- 'py-denormalized/**'
- "py-denormalized/**"

# security: restrict permissions for CI jobs.
permissions:
Expand All @@ -18,9 +18,6 @@ jobs:
# Build the documentation and upload the static HTML files as an artifact.
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: py-denormalized
steps:
- uses: actions/checkout@v4

Expand All @@ -29,26 +26,32 @@ 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
working-directory: ./py-denormalized
run: uv sync --no-dev --group docs --extra feast

- name: Configure Virtual Environment
working-directory: ./py-denormalized
run: |
source .venv/bin/activate
pdoc -t pdocs/ python/denormalized/ -o pdocs/_build
- uses: actions/upload-pages-artifact@v3
with:
path: pdocs/_build
path: py-denormalized/pdocs/_build

# Deploy the artifact to GitHub pages.
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
deploy:
needs: build
runs-on: ubuntu-latest
defaults:
run:
working-directory: py-denormalized
permissions:
pages: write
id-token: write
Expand Down
7 changes: 6 additions & 1 deletion py-denormalized/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ dependencies = [
"datafusion>=40.1.0",
]

[project.optional-dependencies]
feast = ["feast"]

[dependency-groups]
dev = [
"pdoc>=15.0.0",
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions py-denormalized/python/denormalized/feast_data_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 9 additions & 3 deletions py-denormalized/uv.lock

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

0 comments on commit d439476

Please sign in to comment.