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