Hello community,

here is the log from the commit of package python-pyfuse3 for openSUSE:Factory 
checked in at 2019-10-10 11:53:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pyfuse3 (Old)
 and      /work/SRC/openSUSE:Factory/.python-pyfuse3.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pyfuse3"

Thu Oct 10 11:53:33 2019 rev:4 rq:736804 version:2.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pyfuse3/python-pyfuse3.changes    
2019-07-23 22:37:52.654965189 +0200
+++ /work/SRC/openSUSE:Factory/.python-pyfuse3.new.2352/python-pyfuse3.changes  
2019-10-10 11:53:34.835299686 +0200
@@ -1,0 +2,7 @@
+Thu Oct 10 08:27:37 UTC 2019 - Tomáš Chvátal <[email protected]>
+
+- Update to 2.0.0:
+  * Changed open handler to return the new FileInfo struct to allow
+    for modification of certain kernel file attributes, e.g. direct_io.
+
+-------------------------------------------------------------------

Old:
----
  pyfuse3-1.3.1.tar.gz

New:
----
  pyfuse3-2.0.0.tar.gz

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

Other differences:
------------------
++++++ python-pyfuse3.spec ++++++
--- /var/tmp/diff_new_pack.hIbgeh/_old  2019-10-10 11:53:35.375298253 +0200
+++ /var/tmp/diff_new_pack.hIbgeh/_new  2019-10-10 11:53:35.379298242 +0200
@@ -20,17 +20,17 @@
 %define skip_python2 1
 %define pname   pyfuse3
 Name:           python-%{pname}
-Version:        1.3.1
+Version:        2.0.0
 Release:        0
 Summary:        Python Bindings for the low-level FUSE3 API
 License:        LGPL-2.1-or-later
-Group:          Development/Libraries/Python
 URL:            https://github.com/libfuse/pyfuse3
 Source:         
https://github.com/libfuse/pyfuse3/archive/release-%{version}.tar.gz#/%{pname}-%{version}.tar.gz
 BuildRequires:  %{python_module Cython}
 BuildRequires:  %{python_module contextvars >= 2.1}
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module pytest-trio}
+BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  fuse3-devel >= 3.3.0

++++++ pyfuse3-1.3.1.tar.gz -> pyfuse3-2.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyfuse3-release-1.3.1/Changes.rst 
new/pyfuse3-release-2.0.0/Changes.rst
--- old/pyfuse3-release-1.3.1/Changes.rst       2019-07-17 17:13:16.000000000 
+0200
+++ new/pyfuse3-release-2.0.0/Changes.rst       2019-09-27 20:42:36.000000000 
+0200
@@ -4,6 +4,15 @@
 
 .. currentmodule:: pyfuse3
 
+Release 2.0.0
+=============
+
+* Changed `open` handler to return the new `FileInfo` struct to allow for
+  modification of certain kernel file attributes, e.g. ``direct_io``.
+
+  Note that this change breaks backwards compatibility, code that depends on 
the old
+  behavior needs to be changed.
+
 Release 1.3.1 (2019-07-17)
 ==========================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyfuse3-release-1.3.1/examples/hello.py 
new/pyfuse3-release-2.0.0/examples/hello.py
--- old/pyfuse3-release-1.3.1/examples/hello.py 2019-07-17 17:13:16.000000000 
+0200
+++ new/pyfuse3-release-2.0.0/examples/hello.py 2019-09-27 20:42:36.000000000 
+0200
@@ -100,7 +100,7 @@
             raise pyfuse3.FUSEError(errno.ENOENT)
         if flags & os.O_RDWR or flags & os.O_WRONLY:
             raise pyfuse3.FUSEError(errno.EPERM)
-        return inode
+        return pyfuse3.FileInfo(fh=inode)
 
     async def read(self, fh, off, size):
         assert fh == self.hello_inode
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyfuse3-release-1.3.1/examples/hello_asyncio.py 
new/pyfuse3-release-2.0.0/examples/hello_asyncio.py
--- old/pyfuse3-release-1.3.1/examples/hello_asyncio.py 2019-07-17 
17:13:16.000000000 +0200
+++ new/pyfuse3-release-2.0.0/examples/hello_asyncio.py 2019-09-27 
20:42:36.000000000 +0200
@@ -102,7 +102,7 @@
             raise pyfuse3.FUSEError(errno.ENOENT)
         if flags & os.O_RDWR or flags & os.O_WRONLY:
             raise pyfuse3.FUSEError(errno.EPERM)
