File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1+ The existence of this file signals that the code is a matplotlib source repo
2+ and not an installed version. We use this in __init__.py for gating version
3+ detection.
Original file line number Diff line number Diff line change @@ -164,11 +164,13 @@ def _parse_to_version_info(version_str):
164164
165165def _get_version ():
166166 """Return the version string used for __version__."""
167- # Only shell out to a git subprocess if really needed, and not on a
168- # shallow clone, such as those used by CI, as the latter would trigger
169- # a warning from setuptools_scm.
167+ # Only shell out to a git subprocess if really needed, i.e. when we are in
168+ # a matplotlib git repo but not in a shallow clone, such as those used by
169+ # CI, as the latter would trigger a warning from setuptools_scm.
170170 root = Path (__file__ ).resolve ().parents [2 ]
171- if (root / ".git" ).exists () and not (root / ".git/shallow" ).exists ():
171+ if ((root / ".matplotlib-repo" ).exists ()
172+ and (root / ".git" ).exists ()
173+ and not (root / ".git/shallow" ).exists ()):
172174 import setuptools_scm
173175 return setuptools_scm .get_version (
174176 root = root ,
You can’t perform that action at this time.
0 commit comments