Hello community, here is the log from the commit of package python3-testpath for openSUSE:Factory checked in at 2016-02-08 09:47:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python3-testpath (Old) and /work/SRC/openSUSE:Factory/.python3-testpath.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-testpath" Changes: -------- --- /work/SRC/openSUSE:Factory/python3-testpath/python3-testpath.changes 2016-02-01 19:56:38.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python3-testpath.new/python3-testpath.changes 2016-02-08 09:47:53.000000000 +0100 @@ -1,0 +2,10 @@ +Thu Feb 4 18:28:43 UTC 2016 - [email protected] + +- specfile: + * update copyright year + * LICENSE file is now in tar-ball + +- update to version 0.3: + (no changelog available) + +------------------------------------------------------------------- Old: ---- 0.2.tar.gz LICENSE New: ---- 0.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python3-testpath.spec ++++++ --- /var/tmp/diff_new_pack.sTla06/_old 2016-02-08 09:47:53.000000000 +0100 +++ /var/tmp/diff_new_pack.sTla06/_new 2016-02-08 09:47:53.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package python3-testpath # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2016 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 @@ -17,14 +17,13 @@ Name: python3-testpath -Version: 0.2 +Version: 0.3 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://github.com/jupyter/testpath/archive/%{version}.tar.gz -Source1: https://raw.githubusercontent.com/jupyter/testpath/master/LICENSE BuildRequires: python3 BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch @@ -38,7 +37,6 @@ %prep %setup0 -q -n testpath-%{version} -cp %{SOURCE1} ./ %build # We don't do anything here @@ -50,8 +48,7 @@ %files %defattr(-,root,root,-) -%doc README.rst -%doc LICENSE +%doc README.rst LICENSE %{python3_sitelib}/* %changelog ++++++ 0.2.tar.gz -> 0.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testpath-0.2/LICENSE new/testpath-0.3/LICENSE --- old/testpath-0.2/LICENSE 1970-01-01 01:00:00.000000000 +0100 +++ new/testpath-0.3/LICENSE 2016-02-04 18:26:15.000000000 +0100 @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015, The Jupyter Development Team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testpath-0.2/doc/commands.rst new/testpath-0.3/doc/commands.rst --- old/testpath-0.2/doc/commands.rst 2015-04-01 00:33:28.000000000 +0200 +++ new/testpath-0.3/doc/commands.rst 2016-02-04 18:26:15.000000000 +0100 @@ -15,6 +15,11 @@ check these. Using the :class:`MockCommand` API, you can mock a command to do something else. +.. note:: + + These tools work by changing global state. They're not safe to use if + commands may be called from multiple threads or coroutines. + .. currentmodule:: testpath .. autofunction:: assert_calls diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testpath-0.2/doc/conf.py new/testpath-0.3/doc/conf.py --- old/testpath-0.2/doc/conf.py 2015-04-01 00:33:28.000000000 +0200 +++ new/testpath-0.3/doc/conf.py 2016-02-04 18:26:15.000000000 +0100 @@ -19,7 +19,7 @@ # 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 # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +sys.path.insert(0, os.path.abspath('..')) # -- General configuration ------------------------------------------------ @@ -48,14 +48,14 @@ # General information about the project. project = 'Testpath' -copyright = '2015, Thomas Kluyver' +copyright = '2015, Jupyter Development Team' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = '0.2' +version = '0.3' # The full version, including alpha/beta/rc tags. release = version @@ -201,7 +201,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', 'Testpath.tex', 'Testpath Documentation', - 'Thomas Kluyver', 'manual'), + 'Jupyter Development Team', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -231,7 +231,7 @@ # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'testpath', 'Testpath Documentation', - ['Thomas Kluyver'], 1) + ['Jupyter Development Team'], 1) ] # If true, show URL addresses after external links. @@ -245,7 +245,7 @@ # dir menu entry, description, category) texinfo_documents = [ ('index', 'Testpath', 'Testpath Documentation', - 'Thomas Kluyver', 'Testpath', 'One line description of project.', + 'Jupyter Development Team', 'Testpath', 'One line description of project.', 'Miscellaneous'), ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testpath-0.2/doc/env.rst new/testpath-0.3/doc/env.rst --- old/testpath-0.2/doc/env.rst 2015-04-01 00:33:28.000000000 +0200 +++ new/testpath-0.3/doc/env.rst 2016-02-04 18:26:15.000000000 +0100 @@ -6,8 +6,8 @@ .. currentmodule:: testpath -.. autofunction:: modified_env(changes) +.. autofunction:: modified_env -.. autofunction:: temporary_env(new_env) +.. autofunction:: temporary_env .. autofunction:: make_env_restorer diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testpath-0.2/flit.ini new/testpath-0.3/flit.ini --- old/testpath-0.2/flit.ini 2015-04-01 00:33:28.000000000 +0200 +++ new/testpath-0.3/flit.ini 2016-02-04 18:26:15.000000000 +0100 @@ -1,8 +1,8 @@ [metadata] module=testpath -author=Thomas Kluyver [email protected] -home-page=https://github.com/takluyver/testpath +author=Jupyter Development Team [email protected] +home-page=https://github.com/jupyter/testpath description-file=README.rst classifiers = Intended Audience :: Developers License :: OSI Approved :: MIT License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testpath-0.2/testpath/__init__.py new/testpath-0.3/testpath/__init__.py --- old/testpath-0.2/testpath/__init__.py 2015-04-01 00:33:28.000000000 +0200 +++ new/testpath-0.3/testpath/__init__.py 2016-02-04 18:26:15.000000000 +0100 @@ -3,4 +3,4 @@ from .env import temporary_env, modified_env, make_env_restorer from .commands import MockCommand, assert_calls -__version__ = '0.2' +__version__ = '0.3' Files old/testpath-0.2/testpath/cli-32.exe and new/testpath-0.3/testpath/cli-32.exe differ Files old/testpath-0.2/testpath/cli-64.exe and new/testpath-0.3/testpath/cli-64.exe differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testpath-0.2/testpath/commands.py new/testpath-0.3/testpath/commands.py --- old/testpath-0.2/testpath/commands.py 2015-04-01 00:33:28.000000000 +0200 +++ new/testpath-0.3/testpath/commands.py 2016-02-04 18:26:15.000000000 +0100 @@ -1,11 +1,14 @@ import contextlib import json import os +import shutil import sys import tempfile __all__ = ['MockCommand', 'assert_calls'] +pkgdir = os.path.dirname(__file__) + commands_dir = None recording_dir = None @@ -22,13 +25,12 @@ import os, sys import json -cmd = os.path.basename(__file__) -with open(os.path.join({recording_dir!r}, cmd), 'a') as f: +with open({recording_file!r}, 'a') as f: json.dump({{'env': dict(os.environ), 'argv': sys.argv, 'cwd': os.getcwd()}}, f) - f.write('\x1e') # ASCII record separator + f.write('\\x1e') # ASCII record separator """ # TODO: Overlapping calls to the same command may interleave writes. @@ -47,29 +49,34 @@ use. On Unix, it should start with a shebang (``#!/path/to/interpreter``). """ def __init__(self, name, content=None): + global recording_dir self.name = name self.content = content - - def _write_cmd_file(self): - c = '"{python}" "%~dp0\{pyfile}" %*\r\n' - path = os.path.join(commands_dir, self.name+'.cmd') - with open(path, 'w') as f: - f.write(c.format(python=sys.executable, pyfile=self.name+'.py')) + + if recording_dir is None: + recording_dir = tempfile.mkdtemp() + fd, self.recording_file = tempfile.mkstemp(dir=recording_dir, + prefix=name, suffix='.json') + os.close(fd) + + def _copy_exe(self): + bitness = '32' if (sys.maxsize > 2**32) else '64' + src = os.path.join(pkgdir, 'cli-%s.exe' % bitness) + dst = os.path.join(commands_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) if os.name == 'nt': - p += '.py' + p += '-script.py' return p def __enter__(self): - global commands_dir, recording_dir + global commands_dir if commands_dir is None: commands_dir = tempfile.mkdtemp() - if recording_dir is None: - recording_dir = tempfile.mkdtemp() if os.path.isfile(self._cmd_path): raise EnvironmentError("Command %r already exists at %s" % @@ -80,13 +87,13 @@ if self.content is None: self.content = _record_run.format(python=sys.executable, - recording_dir=recording_dir) + recording_file=self.recording_file) with open(self._cmd_path, 'w') as f: f.write(self.content) if os.name == 'nt': - self._write_cmd_file() + self._copy_exe() else: os.chmod(self._cmd_path, 0o755) # Set executable bit @@ -95,7 +102,7 @@ def __exit__(self, etype, evalue, tb): os.remove(self._cmd_path) if os.name == 'nt': - os.remove(os.path.join(commands_dir, self.name+'.cmd')) + os.remove(os.path.join(commands_dir, self.name+'.exe')) if not os.listdir(commands_dir): remove_from_path(commands_dir) @@ -110,11 +117,10 @@ """ if recording_dir is None: return [] - record_file = os.path.join(recording_dir, self.name) - if not os.path.isfile(record_file): + if not os.path.isfile(self.recording_file): return [] - with open(record_file, 'r') as f: + with open(self.recording_file, 'r') as f: # 1E is ASCII record separator, last chunk is empty chunks = f.read().split('\x1e')[:-1] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testpath-0.2/testpath/tempdir.py new/testpath-0.3/testpath/tempdir.py --- old/testpath-0.2/testpath/tempdir.py 2015-04-01 00:33:28.000000000 +0200 +++ new/testpath-0.3/testpath/tempdir.py 2016-02-04 18:26:15.000000000 +0100 @@ -1,4 +1,7 @@ """TemporaryDirectory class, copied from Python 3 + +NamedFileInTemporaryDirectory and TemporaryWorkingDirectory from IPython, which +uses the 3-clause BSD license. """ from __future__ import print_function diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testpath-0.2/tests/test_asserts.py new/testpath-0.3/tests/test_asserts.py --- old/testpath-0.2/tests/test_asserts.py 2015-04-01 00:33:28.000000000 +0200 +++ new/testpath-0.3/tests/test_asserts.py 2016-02-04 18:26:15.000000000 +0100 @@ -47,6 +47,8 @@ assert_not_isfile(self.file_path) def test_isfile_symlink(self): + if os.name == 'nt': + raise unittest.SkipTest('symlink') assert_isfile(self.link_path) # Follows the link by default assert_not_isfile(self.link_path, follow_symlinks=False) @@ -68,6 +70,8 @@ assert_not_isdir(self.dir_path) def test_islink(self): + if os.name == 'nt': + raise unittest.SkipTest('symlink') assert_islink(self.link_path, to=self.file_path) assert_islink(pathlib.Path(self.link_path), to=pathlib.Path(self.file_path)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/testpath-0.2/tests/test_commands.py new/testpath-0.3/tests/test_commands.py --- old/testpath-0.2/tests/test_commands.py 2015-04-01 00:33:28.000000000 +0200 +++ new/testpath-0.3/tests/test_commands.py 2016-02-04 18:26:15.000000000 +0100 @@ -26,3 +26,11 @@ with assert_calls('cheese', ['crackers']): call(['cheese', 'biscuits']) call(['cheese', 'wine']) + + def test_assert_calls_twice(self): + with assert_calls('git'): + call(['git']) + + with self.assertRaises(AssertionError): + with assert_calls('git'): + pass
