2018-04-20 10:14:22 +02:00
|
|
|
#
|
2021-12-14 05:42:16 +01:00
|
|
|
# spec file
|
2018-04-20 10:14:22 +02:00
|
|
|
#
|
2021-12-14 05:42:16 +01:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2018-04-20 10:14:22 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-10-23 08:43:56 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-04-20 10:14:22 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2020-03-08 04:37:02 +01:00
|
|
|
%global flavor @BUILD_FLAVOR@%{nil}
|
|
|
|
%if "%{flavor}" == "test"
|
|
|
|
%define psuffix -test
|
|
|
|
%bcond_without test
|
|
|
|
%else
|
|
|
|
%define psuffix %{nil}
|
|
|
|
%bcond_with test
|
|
|
|
%endif
|
2020-03-14 08:23:10 +01:00
|
|
|
%define skip_python2 1
|
2020-03-08 04:37:02 +01:00
|
|
|
Name: python-pyfakefs%{psuffix}
|
2021-12-14 05:42:16 +01:00
|
|
|
Version: 4.5.3
|
2018-04-20 10:14:22 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Fake file system that mocks the Python file system modules
|
|
|
|
License: Apache-2.0
|
2019-10-07 10:56:22 +02:00
|
|
|
URL: https://github.com/jmcgeheeiv/pyfakefs
|
2020-03-08 04:37:02 +01:00
|
|
|
Source: https://github.com/jmcgeheeiv/pyfakefs/archive/v%{version}.tar.gz#/python-pyfakefs-%{version}.tar.gz
|
2018-04-20 10:14:22 +02:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
BuildRequires: fdupes
|
|
|
|
BuildRequires: python-rpm-macros
|
2019-12-11 09:45:30 +01:00
|
|
|
Requires: python
|
2018-04-20 10:14:22 +02:00
|
|
|
BuildArch: noarch
|
2020-03-08 04:37:02 +01:00
|
|
|
%if %{with test}
|
|
|
|
BuildRequires: %{python_module pytest >= 2.8.6}
|
|
|
|
BuildRequires: %{pythons}
|
2018-11-01 11:04:53 +01:00
|
|
|
%endif
|
2018-04-20 10:14:22 +02:00
|
|
|
%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
|
2020-03-08 04:37:02 +01:00
|
|
|
%if !%{with test}
|
2018-04-20 10:14:22 +02:00
|
|
|
%python_install
|
2020-03-08 04:37:02 +01:00
|
|
|
%python_expand rm -r %{buildroot}%{$python_sitelib}/pyfakefs/tests/
|
2018-04-20 10:14:22 +02:00
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2020-03-08 04:37:02 +01:00
|
|
|
%endif
|
2018-04-20 10:14:22 +02:00
|
|
|
|
|
|
|
%check
|
2020-03-08 04:37:02 +01:00
|
|
|
%if %{with test}
|
2018-04-20 10:14:22 +02:00
|
|
|
export LANG=C.UTF-8
|
2020-03-08 04:37:02 +01:00
|
|
|
%python_expand PYTHONPATH=$(pwd) $python -m pyfakefs.tests.all_tests
|
|
|
|
%endif
|
2018-04-20 10:14:22 +02:00
|
|
|
|
2020-03-08 04:37:02 +01:00
|
|
|
%if !%{with test}
|
2018-04-20 10:14:22 +02:00
|
|
|
%files %{python_files}
|
|
|
|
%doc CHANGES* README*
|
|
|
|
%license COPYING*
|
|
|
|
%{python_sitelib}/*
|
2020-03-08 04:37:02 +01:00
|
|
|
%endif
|
2018-04-20 10:14:22 +02:00
|
|
|
|
|
|
|
%changelog
|