Hello community,
here is the log from the commit of package python-pyfakefs for openSUSE:Factory
checked in at 2019-01-24 14:10:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pyfakefs (Old)
and /work/SRC/openSUSE:Factory/.python-pyfakefs.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyfakefs"
Thu Jan 24 14:10:07 2019 rev:6 rq:665654 version:3.5.6
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pyfakefs/python-pyfakefs.changes
2018-12-24 11:47:18.537138201 +0100
+++
/work/SRC/openSUSE:Factory/.python-pyfakefs.new.28833/python-pyfakefs.changes
2019-01-24 14:10:09.271587947 +0100
@@ -1,0 +2,11 @@
+Mon Jan 14 08:32:56 UTC 2019 - Karol Babioch <[email protected]>
+
+- Removed unit tests from package
+
+-------------------------------------------------------------------
+Sun Jan 13 17:26:44 UTC 2019 - Karol Babioch <[email protected]>
+
+- Update to version 3.5.6
+ * import external pathlib2 and scandir packages first if present
+
+-------------------------------------------------------------------
Old:
----
python-pyfakefs-3.5.5.tar.gz
New:
----
python-pyfakefs-3.5.6.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pyfakefs.spec ++++++
--- /var/tmp/diff_new_pack.m78uYL/_old 2019-01-24 14:10:09.863587265 +0100
+++ /var/tmp/diff_new_pack.m78uYL/_new 2019-01-24 14:10:09.863587265 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-pyfakefs
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 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
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pyfakefs
-Version: 3.5.5
+Version: 3.5.6
Release: 0
Summary: Fake file system that mocks the Python file system modules
License: Apache-2.0
@@ -53,6 +53,7 @@
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%python_expand rm -rf %{buildroot}%{$python_sitelib}/pyfakefs/tests/
%check
export LANG=C.UTF-8
++++++ python-pyfakefs-3.5.5.tar.gz -> python-pyfakefs-3.5.6.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyfakefs-3.5.5/CHANGES.md
new/pyfakefs-3.5.6/CHANGES.md
--- old/pyfakefs-3.5.5/CHANGES.md 2018-12-20 19:06:46.000000000 +0100
+++ new/pyfakefs-3.5.6/CHANGES.md 2019-01-13 14:18:48.000000000 +0100
@@ -1,6 +1,12 @@
# pyfakefs Release Notes
The release versions are PyPi releases.
+## [Version 3.5.6](https://pypi.python.org/pypi/pyfakefs/3.5.6)
+
+#### Changes
+ * import external `pathlib2` and `scandir` packages first if present
+ (see [#462](../../issues/462))
+
## [Version 3.5.5](https://pypi.python.org/pypi/pyfakefs/3.5.5)
#### Fixes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyfakefs-3.5.5/docs/conf.py
new/pyfakefs-3.5.6/docs/conf.py
--- old/pyfakefs-3.5.5/docs/conf.py 2018-12-20 19:06:46.000000000 +0100
+++ new/pyfakefs-3.5.6/docs/conf.py 2019-01-13 14:18:48.000000000 +0100
@@ -58,7 +58,7 @@
project = 'pyfakefs'
copyright = '''2009 Google Inc. All Rights Reserved.
© Copyright 2014 Altera Corporation. All Rights Reserved.
-© Copyright 2014-2018 John McGehee'''
+© Copyright 2014-2019 John McGehee'''
author = 'John McGehee'
# The version info for the project you're documenting, acts as replacement for
@@ -66,9 +66,9 @@
# built documents.
#
# The short X.Y version.
-version = '3.5.5'
+version = '3.5.6'
# The full version, including alpha/beta/rc tags.
-release = '3.5.5'
+release = '3.5.6'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyfakefs-3.5.5/pyfakefs/extra_packages.py
new/pyfakefs-3.5.6/pyfakefs/extra_packages.py
--- old/pyfakefs-3.5.5/pyfakefs/extra_packages.py 2018-12-20
19:06:46.000000000 +0100
+++ new/pyfakefs-3.5.6/pyfakefs/extra_packages.py 2019-01-13
14:18:48.000000000 +0100
@@ -1,24 +1,47 @@
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Imports external packages that replace or emulate internal packages.
+If the external module is not present, the build-in module is imported.
+"""
+
try:
- import pathlib
- pathlib2 = None
+ import pathlib2
+
+ pathlib = None
except ImportError:
try:
- import pathlib2
- pathlib = pathlib2
+ import pathlib
+
+ pathlib2 = None
except ImportError:
pathlib = None
pathlib2 = None
+use_pathlib = pathlib or pathlib2
try:
- from os import scandir
- use_scandir = True
- use_scandir_package = False
+ import scandir
+
+ use_scandir_package = True
+ use_builtin_scandir = False
except ImportError:
try:
- import scandir
- use_scandir = True
- use_scandir_package = True
+ from os import scandir
+
+ use_builtin_scandir = True
+ use_scandir_package = False
except ImportError:
- use_scandir = False
+ use_builtin_scandir = False
use_scandir_package = False
+
+use_scandir = use_scandir_package or use_builtin_scandir
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyfakefs-3.5.5/pyfakefs/fake_filesystem.py
new/pyfakefs-3.5.6/pyfakefs/fake_filesystem.py
--- old/pyfakefs-3.5.5/pyfakefs/fake_filesystem.py 2018-12-20
19:06:46.000000000 +0100
+++ new/pyfakefs-3.5.6/pyfakefs/fake_filesystem.py 2019-01-13
14:18:48.000000000 +0100
@@ -119,7 +119,7 @@
__pychecker__ = 'no-reimportself'
-__version__ = '3.5.5'
+__version__ = '3.5.6'
PERM_READ = 0o400 # Read permission bit.
PERM_WRITE = 0o200 # Write permission bit.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyfakefs-3.5.5/pyfakefs/fake_filesystem_unittest.py
new/pyfakefs-3.5.6/pyfakefs/fake_filesystem_unittest.py
--- old/pyfakefs-3.5.5/pyfakefs/fake_filesystem_unittest.py 2018-12-20
19:06:46.000000000 +0100
+++ new/pyfakefs-3.5.6/pyfakefs/fake_filesystem_unittest.py 2019-01-13
14:18:48.000000000 +0100
@@ -66,9 +66,9 @@
from pyfakefs import fake_filesystem
from pyfakefs import fake_filesystem_shutil
from pyfakefs import mox3_stubout
-from pyfakefs.extra_packages import pathlib, pathlib2, use_scandir
+from pyfakefs.extra_packages import pathlib, pathlib2, use_scandir, use_pathlib
-if pathlib:
+if use_pathlib:
from pyfakefs import fake_pathlib
if use_scandir:
@@ -313,6 +313,8 @@
SKIPNAMES = {'os', 'path', 'io', 'genericpath', OS_MODULE, PATH_MODULE}
if pathlib:
SKIPNAMES.add('pathlib')
+ if pathlib2:
+ SKIPNAMES.add('pathlib2')
def __init__(self, additional_skip_names=None,
modules_to_reload=None, use_dynamic_patch=True,
@@ -356,12 +358,12 @@
# be contained in - this allows for alternative modules like
# `pathlib` and `pathlib2`
self._class_modules = {}
- if pathlib:
+ if use_pathlib:
+ mod_name = 'pathlib2' if pathlib2 is not None else 'pathlib'
self._fake_module_classes[
- 'pathlib'] = fake_pathlib.FakePathlibModule
+ mod_name] = fake_pathlib.FakePathlibModule
self._fake_module_classes[
- 'Path'] = fake_pathlib.FakePathlibPathModule
- mod_name = 'pathlib2' if pathlib2 is not None else 'pathlib'
+ 'Path'] = fake_pathlib.FakePathlibPathModule
self._class_modules['Path'] = [mod_name]
if use_scandir:
self._fake_module_classes[
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyfakefs-3.5.5/pyfakefs/fake_pathlib.py
new/pyfakefs-3.5.6/pyfakefs/fake_pathlib.py
--- old/pyfakefs-3.5.5/pyfakefs/fake_pathlib.py 2018-12-20 19:06:46.000000000
+0100
+++ new/pyfakefs-3.5.6/pyfakefs/fake_pathlib.py 2019-01-13 14:18:48.000000000
+0100
@@ -47,6 +47,9 @@
from pyfakefs.helpers import text_type
from pyfakefs.fake_filesystem import FakeFileOpen, FakeFilesystem
+if pathlib is None:
+ pathlib = pathlib2
+
def init_module(filesystem):
"""Initializes the fake module with the fake file system."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyfakefs-3.5.5/pyfakefs/tests/all_tests.py
new/pyfakefs-3.5.6/pyfakefs/tests/all_tests.py
--- old/pyfakefs-3.5.5/pyfakefs/tests/all_tests.py 2018-12-20
19:06:46.000000000 +0100
+++ new/pyfakefs-3.5.6/pyfakefs/tests/all_tests.py 2019-01-13
14:18:48.000000000 +0100
@@ -1,3 +1,5 @@
+#! /usr/bin/env python
+#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pyfakefs-3.5.5/pyfakefs/tests/all_tests_without_extra_packages.py
new/pyfakefs-3.5.6/pyfakefs/tests/all_tests_without_extra_packages.py
--- old/pyfakefs-3.5.5/pyfakefs/tests/all_tests_without_extra_packages.py
2018-12-20 19:06:46.000000000 +0100
+++ new/pyfakefs-3.5.6/pyfakefs/tests/all_tests_without_extra_packages.py
2019-01-13 14:18:48.000000000 +0100
@@ -1,3 +1,5 @@
+#! /usr/bin/env python
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -19,16 +21,25 @@
from pyfakefs import extra_packages
if extra_packages.pathlib2:
- extra_packages.pathlib = None
extra_packages.pathlib2 = None
+ try:
+ import pathlib
+ except ImportError:
+ pathlib = None
+ extra_packages.pathlib = pathlib
+ extra_packages.use_pathlib = pathlib
if extra_packages.use_scandir_package:
- extra_packages.use_scandir = False
extra_packages.use_scandir_package = False
+ try:
+ from os import scandir
+ except ImportError:
+ scandir = None
+ extra_packages.scandir = scandir
+ extra_packages.use_scandir = scandir
from pyfakefs.tests.all_tests import AllTests # noqa: E402
-
if __name__ == '__main__':
result = unittest.TextTestRunner(verbosity=2).run(AllTests().suite())
sys.exit(int(not result.wasSuccessful()))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyfakefs-3.5.5/pyfakefs/tests/dynamic_patch_test.py
new/pyfakefs-3.5.6/pyfakefs/tests/dynamic_patch_test.py
--- old/pyfakefs-3.5.5/pyfakefs/tests/dynamic_patch_test.py 2018-12-20
19:06:46.000000000 +0100
+++ new/pyfakefs-3.5.6/pyfakefs/tests/dynamic_patch_test.py 2019-01-13
14:18:48.000000000 +0100
@@ -17,13 +17,14 @@
import unittest
from pyfakefs import fake_filesystem_unittest
-from pyfakefs.extra_packages import pathlib
+from pyfakefs.extra_packages import pathlib, pathlib2, use_pathlib
class TestPyfakefsUnittestBase(fake_filesystem_unittest.TestCase):
def setUp(self):
"""Set up the fake file system"""
self.setUpPyfakefs()
+ self.pathlib = pathlib or pathlib2
@unittest.skipIf((3, ) < sys.version_info < (3, 3),
@@ -61,10 +62,10 @@
self.fs.set_disk_usage(100)
self.assertEqual(100, shutil.disk_usage('/').total)
- @unittest.skipIf(not pathlib, 'only run if pathlib is available')
+ @unittest.skipIf(not use_pathlib, 'only run if pathlib is available')
def test_pathlib_patch(self):
file_path = 'test.txt'
- path = pathlib.Path(file_path)
+ path = self.pathlib.Path(file_path)
with path.open('w') as f:
f.write('test')
@@ -72,10 +73,10 @@
file_object = self.fs.get_object(file_path)
self.assertEqual('test', file_object.contents)
- @unittest.skipIf(not pathlib, 'only run if pathlib is available')
+ @unittest.skipIf(not use_pathlib, 'only run if pathlib is available')
def test_pathlib_path_patch(self):
file_path = 'test.txt'
- path = pathlib.Path(file_path)
+ path = self.pathlib.Path(file_path)
with path.open('w') as f:
f.write('test')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyfakefs-3.5.5/pyfakefs/tests/example_test.py
new/pyfakefs-3.5.6/pyfakefs/tests/example_test.py
--- old/pyfakefs-3.5.5/pyfakefs/tests/example_test.py 2018-12-20
19:06:46.000000000 +0100
+++ new/pyfakefs-3.5.6/pyfakefs/tests/example_test.py 2019-01-13
14:18:48.000000000 +0100
@@ -1,3 +1,5 @@
+#! /usr/bin/env python
+#
# Copyright 2014 Altera Corporation. All Rights Reserved.
# Author: John McGehee
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pyfakefs-3.5.5/pyfakefs/tests/fake_filesystem_unittest_test.py
new/pyfakefs-3.5.6/pyfakefs/tests/fake_filesystem_unittest_test.py
--- old/pyfakefs-3.5.5/pyfakefs/tests/fake_filesystem_unittest_test.py
2018-12-20 19:06:46.000000000 +0100
+++ new/pyfakefs-3.5.6/pyfakefs/tests/fake_filesystem_unittest_test.py
2019-01-13 14:18:48.000000000 +0100
@@ -28,7 +28,7 @@
from unittest import TestCase
from pyfakefs import fake_filesystem_unittest, fake_filesystem
-from pyfakefs.extra_packages import pathlib
+from pyfakefs.extra_packages import pathlib, pathlib2, use_pathlib
from pyfakefs.fake_filesystem_unittest import Patcher, Pause
import pyfakefs.tests.import_as_example
from pyfakefs.helpers import IS_PYPY, IS_PY2
@@ -125,9 +125,10 @@
shutil.rmtree('/test/dir1')
self.assertFalse(self.fs.exists('/test/dir1'))
- @unittest.skipIf(not pathlib, "only run if pathlib is available")
+ @unittest.skipIf(not use_pathlib, "only run if pathlib is available")
def test_fakepathlib(self):
- with pathlib.Path('/fake_file.txt') as p:
+ imported_pathlib = pathlib or pathlib2
+ with imported_pathlib.Path('/fake_file.txt') as p:
with p.open('w') as f:
f.write('text')
is_windows = sys.platform.startswith('win')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyfakefs-3.5.5/pyfakefs/tests/fake_pathlib_test.py
new/pyfakefs-3.5.6/pyfakefs/tests/fake_pathlib_test.py
--- old/pyfakefs-3.5.5/pyfakefs/tests/fake_pathlib_test.py 2018-12-20
19:06:46.000000000 +0100
+++ new/pyfakefs-3.5.6/pyfakefs/tests/fake_pathlib_test.py 2019-01-13
14:18:48.000000000 +0100
@@ -52,7 +52,7 @@
class RealPathlibTestCase(RealFsTestCase):
def __init__(self, methodName='runTest'):
super(RealPathlibTestCase, self).__init__(methodName)
- self.pathlib = pathlib
+ self.pathlib = pathlib or pathlib2
self.path = None
def setUp(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pyfakefs-3.5.5/pyfakefs/tests/pytest/example.py
new/pyfakefs-3.5.6/pyfakefs/tests/pytest/example.py
--- old/pyfakefs-3.5.5/pyfakefs/tests/pytest/example.py 2018-12-20
19:06:46.000000000 +0100
+++ new/pyfakefs-3.5.6/pyfakefs/tests/pytest/example.py 2019-01-13
14:18:48.000000000 +0100
@@ -13,9 +13,13 @@
# Used as SUT for pytest_fixture_test.py
try:
- from pathlib import Path
+ from pathlib2 import Path
EXAMPLE_FILE = Path('/test') / 'file'
-
except ImportError:
- EXAMPLE_FILE = None
+ try:
+ from pathlib import Path
+
+ EXAMPLE_FILE = Path('/test') / 'file'
+ except ImportError:
+ EXAMPLE_FILE = None