Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-watchdog for openSUSE:Factory 
checked in at 2021-06-02 22:12:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-watchdog (Old)
 and      /work/SRC/openSUSE:Factory/.python-watchdog.new.1898 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-watchdog"

Wed Jun  2 22:12:04 2021 rev:12 rq:896758 version:2.1.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-watchdog/python-watchdog.changes  
2021-05-17 18:45:56.680463240 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-watchdog.new.1898/python-watchdog.changes    
    2021-06-02 22:12:32.412108592 +0200
@@ -1,0 +2,8 @@
+Tue Jun  1 09:02:44 UTC 2021 - Antonio Larrosa <[email protected]>
+
+- Update to v2.1.2
+  * [mac] Fix relative path handling for non-recursive watch
+  * [windows] On PyPy, events happening right after start() were
+    missed. Add a workaround for that
+
+-------------------------------------------------------------------

Old:
----
  watchdog-2.1.1.tar.gz

New:
----
  watchdog-2.1.2.tar.gz

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

Other differences:
------------------
++++++ python-watchdog.spec ++++++
--- /var/tmp/diff_new_pack.KCdPzO/_old  2021-06-02 22:12:32.808107612 +0200
+++ /var/tmp/diff_new_pack.KCdPzO/_new  2021-06-02 22:12:32.812107603 +0200
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define skip_python2 1
 Name:           python-watchdog
-Version:        2.1.1
+Version:        2.1.2
 Release:        0
 Summary:        Filesystem events monitoring
 License:        Apache-2.0

++++++ watchdog-2.1.1.tar.gz -> watchdog-2.1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/watchdog-2.1.1/PKG-INFO new/watchdog-2.1.2/PKG-INFO
--- old/watchdog-2.1.1/PKG-INFO 2021-05-10 15:41:33.123719200 +0200
+++ new/watchdog-2.1.2/PKG-INFO 2021-05-19 10:12:52.481401000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: watchdog
-Version: 2.1.1
+Version: 2.1.2
 Summary: Filesystem events monitoring
 Home-page: https://github.com/gorakhargosh/watchdog
 Author: Yesudeep Mangalapilly
@@ -316,6 +316,15 @@
         Changelog
         ---------
         
+        2.1.2
+        ~~~~~
+        
+        2021-xx-xx ??? `full history 
<https://github.com/gorakhargosh/watchdog/compare/v2.1.2...v2.1.1>`__
+        
+        - [mac] Fix relative path handling for non-recursive watch. (`#797 
<https://github.com/gorakhargosh/watchdog/pull/797>`_)
+        - [windows] On PyPy, events happening right after ``start()`` were 
missed. Add a workaround for that. (`#796 
<https://github.com/gorakhargosh/watchdog/pull/796>`_)
+        - Thanks to our beloved contributors: @oprypin, @CCP-Aporia, @BoboTiG
+        
         2.1.1
         ~~~~~
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/watchdog-2.1.1/changelog.rst 
new/watchdog-2.1.2/changelog.rst
--- old/watchdog-2.1.1/changelog.rst    2021-05-10 15:41:31.000000000 +0200
+++ new/watchdog-2.1.2/changelog.rst    2021-05-19 10:12:51.000000000 +0200
@@ -3,6 +3,15 @@
 Changelog
 ---------
 
+2.1.2
+~~~~~
+
+2021-xx-xx ??? `full history 
<https://github.com/gorakhargosh/watchdog/compare/v2.1.2...v2.1.1>`__
+
+- [mac] Fix relative path handling for non-recursive watch. (`#797 
<https://github.com/gorakhargosh/watchdog/pull/797>`_)
+- [windows] On PyPy, events happening right after ``start()`` were missed. Add 
a workaround for that. (`#796 
<https://github.com/gorakhargosh/watchdog/pull/796>`_)
+- Thanks to our beloved contributors: @oprypin, @CCP-Aporia, @BoboTiG
+
 2.1.1
 ~~~~~
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/watchdog-2.1.1/docs/source/global.rst.inc 
new/watchdog-2.1.2/docs/source/global.rst.inc
--- old/watchdog-2.1.1/docs/source/global.rst.inc       2021-05-10 
15:41:31.000000000 +0200
+++ new/watchdog-2.1.2/docs/source/global.rst.inc       2021-05-19 
10:12:51.000000000 +0200
@@ -4,7 +4,7 @@
 .. |author_email| replace:: [email protected]
 .. |copyright| replace:: Copyright 2012 Google, Inc & contributors.
 .. |project_name| replace:: ``watchdog``
