Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ init:
install:
- set EXTRA_PACKAGES=pywin32 codecov
# These are optional dependencies so that we don't skip so many tests...
- set EXTRA_PACKAGES=%EXTRA_PACKAGES% ffmpeg inkscape
- set EXTRA_PACKAGES=%EXTRA_PACKAGES% ffmpeg
- choco install inkscape
# miktex is available on conda, but seems to fail with permission errors.
# missing packages on conda-forge for imagemagick
# This install sometimes failed randomly :-(
Expand Down
5 changes: 5 additions & 0 deletions doc/api/next_api_changes/development/31660-ES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
New minimum version of Inkscape
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The required version of Inkscape for testing SVG is now 1.0 (previously there was no
minimum).
4 changes: 2 additions & 2 deletions doc/install/dependencies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ otherwise they must be installed manually:
External tools
^^^^^^^^^^^^^^
- Ghostscript_ (>= 9.0, to render PDF files)
- Inkscape_ (to render SVG files)
- Inkscape_ (>= 1.0, to render SVG files)
- `WenQuanYi Zen Hei`_ and `Noto Sans CJK`_ fonts for testing font fallback and
non-Western fonts

Expand Down Expand Up @@ -477,7 +477,7 @@ Optional
The documentation can be built without Inkscape and optipng, but the build
process will raise various warnings.

* Inkscape_
* Inkscape_ (>= 1.0)
* `optipng <http://optipng.sourceforge.net>`_
* the font `xkcd script <https://github.com/ipython/xkcd-font/>`_ or `Comic Neue <https://github.com/crozynski/comicneue>`_
* the font "Times New Roman"
10 changes: 1 addition & 9 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,15 +446,7 @@ def impl(args, regex, min_ver=None, ignore_exit_code=False):
message = "Failed to find a Ghostscript installation"
raise ExecutableNotFoundError(message)
elif name == "inkscape":
try:
# Try headless option first (needed for Inkscape version < 1.0):
return impl(["inkscape", "--without-gui", "-V"],
"Inkscape ([^ ]*)")
except ExecutableNotFoundError:
pass # Suppress exception chaining.
# If --without-gui is not accepted, we may be using Inkscape >= 1.0 so
# try without it:
return impl(["inkscape", "-V"], "Inkscape ([^ ]*)")
return impl(["inkscape", "-V"], "Inkscape ([^ ]*)", min_ver="1")
elif name == "magick":
if sys.platform == "win32":
# Check the registry to avoid confusing ImageMagick's convert with
Expand Down
12 changes: 4 additions & 8 deletions lib/matplotlib/testing/compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ def encode_and_escape(name):

class _SVGConverter(_Converter):
def __call__(self, orig, dest):
old_inkscape = mpl._get_executable_info("inkscape").version.major < 1
terminator = b"\n>" if old_inkscape else b"> "
terminator = b"> "
if not hasattr(self, "_tmpdir"):
self._tmpdir = TemporaryDirectory()
# On Windows, we must make sure that self._proc has terminated
Expand All @@ -171,13 +170,11 @@ def __call__(self, orig, dest):
# Do not load any user options.
"INKSCAPE_PROFILE_DIR": self._tmpdir.name,
}
# Old versions of Inkscape (e.g. 0.48.3.1) seem to sometimes
# deadlock when stderr is redirected to a pipe, so we redirect it
# to a temporary file instead. This is not necessary anymore as of
# Inkscape 0.92.1.
# Certain versions of Inkscape (e.g., 1.2.2) seem to sometimes deadlock when
# stderr is redirected to a pipe, so we redirect it to a temporary file
# instead. This is not necessary anymore as of Inkscape 1.4.3.
stderr = TemporaryFile()
self._proc = subprocess.Popen(
["inkscape", "--without-gui", "--shell"] if old_inkscape else
["inkscape", "--shell"],
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=stderr,
env=env, cwd=self._tmpdir.name)
Expand All @@ -200,7 +197,6 @@ def __call__(self, orig, dest):
except OSError:
shutil.copyfile(orig, inkscape_orig)
self._proc.stdin.write(
b"f.svg --export-png=f.png\n" if old_inkscape else
b"file-open:f.svg;export-filename:f.png;export-do;file-close\n")
self._proc.stdin.flush()
try:
Expand Down
Loading