Hello community,

here is the log from the commit of package python-testpath for openSUSE:Factory 
checked in at 2018-10-01 08:18:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-testpath (Old)
 and      /work/SRC/openSUSE:Factory/.python-testpath.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-testpath"

Mon Oct  1 08:18:33 2018 rev:5 rq:638877 version:0.4.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-testpath/python-testpath.changes  
2018-01-20 11:27:18.866683462 +0100
+++ /work/SRC/openSUSE:Factory/.python-testpath.new/python-testpath.changes     
2018-10-01 08:18:36.665922086 +0200
@@ -1,0 +2,22 @@
+Fri Sep 28 02:33:42 UTC 2018 - Todd R <toddrme2...@gmail.com>
+
+- Update to version 0.4.1:
+  * Don't error if we can't clean up command directory
+  * Comment test requirement; bug in flit prevents upload with it
+- Update to version 0.4.0:
+  * Convert dev-requires to 'test' extra requirements
+  * Add doc URL
+  * Convert flit.ini to pyproject.toml
+  * Fix bitness selection for Windows exe
+  * Group related operations together
+  * Ignore pytest cache dir
+  * Separate command dir for each MockCommand
+  * Remove python_requires
+  * Remove x.y classifiers
+  * Add support for Python 3.5-3.6
+  * Drop support for EOL Python 3.3
+  * correct spelling mistake
+  * Document new assertion functions
+  * Add support for named pipes and sockets
+
+-------------------------------------------------------------------

Old:
----
  testpath-0.3.1.tar.gz

New:
----
  testpath-0.4.1.tar.gz

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

Other differences:
------------------
++++++ python-testpath.spec ++++++
--- /var/tmp/diff_new_pack.YiJVGV/_old  2018-10-01 08:18:38.005921231 +0200
+++ /var/tmp/diff_new_pack.YiJVGV/_new  2018-10-01 08:18:38.009921228 +0200
@@ -18,14 +18,14 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-testpath
-Version:        0.3.1
+Version:        0.4.1
 Release:        0
 Summary:        Test utilities for code working with files and commands
 License:        MIT
 Group:          Development/Languages/Python
 Url:            https://github.com/jupyter/testpath
 Source0:        
https://files.pythonhosted.org/packages/source/t/testpath/testpath-%{version}.tar.gz
-BuildRequires:  %{python_module devel}
+BuildRequires:  %{python_module base}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
 BuildArch:      noarch
@@ -49,8 +49,8 @@
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
 %files %{python_files}
-%defattr(-,root,root,-)
-%doc README.rst LICENSE
+%doc README.rst
+%license LICENSE
 %{python_sitelib}/testpath/
 %{python_sitelib}/testpath-%{version}-py*.egg-info
 

++++++ testpath-0.3.1.tar.gz -> testpath-0.4.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/.gitignore 
new/testpath-0.4.1/.gitignore
--- old/testpath-0.3.1/.gitignore       2016-02-04 17:27:50.000000000 +0100
+++ new/testpath-0.4.1/.gitignore       2018-09-27 10:57:47.143087400 +0200
@@ -4,3 +4,4 @@
 /MANIFEST
 /build/
 /dist/
+.pytest_cache/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/.travis.yml 
new/testpath-0.4.1/.travis.yml
--- old/testpath-0.3.1/.travis.yml      2017-05-24 15:35:39.000000000 +0200
+++ new/testpath-0.4.1/.travis.yml      2018-09-26 11:22:07.536054800 +0200
@@ -1,13 +1,14 @@
 language: python
 python:
   - "2.7"
-  - "3.3"
   - "3.4"
+  - "3.5"
+  - "3.6"
 
 # command to run tests
 script: py.test
 
-install: if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]] || [[ $TRAVIS_PYTHON_VERSION 
== 3.3 ]]; then pip install pathlib2; fi
+install: if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install pathlib2; fi
 
 # Enable new Travis stack, should speed up builds
 sudo: false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/PKG-INFO new/testpath-0.4.1/PKG-INFO
--- old/testpath-0.3.1/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
+++ new/testpath-0.4.1/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: testpath
-Version: 0.3.1
+Version: 0.4.1
 Summary: Test utilities for code working with files and commands
 Home-page: https://github.com/jupyter/testpath
 Author: Jupyter Development Team
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/doc/conf.py 
new/testpath-0.4.1/doc/conf.py
--- old/testpath-0.3.1/doc/conf.py      2017-05-24 15:37:19.000000000 +0200
+++ new/testpath-0.4.1/doc/conf.py      2018-09-27 22:16:18.024534000 +0200
@@ -55,7 +55,7 @@
 # built documents.
 #
 # The short X.Y version.