-.. |project_version| replace:: 2.1.1
+.. |project_version| replace:: 2.1.2
 
 .. _issue tracker: https://github.com/gorakhargosh/watchdog/issues
 .. _code repository: https://github.com/gorakhargosh/watchdog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/watchdog-2.1.1/src/watchdog/observers/fsevents.py 
new/watchdog-2.1.2/src/watchdog/observers/fsevents.py
--- old/watchdog-2.1.1/src/watchdog/observers/fsevents.py       2021-05-10 
15:41:31.000000000 +0200
+++ new/watchdog-2.1.2/src/watchdog/observers/fsevents.py       2021-05-19 
10:12:51.000000000 +0200
@@ -84,6 +84,7 @@
         self._start_time = 0.0
         self._starting_state = None
         self._lock = threading.Lock()
+        self._absolute_watch_path = 
os.path.abspath(os.path.expanduser(self.watch.path))
 
     def on_thread_stop(self):
         _fsevents.remove_watch(self.watch)
@@ -104,14 +105,14 @@
 
     def _is_recursive_event(self, event):
         src_path = event.src_path if event.is_directory else 
os.path.dirname(event.src_path)
-        if src_path == self._watch.path:
+        if src_path == self._absolute_watch_path:
             return False
 
         if isinstance(event, (FileMovedEvent, DirMovedEvent)):
             # when moving something into the watch path we must always take 
the dirname,
             # otherwise we miss out on `DirMovedEvent`s
             dest_path = os.path.dirname(event.dest_path)
-            if dest_path == self._watch.path:
+            if dest_path == self._absolute_watch_path:
                 return False
 
         return True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/watchdog-2.1.1/src/watchdog/observers/read_directory_changes.py 
new/watchdog-2.1.2/src/watchdog/observers/read_directory_changes.py
--- old/watchdog-2.1.1/src/watchdog/observers/read_directory_changes.py 
2021-05-10 15:41:31.000000000 +0200
+++ new/watchdog-2.1.2/src/watchdog/observers/read_directory_changes.py 
2021-05-19 10:12:51.000000000 +0200
@@ -19,6 +19,7 @@
 import threading
 import os.path
 import time
