-
Notifications
You must be signed in to change notification settings - Fork 2
91 lines (88 loc) · 3.66 KB
/
Copy pathapi-docs.yml
File metadata and controls
91 lines (88 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
name: API Docs
env:
DEFAULT_KHIOPS_REVISION: 11.0.1
DEFAULT_KHIOPS_PYTHON_TUTORIAL_REVISION: 11.0.0.0
DEFAULT_KHIOPS_SAMPLES_REVISION: 11.0.0
on:
workflow_dispatch:
inputs:
khiops-revision:
description: Khiops core version
default: 11.0.1
khiops-python-tutorial-revision:
default: 11.0.0.0
description: khiops-python-tutorial repo revision
khiops-samples-revision:
default: 11.0.0
description: khiops-samples repo revision
pull_request:
paths:
- doc/site/**.md
- doc/util/create-doc
- doc/util/clean-doc
- doc/util/*.py
- zensical.toml
- khiops/**.py
- .github/workflows/api-docs.yml
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Checkout khiops-python
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Add pip scripts directory to path
run: echo PATH="$PATH:/github/home/.local/bin" >> "$GITHUB_ENV"
- name: Setup uv
uses: astral-sh/setup-uv@v6
with:
enable-cache: true
cache-dependency-glob: uv.lock
- name: Install Khiops core
run: |
# Create the .venv virtual environment and activate it
uv venv
. .venv/bin/activate
# Building the Python API docs always executes khiops-python's own
# tutorial notebooks (create-doc -t -d), so a real Khiops core
# install is required unconditionally.
uv pip install khiops-core==${{ inputs.khiops-revision || env.DEFAULT_KHIOPS_REVISION }}
- name: Install doc build requirements
run: |
# Install package itself to install the samples datasets
# Add homogeneous TOML support (Python >= 3.12 has standard tomllib)
uv pip install tomli
# First, install all dependencies except khiops-core and khiops-drivers-*
uv run scripts/extract_dependencies_from_pyproject_toml.py -f "pyproject.toml" --exclude-khiops-family > requires-no-khiops.txt
uv pip install `cat requires-no-khiops.txt`
# khiops-core and khiops-drivers-* must always be installed from TestPyPI in order to avoid distorting usage statistics
uv run scripts/extract_dependencies_from_pyproject_toml.py -f "pyproject.toml" --khiops-family-only > requires-khiops.txt
uv pip install --index-url https://test.pypi.org/simple `cat requires-khiops.txt`
rm -f requires-khiops.txt requires-no-khiops.txt
# Lastly, install khiops-python
uv pip install .
uv run kh-download-datasets --force-overwrite --version ${{ inputs.khiops-samples-revision || env.DEFAULT_KHIOPS_SAMPLES_REVISION }}
# Discard error as this is expected (Uv is not yet officially
# supported by khiops, but this should pose no issue in practice)
# TODO: Revert as soon as issue
# https://github.com/KhiopsML/khiops-python/issues/602 is tackled
uv run kh-status || true
# Install the doc python requirements
uv pip install -U -r doc/util/requirements.txt
# Clone the Khiops Python tutorial repository while building the documentation
- name: Build Zensical Documentation
run: |
doc/util/create-doc -t -d -g \
${{ inputs.khiops-python-tutorial-revision || env.DEFAULT_KHIOPS_PYTHON_TUTORIAL_REVISION }}
- name: Upload the docs as an artifact
uses: actions/upload-artifact@v4
with:
name: api-docs
path: ./doc/build/html/