Skip to content

Commit bbd6ab2

Browse files
committed
Fallback to latest PyPi version
Signed-off-by: Michael Dolan <[email protected]>
1 parent aa3b163 commit bbd6ab2

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

docs/conf.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,13 @@
196196
# -- Install PyOpenColorIO ----------------------------------------------------
197197

198198
# When building docs for Read the Docs, we won't have a local PyOpenColorIO
199-
# build to run autodoc for, so we instead install the specific version needed
200-
# from PyPi.
199+
# build to run autodoc for, so we try to install the specific version needed
200+
# from PyPi. If that version is not yet available (pre-release), fallback to
201+
# installing the latest version.
201202

202203
if RTD_BUILD:
203-
subprocess.run(
204-
[
205-
"python", "-m", "pip", "install", "--no-cache-dir",
206-
f"opencolorio=={version}"
207-
],
208-
check=True
209-
)
204+
pip_cmd = ["python", "-m", "pip", "install", "--no-cache-dir"]
205+
try:
206+
subprocess.run(pip_cmd + [f"opencolorio=={version}"], check=True)
207+
except subprocess.CalledProcessError:
208+
subprocess.run(pip_cmd + ["--upgrade", "opencolorio"], check=True)

0 commit comments

Comments
 (0)