@@ -70,47 +70,57 @@ 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 : Install pandoc & texlive
92
98
if : ${{ matrix.pkg-name == 'pytorch' }}
93
99
timeout-minutes : 5
94
100
run : |
95
101
sudo apt-get update --fix-missing
96
102
sudo apt-get install -y pandoc
103
+
97
104
- name : Install package & dependencies
98
105
timeout-minutes : 20
99
106
run : |
100
- pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
107
+ uv pip install .[all] -U -r requirements/${{ matrix.pkg-name }}/docs.txt \
101
108
-f ${PYPI_LOCAL_DIR} --extra-index-url="${TORCH_URL}"
102
- pip list
109
+ uv pip list
110
+
103
111
- name : Install req. for Notebooks/tutorials
104
112
if : matrix.pkg-name == 'pytorch'
105
113
timeout-minutes : 10
106
- run : pip install -q -r _notebooks/.actions/requires.txt
114
+ run : uv pip install -q -r _notebooks/.actions/requires.txt
107
115
108
116
- name : Full build for deployment
109
117
if : github.event_name != 'pull_request'
110
118
run : echo "DOCS_FETCH_ASSETS=1" >> $GITHUB_ENV
119
+
111
120
- name : Build without warnings
112
121
if : github.event_name != 'workflow_dispatch'
113
122
run : echo "BUILD_SPHINX_OPTS=-W --keep-going" >> $GITHUB_ENV
123
+
114
124
- name : Make ${{ matrix.target }}
115
125
working-directory : ./docs/source-${{ matrix.pkg-name }}
116
126
# allow failing link check and doctest if you run with dispatch
@@ -120,6 +130,7 @@ jobs:
120
130
- name : Keep artifact
121
131
if : github.event_name == 'pull_request'
122
132
run : echo "ARTIFACT_DAYS=7" >> $GITHUB_ENV
133
+
123
134
- name : Upload built docs
124
135
if : ${{ matrix.target == 'html' }}
125
136
uses : actions/upload-artifact@v4
0 commit comments