@@ -67,26 +67,33 @@ jobs:
67
67
- uses : actions/checkout@v5
68
68
with :
69
69
ref : ${{ inputs.checkout }}
70
+ token : ${{ secrets.GITHUB_TOKEN }}
70
71
# only Pytorch has/uses notebooks
71
72
submodules : ${{ matrix.pkg-name == 'pytorch' }}
72
73
lfs : ${{ matrix.pkg-name == 'pytorch' }}
73
- - uses : actions/setup-python@v6
74
+
75
+ - name : Install uv and set Python version
76
+ uses : astral-sh/setup-uv@v6
74
77
with :
75
78
python-version : " 3.10"
79
+ # TODO: Avoid activating environment like this
80
+ # see: https://github.com/astral-sh/setup-uv/tree/v6/?tab=readme-ov-file#activate-environment
81
+ activate-environment : true
82
+ enable-cache : true
76
83
77
84
- name : List notebooks
78
85
if : ${{ matrix.pkg-name == 'pytorch' }}
79
86
working-directory : _notebooks/
80
87
run : |
81
- pip install -q py-tree
88
+ uv pip install -q py-tree
82
89
py-tree .notebooks/
83
90
ls -lhR .notebooks/
84
91
85
92
- name : Pull sphinx template
86
93
run : |
87
- pip install -q -r requirements/ci.txt
94
+ uv pip install -q -r requirements/ci.txt
88
95
aws s3 sync --no-sign-request s3://sphinx-packages/ ${PYPI_LOCAL_DIR}
89
- pip install lai-sphinx-theme -U -f ${PYPI_LOCAL_DIR}
96
+ uv pip install lai-sphinx-theme -U -f ${PYPI_LOCAL_DIR}
90
97
91
98
- name : pip wheels cache
92
99
uses : actions/cache/restore@v4
@@ -100,25 +107,29 @@ jobs:
100
107
run : |
101
108
sudo apt-get update --fix-missing
102
109
sudo apt-get install -y pandoc
110
+
103
111
- name : Install package & dependencies
104
112
timeout-minutes : 20
105
113
run : |
106
114
mkdir -p ${PYPI_CACHE_DIR} # in case cache was not hit
107
115
ls -lh ${PYPI_CACHE_DIR}
108
- pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
116
+ uv pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
109
117
-f ${PYPI_LOCAL_DIR} -f ${PYPI_CACHE_DIR} --extra-index-url="${TORCH_URL}"
110
- pip list
118
+ uv pip list
119
+
111
120
- name : Install req. for Notebooks/tutorials
112
121
if : matrix.pkg-name == 'pytorch'
113
122
timeout-minutes : 10
114
- run : pip install -q -r _notebooks/.actions/requires.txt
123
+ run : uv pip install -q -r _notebooks/.actions/requires.txt
115
124
116
125
- name : Full build for deployment
117
126
if : github.event_name != 'pull_request'
118
127
run : echo "DOCS_FETCH_ASSETS=1" >> $GITHUB_ENV
128
+
119
129
- name : Build without warnings
120
130
if : github.event_name != 'workflow_dispatch'
121
131
run : echo "BUILD_SPHINX_OPTS=-W --keep-going" >> $GITHUB_ENV
132
+
122
133
- name : Make ${{ matrix.target }}
123
134
working-directory : ./docs/source-${{ matrix.pkg-name }}
124
135
# allow failing link check and doctest if you run with dispatch
@@ -128,6 +139,7 @@ jobs:
128
139
- name : Keep artifact
129
140
if : github.event_name == 'pull_request'
130
141
run : echo "ARTIFACT_DAYS=7" >> $GITHUB_ENV
142
+
131
143
- name : Upload built docs
132
144
if : ${{ matrix.target == 'html' }}
133
145
uses : actions/upload-artifact@v4
0 commit comments