-version = '0.3.1'
+version = '0.4.1'
 # The full version, including alpha/beta/rc tags.
 release = version
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/doc/fsasserts.rst 
new/testpath-0.4.1/doc/fsasserts.rst
--- old/testpath-0.3.1/doc/fsasserts.rst        2016-02-04 17:27:50.000000000 
+0100
+++ new/testpath-0.4.1/doc/fsasserts.rst        2017-08-20 15:36:07.575328400 
+0200
@@ -21,3 +21,20 @@
 .. autofunction:: assert_islink
 
 .. autofunction:: assert_not_islink
+
+Unix specific
+-------------
+
+.. versionadded:: 0.4
+
+These additional functions test for special Unix filesystem objects: named 
pipes
+and Unix domain sockets. The functions can be used on all platforms, but these
+types of objects do not exist on Windows.
+
+.. autofunction:: assert_ispipe
+
+.. autofunction:: assert_not_ispipe
+
+.. autofunction:: assert_issocket
+
+.. autofunction:: assert_not_issocket
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/flit.ini new/testpath-0.4.1/flit.ini
--- old/testpath-0.3.1/flit.ini 2017-05-24 15:36:56.000000000 +0200
+++ new/testpath-0.4.1/flit.ini 1970-01-01 01:00:00.000000000 +0100
@@ -1,13 +0,0 @@
-[metadata]
-module=testpath
-author=Jupyter Development Team
-author-email=jupy...@googlegroups.com
-home-page=https://github.com/jupyter/testpath
-description-file=README.rst
-dev-requires = pathlib2; python_version == "2.7" or python_version == "3.3"
-classifiers = Intended Audience :: Developers
-    License :: OSI Approved :: MIT License
-    Programming Language :: Python
-    Programming Language :: Python :: 2
-    Programming Language :: Python :: 3
-    Topic :: Software Development :: Testing
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/pyproject.toml 
new/testpath-0.4.1/pyproject.toml
--- old/testpath-0.3.1/pyproject.toml   1970-01-01 01:00:00.000000000 +0100
+++ new/testpath-0.4.1/pyproject.toml   2018-09-27 22:16:25.187562500 +0200
@@ -0,0 +1,24 @@
+[build-system]
+requires = ["flit"]
+build-backend = "flit.buildapi"
+
+[tool.flit.metadata]
+module = "testpath"
+author = "Jupyter Development Team"
+author-email = "jupy...@googlegroups.com"
+home-page = "https://github.com/jupyter/testpath";
+description-file = "README.rst"
+classifiers = [
+    "Intended Audience :: Developers",
+    "License :: OSI Approved :: MIT License",
+    "Programming Language :: Python",
+    "Programming Language :: Python :: 2",
+    "Programming Language :: Python :: 3",
+    "Topic :: Software Development :: Testing",
+]
+
+[tool.flit.metadata.requires-extra]
+test = ["pathlib2; python_version == \"2.7\""]
+
+[tool.flit.metadata.urls]
+Documentation = "https://testpath.readthedocs.io/en/latest/";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/setup.py new/testpath-0.4.1/setup.py
--- old/testpath-0.3.1/setup.py 1970-01-01 01:00:00.000000000 +0100
+++ new/testpath-0.4.1/setup.py 1970-01-01 01:00:00.000000000 +0100
@@ -9,12 +9,16 @@
 package_data = \
 {'': ['*']}
 
+extras_require = \
+{':extra == "test" and ( python_version == "2.7")': ['pathlib2']}
+
 setup(name='testpath',
-      version='0.3.1',
+      version='0.4.1',
       description='Test utilities for code working with files and commands',
       author='Jupyter Development Team',
       author_email='jupy...@googlegroups.com',
       url='https://github.com/jupyter/testpath',
       packages=packages,
       package_data=package_data,
+      extras_require=extras_require,
      )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/testpath/__init__.py 
new/testpath-0.4.1/testpath/__init__.py
--- old/testpath-0.3.1/testpath/__init__.py     2017-05-24 15:37:19.000000000 
+0200
+++ new/testpath-0.4.1/testpath/__init__.py     2018-09-27 22:16:14.597520400 
+0200
@@ -3,4 +3,4 @@
 from .env import temporary_env, modified_env, make_env_restorer
 from .commands import MockCommand, assert_calls
 