+import platform
 
 from watchdog.events import (
     DirCreatedEvent,
@@ -65,6 +66,12 @@
     def on_thread_start(self):
         self._handle = get_directory_handle(self.watch.path)
 
+    if platform.python_implementation() == 'PyPy':
+        def start(self):
+            """PyPy needs some time before receiving events, see #792."""
+            super().start()
+            time.sleep(0.01)
+
     def on_thread_stop(self):
         if self._handle:
             close_directory_handle(self._handle)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/watchdog-2.1.1/src/watchdog/version.py 
new/watchdog-2.1.2/src/watchdog/version.py
--- old/watchdog-2.1.1/src/watchdog/version.py  2021-05-10 15:41:31.000000000 
+0200
+++ new/watchdog-2.1.2/src/watchdog/version.py  2021-05-19 10:12:51.000000000 
+0200
@@ -20,7 +20,7 @@
 # ``docs/source/global.rst.inc`` file as well.
 VERSION_MAJOR = 2
 VERSION_MINOR = 1
-VERSION_BUILD = 1
+VERSION_BUILD = 2
 VERSION_INFO = (VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD)
 VERSION_STRING = "%d.%d.%d" % VERSION_INFO
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/watchdog-2.1.1/src/watchdog.egg-info/PKG-INFO 
new/watchdog-2.1.2/src/watchdog.egg-info/PKG-INFO
--- old/watchdog-2.1.1/src/watchdog.egg-info/PKG-INFO   2021-05-10 
15:41:32.000000000 +0200
+++ new/watchdog-2.1.2/src/watchdog.egg-info/PKG-INFO   2021-05-19 
10:12:52.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: watchdog
-Version: 2.1.1
+Version: 2.1.2
 Summary: Filesystem events monitoring
 Home-page: https://github.com/gorakhargosh/watchdog
 Author: Yesudeep Mangalapilly
@@ -316,6 +316,15 @@
         Changelog
         ---------
         
+        2.1.2
+        ~~~~~
+        
+        2021-xx-xx ??? `full history 
<https://github.com/gorakhargosh/watchdog/compare/v2.1.2...v2.1.1>`__
+        
+        - [mac] Fix relative path handling for non-recursive watch. (`#797 
<https://github.com/gorakhargosh/watchdog/pull/797>`_)
+        - [windows] On PyPy, events happening right after ``start()`` were 
missed. Add a workaround for that. (`#796 
<https://github.com/gorakhargosh/watchdog/pull/796>`_)
+        - Thanks to our beloved contributors: @oprypin, @CCP-Aporia, @BoboTiG
+        
         2.1.1
         ~~~~~
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/watchdog-2.1.1/tests/test_fsevents.py 
new/watchdog-2.1.2/tests/test_fsevents.py
--- old/watchdog-2.1.1/tests/test_fsevents.py   2021-05-10 15:41:31.000000000 
+0200
+++ new/watchdog-2.1.2/tests/test_fsevents.py   2021-05-19 10:12:51.000000000 
+0200
@@ -46,10 +46,10 @@
     rm(p(""), recursive=True)
 
 
-def start_watching(path=None, use_full_emitter=False):
+def start_watching(path=None, recursive=True, use_full_emitter=False):
     global emitter
     path = p("") if path is None else path
-    emitter = FSEventsEmitter(event_queue, ObservedWatch(path, 
recursive=True), suppress_history=True)
+    emitter = FSEventsEmitter(event_queue, ObservedWatch(path, 
recursive=recursive), suppress_history=True)
     emitter.start()
 
 
@@ -247,6 +247,58 @@
         emitter.stop()
 
 
+def test_recursive_check_accepts_relative_paths():
+    """See https://github.com/gorakhargosh/watchdog/issues/797
+
+    The test code provided in the defect observes the current working directory
+    using ".". Since the watch path wasn't normalized then that failed.
+    This test emulates the scenario.
+    """
+    from watchdog.events import (
+        PatternMatchingEventHandler,
+        FileCreatedEvent,
+        FileModifiedEvent
+    )
+
+    class TestEventHandler(PatternMatchingEventHandler):
+        def __init__(self, *args, **kwargs):
+            super().__init__(*args, **kwargs)
+            # the TestEventHandler instance is set to ignore_directories,
+            # as such we won't get a DirModifiedEvent(p()) here.
+            self.expected_events = [
+                FileCreatedEvent(p('foo.json')),
+                FileModifiedEvent(p('foo.json'))
+            ]
+            self.observed_events = set()
+
+        def on_any_event(self, event):
+            self.expected_events.remove(event)
+            self.observed_events.add(event)
+
+        def done(self):
+            return not self.expected_events
+
+    cwd = os.getcwd()
+    os.chdir(p())
+    event_handler = TestEventHandler(patterns=["*.json"], ignore_patterns=[], 
ignore_directories=True)
+    observer = Observer()
+    observer.schedule(event_handler, ".")
+    observer.start()
+    time.sleep(0.1)
+
+    try:
+        touch(p('foo.json'))
+        timeout_at = time.time() + 5
+        while not event_handler.done() and time.time() < timeout_at:
+            time.sleep(0.1)
+
+        assert event_handler.done()
+    finally:
+        os.chdir(cwd)
+        observer.stop()
+        observer.join()
+
+
 def test_watchdog_recursive():
     """ See https://github.com/gorakhargosh/watchdog/issues/706
     """

Reply via email to