Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-oiffile for openSUSE:Factory 
checked in at 2024-06-07 15:03:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-oiffile (Old)
 and      /work/SRC/openSUSE:Factory/.python-oiffile.new.24587 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-oiffile"

Fri Jun  7 15:03:36 2024 rev:6 rq:1179038 version:2024.5.24

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-oiffile/python-oiffile.changes    
2024-01-10 21:52:24.780438138 +0100
+++ /work/SRC/openSUSE:Factory/.python-oiffile.new.24587/python-oiffile.changes 
2024-06-07 15:04:12.597615792 +0200
@@ -1,0 +2,7 @@
+Thu Jun  6 15:08:00 UTC 2024 - Dirk Müller <[email protected]>
+
+- update to 2024.5.24:
+  * Support NumPy 2.
+  * Fix docstring examples not correctly rendered on GitHub.
+
+-------------------------------------------------------------------

Old:
----
  oiffile-2023.8.30.tar.gz

New:
----
  oiffile-2024.5.24.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-oiffile.spec ++++++
--- /var/tmp/diff_new_pack.7IV8hQ/_old  2024-06-07 15:04:13.173636777 +0200
+++ /var/tmp/diff_new_pack.7IV8hQ/_new  2024-06-07 15:04:13.177636922 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           python-oiffile
-Version:        2023.8.30
+Version:        2024.5.24
 Release:        0
 Summary:        Read Olympus(r) image files (OIF and OIB)
 License:        BSD-3-Clause

++++++ oiffile-2023.8.30.tar.gz -> oiffile-2024.5.24.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/oiffile-2023.8.30/LICENSE 
new/oiffile-2024.5.24/LICENSE
--- old/oiffile-2023.8.30/LICENSE       2023-08-31 02:23:03.000000000 +0200
+++ new/oiffile-2024.5.24/LICENSE       2024-05-25 19:01:28.000000000 +0200
@@ -1,6 +1,6 @@
 BSD 3-Clause License
 
-Copyright (c) 2012-2023, Christoph Gohlke
+Copyright (c) 2012-2024, Christoph Gohlke
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/oiffile-2023.8.30/README.rst 
new/oiffile-2024.5.24/README.rst
--- old/oiffile-2023.8.30/README.rst    2023-08-31 02:23:03.000000000 +0200
+++ new/oiffile-2024.5.24/README.rst    2024-05-25 19:01:28.000000000 +0200
@@ -1,5 +1,8 @@
-Read Olympus(r) image files (OIF and OIB)
-=========================================
+..
+  This file is generated by setup.py
+
+Read Olympus image files (OIF and OIB)
+======================================
 
 Oiffile is a Python library to read image and metadata from Olympus Image
 Format files. OIF is the native file format of the Olympus FluoView(tm)
@@ -16,7 +19,7 @@
 
 :Author: `Christoph Gohlke <https://www.cgohlke.com>`_
 :License: BSD 3-Clause
-:Version: 2023.8.30
+:Version: 2024.5.24
 
 Quickstart
 ----------
@@ -24,7 +27,7 @@
 Install the oiffile package and all dependencies from the
 `Python Package Index <https://pypi.org/project/oiffile/>`_::
 
-    python -m pip install -U oiffile[all]
+    python -m pip install -U "oiffile[all]"
 
 View image and metadata stored in a OIF or OIB file::
 
@@ -41,13 +44,18 @@
 This revision was tested with the following requirements and dependencies
 (other versions may work):
 
-- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.5, 3.12rc, 64-bit
-- `NumPy <https://pypi.org/project/numpy/>`_ 1.25.2
-- `Tifffile <https://pypi.org/project/tifffile/>`_  2023.8.30
+- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.9, 3.12.3, 64-bit
+- `NumPy <https://pypi.org/project/numpy/>`_ 1.26.4
+- `Tifffile <https://pypi.org/project/tifffile/>`_ 2024.5.22
 
 Revisions
 ---------
 
+2024.5.24
+
+- Support NumPy 2.
+- Fix docstring examples not correctly rendered on GitHub.
+
 2023.8.30
 
 - Fix linting issues.
@@ -90,8 +98,6 @@
 Notes
 -----
 
-The API is not stable yet and might change between revisions.
-
 No specification document is available.
 
 Tested only with files produced on Olympus FV1000 hardware.
@@ -101,54 +107,69 @@
 
 Read the image from an OIB file as numpy array:
 
->>> image = imread('test.oib')
->>> image.shape
-(3, 256, 256)
->>> image[:, 95, 216]
-array([820,  50, 436], dtype=uint16)
+.. code-block:: python
+
+    >>> image = imread('test.oib')
+    >>> image.shape
+    (3, 256, 256)
+    >>> image[:, 95, 216]
+    array([820,  50, 436], dtype=uint16)
 
 Read the image from a single TIFF file in an OIB file:
 
