Hello community, here is the log from the commit of package python-scandir for openSUSE:Factory checked in at 2018-11-14 14:40:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-scandir (Old) and /work/SRC/openSUSE:Factory/.python-scandir.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-scandir" Wed Nov 14 14:40:33 2018 rev:5 rq:645884 version:1.9.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-scandir/python-scandir.changes 2018-04-24 15:34:07.444062957 +0200 +++ /work/SRC/openSUSE:Factory/.python-scandir.new/python-scandir.changes 2018-11-14 14:40:59.226853316 +0100 @@ -1,0 +2,8 @@ +Thu Nov 1 09:54:50 UTC 2018 - Tomáš Chvátal <tchva...@suse.com> + +- Update to 1.9.0: + * Mark C extension as optional for things like Jython. See #105. + * Fix build on Python 2.7 (#107). Fix dirent struct alignment on OpenBSD (#109). +- Do not build on python 3.5+ as it is part of the base + +------------------------------------------------------------------- Old: ---- scandir-1.7.tar.gz New: ---- scandir-1.9.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-scandir.spec ++++++ --- /var/tmp/diff_new_pack.BJAsoZ/_old 2018-11-14 14:41:00.938851290 +0100 +++ /var/tmp/diff_new_pack.BJAsoZ/_new 2018-11-14 14:41:00.938851290 +0100 @@ -12,14 +12,16 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # +%if %{python3_version_nodots} > 34 +%define skip_python3 1 +%endif %{?!python_module:%define python_module() python-%{**} python3-%{**}} -%bcond_without test Name: python-scandir -Version: 1.7 +Version: 1.9.0 Release: 0 Summary: Scandir, a better directory iterator and faster oswalk License: BSD-3-Clause @@ -78,11 +80,9 @@ %python_install %python_expand %fdupes -s %{buildroot}%{$python_sitearch} -%if %{with test} %check export LANG=en_US.UTF-8 %python_expand PYTHONPATH=%{buildroot}%{$python_sitearch} $python test/run_tests.py -%endif %files %{python_files} %license LICENSE.txt ++++++ scandir-1.7.tar.gz -> scandir-1.9.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scandir-1.7/PKG-INFO new/scandir-1.9.0/PKG-INFO --- old/scandir-1.7/PKG-INFO 2018-02-12 22:00:05.000000000 +0100 +++ new/scandir-1.9.0/PKG-INFO 2018-08-10 15:22:47.000000000 +0200 @@ -1,11 +1,12 @@ Metadata-Version: 1.1 Name: scandir -Version: 1.7 +Version: 1.9.0 Summary: scandir, a better directory iterator and faster os.walk() Home-page: https://github.com/benhoyt/scandir Author: Ben Hoyt Author-email: benh...@gmail.com License: New BSD License +Description-Content-Type: UNKNOWN Description: scandir, a better directory iterator and faster os.walk() ========================================================= @@ -41,7 +42,9 @@ immediately, otherwise just `download this module from PyPI <https://pypi.python.org/pypi/scandir>`_, install it with ``pip install scandir``, and then do something like - this in your code:: + this in your code: + + .. code-block:: python # Use the built-in version of scandir/walk if possible, otherwise # use the scandir module version @@ -178,7 +181,9 @@ is cached on the ``DirEntry`` object Here's a very simple example of ``scandir()`` showing use of the - ``DirEntry.name`` attribute and the ``DirEntry.is_dir()`` method:: + ``DirEntry.name`` attribute and the ``DirEntry.is_dir()`` method: + + .. code-block:: python def subdirs(path): """Yield directory names not starting with '.' under given path.""" @@ -227,7 +232,6 @@ Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scandir-1.7/README.rst new/scandir-1.9.0/README.rst --- old/scandir-1.7/README.rst 2017-09-28 14:59:27.000000000 +0200 +++ new/scandir-1.9.0/README.rst 2018-05-29 15:50:21.000000000 +0200 @@ -33,7 +33,9 @@ immediately, otherwise just `download this module from PyPI <https://pypi.python.org/pypi/scandir>`_, install it with ``pip install scandir``, and then do something like -this in your code:: +this in your code: + +.. code-block:: python # Use the built-in version of scandir/walk if possible, otherwise # use the scandir module version @@ -170,7 +172,9 @@ is cached on the ``DirEntry`` object Here's a very simple example of ``scandir()`` showing use of the -``DirEntry.name`` attribute and the ``DirEntry.is_dir()`` method:: +``DirEntry.name`` attribute and the ``DirEntry.is_dir()`` method: + +.. code-block:: python def subdirs(path): """Yield directory names not starting with '.' under given path.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scandir-1.7/_scandir.c new/scandir-1.9.0/_scandir.c --- old/scandir-1.7/_scandir.c 2018-02-12 21:54:37.000000000 +0100 +++ new/scandir-1.9.0/_scandir.c 2018-08-02 18:17:16.000000000 +0200 @@ -48,6 +48,11 @@ PyUnicode_AsUnicode(unicode); *(addr_length) = PyUnicode_GetSize(unicode) #endif +// Because on PyPy not working without +#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 2 && defined(PYPY_VERSION_NUM) +#define _Py_IDENTIFIER(name) static char * PyId_##name = #name; +#define _PyObject_GetAttrId(obj, pyid_name) PyObject_GetAttrString((obj), *(pyid_name)) +#endif /* SECTION: Helper utilities from posixmodule.c, fileutils.h, etc */ @@ -88,7 +93,8 @@ #endif // _Py_stat_struct is already defined in fileutils.h on Python 3.5+ -#if PY_MAJOR_VERSION < 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 5) +// But not in PyPy +#if PY_MAJOR_VERSION < 3 || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 5) || defined(PYPY_VERSION_NUM) #ifdef MS_WINDOWS struct _Py_stat_struct { unsigned long st_dev; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scandir-1.7/scandir.egg-info/PKG-INFO new/scandir-1.9.0/scandir.egg-info/PKG-INFO --- old/scandir-1.7/scandir.egg-info/PKG-INFO 2018-02-12 22:00:05.000000000 +0100 +++ new/scandir-1.9.0/scandir.egg-info/PKG-INFO 2018-08-10 15:22:47.000000000 +0200 @@ -1,11 +1,12 @@ Metadata-Version: 1.1 Name: scandir -Version: 1.7 +Version: 1.9.0 Summary: scandir, a better directory iterator and faster os.walk() Home-page: https://github.com/benhoyt/scandir Author: Ben Hoyt Author-email: benh...@gmail.com License: New BSD License +Description-Content-Type: UNKNOWN Description: scandir, a better directory iterator and faster os.walk() ========================================================= @@ -41,7 +42,9 @@ immediately, otherwise just `download this module from PyPI <https://pypi.python.org/pypi/scandir>`_, install it with ``pip install scandir``, and then do something like - this in your code:: + this in your code: + + .. code-block:: python # Use the built-in version of scandir/walk if possible, otherwise # use the scandir module version @@ -178,7 +181,9 @@ is cached on the ``DirEntry`` object Here's a very simple example of ``scandir()`` showing use of the - ``DirEntry.name`` attribute and the ``DirEntry.is_dir()`` method:: + ``DirEntry.name`` attribute and the ``DirEntry.is_dir()`` method: + + .. code-block:: python def subdirs(path): """Yield directory names not starting with '.' under given path.""" @@ -227,7 +232,6 @@ Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scandir-1.7/scandir.py new/scandir-1.9.0/scandir.py --- old/scandir-1.7/scandir.py 2018-02-12 21:54:46.000000000 +0100 +++ new/scandir-1.9.0/scandir.py 2018-08-10 15:21:31.000000000 +0200 @@ -23,7 +23,6 @@ from os.path import join, islink from stat import S_IFDIR, S_IFLNK, S_IFREG import collections -import os import sys try: @@ -41,7 +40,7 @@ warnings.warn("scandir can't find the compiled _scandir C module " "or ctypes, using slow generic fallback") -__version__ = '1.7' +__version__ = '1.9.0' __all__ = ['scandir', 'walk'] # Windows FILE_ATTRIBUTE constants for interpreting the @@ -96,6 +95,10 @@ self._lstat = lstat(self.path) return self._lstat + # The code duplication below is intentional: this is for slightly + # better performance on systems that fall back to GenericDirEntry. + # It avoids an additional attribute lookup and method call, which + # are relatively slow on CPython. def is_dir(self, follow_symlinks=True): try: st = self.stat(follow_symlinks=follow_symlinks) @@ -419,6 +422,16 @@ ('d_type', ctypes.c_byte), ('d_name', ctypes.c_char * 256), ) + elif 'openbsd' in sys.platform: + _fields_ = ( + ('d_ino', ctypes.c_uint64), + ('d_off', ctypes.c_uint64), + ('d_reclen', ctypes.c_uint16), + ('d_type', ctypes.c_uint8), + ('d_namlen', ctypes.c_uint8), + ('__d_padding', ctypes.c_uint8 * 4), + ('d_name', ctypes.c_char * 256), + ) else: _fields_ = ( ('d_ino', ctypes.c_uint32), # must be uint32, not ulong diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scandir-1.7/setup.cfg new/scandir-1.9.0/setup.cfg --- old/scandir-1.7/setup.cfg 2018-02-12 22:00:05.000000000 +0100 +++ new/scandir-1.9.0/setup.cfg 2018-08-10 15:22:47.000000000 +0200 @@ -1,5 +1,4 @@ [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scandir-1.7/setup.py new/scandir-1.9.0/setup.py --- old/scandir-1.7/setup.py 2017-09-29 14:30:15.000000000 +0200 +++ new/scandir-1.9.0/setup.py 2018-08-10 15:21:31.000000000 +0200 @@ -2,10 +2,20 @@ try: from setuptools import setup, Extension + from setuptools.command.build_ext import build_ext as base_build_ext except ImportError: + import warnings + import sys + val = sys.exc_info()[1] + + warnings.warn("import of setuptools failed %r" % val) from distutils.core import setup, Extension + from distutils.command.build_ext import build_ext as base_build_ext + import os import re +import sys +import logging # Get version without importing scandir because that will lock the # .pyd file (if scandir is already installed) so it can't be @@ -22,6 +32,22 @@ with open('README.rst') as f: long_description = f.read() + +class BuildExt(base_build_ext): + + # the extension is optional since in case of lack of c the api + # there is a ctypes fallback and a slow python fallback + + def build_extension(self, ext): + try: + base_build_ext.build_extension(self, ext) + except Exception: + exception = sys.exc_info()[0] + logging.warn("building the %s failed with %s", ext.name, exception) + +extension = Extension('_scandir', ['_scandir.c'], optional=True) + + setup( name='scandir', version=version, @@ -32,7 +58,7 @@ description='scandir, a better directory iterator and faster os.walk()', long_description=long_description, py_modules=['scandir'], - ext_modules=[Extension('_scandir', ['_scandir.c'])], + ext_modules=[extension], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', @@ -46,10 +72,9 @@ 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: Implementation :: CPython', - ] + ], cmdclass={'build_ext': BuildExt}, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scandir-1.7/test/run_tests.py new/scandir-1.9.0/test/run_tests.py --- old/scandir-1.7/test/run_tests.py 2016-08-26 14:42:09.000000000 +0200 +++ new/scandir-1.9.0/test/run_tests.py 2018-05-29 15:50:21.000000000 +0200 @@ -3,7 +3,11 @@ import glob import os import sys -import unittest + +if sys.version_info[:2] < (2, 7): + import unittest2 as unittest +else: + import unittest def main(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scandir-1.7/test/test_scandir.py new/scandir-1.9.0/test/test_scandir.py --- old/scandir-1.7/test/test_scandir.py 2018-02-12 21:54:37.000000000 +0100 +++ new/scandir-1.9.0/test/test_scandir.py 2018-05-29 15:50:21.000000000 +0200 @@ -6,7 +6,11 @@ import shutil import sys import time -import unittest + +if sys.version_info[:2] < (2, 7): + import unittest2 as unittest +else: + import unittest try: import scandir diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/scandir-1.7/test/test_walk.py new/scandir-1.9.0/test/test_walk.py --- old/scandir-1.7/test/test_walk.py 2016-08-26 14:42:09.000000000 +0200 +++ new/scandir-1.9.0/test/test_walk.py 2018-05-29 15:50:21.000000000 +0200 @@ -3,7 +3,11 @@ import os import shutil import sys -import unittest + +if sys.version_info[:2] < (2, 7): + import unittest2 as unittest +else: + import unittest import scandir