Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 73a7c0c

Browse filesBrowse files
authored
Merge pull request #13175 from meeseeksmachine/auto-backport-of-pr-13015-on-v3.0.x
Backport PR #13015 on branch v3.0.x (Enable local doc building without git installation)
2 parents e43acae + c3ea441 commit 73a7c0c
Copy full SHA for 73a7c0c

File tree

Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed

‎doc/conf.py

Copy file name to clipboardExpand all lines: doc/conf.py
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import os
1313
import shutil
14+
import subprocess
1415
import sys
1516

1617
import matplotlib
@@ -141,8 +142,13 @@ def _check_deps():
141142
master_doc = 'contents'
142143

143144
# General substitutions.
144-
from subprocess import check_output
145-
SHA = check_output(['git', 'describe', '--dirty']).decode('utf-8').strip()
145+
try:
146+
SHA = subprocess.check_output(
147+
['git', 'describe', '--dirty']).decode('utf-8').strip()
148+
# Catch the case where git is not installed locally, and use the versioneer
149+
# version number instead
150+
except (subprocess.CalledProcessError, FileNotFoundError):
151+
SHA = matplotlib.__version__
146152

147153
html_context = {'sha': SHA}
148154

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.