->>> with OifFile('test.oib') as oib:
-...     filename = natural_sorted(oib.glob('*.tif'))[0]
-...     image = oib.asarray(filename)
->>> filename
-'Storage00001/s_C001.tif'
->>> image[95, 216]
-820
+.. code-block:: python
+
+    >>> with OifFile('test.oib') as oib:
+    ...     filename = natural_sorted(oib.glob('*.tif'))[0]
+    ...     image = oib.asarray(filename)
+    ...
+    >>> filename
+    'Storage00001/s_C001.tif'
+    >>> print(image[95, 216])
+    820
 
 Access metadata and the OIB main file:
 
->>> with OifFile('test.oib') as oib:
-...     oib.axes
-...     oib.shape
-...     oib.dtype
-...     dataname = oib.mainfile['File Info']['DataName']
-'CYX'
-(3, 256, 256)
-dtype('uint16')
->>> dataname
-'Cell 1 mitoEGFP.oib'
+.. code-block:: python
+
+    >>> with OifFile('test.oib') as oib:
+    ...     oib.axes
+    ...     oib.shape
+    ...     oib.dtype
+    ...     dataname = oib.mainfile['File Info']['DataName']
+    ...
+    'CYX'
+    (3, 256, 256)
+    dtype('uint16')
+    >>> dataname
+    'Cell 1 mitoEGFP.oib'
 
 Extract the OIB file content to an OIF file and associated data directory:
 
->>> import tempfile
->>> tempdir = tempfile.mkdtemp()
->>> oib2oif('test.oib', location=tempdir)
-Saving ... done.
+.. code-block:: python
+
+    >>> import tempfile
+    >>> tempdir = tempfile.mkdtemp()
+    >>> oib2oif('test.oib', location=tempdir)
+    Saving ... done.
 
 Read the image from the extracted OIF file:
 
->>> image = imread(f'{tempdir}/{dataname[:-4]}.oif')
->>> image[:, 95, 216]
-array([820,  50, 436], dtype=uint16)
+.. code-block:: python
+
+    >>> image = imread(f'{tempdir}/{dataname[:-4]}.oif')
+    >>> image[:, 95, 216]
+    array([820,  50, 436], dtype=uint16)
 
 Read OLE compound file and access the 'OibInfo.txt' settings file:
 
->>> with CompoundFile('test.oib') as com:
-...     info = com.open_file('OibInfo.txt')
-...     len(com.files())
-14
->>> info = SettingsFile(info, 'OibInfo.txt')
->>> info['OibSaveInfo']['Version']
-'2.0.0.0'
+.. code-block:: python
+
+    >>> with CompoundFile('test.oib') as com:
+    ...     info = com.open_file('OibInfo.txt')
+    ...     len(com.files())
+    ...
+    14
+    >>> info = SettingsFile(info, 'OibInfo.txt')
+    >>> info['OibSaveInfo']['Version']
+    '2.0.0.0'
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/oiffile-2023.8.30/oiffile/oiffile.py 
new/oiffile-2024.5.24/oiffile/oiffile.py
--- old/oiffile-2023.8.30/oiffile/oiffile.py    2023-08-31 02:23:03.000000000 
+0200
+++ new/oiffile-2024.5.24/oiffile/oiffile.py    2024-05-25 19:01:28.000000000 
+0200
@@ -1,6 +1,6 @@
 # oiffile.py
 
-# Copyright (c) 2012-2023, Christoph Gohlke
+# Copyright (c) 2012-2024, Christoph Gohlke
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -29,7 +29,7 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
-"""Read Olympus(r) image files (OIF and OIB).
+"""Read Olympus image files (OIF and OIB).
 
 Oiffile is a Python library to read image and metadata from Olympus Image
 Format files. OIF is the native file format of the Olympus FluoView(tm)
@@ -46,7 +46,7 @@
 
 :Author: `Christoph Gohlke <https://www.cgohlke.com>`_
 :License: BSD 3-Clause
-:Version: 2023.8.30
+:Version: 2024.5.24
 
 Quickstart
 ----------
@@ -54,7 +54,7 @@
 Install the oiffile package and all dependencies from the
 `Python Package Index <https://pypi.org/project/oiffile/>`_::
 
-    python -m pip install -U oiffile[all]
+    python -m pip install -U "oiffile[all]"
 
 View image and metadata stored in a OIF or OIB file::
 
@@ -71,13 +71,18 @@
 This revision was tested with the following requirements and dependencies
 (other versions may work):
 
-- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.5, 3.12rc, 64-bit
-- `NumPy <https://pypi.org/project/numpy/>`_ 1.25.2
-- `Tifffile <https://pypi.org/project/tifffile/>`_  2023.8.30
+- `CPython <https://www.python.org>`_ 3.9.13, 3.10.11, 3.11.9, 3.12.3, 64-bit
+- `NumPy <https://pypi.org/project/numpy/>`_ 1.26.4
+- `Tifffile <https://pypi.org/project/tifffile/>`_ 2024.5.22
 
 Revisions
 ---------
 
