"vscode:/vscode.git/clone" did not exist on "dc8da1d44922c2e2a6731c70a4fa7789cd983bb2"
Unverified Commit 689ff292 authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

fix version wrangling in docs (#7600)

parent abc40ef2
......@@ -43,6 +43,14 @@ jobs:
pip install --progress-bar=off -r requirements.txt
echo '::endgroup::'
if [[ ${{ github.event_name }} == push && (${{ github.ref_type }} == tag || (${{ github.ref_type }} == branch && ${{ github.ref_name }} == release/*)) ]]; then
echo '::group::Enable version string sanitization'
# This environment variable just has to exist and must not be empty. The actual value is arbitrary.
# See docs/source/conf.py for details
export TORCHVISION_SANITIZE_VERSION_STR_IN_DOCS=1
echo '::endgroup::'
fi
# The runner does not have sufficient memory to run with as many processes as there are
# cores (`-j auto`). Thus, we limit to a single process (`-j 1`) here.
sed -i -e 's/-j auto/-j 1/' Makefile
......
......@@ -92,17 +92,15 @@ author = "Torch Contributors"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = "main (" + torchvision.__version__ + " )"
# The full version, including alpha/beta/rc tags.
release = "main"
VERSION = os.environ.get("VERSION", None)
if VERSION:
# version: The short X.Y version.
# release: The full version, including alpha/beta/rc tags.
if os.environ.get("TORCHVISION_SANITIZE_VERSION_STR_IN_DOCS", None):
# Turn 1.11.0aHASH into 1.11 (major.minor only)
version = ".".join(version.split(".")[:2])
version = release = ".".join(torchvision.__version__.split(".")[:2])
html_title = " ".join((project, version, "documentation"))
release = version
else:
version = f"main ({torchvision.__version__})"
release = "main"
# The language for content autogenerated by Sphinx. Refer to documentation
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment