Hello community,

here is the log from the commit of package python-portalocker for 
openSUSE:Factory checked in at 2019-02-15 10:02:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-portalocker (Old)
 and      /work/SRC/openSUSE:Factory/.python-portalocker.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-portalocker"

Fri Feb 15 10:02:12 2019 rev:3 rq:674951 version:1.4.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-portalocker/python-portalocker.changes    
2018-05-29 10:30:03.789404593 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-portalocker.new.28833/python-portalocker.changes
 2019-02-15 10:02:17.895627757 +0100
@@ -1,0 +2,7 @@
+Thu Feb 14 12:13:23 UTC 2019 - Tomáš Chvátal <tchva...@suse.com>
+
+- Update to 1.4.0:
+  * no upstream changelog
+- Drop patch portalocker-1.2.1-old-Sphinx.patch
+
+-------------------------------------------------------------------

Old:
----
  portalocker-1.2.1-old-Sphinx.patch
  portalocker-1.2.1.tar.gz

New:
----
  portalocker-1.4.0.tar.gz

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

Other differences:
------------------
++++++ python-portalocker.spec ++++++
--- /var/tmp/diff_new_pack.dqJhsj/_old  2019-02-15 10:02:18.279627633 +0100
+++ /var/tmp/diff_new_pack.dqJhsj/_new  2019-02-15 10:02:18.283627632 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-portalocker
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,29 +12,25 @@
 # 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/
 #
 
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-portalocker
-Version:        1.2.1
+Version:        1.4.0
 Release:        0
 Summary:        Locking library for Python
 License:        Python-2.0
 Group:          Development/Languages/Python
 URL:            https://github.com/WoLpH/portalocker
 Source:         
https://files.pythonhosted.org/packages/source/p/portalocker/portalocker-%{version}.tar.gz
-Patch0:         portalocker-1.2.1-old-Sphinx.patch
-BuildRequires:  %{python_module setuptools}
+BuildRequires:  %{python_module Sphinx >= 1.7.1}
+BuildRequires:  %{python_module pytest >= 3.4.0}
+BuildRequires:  %{python_module setuptools >= 38.3.0}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 BuildArch:      noarch
-BuildRequires:  %{python_module Sphinx >= 1.6.5}
-BuildRequires:  %{python_module flake8 >= 3.5.0}
-BuildRequires:  %{python_module pytest >= 3.4.0}
-BuildRequires:  %{python_module pytest-cache >= 1.0}
-
 %python_subpackages
 
 %description
@@ -47,7 +43,6 @@
 
 %prep
 %setup -q -n portalocker-%{version}
-%patch0 -p1
 
 %build
 %python_build
@@ -55,9 +50,10 @@
 %install
 %python_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
+%python_expand rm -rf %{buildroot}%{$python_sitelib}/tests/
 
 %check
-%python_exec setup.py test
+%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} 
py.test-%{$python_bin_suffix} tests/t*.py
 
 %files %{python_files}
 %license LICENSE

++++++ portalocker-1.2.1.tar.gz -> portalocker-1.4.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portalocker-1.2.1/PKG-INFO 
new/portalocker-1.4.0/PKG-INFO
--- old/portalocker-1.2.1/PKG-INFO      2018-05-01 15:20:39.000000000 +0200
+++ new/portalocker-1.4.0/PKG-INFO      2019-02-11 13:42:56.000000000 +0100
@@ -1,12 +1,11 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: portalocker
-Version: 1.2.1
+Version: 1.4.0
 Summary: Wraps the portalocker recipe for easy usage
 Home-page: https://github.com/WoLpH/portalocker
 Author: Rick van Hattem
 Author-email: wo...@wol.ph
 License: PSF
-Description-Content-Type: UNKNOWN
 Description: ############################################
         portalocker - Cross-platform locking library
         ############################################
@@ -41,6 +40,21 @@
         The project resides at https://github.com/WoLpH/portalocker . Bugs and 
feature
         requests can be submitted there. Patches are also very welcome.
         
+        Tips
+        ----
+        
+        On some networked filesystems it might be needed to force a 
`os.fsync()` before closing the file so it's actually written before another 
client reads the file. Effectively this comes down to:
+        
+        ::
+            
+           with portalocker.Lock('some_file', 'rb+', timeout=60) as fh:
+               # do what you need to do
+               ...
+               
+               # flush and sync to filesystem
+               fh.flush()
+               os.fsync(fh.fileno())
+        
         Links
         -----
         
@@ -107,3 +121,5 @@
 Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
+Provides-Extra: docs
+Provides-Extra: tests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portalocker-1.2.1/README.rst 
new/portalocker-1.4.0/README.rst
--- old/portalocker-1.2.1/README.rst    2016-09-27 22:37:07.000000000 +0200
+++ new/portalocker-1.4.0/README.rst    2018-12-17 03:08:17.000000000 +0100
@@ -32,6 +32,21 @@
 The project resides at https://github.com/WoLpH/portalocker . Bugs and feature
 requests can be submitted there. Patches are also very welcome.
 
+Tips
+----
+
+On some networked filesystems it might be needed to force a `os.fsync()` 
before closing the file so it's actually written before another client reads 
the file. Effectively this comes down to:
+
+::
+    
+   with portalocker.Lock('some_file', 'rb+', timeout=60) as fh:
+       # do what you need to do
+       ...
+       
+       # flush and sync to filesystem
+       fh.flush()
+       os.fsync(fh.fileno())
+
 Links
 -----
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portalocker-1.2.1/portalocker/__about__.py 
new/portalocker-1.4.0/portalocker/__about__.py
--- old/portalocker-1.2.1/portalocker/__about__.py      2018-05-01 
15:18:30.000000000 +0200
+++ new/portalocker-1.4.0/portalocker/__about__.py      2019-02-11 
13:42:34.000000000 +0100
@@ -1,7 +1,7 @@
 __package_name__ = 'portalocker'
 __author__ = 'Rick van Hattem'
 __email__ = 'wo...@wol.ph'
-__version__ = '1.2.1'
+__version__ = '1.4.0'
 __description__ = '''Wraps the portalocker recipe for easy usage'''
 __url__ = 'https://github.com/WoLpH/portalocker'
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portalocker-1.2.1/portalocker/__init__.py 
new/portalocker-1.4.0/portalocker/__init__.py
--- old/portalocker-1.2.1/portalocker/__init__.py       2018-05-01 
15:18:30.000000000 +0200
+++ new/portalocker-1.4.0/portalocker/__init__.py       2019-02-11 
13:42:34.000000000 +0100
@@ -11,7 +11,7 @@
 #: Current author's email address
 __email__ = __about__.__email__
 #: Version number
-__version__ = '1.2.1'
+__version__ = '1.4.0'
 #: Package description for Pypi
 __description__ = __about__.__description__
 #: Package homepage
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portalocker-1.2.1/portalocker/constants.py 
new/portalocker-1.4.0/portalocker/constants.py
--- old/portalocker-1.2.1/portalocker/constants.py      2018-03-08 
00:11:11.000000000 +0100
+++ new/portalocker-1.4.0/portalocker/constants.py      2018-12-17 
03:06:37.000000000 +0100
@@ -1,3 +1,19 @@
+'''
+Locking constants
+
+Lock types:
+
+- `LOCK_EX` exclusive lock
+- `LOCK_SH` shared lock
+
+Lock flags:
+
+- `LOCK_NB` non-blocking
+
+Manually unlock, only needed internally
+
+- `LOCK_UN` unlock
+'''
 import os
 
 # The actual tests will execute the code anyhow so the following code can
@@ -5,18 +21,18 @@
 if os.name == 'nt':  # pragma: no cover
     import msvcrt
 
-    LOCK_EX = 0x1
-    LOCK_SH = 0x2
-    LOCK_NB = 0x4
-    LOCK_UN = msvcrt.LK_UNLCK
+    LOCK_EX = 0x1  #: exclusive lock
+    LOCK_SH = 0x2  #: shared lock
+    LOCK_NB = 0x4  #: non-blocking
+    LOCK_UN = msvcrt.LK_UNLCK  #: unlock
 
 elif os.name == 'posix':  # pragma: no cover
     import fcntl
 
-    LOCK_EX = fcntl.LOCK_EX
-    LOCK_SH = fcntl.LOCK_SH
-    LOCK_NB = fcntl.LOCK_NB
-    LOCK_UN = fcntl.LOCK_UN
+    LOCK_EX = fcntl.LOCK_EX  #: exclusive lock
+    LOCK_SH = fcntl.LOCK_SH  #: shared lock
+    LOCK_NB = fcntl.LOCK_NB  #: non-blocking
+    LOCK_UN = fcntl.LOCK_UN  #: unlock
 
 else:  # pragma: no cover
     raise RuntimeError('PortaLocker only defined for nt and posix platforms')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portalocker-1.2.1/portalocker/exceptions.py 
new/portalocker-1.4.0/portalocker/exceptions.py
--- old/portalocker-1.2.1/portalocker/exceptions.py     2017-02-06 
15:42:28.000000000 +0100
+++ new/portalocker-1.4.0/portalocker/exceptions.py     2018-12-17 
03:08:17.000000000 +0100
@@ -2,6 +2,10 @@
     # Error codes:
     LOCK_FAILED = 1
 
+    def __init__(self, *args, **kwargs):
+        self.fh = kwargs.pop('fh', None)
+        Exception.__init__(self, *args, **kwargs)
+
 
 class LockException(BaseLockException):
     pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portalocker-1.2.1/portalocker/portalocker.py 
new/portalocker-1.4.0/portalocker/portalocker.py
--- old/portalocker-1.2.1/portalocker/portalocker.py    2018-03-08 
04:18:17.000000000 +0100
+++ new/portalocker-1.4.0/portalocker/portalocker.py    2018-12-17 
03:08:17.000000000 +0100
@@ -41,7 +41,8 @@
                 if exc_value.winerror == winerror.ERROR_LOCK_VIOLATION:
                     raise exceptions.LockException(
                         exceptions.LockException.LOCK_FAILED,
-                        exc_value.strerror)
+                        exc_value.strerror,
+                        fh=file_)
                 else:
                     # Q:  Are there exceptions/codes we should be dealing with
                     # here?
@@ -74,13 +75,15 @@
                     # [ ] be more specific here
                     raise exceptions.LockException(
                         exceptions.LockException.LOCK_FAILED,
-                        exc_value.strerror)
+                        exc_value.strerror,
+                        fh=file_)
                 finally:
                     if savepos:
                         file_.seek(savepos)
             except IOError as exc_value:
                 raise exceptions.LockException(
-                    exceptions.LockException.LOCK_FAILED, exc_value.strerror)
+                    exceptions.LockException.LOCK_FAILED, exc_value.strerror,
+                    fh=file_)
 
     def unlock(file_):
         try:
@@ -110,13 +113,15 @@
                 else:
                     raise exceptions.LockException(
                         exceptions.LockException.LOCK_FAILED,
-                        exc_value.strerror)
+                        exc_value.strerror,
+                        fh=file_)
             finally:
                 if savepos:
                     file_.seek(savepos)
         except IOError as exc_value:
             raise exceptions.LockException(
-                exceptions.LockException.LOCK_FAILED, exc_value.strerror)
+                exceptions.LockException.LOCK_FAILED, exc_value.strerror,
+                fh=file_)
 
 elif os.name == 'posix':  # pragma: no cover
     import fcntl
@@ -133,7 +138,7 @@
         except locking_exceptions as exc_value:
             # The exception code varies on different systems so we'll catch
             # every IO error
-            raise exceptions.LockException(exc_value)
+            raise exceptions.LockException(exc_value, fh=file_)
 
     def unlock(file_):
         fcntl.flock(file_.fileno(), constants.LOCK_UN)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portalocker-1.2.1/portalocker/utils.py 
new/portalocker-1.4.0/portalocker/utils.py
--- old/portalocker-1.2.1/portalocker/utils.py  2018-03-07 19:30:29.000000000 
+0100
+++ new/portalocker-1.4.0/portalocker/utils.py  2019-02-11 13:42:34.000000000 
+0100
@@ -68,7 +68,7 @@
     def __init__(
             self, filename, mode='a', timeout=DEFAULT_TIMEOUT,
             check_interval=DEFAULT_CHECK_INTERVAL, fail_when_locked=False,
-            flags=LOCK_METHOD):
+            flags=LOCK_METHOD, **file_open_kwargs):
         '''Lock manager with build-in timeout
 
         filename -- filename
@@ -79,6 +79,7 @@
         check_interval -- check interval while waiting
         fail_when_locked -- after the initial lock failed, return an error
             or lock the file
+        **file_open_kwargs -- The kwargs for the `open(...)` call
 
         fail_when_locked is useful when multiple threads/processes can race
         when creating a file. If set to true than the system will wait till
@@ -102,6 +103,7 @@
         self.check_interval = check_interval
         self.fail_when_locked = fail_when_locked
         self.flags = flags
+        self.file_open_kwargs = file_open_kwargs
 
     def acquire(
             self, timeout=None, check_interval=None, fail_when_locked=None):
@@ -168,7 +170,7 @@
 
     def _get_fh(self):
         '''Get a new filehandle'''
-        return open(self.filename, self.mode)
+        return open(self.filename, self.mode, **self.file_open_kwargs)
 
     def _get_lock(self, fh):
         '''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portalocker-1.2.1/portalocker.egg-info/PKG-INFO 
new/portalocker-1.4.0/portalocker.egg-info/PKG-INFO
--- old/portalocker-1.2.1/portalocker.egg-info/PKG-INFO 2018-05-01 
15:20:39.000000000 +0200
+++ new/portalocker-1.4.0/portalocker.egg-info/PKG-INFO 2019-02-11 
13:42:56.000000000 +0100
@@ -1,12 +1,11 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
 Name: portalocker
-Version: 1.2.1
+Version: 1.4.0
 Summary: Wraps the portalocker recipe for easy usage
 Home-page: https://github.com/WoLpH/portalocker
 Author: Rick van Hattem
 Author-email: wo...@wol.ph
 License: PSF
-Description-Content-Type: UNKNOWN
 Description: ############################################
         portalocker - Cross-platform locking library
         ############################################
@@ -41,6 +40,21 @@
         The project resides at https://github.com/WoLpH/portalocker . Bugs and 
feature
         requests can be submitted there. Patches are also very welcome.
         
+        Tips
+        ----
+        
+        On some networked filesystems it might be needed to force a 
`os.fsync()` before closing the file so it's actually written before another 
client reads the file. Effectively this comes down to:
+        
+        ::
+            
+           with portalocker.Lock('some_file', 'rb+', timeout=60) as fh:
+               # do what you need to do
+               ...
+               
+               # flush and sync to filesystem
+               fh.flush()
+               os.fsync(fh.fileno())
+        
         Links
         -----
         
@@ -107,3 +121,5 @@
 Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
+Provides-Extra: docs
+Provides-Extra: tests
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portalocker-1.2.1/portalocker.egg-info/SOURCES.txt 
new/portalocker-1.4.0/portalocker.egg-info/SOURCES.txt
--- old/portalocker-1.2.1/portalocker.egg-info/SOURCES.txt      2018-05-01 
15:20:39.000000000 +0200
+++ new/portalocker-1.4.0/portalocker.egg-info/SOURCES.txt      2019-02-11 
13:42:56.000000000 +0100
@@ -14,6 +14,7 @@
 portalocker.egg-info/dependency_links.txt
 portalocker.egg-info/requires.txt
 portalocker.egg-info/top_level.txt
+tests/__init__.py
 tests/conftest.py
 tests/temporary_file_lock.py
 tests/test_combined.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/portalocker-1.2.1/portalocker.egg-info/top_level.txt 
new/portalocker-1.4.0/portalocker.egg-info/top_level.txt
--- old/portalocker-1.2.1/portalocker.egg-info/top_level.txt    2018-05-01 
15:20:39.000000000 +0200
+++ new/portalocker-1.4.0/portalocker.egg-info/top_level.txt    2019-02-11 
13:42:56.000000000 +0100
@@ -1 +1,2 @@
 portalocker
+tests


Reply via email to