File tree 2 files changed +9
-4
lines changed
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 @@ -160,11 +160,13 @@ def _parse_to_version_info(version_str):
160
160
161
161
def _get_version ():
162
162
"""Return the version string used for __version__."""
163
- # Only shell out to a git subprocess if really needed, and not on a
164
- # shallow clone, such as those used by CI, as the latter would trigger
165
- # a warning from setuptools_scm.
163
+ # Only shell out to a git subprocess if really needed, i.e. when we are in
164
+ # a matplotlib git repo but not in a shallow clone, such as those used by
165
+ # CI, as the latter would trigger a warning from setuptools_scm.
166
166
root = Path (__file__ ).resolve ().parents [2 ]
167
- if (root / ".git" ).exists () and not (root / ".git/shallow" ).exists ():
167
+ if ((root / ".matplotlib-repo" ).exists ()
168
+ and (root / ".git" ).exists ()
169
+ and not (root / ".git/shallow" ).exists ()):
168
170
import setuptools_scm
169
171
return setuptools_scm .get_version (
170
172
root = root ,
You can’t perform that action at this time.
0 commit comments