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 41c9fb7

Browse filesBrowse files
committed
prepare a fresh git checkout for doc build on MS windows
1 parent 71ba349 commit 41c9fb7
Copy full SHA for 41c9fb7

File tree

Expand file treeCollapse file tree

1 file changed

+18
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+18
-0
lines changed

‎doc/make.py

Copy file name to clipboardExpand all lines: doc/make.py
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,31 @@ def all():
249249
('mpl_toolkits/axes_grid/examples', '../../../examples/axes_grid/')
250250
]
251251

252+
symlink_warnings = []
252253
for link, target in required_symlinks:
254+
if sys.platform == 'win32' and os.path.isfile(link):
255+
# This is special processing that applies on platforms that don't deal
256+
# with git symlinks -- probably only MS windows.
257+
delete = False
258+
with open(link, 'r') as content:
259+
delete = target == content.read()
260+
if delete:
261+
symlink_warnings.append('deleted: doc/{}'.format(link))
262+
os.unlink(link)
263+
else:
264+
raise RuntimeError("doc/{} should be a directory or symlink -- it isn't")
253265
if not os.path.exists(link):
254266
if hasattr(os, 'symlink'):
255267
os.symlink(target, link)
256268
else:
269+
symlink_warnings.append('files copied to {}'.format(link))
257270
shutil.copytree(os.path.join(link, '..', target), link)
258271

272+
if sys.platform == 'win32' and len(symlink_warnings) > 0:
273+
print('The following items related to symlinks will show up '+
274+
'as spurious changes in your \'git status\':\n\t{}'
275+
.format('\n\t'.join(symlink_warnings)))
276+
259277
if len(sys.argv)>1:
260278
if '--small' in sys.argv[1:]:
261279
small_docs = True

0 commit comments

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