+2024.5.24
+
+- Support NumPy 2.
+- Fix docstring examples not correctly rendered on GitHub.
+
 2023.8.30
 
 - Fix linting issues.
@@ -120,8 +125,6 @@
 Notes
 -----
 
-The API is not stable yet and might change between revisions.
-
 No specification document is available.
 
 Tested only with files produced on Olympus FV1000 hardware.
@@ -142,9 +145,10 @@
 >>> with OifFile('test.oib') as oib:
 ...     filename = natural_sorted(oib.glob('*.tif'))[0]
 ...     image = oib.asarray(filename)
+...
 >>> filename
 'Storage00001/s_C001.tif'
->>> image[95, 216]
+>>> print(image[95, 216])
 820
 
 Access metadata and the OIB main file:
@@ -154,6 +158,7 @@
 ...     oib.shape
 ...     oib.dtype
 ...     dataname = oib.mainfile['File Info']['DataName']
+...
 'CYX'
 (3, 256, 256)
 dtype('uint16')
@@ -178,6 +183,7 @@
 >>> with CompoundFile('test.oib') as com:
 ...     info = com.open_file('OibInfo.txt')
 ...     len(com.files())
+...
 14
 >>> info = SettingsFile(info, 'OibInfo.txt')
 >>> info['OibSaveInfo']['Version']
@@ -187,7 +193,7 @@
 
 from __future__ import annotations
 
-__version__ = '2023.8.30'
+__version__ = '2024.5.24'
 
 __all__ = [
     'imread',
@@ -710,11 +716,11 @@
         finally:
             stream.close()
 
-        if content[:4] == b'\xFF\xFE\x5B\x00':
+        if content[:4] == b'\xff\xfe\x5b\x00':
             # UTF16 BOM
             content_list = content.rsplit(
                 b'[\x00C\x00o\x00l\x00o\x00r\x00L\x00U\x00T\x00'
-                b'D\x00a\x00t\x00a\x00]\x00\x0D\x00\x0A\x00',
+                b'D\x00a\x00t\x00a\x00]\x00\x0d\x00\x0a\x00',
                 1,
             )
             if len(content_list) > 1:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/oiffile-2023.8.30/setup.py 
new/oiffile-2024.5.24/setup.py
--- old/oiffile-2023.8.30/setup.py      2023-08-31 02:23:03.000000000 +0200
+++ new/oiffile-2024.5.24/setup.py      2024-05-25 19:01:28.000000000 +0200
@@ -8,14 +8,32 @@
 from setuptools import setup
 
 
-def search(pattern, code, flags=0):
-    # return first match for pattern in code
-    match = re.search(pattern, code, flags)
+def search(pattern, string, flags=0):
+    """Return first match of pattern in string."""
+    match = re.search(pattern, string, flags)
     if match is None:
         raise ValueError(f'{pattern!r} not found')
     return match.groups()[0]
 
 
+def fix_docstring_examples(docstring):
+    """Return docstring with examples fixed for GitHub."""
+    start = True
+    indent = False
+    lines = ['..', '  This file is generated by setup.py', '']
+    for line in docstring.splitlines():
+        if not line.strip():
+            start = True
+            indent = False
+        if line.startswith('>>> '):
+            indent = True
+            if start:
+                lines.extend(['.. code-block:: python', ''])
+                start = False
+        lines.append(('    ' if indent else '') + line)
+    return '\n'.join(lines)
+
+
 with open('oiffile/oiffile.py', encoding='utf-8') as fh:
     code = fh.read()
 
@@ -28,25 +46,26 @@
     code,
     re.MULTILINE | re.DOTALL,
 )
-
 readme = '\n'.join(
     [description, '=' * len(description)] + readme.splitlines()[1:]
 )
 
-license = search(
-    r'(# Copyright.*?(?:\r\n|\r|\n))(?:\r\n|\r|\n)+""',
-    code,
-    re.MULTILINE | re.DOTALL,
-)
+if 'sdist' in sys.argv:
+    # update README, LICENSE, and CHANGES files
 
-license = license.replace('# ', '').replace('#', '')
+    with open('README.rst', 'w', encoding='utf-8') as fh:
+        fh.write(fix_docstring_examples(readme))
+
+    license = search(
+        r'(# Copyright.*?(?:\r\n|\r|\n))(?:\r\n|\r|\n)+""',
+        code,
+        re.MULTILINE | re.DOTALL,
+    )
+    license = license.replace('# ', '').replace('#', '')
 
-if 'sdist' in sys.argv:
     with open('LICENSE', 'w', encoding='utf-8') as fh:
         fh.write('BSD 3-Clause License\n\n')
         fh.write(license)
-    with open('README.rst', 'w', encoding='utf-8') as fh:
-        fh.write(readme)
 
 setup(
     name='oiffile',

Reply via email to