-__version__ = '0.3.1'
+__version__ = '0.4.1'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/testpath/asserts.py 
new/testpath-0.4.1/testpath/asserts.py
--- old/testpath-0.3.1/testpath/asserts.py      2017-05-24 15:35:39.000000000 
+0200
+++ new/testpath-0.4.1/testpath/asserts.py      2017-08-20 15:25:13.475373700 
+0200
@@ -17,6 +17,8 @@
            'assert_isfile', 'assert_not_isfile',
            'assert_isdir', 'assert_not_isdir',
            'assert_islink', 'assert_not_islink',
+           'assert_ispipe', 'assert_not_ispipe',
+           'assert_issocket', 'assert_not_issocket',
           ]
 
 def _strpath(p):
@@ -137,3 +139,55 @@
         if msg is None:
             msg = "Path is a symlink: %r" % path
         raise AssertionError(msg)
+
+def assert_ispipe(path, follow_symlinks=True, msg=None):
+    """Assert that path exists and is a named pipe (FIFO).
+
+    With follow_symlinks=True, the default, this will pass if path is a symlink
+    to a named pipe. With follow_symlinks=False, it will fail in that case.
+    """
+    path = _strpath(path)
+    st = _stat_for_assert(path, follow_symlinks, msg)
+    if not stat.S_ISFIFO(st.st_mode):
+        if msg is None:
+            msg = "Path exists, but is not a named pipe: %r" % path
+        raise AssertionError(msg)
+
+def assert_not_ispipe(path, follow_symlinks=True, msg=None):
+    """Assert that path exists but is not a named pipe (FIFO).
+
+    With follow_symlinks=True, the default, this will fail if path is a symlink
+    to a named pipe. With follow_symlinks=False, it will pass in that case.
+    """
+    path = _strpath(path)
+    st = _stat_for_assert(path, follow_symlinks, msg)
+    if stat.S_ISFIFO(st.st_mode):
+        if msg is None:
+            msg = "Path is a named pipe: %r" % path
+        raise AssertionError(msg)
+
+def assert_issocket(path, follow_symlinks=True, msg=None):
+    """Assert that path exists and is a Unix domain socket.
+
+    With follow_symlinks=True, the default, this will pass if path is a symlink
+    to a Unix domain socket. With follow_symlinks=False, it will fail in that 
case.
+    """
+    path = _strpath(path)
+    st = _stat_for_assert(path, follow_symlinks, msg)
+    if not stat.S_ISSOCK(st.st_mode):
+        if msg is None:
+            msg = "Path exists, but is not a socket: %r" % path
+        raise AssertionError(msg)
+
+def assert_not_issocket(path, follow_symlinks=True, msg=None):
+    """Assert that path exists but is not a Unix domain socket.
+
+    With follow_symlinks=True, the default, this will fail if path is a symlink
+    to a Unix domain socket. With follow_symlinks=False, it will pass in that 
case.
+    """
+    path = _strpath(path)
+    st = _stat_for_assert(path, follow_symlinks, msg)
+    if stat.S_ISSOCK(st.st_mode):
+        if msg is None:
+            msg = "Path is a socket: %r" % path
+        raise AssertionError(msg)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/testpath/commands.py 
new/testpath-0.4.1/testpath/commands.py
--- old/testpath-0.3.1/testpath/commands.py     2017-05-15 17:52:02.000000000 
+0200
+++ new/testpath-0.4.1/testpath/commands.py     2018-09-27 22:15:03.638236800 
+0200
@@ -9,7 +9,6 @@
 
 pkgdir = os.path.dirname(__file__)
 
-commands_dir = None
 recording_dir = None
 
 def prepend_to_path(dir):
@@ -58,33 +57,27 @@
         fd, self.recording_file = tempfile.mkstemp(dir=recording_dir,
                                                 prefix=name, suffix='.json')
         os.close(fd)
+        self.command_dir = tempfile.mkdtemp()
 
     def _copy_exe(self):
-        bitness = '32' if (sys.maxsize > 2**32) else '64'
+        bitness = '64' if (sys.maxsize > 2**32) else '32'
         src = os.path.join(pkgdir, 'cli-%s.exe' % bitness)