-        return inode
+        return pyfuse3.FileInfo(fh=inode)
 
     async def read(self, fh, off, size):
         assert fh == self.hello_inode
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyfuse3-release-1.3.1/examples/passthroughfs.py 
new/pyfuse3-release-2.0.0/examples/passthroughfs.py
--- old/pyfuse3-release-1.3.1/examples/passthroughfs.py 2019-07-17 
17:13:16.000000000 +0200
+++ new/pyfuse3-release-2.0.0/examples/passthroughfs.py 2019-09-27 
20:42:36.000000000 +0200
@@ -378,7 +378,7 @@
         if inode in self._inode_fd_map:
             fd = self._inode_fd_map[inode]
             self._fd_open_count[fd] += 1
-            return fd
+            return pyfuse3.FileInfo(fh=fd)
         assert flags & os.O_CREAT == 0
         try:
             fd = os.open(self._inode_to_path(inode), flags)
@@ -387,7 +387,7 @@
         self._inode_fd_map[inode] = fd
         self._fd_inode_map[fd] = inode
         self._fd_open_count[fd] = 1
-        return fd
+        return pyfuse3.FileInfo(fh=fd)
 
     async def create(self, inode_p, name, mode, flags, ctx):
         path = os.path.join(self._inode_to_path(inode_p), fsdecode(name))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyfuse3-release-1.3.1/examples/tmpfs.py 
new/pyfuse3-release-2.0.0/examples/tmpfs.py
--- old/pyfuse3-release-1.3.1/examples/tmpfs.py 2019-07-17 17:13:16.000000000 
+0200
+++ new/pyfuse3-release-2.0.0/examples/tmpfs.py 2019-09-27 20:42:36.000000000 
+0200
@@ -344,7 +344,7 @@
         self.inode_open_count[inode] += 1
 
         # Use inodes as a file handles
-        return inode
+        return pyfuse3.FileInfo(fh=inode)
 
     async def access(self, inode, mode, ctx):
         # Yeah, could be a function and has unused arguments
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyfuse3-release-1.3.1/rst/data.rst 
new/pyfuse3-release-2.0.0/rst/data.rst
--- old/pyfuse3-release-1.3.1/rst/data.rst      2019-07-17 17:13:16.000000000 
+0200
+++ new/pyfuse3-release-2.0.0/rst/data.rst      2019-09-27 20:42:36.000000000 
+0200
@@ -105,6 +105,26 @@
 
    .. autoattribute:: st_mtime_ns
 
+.. autoclass:: FileInfo
+
+   .. autoattribute:: fh
+
+      This attribute must be set to the file handle to be returned from
+      `Operations.open`.
+
+   .. autoattribute:: direct_io
+
+      If true, signals to the kernel that this file should not be cached
+      or buffered.
+
+   .. autoattribute:: keep_cache
+
+      If true, signals to the kernel that previously cached data for this
+      inode is still valid, and should not be invalidated.
+
+   .. autoattribute:: nonseekable
+
+      If true, indicates that the file does not support seeking.
 
 .. autoclass:: SetattrFields
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyfuse3-release-1.3.1/setup.py 
new/pyfuse3-release-2.0.0/setup.py
--- old/pyfuse3-release-1.3.1/setup.py  2019-07-17 17:13:16.000000000 +0200
+++ new/pyfuse3-release-2.0.0/setup.py  2019-09-27 20:42:36.000000000 +0200
@@ -57,7 +57,7 @@
 # to work properly
 sys.path.insert(0, os.path.join(basedir, 'src'))
 
-PYFUSE3_VERSION = '1.3.1'
+PYFUSE3_VERSION = '2.0.0'
 
 def main():
 
@@ -212,18 +212,22 @@
         self.extensions = self.distribution.ext_modules
 
     def run(self):
-        try:
-            version = subprocess.check_output(['cython', '--version'],
-                                              universal_newlines=True,
-                                              stderr=subprocess.STDOUT)
-        except OSError:
-            raise SystemExit('Cython needs to be installed for this command')
+        cython = None
+        for c in ('cython3', 'cython'):
+            try:
+                version = subprocess.check_output([c, '--version'],
+                                              universal_newlines=True, 
stderr=subprocess.STDOUT)
+                cython = c
+            except FileNotFoundError:
+                pass
+        if cython is None:
+            raise SystemExit('Cython needs to be installed for this command') 
from None
 
         hit = re.match('^Cython version (.+)$', version)
         if not hit or LooseVersion(hit.group(1)) < "0.24":
             raise SystemExit('Need Cython 0.24 or newer, found ' + version)
 
