Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-imageio for openSUSE:Factory checked in at 2021-02-16 22:34:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-imageio (Old) and /work/SRC/openSUSE:Factory/.python-imageio.new.28504 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-imageio" Tue Feb 16 22:34:32 2021 rev:10 rq:872659 version:2.9.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-imageio/python-imageio.changes 2020-06-05 19:58:42.043624576 +0200 +++ /work/SRC/openSUSE:Factory/.python-imageio.new.28504/python-imageio.changes 2021-02-16 22:34:44.273517534 +0100 @@ -1,0 +2,20 @@ +Mon Feb 15 19:25:55 UTC 2021 - Ben Greiner <[email protected]> + +- Update to version 2.9.0 + Fixed + * More robust loading of FEI SEM data (#529 by jon-lab). + * Fix webcam not working on Win10 (#525). + Added + * Add a few standard images useful to 3D visualization. + * The timeout used in HTTP requests can now be set with an + environment variable (#534 by Johann Neuhauser). + * The DICOM plugin can now used gdcm for compressed transfer + formats. + * Better support for itk/sitk plugins (#530 by Jonathan Daniel). + * Test coverage and CI for ARM (#518 by odidev). +- Skip python36 build: NumPy 1.20 dropped suport for Python 3.6 + making python36-numpy unavailable in Tumbleweed (NEP 29) +- Suggest the extras, you can test what we have in openSUSE with + `osc build --with test_extras` + +------------------------------------------------------------------- Old: ---- imageio-2.8.0.tar.gz New: ---- imageio-2.9.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-imageio.spec ++++++ --- /var/tmp/diff_new_pack.KMsG4o/_old 2021-02-16 22:34:45.393519070 +0100 +++ /var/tmp/diff_new_pack.KMsG4o/_new 2021-02-16 22:34:45.397519075 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-imageio # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,8 +18,11 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 +# NEP29: python36-numpy is no longer available in Tumbleweed, because NumPy 1.20 dropped support for it +%define skip_python36 1 +%bcond_with test_extras Name: python-imageio -Version: 2.8.0 +Version: 2.9.0 Release: 0 Summary: Python library for reading and writing image, video, and related formats License: BSD-2-Clause @@ -27,7 +30,6 @@ Source0: https://files.pythonhosted.org/packages/source/i/imageio/imageio-%{version}.tar.gz Source1: python-imageio-rpmlintrc BuildRequires: %{python_module Pillow} -BuildRequires: %{python_module imageio-ffmpeg} BuildRequires: %{python_module numpy} BuildRequires: %{python_module psutil} BuildRequires: %{python_module pytest} @@ -35,11 +37,26 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-Pillow -Requires: python-imageio-ffmpeg Requires: python-numpy +Recommends: python-imageio-ffmpeg +Suggests: python-astropy +# not in openSUSE (yet) +Suggests: python-simpleitk +# alternative is not singlespec +Suggests: python3-itk +%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" +# GDAL is not (yet) singlespec +Suggests: python3-GDAL +%endif Requires(post): update-alternatives Requires(postun): update-alternatives Recommends: libfreeimageplus3 +%if %{with test_extras} +BuildRequires: %{python_module astropy} +BuildRequires: %{python_module imageio-ffmpeg} +# BuildRequires: %%{python_module simpleitk} # (non simple python3-itk does not work on 32-bit, don't bother testing that) +BuildRequires: python3-GDAL +%endif BuildArch: noarch %python_subpackages @@ -70,7 +87,9 @@ %check export IMAGEIO_NO_INTERNET=1 -%pytest -k "not test_fei_file_fail and not test_ffmpeg and not test_series_unclosed and not test_import_dependencies" +# ffmpeg: plain openSUSE does not have the right codecs to test this" +donttest="test_ffmpeg" +%pytest -ra -k "not ($donttest)" %post %python_install_alternative imageio_remove_bin ++++++ imageio-2.8.0.tar.gz -> imageio-2.9.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/PKG-INFO new/imageio-2.9.0/PKG-INFO --- old/imageio-2.8.0/PKG-INFO 2020-02-19 00:10:26.000000000 +0100 +++ new/imageio-2.9.0/PKG-INFO 2020-07-06 15:20:34.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: imageio -Version: 2.8.0 +Version: 2.9.0 Summary: Library for reading and writing a wide range of image, video, scientific, and volumetric data formats. Home-page: https://github.com/imageio/imageio Author: imageio contributors @@ -20,7 +20,7 @@ data, and scientific formats. It is cross-platform, runs on Python 3.5+, and is easy to install. - Main website: http://imageio.github.io + Main website: https://imageio.github.io Release notes: hhttps://github.com/imageio/imageio/blob/master/CHANGELOG.md @@ -35,8 +35,8 @@ (512, 512, 3) >>> imageio.imwrite('astronaut-gray.jpg', im[:, :, 0]) - See the `user API <http://imageio.readthedocs.io/en/latest/userapi.html>`_ - or `examples <http://imageio.readthedocs.io/en/latest/examples.html>`_ + See the `user API <https://imageio.readthedocs.io/en/stable/userapi.html>`_ + or `examples <https://imageio.readthedocs.io/en/stable/examples.html>`_ for more information. Keywords: image video volume imread imwrite io animation ffmpeg @@ -57,7 +57,7 @@ Provides: imageio Requires-Python: >=3.5 Provides-Extra: fits +Provides-Extra: gdal Provides-Extra: itk Provides-Extra: ffmpeg Provides-Extra: full -Provides-Extra: gdal diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/README.md new/imageio-2.9.0/README.md --- old/imageio-2.8.0/README.md 2020-02-18 23:42:46.000000000 +0100 +++ new/imageio-2.9.0/README.md 2020-06-08 13:09:32.000000000 +0200 @@ -3,12 +3,12 @@ [](https://pypi.python.org/pypi/imageio/) [](https://pypi.python.org/pypi/imageio/) [](https://travis-ci.org/imageio/imageio) -[](https://coveralls.io/r/imageio/imageio?branch=master) +[](https://coveralls.io/github/imageio/imageio?branch=master) [](https://imageio.readthedocs.io) [](http://pepy.tech/project/imageio) [](https://doi.org/10.5281/zenodo.1488561) -Website: http://imageio.github.io +Website: https://imageio.github.io <!-- From below ends up on the website Keep this ---- DIVIDER ---- --> @@ -21,38 +21,39 @@ <h2>Example</h2> Here's a minimal example of how to use imageio. See the docs for -<a href='http://imageio.readthedocs.io/en/latest/examples.html'>more examples</a>. -<pre> +<a href='https://imageio.readthedocs.io/en/stable/examples.html'>more examples</a>. + +```python import imageio im = imageio.imread('imageio:chelsea.png') # read a standard image -im.shape # im is a numpy array +im.shape # im is a NumPy array >> (300, 451, 3) imageio.imwrite('~/chelsea-gray.jpg', im[:, :, 0]) -</pre> +``` <h2>API in a nutshell</h2> -As a user, you just have to remember a handfull of functions: +As a user, you just have to remember a handful of functions: <ul> <li>imread() and imwrite() - for single images</li> <li>mimread() and mimwrite() - for image series (animations)</li> <li>volread() and volwrite() - for volumetric image data</li> <li>get_reader() and get_writer() - for more control (e.g. streaming or compression)</li> - <li>See the <a href='http://imageio.readthedocs.io/en/latest/userapi.html'>user api</a> for more information</li> + <li>See the <a href='https://imageio.readthedocs.io/en/stable/userapi.html'>user api</a> for more information</li> </ul> <h2>Features</h2> <ul> <li>Simple interface via a consise set of functions.</li> - <li>Easy to <a href='http://imageio.readthedocs.io/en/latest/installation.html'>install</a> using conda or pip.</li> - <li>Few dependencies (only Numpy and Pillow).</li> - <li>Pure Python, runs on Python 3.5+, and Pypy</li> + <li>Easy to <a href='https://imageio.readthedocs.io/en/stable/installation.html'>install</a> using Conda or pip</li> + <li>Few dependencies (only NumPy and Pillow)</li> + <li>Pure Python, runs on Python 3.5+, and PyPy</li> <li>Cross platform, runs on Windows, Linux, macOS</li> - <li>Lots of supported <a href='http://imageio.readthedocs.io/en/latest/formats.html'>formats</a>.</li> - <li>Can read from file names, file objects, zipfiles, http/ftp, and raw bytes.</li> - <li>Easy to extend using plugins.</li> - <li>Code quality is maintained with many tests and continuous integration.</li> + <li>Lots of supported <a href='https://imageio.readthedocs.io/en/stable/formats.html'>formats</a></li> + <li>Can read from file names, file objects, zipfiles, http/ftp, and raw bytes</li> + <li>Easy to extend using plugins</li> + <li>Code quality is maintained with many tests and continuous integration</li> </ul> @@ -61,7 +62,7 @@ Minimal requirements: <ul> <li>Python 3.5+</li> - <li>Numpy</li> + <li>NumPy</li> <li>Pillow</li> </ul> @@ -92,7 +93,7 @@ <h2>imageio for enterprise</h2> -Available as part of the Tidelift Subscription +Available as part of the Tidelift Subscription. The maintainers of imageio and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. <a href='https://tidelift.com/subscription/pkg/pypi-imageio?utm_source=pypi-imageio&utm_medium=referral&utm_campaign=readme'>Learn more</a>. @@ -118,10 +119,10 @@ <p>Install a complete development environment:</p> -<pre> +```bash pip install -r requirements.txt pip install -e . -</pre> +``` <p><i>N.B. this does not include GDAL because it has awkward compiled dependencies</i></p> @@ -132,7 +133,7 @@ Style checks, unit tests and coverage are controlled by <code>invoke</code>. Before committing, check these with:</p> -<pre> +```bash # reformat code on python 3.6+ invoke autoformat # check there are no style errors @@ -141,4 +142,4 @@ invoke test --unit # check test coverage (re-runs tests) invoke test --cover -</pre> +``` diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/docs/envvariables.rst new/imageio-2.9.0/docs/envvariables.rst --- old/imageio-2.8.0/docs/envvariables.rst 2020-02-18 22:17:18.000000000 +0100 +++ new/imageio-2.9.0/docs/envvariables.rst 2020-07-06 14:38:25.000000000 +0200 @@ -18,5 +18,7 @@ * ``IMAGEIO_FORMAT_ORDER``: Determine format preference. E.g. setting this to ``"TIFF, -FI"`` will prefer the FreeImage plugin over the Pillow plugin, but still prefer TIFF over that. Also see the ``formats.sort()`` method. +* ``IMAGEIO_REQUEST_TIMEOUT``: Set the timeout of http/ftp request in seconds. + If not set, this defaults to 5 seconds. * ``IMAGEIO_USERDIR``: Set the path to the default user directory. If not given, imageio will try ``~`` and if that's not available ``/var/tmp``. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/imageio/__init__.py new/imageio-2.9.0/imageio/__init__.py --- old/imageio-2.8.0/imageio/__init__.py 2020-02-19 00:09:16.000000000 +0100 +++ new/imageio-2.9.0/imageio/__init__.py 2020-07-06 15:08:04.000000000 +0200 @@ -11,12 +11,12 @@ data, and scientific formats. It is cross-platform, runs on Python 3.5+, and is easy to install. -Main website: http://imageio.github.io +Main website: https://imageio.github.io """ # flake8: noqa -__version__ = "2.8.0" +__version__ = "2.9.0" # Load some bits from core from .core import FormatManager, RETURN_BYTES diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/imageio/core/findlib.py new/imageio-2.9.0/imageio/core/findlib.py --- old/imageio-2.8.0/imageio/core/findlib.py 2019-10-08 11:55:29.000000000 +0200 +++ new/imageio-2.9.0/imageio/core/findlib.py 2020-05-11 14:05:35.000000000 +0200 @@ -41,6 +41,7 @@ "/lib", "/usr/lib", "/usr/lib/x86_64-linux-gnu", + "/usr/lib/aarch64-linux-gnu", "/usr/local/lib", "/opt/local/lib", ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/imageio/core/request.py new/imageio-2.9.0/imageio/core/request.py --- old/imageio-2.8.0/imageio/core/request.py 2020-02-18 22:46:53.000000000 +0100 +++ new/imageio-2.9.0/imageio/core/request.py 2020-07-06 15:18:51.000000000 +0200 @@ -37,6 +37,8 @@ "astronaut.png": "Image of the astronaut Eileen Collins", "camera.png": "Classic grayscale image of a photographer", "checkerboard.png": "Black and white image of a chekerboard", + "wood.jpg": "A (repeatable) texture of wooden planks", + "bricks.jpg": "A (repeatable) texture of stone bricks", "clock.png": "Photo of a clock with motion blur (Stefan van der Walt)", "coffee.png": "Image of a cup of coffee (Rachel Michetti)", "chelsea.png": "Image of Stefan's cat", @@ -53,6 +55,7 @@ "newtonscradle.gif": "Animated GIF of a newton's cradle", "cockatoo.mp4": "Video file of a cockatoo", "stent.npz": "Volumetric image showing a stented abdominal aorta", + "meadow_cube.jpg": "A cubemap image of a meadow, e.g. to render a skybox.", } @@ -344,7 +347,10 @@ elif self._uri_type in [URI_HTTP or URI_FTP]: assert not want_to_write # This should have been tested in init - self._file = urlopen(self.filename, timeout=5) + timeout = os.getenv('IMAGEIO_REQUEST_TIMEOUT') + if timeout is None or not timeout.isdigit(): + timeout = 5 + self._file = urlopen(self.filename, timeout=float(timeout)) self._file = SeekableFileObject(self._file) return self._file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/imageio/plugins/dicom.py new/imageio-2.9.0/imageio/plugins/dicom.py --- old/imageio-2.8.0/imageio/plugins/dicom.py 2019-10-08 11:55:29.000000000 +0200 +++ new/imageio-2.9.0/imageio/plugins/dicom.py 2020-06-08 15:01:35.000000000 +0200 @@ -47,26 +47,62 @@ ): filename = os.path.join(dir, fname) if os.path.isfile(filename): - return filename + return [filename] try: subprocess.check_call([fname, "--version"]) - return fname + return [fname] except Exception: return None +def get_gdcmconv_exe(): + fname = "gdcmconv" + ".exe" * sys.platform.startswith("win") + # Maybe it's on the path + try: + subprocess.check_call([fname, "--version"]) + return [fname, "--raw"] + except Exception: + pass + # Select directories where it could be + candidates = [] + base_dirs = [r"c:\Program Files"] + for base_dir in base_dirs: + if os.path.isdir(base_dir): + for dname in os.listdir(base_dir): + if dname.lower().startswith("gdcm"): + suffix = dname[4:].strip() + candidates.append((suffix, os.path.join(base_dir, dname))) + # Sort, so higher versions are tried earlier + candidates.sort(reverse=True) + # Select executable + filename = None + for _, dirname in candidates: + exe1 = os.path.join(dirname, "gdcmconv.exe") + exe2 = os.path.join(dirname, "bin", "gdcmconv.exe") + if os.path.isfile(exe1): + filename = exe1 + break + if os.path.isfile(exe2): + filename = exe2 + break + else: + return None + return [filename, "--raw"] + + class DicomFormat(Format): """ A format for reading DICOM images: a common format used to store medical image data, such as X-ray, CT and MRI. - This format borrows some code (and ideas) from the pydicom project, - and (to the best of our knowledge) has the same limitations as - pydicom with regard to the type of files that it can handle. However, + This format borrows some code (and ideas) from the pydicom project. However, only a predefined subset of tags are extracted from the file. This allows for great simplifications allowing us to make a stand-alone reader, and - also results in a much faster read time. We plan to allow reading all - tags in the future (by using pydicom). + also results in a much faster read time. + + By default, only uncompressed and deflated transfer syntaxes are supported. + If gdcm or dcmtk is installed, these will be used to automatically convert + the data. See https://github.com/malaterre/GDCM/releases for installing GDCM. This format provides functionality to group images of the same series together, thus extracting volumes (and multiple volumes). @@ -107,6 +143,9 @@ # -- class Reader(Format.Reader): + + _compressed_warning_dirs = set() + def _open(self, progress=True): if not _dicom: load_lib() @@ -119,23 +158,32 @@ try: dcm = _dicom.SimpleDicomReader(self.request.get_file()) except _dicom.CompressedDicom as err: - if "JPEG" in str(err): - exe = get_dcmdjpeg_exe() - if not exe: - raise + # We cannot do this on our own. Perhaps with some help ... + cmd = get_gdcmconv_exe() + if not cmd and "JPEG" in str(err): + cmd = get_dcmdjpeg_exe() + if not cmd: + msg = err.args[0].replace("using", "installing") + msg = msg.replace("convert", "auto-convert") + err.args = (msg,) + raise + else: fname1 = self.request.get_local_filename() fname2 = fname1 + ".raw" try: - subprocess.check_call([exe, fname1, fname2]) + subprocess.check_call(cmd + [fname1, fname2]) except Exception: raise err - logger.warning( - "DICOM file contained compressed data. " - "Used dcmtk to convert it." - ) + d = os.path.dirname(fname1) + if d not in self._compressed_warning_dirs: + self._compressed_warning_dirs.add(d) + logger.warning( + "DICOM file contained compressed data. " + + "Autoconverting with " + + cmd[0] + + " (this warning is shown once for each directory)" + ) dcm = _dicom.SimpleDicomReader(fname2) - else: - raise self._info = dcm._info self._data = dcm.get_numpy_array() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/imageio/plugins/feisem.py new/imageio-2.9.0/imageio/plugins/feisem.py --- old/imageio-2.8.0/imageio/plugins/feisem.py 2019-10-08 11:55:29.000000000 +0200 +++ new/imageio-2.9.0/imageio/plugins/feisem.py 2020-06-08 14:32:43.000000000 +0200 @@ -56,20 +56,20 @@ current_tag = "root" reading_metadata = False filename = self.request.get_local_filename() - with open(filename, "rb") as fin: + with open(filename, encoding="utf8", errors="ignore") as fin: for line in fin: if not reading_metadata: - if not line.startswith(b"Date="): + if not line.startswith("Date="): continue else: reading_metadata = True - line = line.rstrip().decode() + line = line.rstrip() if line.startswith("["): current_tag = line.lstrip("[").rstrip("]") md[current_tag] = {} else: - if line and line != "\x00": # ignore blank lines - key, val = line.split("=") + if "=" in line: # ignore empty and irrelevant lines + key, val = line.split("=", maxsplit=1) for tag_type in (int, float): try: val = tag_type(val) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/imageio/plugins/ffmpeg.py new/imageio-2.9.0/imageio/plugins/ffmpeg.py --- old/imageio-2.8.0/imageio/plugins/ffmpeg.py 2020-02-18 16:43:23.000000000 +0100 +++ new/imageio-2.9.0/imageio/plugins/ffmpeg.py 2020-06-08 14:32:43.000000000 +0200 @@ -289,7 +289,7 @@ # Specify input framerate? if self.request._video: if "-framerate" not in str(self._arg_input_params): - self._arg_input_params.extend(["-framerate", str(float(fps or 15))]) + self._arg_input_params.extend(["-framerate", str(float(fps or 30))]) # Get local filename if self.request._video: index = int(self.request._video[-2]) @@ -458,7 +458,9 @@ "support for cameras." ) raise IndexError( - "No camera at {}.\n\n{}".format(self.request._video, err_text) + "No (working) camera at {}.\n\n{}".format( + self.request._video, err_text + ) ) else: self._meta.update(meta) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/imageio/plugins/simpleitk.py new/imageio-2.9.0/imageio/plugins/simpleitk.py --- old/imageio-2.8.0/imageio/plugins/simpleitk.py 2019-10-08 11:55:29.000000000 +0200 +++ new/imageio-2.9.0/imageio/plugins/simpleitk.py 2020-06-08 13:09:32.000000000 +0200 @@ -48,6 +48,9 @@ "hdr", ".nrrd", ".nii", + ".nii.gz", + ".img", + ".img.gz", ".vtk", "hdf5", "lsm", @@ -106,10 +109,15 @@ # -- reader class Reader(Format.Reader): - def _open(self, **kwargs): + def _open(self, pixel_type=None, fallback_only=None, **kwargs): if not _itk: load_lib() - self._img = _read_function(self.request.get_local_filename()) + args = () + if pixel_type is not None: + args += (pixel_type,) + if fallback_only is not None: + args += (fallback_only,) + self._img = _read_function(self.request.get_local_filename(), *args) def _get_length(self): return 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/setup.py new/imageio-2.9.0/setup.py --- old/imageio-2.8.0/setup.py 2020-02-18 23:38:25.000000000 +0100 +++ new/imageio-2.9.0/setup.py 2020-02-19 00:40:06.000000000 +0100 @@ -83,8 +83,8 @@ (512, 512, 3) >>> imageio.imwrite('astronaut-gray.jpg', im[:, :, 0]) -See the `user API <http://imageio.readthedocs.io/en/latest/userapi.html>`_ -or `examples <http://imageio.readthedocs.io/en/latest/examples.html>`_ +See the `user API <https://imageio.readthedocs.io/en/stable/userapi.html>`_ +or `examples <https://imageio.readthedocs.io/en/stable/examples.html>`_ for more information. """ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/tests/test_ffmpeg.py new/imageio-2.9.0/tests/test_ffmpeg.py --- old/imageio-2.8.0/tests/test_ffmpeg.py 2020-02-18 22:17:18.000000000 +0100 +++ new/imageio-2.9.0/tests/test_ffmpeg.py 2020-06-08 14:32:43.000000000 +0200 @@ -8,7 +8,7 @@ import gc import time import threading - +import platform import psutil import numpy as np @@ -42,22 +42,25 @@ def test_get_exe_installed(): - import imageio_ffmpeg - - # backup any user-defined path - if "IMAGEIO_FFMPEG_EXE" in os.environ: - oldpath = os.environ["IMAGEIO_FFMPEG_EXE"] + if platform.machine() == "aarch64": + skip("Skip for aarch64") else: - oldpath = "" - # Test if download works - os.environ["IMAGEIO_FFMPEG_EXE"] = "" - path = imageio_ffmpeg.get_ffmpeg_exe() - # cleanup - os.environ.pop("IMAGEIO_FFMPEG_EXE") - if oldpath: - os.environ["IMAGEIO_FFMPEG_EXE"] = oldpath - print(path) - assert os.path.isfile(path) + import imageio_ffmpeg + + # backup any user-defined path + if "IMAGEIO_FFMPEG_EXE" in os.environ: + oldpath = os.environ["IMAGEIO_FFMPEG_EXE"] + else: + oldpath = "" + # Test if download works + os.environ["IMAGEIO_FFMPEG_EXE"] = "" + path = imageio_ffmpeg.get_ffmpeg_exe() + # cleanup + os.environ.pop("IMAGEIO_FFMPEG_EXE") + if oldpath: + os.environ["IMAGEIO_FFMPEG_EXE"] = oldpath + print(path) + assert os.path.isfile(path) def test_get_exe_env(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imageio-2.8.0/tests/test_ffmpeg_info.py new/imageio-2.9.0/tests/test_ffmpeg_info.py --- old/imageio-2.8.0/tests/test_ffmpeg_info.py 2019-10-08 11:55:29.000000000 +0200 +++ new/imageio-2.9.0/tests/test_ffmpeg_info.py 2020-06-08 14:32:43.000000000 +0200 @@ -52,7 +52,6 @@ def test_overload_fps(): - need_internet() # Native @@ -60,7 +59,7 @@ assert r.count_frames() == 280 # native assert int(r._meta["fps"] * r._meta["duration"] + 0.5) == 280 ims = [im for im in r] - assert len(ims) == 280 + assert len(ims) in (280, 281) # imageio.mimwrite('~/parot280.gif', ims[:30]) # Less @@ -76,7 +75,7 @@ # assert r.count_frames() == 336 # cant :( ims = [im for im in r] assert int(r._meta["fps"] * r._meta["duration"] + 0.5) == 336 - assert len(ims) == 336 + assert len(ims) in (336, 337) # imageio.mimwrite('~/parot336.gif', ims[:30]) # Do we calculate nframes correctly? To be fair, the reader wont try to
