Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move docs dependencies to common location and check for broken docs on pull request #6919

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/cd-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ on:
workflow_dispatch:
push:
branches:
- master
- 'master'
pull_request:
permissions:
contents: write
jobs:
Expand All @@ -17,6 +18,7 @@ jobs:
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
if: (github.event_name != 'pull_request')

- name: Set up Python 3.9
uses: actions/setup-python@v5
Expand All @@ -26,6 +28,7 @@ jobs:
cache-dependency-path: |
setup.py
tfx/dependencies.py
requirements-docs.txt

- name: Save time for cache for mkdocs
run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
Expand All @@ -39,7 +42,12 @@ jobs:
mkdocs-material-

- name: Install Dependencies
run: pip install mkdocs mkdocs-material mkdocstrings[python] griffe-inherited-docstrings mkdocs-autorefs mkdocs-jupyter mkdocs-caption markdown-grid-tables
run: pip install -r requirements-docs.txt

- name: Deploy to GitHub Pages
run: mkdocs gh-deploy --force
if: (github.event_name != 'pull_request')
peytondmurray marked this conversation as resolved.
Show resolved Hide resolved

- name: Build docs to check for errors
run: mkdocs build
if: (github.event_name == 'pull_request')
8 changes: 8 additions & 0 deletions requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mkdocs
mkdocstrings[python]
mkdocs-material
griffe-inherited-docstrings
mkdocs-autorefs
mkdocs-jupyter
mkdocs-caption
markdown-grid-tables
19 changes: 7 additions & 12 deletions tfx/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from __future__ import annotations

import os

from pathlib import Path

def select_constraint(default, nightly=None, git_master=None):
"""Select dependency constraint based on TFX_DEPENDENCY_SELECTOR env var."""
Expand Down Expand Up @@ -262,17 +262,12 @@ def make_extra_packages_docs() -> list[str]:
list[str]
List of packages required for building docs
"""
return [
"mkdocs",
"mkdocstrings[python]",
"mkdocs-material",
"griffe-inherited-docstrings",
"mkdocs-autorefs",
"mkdocs-jupyter",
"mkdocs-caption",
"pymdown-extensions",
"markdown-grid-tables",
]
with open(Path(__file__).resolve().parent.parent / "requirements-docs.txt", "r") as fp:
reqs = fp.readlines()

reqs = [req.replace("\n", "") for req in reqs]

return reqs
peytondmurray marked this conversation as resolved.
Show resolved Hide resolved


def make_extra_packages_all():
Expand Down