-        dst = os.path.join(commands_dir, self.name+'.exe')
+        dst = os.path.join(self.command_dir, self.name+'.exe')
         shutil.copy(src, dst)
 
     @property
     def _cmd_path(self):
         # Can only be used once commands_dir has been set
-        p = os.path.join(commands_dir, self.name)
+        p = os.path.join(self.command_dir, self.name)
         if os.name == 'nt':
             p += '-script.py'
         return p
 
     def __enter__(self):
-        global commands_dir
-        if commands_dir is None:
-            commands_dir = tempfile.mkdtemp()
-
         if os.path.isfile(self._cmd_path):
             raise EnvironmentError("Command %r already exists at %s" %
                                             (self.name, self._cmd_path))
         
-        if commands_dir not in os.environ['PATH'].split(os.pathsep):
-            prepend_to_path(commands_dir)
-        
         if self.content is None:
             self.content = _record_run.format(python=sys.executable,
                                              
recording_file=self.recording_file)
@@ -96,15 +89,14 @@
             self._copy_exe()
         else:
             os.chmod(self._cmd_path, 0o755) # Set executable bit
-        
+
+        prepend_to_path(self.command_dir)
+
         return self
     
     def __exit__(self, etype, evalue, tb):
-        os.remove(self._cmd_path)
-        if os.name == 'nt':
-            os.remove(os.path.join(commands_dir, self.name+'.exe'))
-        if not os.listdir(commands_dir):
-            remove_from_path(commands_dir)
+        remove_from_path(self.command_dir)
+        shutil.rmtree(self.command_dir, ignore_errors=True)
 
     def get_calls(self):
         """Get a list of calls made to this mocked command.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/testpath/tempdir.py 
new/testpath-0.4.1/testpath/tempdir.py
--- old/testpath-0.3.1/testpath/tempdir.py      2017-05-15 17:52:02.000000000 
+0200
+++ new/testpath-0.4.1/testpath/tempdir.py      2018-09-26 11:22:07.537055000 
+0200
@@ -25,7 +25,7 @@
             with TemporaryDirectory() as tmpdir:
                 ...
 
-        Upon exiting the context, the directory and everthing contained
+        Upon exiting the context, the directory and everything contained
         in it are removed.
         """
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/testpath-0.3.1/tests/test_asserts.py 
new/testpath-0.4.1/tests/test_asserts.py
--- old/testpath-0.3.1/tests/test_asserts.py    2017-05-24 15:35:39.000000000 
+0200
+++ new/testpath-0.4.1/tests/test_asserts.py    2017-08-20 15:25:13.477373800 
+0200
@@ -1,4 +1,5 @@
 import os
+import socket
 import unittest
 
 try:
@@ -23,13 +24,22 @@
         os.mkdir(self.dir_path)
         
         self.link_path = os.path.join(self.td.name, 'alink')
+        self.pipe_path = os.path.join(self.td.name, 'apipe')
+        self.socket_path = os.path.join(self.td.name, 'asocket')
         if os.name == 'posix':
             # Symlinks are rarely usable on Windows, because a special
             # permission is needed to create them.
             os.symlink(self.file_path, self.link_path)
-        
+            os.mkfifo(self.pipe_path)
+            self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+            self.sock.bind(self.socket_path)
+
         self.nonexistant_path = os.path.join(self.td.name, 'doesntexist')
-    
+
+    def tearDown(self):
+        if hasattr(self, 'sock'):
+            self.sock.close()
+
     def test_exists(self):
         assert_path_exists(self.file_path)
         assert_path_exists(pathlib.Path(self.file_path))
@@ -92,3 +102,29 @@
         
         with self.assertRaises(AssertionError):
             assert_not_islink(self.link_path)
+
+    def test_ispipe(self):
+        if os.name == 'nt':
+            raise unittest.SkipTest('pipe')
+
+        assert_ispipe(self.pipe_path)
+        assert_not_ispipe(self.dir_path)
+
+        with self.assertRaises(AssertionError):
+            assert_ispipe(self.dir_path)
+
+        with self.assertRaises(AssertionError):
+            assert_not_ispipe(self.pipe_path)
+
+    def test_issocket(self):
+        if os.name == 'nt':
+            raise unittest.SkipTest('socket')
+
+        assert_issocket(self.socket_path)
+        assert_not_issocket(self.file_path)
+
+        with self.assertRaises(AssertionError):
+            assert_issocket(self.file_path)
+
+        with self.assertRaises(AssertionError):
+            assert_not_issocket(self.socket_path)


Reply via email to