Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-sane for openSUSE:Factory checked in at 2025-11-10 19:19:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-sane (Old) and /work/SRC/openSUSE:Factory/.python-sane.new.1980 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-sane" Mon Nov 10 19:19:29 2025 rev:5 rq:1316817 version:2.9.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-sane/python-sane.changes 2025-06-12 15:56:01.504060713 +0200 +++ /work/SRC/openSUSE:Factory/.python-sane.new.1980/python-sane.changes 2025-11-10 19:19:35.077988344 +0100 @@ -1,0 +2,11 @@ +Mon Nov 10 08:22:29 UTC 2025 - Dirk Müller <[email protected]> + +- update to 2.9.2: + * sane.py: Silently ignore exception raised by device.cancel in + SaneIterator.__del__ if device was already closed + * Silently ignore exception raised by device.cancel in + SaneIterator.__del__ if device was already closed + * Port to pyproject.toml + * Added Python 3.10, 3.11, 3.12, 3.13 + +------------------------------------------------------------------- Old: ---- v2.9.1.tar.gz New: ---- v2.9.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-sane.spec ++++++ --- /var/tmp/diff_new_pack.BTFJGm/_old 2025-11-10 19:19:35.654012527 +0100 +++ /var/tmp/diff_new_pack.BTFJGm/_new 2025-11-10 19:19:35.654012527 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-sane # -# Copyright (c) 2025 SUSE LLC +# Copyright (c) 2025 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-sane -Version: 2.9.1 +Version: 2.9.2 Release: 0 Summary: A Python interface to the SANE scanner and frame grabber interface License: NTP ++++++ v2.9.1.tar.gz -> v2.9.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sane-2.9.1/.github/workflows/test.yml new/Sane-2.9.2/.github/workflows/test.yml --- old/Sane-2.9.1/.github/workflows/test.yml 2021-01-05 13:44:54.000000000 +0100 +++ new/Sane-2.9.2/.github/workflows/test.yml 2025-07-21 21:05:49.000000000 +0200 @@ -11,14 +11,14 @@ strategy: fail-fast: false matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "pypy3"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.9", "pypy-3.10"] os: [ubuntu-latest] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -26,12 +26,11 @@ run: | sudo apt-get install libsane-dev - # No tests: just check it can build and install - - name: Test build and install + # No tests: just check it can install + - name: Test install shell: bash run: | - python setup.py build - python setup.py install + python3 -m pip install . - name: Lint shell: bash diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sane-2.9.1/CHANGES.rst new/Sane-2.9.2/CHANGES.rst --- old/Sane-2.9.1/CHANGES.rst 2021-01-05 13:44:54.000000000 +0100 +++ new/Sane-2.9.2/CHANGES.rst 2025-07-21 21:05:49.000000000 +0200 @@ -1,4 +1,16 @@ +Version 2.9.2 +------------- + +- sane.py: + + - Silently ignore exception raised by device.cancel in SaneIterator.__del__ if device was already closed + +- Port to pyproject.toml +- Added Python 3.10, 3.11, 3.12, 3.13 + + Version 2.9.1 +------------- - _sane.c: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sane-2.9.1/COPYING new/Sane-2.9.2/COPYING --- old/Sane-2.9.1/COPYING 2021-01-05 13:44:54.000000000 +0100 +++ new/Sane-2.9.2/COPYING 2025-07-21 21:05:49.000000000 +0200 @@ -1,6 +1,6 @@ (C) Copyright 2003 A.M. Kuchling. All Rights Reserved (C) Copyright 2004 A.M. Kuchling, Ralph Heinkel All Rights Reserved -(C) Copyright 2013-2021 Sandro Mani All Rights Reserved +(C) Copyright 2013 Sandro Mani All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sane-2.9.1/README.rst new/Sane-2.9.2/README.rst --- old/Sane-2.9.1/README.rst 2021-01-05 13:44:54.000000000 +0100 +++ new/Sane-2.9.2/README.rst 2025-07-21 21:05:49.000000000 +0200 @@ -1,5 +1,5 @@ -Python SANE module 2.9 -====================== +Python SANE module 2.9.2 +======================== .. image:: https://github.com/python-pillow/Sane/workflows/Test/badge.svg :target: https://github.com/python-pillow/Sane/actions @@ -16,11 +16,11 @@ To build this module, make sure the sane development package is installed. Then, type:: - python setup.py build + python3 setup.py build In order to install the module type:: - python setup.py install + python3 -m pip install . For some basic documentation please look at the file sanedoc.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sane-2.9.1/_sane.c new/Sane-2.9.2/_sane.c --- old/Sane-2.9.1/_sane.c 2021-01-05 13:44:54.000000000 +0100 +++ new/Sane-2.9.2/_sane.c 2025-07-21 21:05:49.000000000 +0200 @@ -1,7 +1,7 @@ /*********************************************************** (C) Copyright 2003 A.M. Kuchling. All Rights Reserved (C) Copyright 2004 A.M. Kuchling, Ralph Heinkel All Rights Reserved -(C) Copyright 2013-2021 Sandro Mani All Rights Reserved +(C) Copyright 2013 Sandro Mani All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sane-2.9.1/doc/conf.py new/Sane-2.9.2/doc/conf.py --- old/Sane-2.9.1/doc/conf.py 2021-01-05 13:44:54.000000000 +0100 +++ new/Sane-2.9.2/doc/conf.py 2025-07-21 21:05:49.000000000 +0200 @@ -15,6 +15,8 @@ import sys import os +import sane + # -- Mock module for _sane try: from unittest.mock import MagicMock @@ -25,20 +27,24 @@ return Mock() sys.modules.update([('_sane', Mock())]) -except: +except Exception: pass # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -libbuilddir = "lib.{p}-{v[0]}.{v[1]}".format(p=sysconfig.get_platform(), v=sys.version_info) -sys.path.insert(0, os.path.join(os.path.abspath('.'), '..', 'build', libbuilddir)) +libbuilddir = "lib.{p}-{v[0]}.{v[1]}".format( + p=sysconfig.get_platform(), v=sys.version_info +) +sys.path.insert( + 0, os.path.join(os.path.abspath('.'), '..', 'build', libbuilddir) +) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom @@ -55,20 +61,19 @@ source_suffix = '.rst' # The encoding of source files. -#source_encoding = 'utf-8-sig' +# source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = 'python-sane' -copyright = '2003-2021, Andrew Kuchling, Ralph Heinkel, Sandro Mani' +copyright = '2003, Andrew Kuchling, Ralph Heinkel, Sandro Mani' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # -import sane # The short X.Y version. version = sane.__version__ # The full version, including alpha/beta/rc tags. @@ -76,13 +81,13 @@ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -#language = None +# language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -#today = '' +# today = '' # Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' +# today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -90,27 +95,27 @@ # The reST default role (used for this markup: `text`) to use for all # documents. -#default_role = None +# default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +# add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -#add_module_names = True +# add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -#show_authors = False +# show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] +# modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False +# keep_warnings = False # -- Options for HTML output ---------------------------------------------- @@ -122,26 +127,26 @@ # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} +# html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] +# html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". -#html_title = None +# html_title = None # A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None +# html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +# html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -#html_favicon = None +# html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, @@ -151,48 +156,48 @@ # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. -#html_extra_path = [] +# html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' +# html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -#html_use_smartypants = True +# html_use_smartypants = True # Custom sidebar templates, maps document names to template names. -#html_sidebars = {} +# html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. -#html_additional_pages = {} +# html_additional_pages = {} # If false, no module index is generated. -#html_domain_indices = True +# html_domain_indices = True # If false, no index is generated. -#html_use_index = True +# html_use_index = True # If true, the index is split into individual pages for each letter. -#html_split_index = False +# html_split_index = False # If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +# html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True +# html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True +# html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -#html_use_opensearch = '' +# html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None +# html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'python-sanedoc' @@ -201,14 +206,14 @@ # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + # 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', + # The font size ('10pt', '11pt' or '12pt'). + # 'pointsize': '10pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # Additional stuff for the LaTeX preamble. + # 'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples @@ -221,23 +226,23 @@ # The name of an image file (relative to this directory) to place at the top of # the title page. -#latex_logo = None +# latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -#latex_use_parts = False +# latex_use_parts = False # If true, show page references after internal links. -#latex_show_pagerefs = False +# latex_show_pagerefs = False # If true, show URL addresses after external links. -#latex_show_urls = False +# latex_show_urls = False # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] # If false, no module index is generated. -#latex_domain_indices = True +# latex_domain_indices = True # -- Options for manual page output --------------------------------------- @@ -250,7 +255,7 @@ ] # If true, show URL addresses after external links. -#man_show_urls = False +# man_show_urls = False # -- Options for Texinfo output ------------------------------------------- @@ -261,18 +266,19 @@ texinfo_documents = [ ('index', 'python-sane', 'python-sane Documentation', 'Andrew Kuchling, Ralph Heinkel, Sandro Mani', 'python-sane', - 'Provides an interface to the SANE scanner and frame grabber interface for Linux', + 'Provides an interface to the SANE scanner and frame grabber interface for' + ' Linux', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. -#texinfo_appendices = [] +# texinfo_appendices = [] # If false, no module index is generated. -#texinfo_domain_indices = True +# texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' +# texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False +# texinfo_no_detailmenu = False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sane-2.9.1/doc/index.rst new/Sane-2.9.2/doc/index.rst --- old/Sane-2.9.1/doc/index.rst 2021-01-05 13:44:54.000000000 +0100 +++ new/Sane-2.9.2/doc/index.rst 2025-07-21 21:05:49.000000000 +0200 @@ -17,6 +17,28 @@ :local: :depth: 1 +Installation +============ + +Basic Installation using pip +---------------------------- +Before you begin, ensure that the libsane-dev package is installed on your system. This is a required dependency. + +On Debian-based system (like Ubuntu), you can install libsane-dev using the apt package manager. + + apt install libsane-dev + +Then install the packages via pip + + pip install python-sane + + +Building from sources +--------------------- + +You can find the instructions on how to build and install from sources in the main README.rst + + Indices ======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sane-2.9.1/example.py new/Sane-2.9.2/example.py --- old/Sane-2.9.1/example.py 2021-01-05 13:44:54.000000000 +0100 +++ new/Sane-2.9.2/example.py 2025-07-21 21:05:49.000000000 +0200 @@ -33,22 +33,26 @@ params = dev.get_parameters() try: dev.depth = depth -except: +except Exception: print('Cannot set depth, defaulting to %d' % params[3]) try: dev.mode = mode -except: +except Exception: print('Cannot set mode, defaulting to %s' % params[0]) try: dev.br_x = 320. dev.br_y = 240. -except: +except Exception: print('Cannot set scan area, using default') params = dev.get_parameters() -print('Device parameters:', params, "\n Resolutions %d, x %d, y %d "%(dev.resolution, dev.x_resolution, dev.y_resolution)) +print( + 'Device parameters:', params, + '\n Resolutions %d, x %d, y %d ' + % (dev.resolution, dev.x_resolution, dev.y_resolution) +) # # Start a scan and get a PIL.Image object @@ -72,7 +76,7 @@ arr = (arr / 255).astype(numpy.uint8) # reshape needed by PIL library -arr=arr.reshape(arr.shape[2],arr.shape[1],arr.shape[0]) +arr = arr.reshape(arr.shape[2], arr.shape[1], arr.shape[0]) if params[0] == 'color': im = Image.frombytes('RGB', arr.shape[1:], arr.tostring(), 'raw', 'RGB', 0, 1) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sane-2.9.1/pyproject.toml new/Sane-2.9.2/pyproject.toml --- old/Sane-2.9.1/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/Sane-2.9.2/pyproject.toml 2025-07-21 21:05:49.000000000 +0200 @@ -0,0 +1,32 @@ +[build-system] +requires = [ + "setuptools>=67.8", +] +build-backend = "setuptools.build_meta" + +[project] +name = "python-sane" +version = "2.9.2" +description = "This is the python-sane package" +readme = "README.rst" +authors = [{name = "Sandro Mani", email = "[email protected]"}] +requires-python = ">=3.8" +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Multimedia :: Graphics", + "Topic :: Multimedia :: Graphics :: Capture :: Scanners", +] +[project.urls] +Homepage = "https://github.com/python-pillow/Sane" + +[tool.setuptools] +py-modules = ["sane"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sane-2.9.1/sane.py new/Sane-2.9.2/sane.py --- old/Sane-2.9.1/sane.py 2021-01-05 13:44:54.000000000 +0100 +++ new/Sane-2.9.2/sane.py 2025-07-21 21:05:49.000000000 +0200 @@ -5,7 +5,7 @@ # of SANE, consult the documentation at the SANE home page: # http://www.sane-project.org/docs.html -__version__ = '2.9.1' +__version__ = '2.9.2' __author__ = ['Andrew Kuchling', 'Ralph Heinkel', 'Sandro Mani'] import _sane @@ -116,7 +116,11 @@ return self def __del__(self): - self.device.cancel() + try: + self.device.cancel() + except Exception: + # In case device was already closed + pass def __next__(self): try: @@ -290,7 +294,7 @@ """ try: from PIL import Image - except: + except ImportError: raise RuntimeError("Cannot import PIL.Image") result = self.dev.snap(no_cancel, False, progress) data, width, height, samples, sampleSize = result @@ -319,7 +323,7 @@ """ try: import numpy - except: + except ImportError: raise RuntimeError("Cannot import numpy") result = self.dev.snap(False, True, progress) data, width, height, samples, sampleSize = result diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sane-2.9.1/setup.py new/Sane-2.9.2/setup.py --- old/Sane-2.9.1/setup.py 2021-01-05 13:44:54.000000000 +0100 +++ new/Sane-2.9.2/setup.py 2025-07-21 21:05:49.000000000 +0200 @@ -1,31 +1,14 @@ -import setuptools +from setuptools import Extension, setup -sane = setuptools.Extension('_sane', - include_dirs=[], - libraries=['sane'], - define_macros=[], - extra_compile_args=[], - sources=['_sane.c']) +ext_modules = [ + Extension( + "_sane", + include_dirs=[], + libraries=["sane"], + define_macros=[], + extra_compile_args=[], + sources=["_sane.c"], + ) +] -setuptools.setup(name='python-sane', - version='2.9.1', - description='This is the python-sane package', - url='https://github.com/python-pillow/Sane', - maintainer='Sandro Mani', - maintainer_email='[email protected]', - packages=setuptools.find_packages(), - classifiers=[ - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: Implementation :: CPython", - "Programming Language :: Python :: Implementation :: PyPy", - "Topic :: Multimedia :: Graphics", - "Topic :: Multimedia :: Graphics :: Capture :: Scanners", - ], - python_requires=">=3.6", - py_modules=['sane'], - ext_modules=[sane]) +setup(ext_modules=ext_modules)
