diff --git a/.appveyor.yml b/.appveyor.yml index 4521bc876a8f..863a7f967dc7 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -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 :-( diff --git a/doc/api/next_api_changes/development/31660-ES.rst b/doc/api/next_api_changes/development/31660-ES.rst new file mode 100644 index 000000000000..40894022efb9 --- /dev/null +++ b/doc/api/next_api_changes/development/31660-ES.rst @@ -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). diff --git a/doc/install/dependencies.rst b/doc/install/dependencies.rst index 8f638ea5ed1d..6e2bffc7af60 100644 --- a/doc/install/dependencies.rst +++ b/doc/install/dependencies.rst @@ -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 @@ -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 `_ * the font `xkcd script `_ or `Comic Neue `_ * the font "Times New Roman" diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py index 2a83cc1f1091..3fae9c217c6c 100644 --- a/lib/matplotlib/__init__.py +++ b/lib/matplotlib/__init__.py @@ -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 diff --git a/lib/matplotlib/testing/compare.py b/lib/matplotlib/testing/compare.py index 2b94847a72b6..0cb315868b11 100644 --- a/lib/matplotlib/testing/compare.py +++ b/lib/matplotlib/testing/compare.py @@ -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 @@ -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) @@ -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: