Hello community,
here is the log from the commit of package python-filelock for openSUSE:Factory
checked in at 2019-03-29 20:34:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-filelock (Old)
and /work/SRC/openSUSE:Factory/.python-filelock.new.25356 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-filelock"
Fri Mar 29 20:34:05 2019 rev:2 rq:684351 version:3.0.10
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-filelock/python-filelock.changes
2018-08-03 12:37:20.867573667 +0200
+++
/work/SRC/openSUSE:Factory/.python-filelock.new.25356/python-filelock.changes
2019-03-29 20:34:06.770630433 +0100
@@ -1,0 +2,6 @@
+Tue Mar 12 15:13:39 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 3.0.10:
+ * No upstream changelog
+
+-------------------------------------------------------------------
Old:
----
v3.0.4.tar.gz
New:
----
v3.0.10.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-filelock.spec ++++++
--- /var/tmp/diff_new_pack.uDNug4/_old 2019-03-29 20:34:07.658630487 +0100
+++ /var/tmp/diff_new_pack.uDNug4/_new 2019-03-29 20:34:07.662630488 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-filelock
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2018 Matthias Fehring <[email protected]>
#
# All modifications and additions to the file contributed by third parties
@@ -13,19 +13,20 @@
# 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-filelock
-Version: 3.0.4
+Version: 3.0.10
Release: 0
Summary: Platform Independent File Lock in Python
License: Unlicense
Group: Development/Languages/Python
URL: https://github.com/benediktschmitt/py-filelock
Source:
https://github.com/benediktschmitt/py-filelock/archive/v%{version}.tar.gz
+BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -48,8 +49,7 @@
%python_expand %fdupes -s %{buildroot}/%{$python_sitelib}
%check
-# test will not work on python2 wrong exceptions
-python3 test.py
+%pytest test.py
%files %{python_files}
%doc README.rst
++++++ v3.0.4.tar.gz -> v3.0.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/py-filelock-3.0.4/.travis.yml
new/py-filelock-3.0.10/.travis.yml
--- old/py-filelock-3.0.4/.travis.yml 1970-01-01 01:00:00.000000000 +0100
+++ new/py-filelock-3.0.10/.travis.yml 2018-11-01 18:15:32.000000000 +0100
@@ -0,0 +1,25 @@
+language: python
+
+cache: pip
+
+matrix:
+ fast_finish: true
+ include:
+ - python: "2.7"
+ - python: "3.4"
+ - python: "3.5"
+ - python: "3.6"
+ - python: "3.7"
+ sudo: required
+ dist: xenial
+ - python: "3.8-dev"
+ sudo: required
+ dist: xenial
+ allow_failures:
+ - python: "3.8-dev"
+
+install:
+ - pip install -e .
+
+script:
+ - pytest -xvv test.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/py-filelock-3.0.4/README.rst
new/py-filelock-3.0.10/README.rst
--- old/py-filelock-3.0.4/README.rst 2018-02-01 11:59:11.000000000 +0100
+++ new/py-filelock-3.0.10/README.rst 2018-11-01 18:15:32.000000000 +0100
@@ -1,11 +1,8 @@
py-filelock
===========
-`Similar Libraries <#similar-libraries>`_
-~ `Installation <#installation>`_
-~ `Documentation <#documentation>`_
-~ `Contributions <#contributions>`_
-~ `License <#license>`_
+.. image:: https://travis-ci.org/benediktschmitt/py-filelock.svg?branch=master
+ :target: https://travis-ci.org/benediktschmitt/py-filelock
This package contains a single module, which implements a platform independent
file lock in Python, which provides a simple way of inter-process
communication:
@@ -96,7 +93,7 @@
def cite1():
with lock:
- open(file_path, "a").write("I hat it when he does that.")
+ open(file_path, "a").write("I hate it when he does that.")
def cite2():
with lock:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/py-filelock-3.0.4/docs/source/conf.py
new/py-filelock-3.0.10/docs/source/conf.py
--- old/py-filelock-3.0.4/docs/source/conf.py 2018-02-01 11:59:11.000000000
+0100
+++ new/py-filelock-3.0.10/docs/source/conf.py 2018-11-01 18:15:32.000000000
+0100
@@ -15,6 +15,7 @@
import sys
import os
+import alabaster
# 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
@@ -115,7 +116,7 @@
#html_theme_options = {}
# Add any paths that contain custom themes here, relative to this directory.
-#html_theme_path = []
+html_theme_path = [alabaster.get_path()]
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/py-filelock-3.0.4/filelock.py
new/py-filelock-3.0.10/filelock.py
--- old/py-filelock-3.0.4/filelock.py 2018-02-01 11:59:11.000000000 +0100
+++ new/py-filelock-3.0.10/filelock.py 2018-11-01 18:15:32.000000000 +0100
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
@@ -71,7 +69,7 @@
"FileLock"
]
-__version__ = "3.0.4"
+__version__ = "3.0.10"
_logger = None
@@ -105,6 +103,29 @@
# Classes
# ------------------------------------------------
+
+# This is a helper class which is returned by :meth:`BaseFileLock.acquire`
+# and wraps the lock to make sure __enter__ is not called twice when entering
+# the with statement.
+# If we would simply return *self*, the lock would be acquired again
+# in the *__enter__* method of the BaseFileLock, but not released again
+# automatically.
+#
+# :seealso: issue #37 (memory leak)
+class _Acquire_ReturnProxy(object):
+
+ def __init__(self, lock):
+ self.lock = lock
+ return None
+
+ def __enter__(self):
+ return self.lock
+
+ def __exit__(self, exc_type, exc_value, traceback):
+ self.lock.release()
+ return None
+
+
class BaseFileLock(object):
"""
Implements the base class of a file lock.
@@ -239,12 +260,11 @@
with self._thread_lock:
self._lock_counter += 1
+ lock_id = id(self)
+ lock_filename = self._lock_file
+ start_time = time.time()
try:
- start_time = time.time()
while True:
- lock_id = id(self)
- lock_filename = self._lock_file
-
with self._thread_lock:
if not self.is_locked:
logger().debug('Attempting to acquire lock %s on %s',
lock_id, lock_filename)
@@ -268,26 +288,7 @@
self._lock_counter = max(0, self._lock_counter - 1)
raise
-
- # This class wraps the lock to make sure __enter__ is not called
- # twiced when entering the with statement.
- # If we would simply return *self*, the lock would be acquired again
- # in the *__enter__* method of the BaseFileLock, but not released again
- # automatically.
- class ReturnProxy(object):
-
- def __init__(self, lock):
- self.lock = lock
- return None
-
- def __enter__(self):
- return self.lock
-
- def __exit__(self, exc_type, exc_value, traceback):
- self.lock.release()
- return None
-
- return ReturnProxy(lock = self)
+ return _Acquire_ReturnProxy(lock = self)
def release(self, force = False):
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/py-filelock-3.0.4/setup.py
new/py-filelock-3.0.10/setup.py
--- old/py-filelock-3.0.4/setup.py 2018-02-01 11:59:11.000000000 +0100
+++ new/py-filelock-3.0.10/setup.py 2018-11-01 18:15:32.000000000 +0100
@@ -28,7 +28,7 @@
# Modules
# ------------------------------------------------
-from distutils.core import setup
+from setuptools import setup
from filelock import __version__
# Main
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/py-filelock-3.0.4/test.py
new/py-filelock-3.0.10/test.py
--- old/py-filelock-3.0.4/test.py 2018-02-01 11:59:11.000000000 +0100
+++ new/py-filelock-3.0.10/test.py 2018-11-01 18:15:32.000000000 +0100
@@ -34,6 +34,7 @@
import sys
import unittest
import threading
+import errno
import filelock
@@ -82,16 +83,20 @@
"""Deletes the potential lock file at :attr:`LOCK_PATH`."""
try:
os.remove(self.LOCK_PATH)
- except FileNotFoundError:
- pass
+ except OSError as e:
+ # FileNotFound
+ if e.errno != errno.ENOENT:
+ raise
return None
def tearDown(self):
"""Deletes the potential lock file at :attr:`LOCK_PATH`."""
try:
os.remove(self.LOCK_PATH)
- except OSError:
- pass
+ except OSError as e:
+ # FileNotFound
+ if e.errno != errno.ENOENT:
+ raise
return None
def test_simple(self):