Skip to content

Commit 608a868

Browse files
committed
Always assume plots with context are out of date
Fixes matplotlib#20523.
1 parent 409511b commit 608a868

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,8 @@ def render_figures(code, code_path, output_dir, output_base, context,
559559
all_exists = True
560560
img = ImageFile(output_base, output_dir)
561561
for format, dpi in formats:
562-
if out_of_date(code_path, img.filename(format)):
562+
if context or out_of_date(code_path, img.filename(format),
563+
includes=code_includes):
563564
all_exists = False
564565
break
565566
img.formats.append(format)
@@ -579,7 +580,8 @@ def render_figures(code, code_path, output_dir, output_base, context,
579580
else:
580581
img = ImageFile('%s_%02d' % (output_base, j), output_dir)
581582
for fmt, dpi in formats:
582-
if out_of_date(code_path, img.filename(fmt)):
583+
if context or out_of_date(code_path, img.filename(fmt),
584+
includes=code_includes):
583585
all_exists = False
584586
break
585587
img.formats.append(fmt)

0 commit comments

Comments
 (0)