File tree Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Expand file tree Collapse file tree 2 files changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -73,15 +73,24 @@ jobs:
73
73
74
74
# 8. Install requirements
75
75
python3 -m pip install -r docs/requirements.txt --quiet --root-user-action=ignore
76
-
77
- # 9. Test torchrl installation
76
+
77
+ # 9. Set sanitize version
78
+ if [[ ${{ github.event_name }} == push && (${{ github.ref_type }} == tag || (${{ github.ref_type }} == branch && ${{ github.ref_name }} == release/*)) ]]; then
79
+ echo '::group::Enable version string sanitization'
80
+ # This environment variable just has to exist and must not be empty. The actual value is arbitrary.
81
+ # See docs/source/conf.py for details
82
+ export RL_SANITIZE_VERSION_STR_IN_DOCS=1
83
+ echo '::endgroup::'
84
+ fi
85
+
86
+ # 10. Test torchrl installation
78
87
mkdir _tmp
79
88
cd _tmp
80
89
PYOPENGL_PLATFORM=egl MUJOCO_GL=egl python3 -c """from torchrl.envs.libs.dm_control import DMControlEnv
81
90
print(DMControlEnv('cheetah', 'run', from_pixels=True).reset())"""
82
91
cd ..
83
92
84
- # 10 . Build doc
93
+ # 11 . Build doc
85
94
cd ./docs
86
95
# timeout 7m bash -ic "MUJOCO_GL=egl sphinx-build ./source _local_build" || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
87
96
# bash -ic "PYOPENGL_PLATFORM=egl MUJOCO_GL=egl sphinx-build ./source _local_build" || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
Original file line number Diff line number Diff line change 39
39
# The version info for the project you're documenting, acts as replacement for
40
40
# |version| and |release|, also used in various other places throughout the
41
41
# built documents.
42
- #
43
- # The short X.Y version.
44
- version = "main (" + str (torchrl .__version__ ) + " )"
45
- # The full version, including alpha/beta/rc tags.
46
- # TODO: verify this works as expected
47
- release = "main"
42
+ # version: The short X.Y version.
43
+ # release: The full version, including alpha/beta/rc tags.
44
+ if os .environ .get ("RL_SANITIZE_VERSION_STR_IN_DOCS" , None ):
45
+ # Turn 1.11.0aHASH into 1.11 (major.minor only)
46
+ version = release = "." .join (torchrl .__version__ .split ("." )[:2 ])
47
+ html_title = " " .join ((project , version , "documentation" ))
48
+ else :
49
+ version = f"main ({ torchrl .__version__ } )"
50
+ release = "main"
48
51
49
52
# The language for content autogenerated by Sphinx. Refer to documentation
50
53
# for a list of supported languages.
You can’t perform that action at this time.
0 commit comments