-        cmd = ['cython', '-Wextra', '--force', '-3', '--fast-fail',
+        cmd = [cython, '-Wextra', '--force', '-3', '--fast-fail',
                '--directive', 'embedsignature=True', '--include-dir',
                os.path.join(basedir, 'Include'), '--verbose' ]
         if DEVELOPER_MODE:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyfuse3-release-1.3.1/src/_pyfuse3.py 
new/pyfuse3-release-2.0.0/src/_pyfuse3.py
--- old/pyfuse3-release-1.3.1/src/_pyfuse3.py   2019-07-17 17:13:16.000000000 
+0200
+++ new/pyfuse3-release-2.0.0/src/_pyfuse3.py   2019-09-27 20:42:36.000000000 
+0200
@@ -308,9 +308,11 @@
         :manpage:`open(2)` manpage and defined in the `os` module (with the
         exception of ``O_CREAT``, ``O_EXCL``, ``O_NOCTTY`` and ``O_TRUNC``)
 
-        This method must return an integer file handle. The file handle will be
-        passed to the `read`, `write`, `flush`, `fsync` and `release` methods 
to
-        identify the open file.
+        This method must return a `FileInfo` instance. The `FileInfo.fh` field
+        must contain an integer file handle, which will be passed to the 
`read`,
+        `write`, `flush`, `fsync` and `release` methods to identify the open
+        file. The `FileInfo` instance may also have relevant configuration
+        attributes set; see the `FileInfo` documentation for more information.
         '''
 
         raise FUSEError(errno.ENOSYS)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyfuse3-release-1.3.1/src/handlers.pxi 
new/pyfuse3-release-2.0.0/src/handlers.pxi
--- old/pyfuse3-release-1.3.1/src/handlers.pxi  2019-07-17 17:13:16.000000000 
+0200
+++ new/pyfuse3-release-2.0.0/src/handlers.pxi  2019-09-27 20:42:36.000000000 
+0200
@@ -380,17 +380,16 @@
 
 async def fuse_open_async (_Container c):
     cdef int ret
+    cdef FileInfo res
 
     ctx = get_request_context(c.req)
+
     try:
-        c.fi.fh = await operations.open(c.ino, c.fi.flags, ctx)
+        res = await operations.open(c.ino, c.fi.flags, ctx)
     except FUSEError as e:
         ret = fuse_reply_err(c.req, e.errno)
     else:
-        # Cached file data does not need to be invalidated.
-        # http://article.gmane.org/gmane.comp.file-systems.fuse.devel/5325/
-        c.fi.keep_cache = 1
-
+        res._copy_to_fuse(&c.fi)
         ret = fuse_reply_open(c.req, &c.fi)
 
     if ret != 0:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyfuse3-release-1.3.1/src/pyfuse3.pyx 
new/pyfuse3-release-2.0.0/src/pyfuse3.pyx
--- old/pyfuse3-release-1.3.1/src/pyfuse3.pyx   2019-07-17 17:13:16.000000000 
+0200
+++ new/pyfuse3-release-2.0.0/src/pyfuse3.pyx   2019-09-27 20:42:36.000000000 
+0200
@@ -344,6 +344,46 @@
             setattr(self, k, v)
 
 
[email protected](10)
+cdef class FileInfo:
+    '''
+    Instances of this class store options and data that `Operations.open`
+    returns. The attributes correspond to the elements of the 
``fuse_file_info``
+    struct that are relevant to the `Operations.open` function.
+    '''
+
+    cdef public uint64_t fh
+    cdef public bint direct_io
+    cdef public bint keep_cache
+    cdef public bint nonseekable
+
+    def __cinit__(self, fh=0, direct_io=0, keep_cache=1, nonseekable=0):
+        self.fh = fh
+        self.direct_io = direct_io
+        self.keep_cache = keep_cache
+        self.nonseekable = nonseekable
+
+    cdef _copy_to_fuse(self, fuse_file_info *out):
+        out.fh = self.fh
+
+        # Due to how Cython generates its C code, GCC will complain about
+        # assigning to the bitfields in the fuse_file_info struct.
+        # This is the workaround.
+        if self.direct_io:
+            out.direct_io = 1
+        else:
+            out.direct_io = 0
+
+        if self.keep_cache:
+            out.keep_cache = 1
+        else:
+            out.keep_cache = 0
+
+        if self.nonseekable:
+            out.nonseekable = 1
+        else:
+            out.nonseekable = 0
+
 @cython.freelist(1)
 cdef class StatvfsData:
     '''
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pyfuse3-release-1.3.1/test/test_fs.py 
new/pyfuse3-release-2.0.0/test/test_fs.py
--- old/pyfuse3-release-1.3.1/test/test_fs.py   2019-07-17 17:13:16.000000000 
+0200
+++ new/pyfuse3-release-2.0.0/test/test_fs.py   2019-09-27 20:42:36.000000000 
+0200
@@ -199,7 +199,7 @@
             raise pyfuse3.FUSEError(errno.ENOENT)
         if flags & os.O_RDWR or flags & os.O_WRONLY:
             raise pyfuse3.FUSEError(errno.EPERM)
-        return inode
+        return pyfuse3.FileInfo(fh=inode)
 
     async def read(self, fh, off, size):
         assert fh == self.hello_inode


Reply via email to