python-pyfakefs/python-pyfakefs.spec

81 lines
2.3 KiB
RPMSpec
Raw Normal View History

#
- Update to 4.5.3: * New Features + added support for some Python 3.10 features: + new method pathlib.Path.hardlink_to + new newline argument in pathlib.Path.write_text + new follow_symlinks argument in pathlib.Path.stat and pathlib.Path.chmod + new 'strict' argument in os.path.realpath + added support for pathlib.Path.link_to (new in Python 3.8) (see #580) + added support for pathlib.Path.readlink (new in Python 3.9) (see #584) + added FakeFilesystem.create_link convenience method which creates intermittent directories (see #580) * Changes + Python 3.5 has reached its end of life in September 2020 and is no longer supported + pathlib2 is still supported, but considered to have the same functionality as pathlib and is no longer tested separately; the previous behavior broke newer pathlib features if pathlib2 was installed (see #592) + Added caching of patched modules to avoid lookup overhead + Added use_cache option and clear_cache method to be able to deal with unwanted side effects of the newly introduced caching + The patchfs decorator now expects a positional argument instead of the keyword arguments fs. This avoids confusion with the pytest fs fixture and conforms to the behavior of mock.patch. You may have to adapt the argument order if you use the patchfs and mock.patch decorators together (see #566) + Default arguments that are file system functions are now not patched by default to avoid a large performance impact. An additional parameter patch_default_args has been added that switches this behavior on (see #567). * Fixes + added handling of path-like where missing + improved handling of str/bytes paths + suppress all warnings while inspecting loaded modules (see #614) + do not import pandas and related modules if it is not patched (see #627) + handle pathlib.Path.owner() and pathlib.Path.group by returning the current user/group name (see #629) + fixed handling of use_known_patches=False (could cause an exception) + correctly handle byte paths in os.path.exists (see #595) + Update fake_pathlib to support changes coming in Python 3.10 (see + correctly handle UNC paths in os.path.split and in directory path evaluation (see #606) + fixed handling of pipe descriptors in the fake filesystem (see #581) + added non-functional argument effective_ids to os.access (see #585) + correctly handle os.file for unreadable files (see #588) OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyfakefs?expand=0&rev=31
2021-12-14 05:42:16 +01:00
# spec file
#
Accepting request 993340 from home:bnavigator:branches:devel:languages:python - Update to 4.6.3 * automatically reset filesystem on changing is_windows_fs or is_macos (see #692) - ensures better upwards compatibility in most cases * Make sure you write to the filesystem after you change is_windows_fs or is_macos, otherwise the changes will be lost. * fixed regression: os.path.exists returned True for any root drive path under Windows - Update to 4.6.2 * fixed support for opener introduced in previous patch release (see #689) * added support for opener argument in open, which is used in tempfile in Python 3.11 since beta 4 (see #686) * make sure tests run without pyfakefs installed as a package (see #687) - Version 4.6.0 * Adds support for Python 3.11, removes support for Python 3.6, changes root path behavior under Windows. * Python 3.6 has reached its end of life on 2021/12/23 and is no longer officially supported by pyfakefs ** os.stat_float_times has been removed in Python 3.7 and is therefore no longer supported under Windows, the root path is now effectively C:\ instead of \; a path starting with \ points to the current drive as in the real file system (see #673) * fake pathlib.Path.owner() and pathlib.Path.group() now behave like the real methods - they look up the real user/group name for the user/group id that is associated with the fake file (see #678) * added some support for the upcoming Python version 3.11 (see #677) OBS-URL: https://build.opensuse.org/request/show/993340 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyfakefs?expand=0&rev=32
2022-08-06 17:23:38 +02:00
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Accepting request 993340 from home:bnavigator:branches:devel:languages:python - Update to 4.6.3 * automatically reset filesystem on changing is_windows_fs or is_macos (see #692) - ensures better upwards compatibility in most cases * Make sure you write to the filesystem after you change is_windows_fs or is_macos, otherwise the changes will be lost. * fixed regression: os.path.exists returned True for any root drive path under Windows - Update to 4.6.2 * fixed support for opener introduced in previous patch release (see #689) * added support for opener argument in open, which is used in tempfile in Python 3.11 since beta 4 (see #686) * make sure tests run without pyfakefs installed as a package (see #687) - Version 4.6.0 * Adds support for Python 3.11, removes support for Python 3.6, changes root path behavior under Windows. * Python 3.6 has reached its end of life on 2021/12/23 and is no longer officially supported by pyfakefs ** os.stat_float_times has been removed in Python 3.7 and is therefore no longer supported under Windows, the root path is now effectively C:\ instead of \; a path starting with \ points to the current drive as in the real file system (see #673) * fake pathlib.Path.owner() and pathlib.Path.group() now behave like the real methods - they look up the real user/group name for the user/group id that is associated with the fake file (see #678) * added some support for the upcoming Python version 3.11 (see #677) OBS-URL: https://build.opensuse.org/request/show/993340 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyfakefs?expand=0&rev=32
2022-08-06 17:23:38 +02:00
%{?!python_module:%define python_module() python3-%{**}}
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%define skip_python2 1
Name: python-pyfakefs%{psuffix}
Version: 5.0.0
Release: 0
Summary: Fake file system that mocks the Python file system modules
License: Apache-2.0
URL: https://github.com/jmcgeheeiv/pyfakefs
Source: https://github.com/jmcgeheeiv/pyfakefs/archive/v%{version}.tar.gz#/python-pyfakefs-%{version}.tar.gz
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python
BuildArch: noarch
%if %{with test}
Accepting request 993340 from home:bnavigator:branches:devel:languages:python - Update to 4.6.3 * automatically reset filesystem on changing is_windows_fs or is_macos (see #692) - ensures better upwards compatibility in most cases * Make sure you write to the filesystem after you change is_windows_fs or is_macos, otherwise the changes will be lost. * fixed regression: os.path.exists returned True for any root drive path under Windows - Update to 4.6.2 * fixed support for opener introduced in previous patch release (see #689) * added support for opener argument in open, which is used in tempfile in Python 3.11 since beta 4 (see #686) * make sure tests run without pyfakefs installed as a package (see #687) - Version 4.6.0 * Adds support for Python 3.11, removes support for Python 3.6, changes root path behavior under Windows. * Python 3.6 has reached its end of life on 2021/12/23 and is no longer officially supported by pyfakefs ** os.stat_float_times has been removed in Python 3.7 and is therefore no longer supported under Windows, the root path is now effectively C:\ instead of \; a path starting with \ points to the current drive as in the real file system (see #673) * fake pathlib.Path.owner() and pathlib.Path.group() now behave like the real methods - they look up the real user/group name for the user/group id that is associated with the fake file (see #678) * added some support for the upcoming Python version 3.11 (see #677) OBS-URL: https://build.opensuse.org/request/show/993340 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyfakefs?expand=0&rev=32
2022-08-06 17:23:38 +02:00
BuildRequires: %{python_module pytest >= 3}
BuildRequires: %{pythons}
%endif
%python_subpackages
%description
pyfakefs implements a fake file system that mocks the Python file system
modules. Using pyfakefs, your tests operate on a fake file system in
memory without touching the real disk. The software under test requires
no modification to work with pyfakefs.
%prep
%setup -q -n pyfakefs-%{version}
%build
%python_build
%install
%if !%{with test}
%python_install
%python_expand rm -r %{buildroot}%{$python_sitelib}/pyfakefs/tests/
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%endif
%check
%if %{with test}
export LANG=C.UTF-8
%python_expand PYTHONPATH=$(pwd) $python -m pyfakefs.tests.all_tests
%endif
%if !%{with test}
%files %{python_files}
Accepting request 993340 from home:bnavigator:branches:devel:languages:python - Update to 4.6.3 * automatically reset filesystem on changing is_windows_fs or is_macos (see #692) - ensures better upwards compatibility in most cases * Make sure you write to the filesystem after you change is_windows_fs or is_macos, otherwise the changes will be lost. * fixed regression: os.path.exists returned True for any root drive path under Windows - Update to 4.6.2 * fixed support for opener introduced in previous patch release (see #689) * added support for opener argument in open, which is used in tempfile in Python 3.11 since beta 4 (see #686) * make sure tests run without pyfakefs installed as a package (see #687) - Version 4.6.0 * Adds support for Python 3.11, removes support for Python 3.6, changes root path behavior under Windows. * Python 3.6 has reached its end of life on 2021/12/23 and is no longer officially supported by pyfakefs ** os.stat_float_times has been removed in Python 3.7 and is therefore no longer supported under Windows, the root path is now effectively C:\ instead of \; a path starting with \ points to the current drive as in the real file system (see #673) * fake pathlib.Path.owner() and pathlib.Path.group() now behave like the real methods - they look up the real user/group name for the user/group id that is associated with the fake file (see #678) * added some support for the upcoming Python version 3.11 (see #677) OBS-URL: https://build.opensuse.org/request/show/993340 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pyfakefs?expand=0&rev=32
2022-08-06 17:23:38 +02:00
%doc CHANGES.md README.md
%license COPYING
%{python_sitelib}/pyfakefs
%{python_sitelib}/pyfakefs-%{version}*-info
%endif
%changelog