File python-py.spec of Package python-py
109
1
#
2
# spec file
3
#
4
# Copyright (c) 2023 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
19
%define oldpython python
20
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
21
%global flavor @BUILD_FLAVOR@%{nil}
22
%if "%{flavor}" == "test"
23
%define psuffix -test
24
%bcond_without test
25
%else
26
%define psuffix %{nil}
27
%bcond_with test
28
%endif
29
Name: python-py%{psuffix}
30
Version: 1.10.0
31
Release: 0
32
Summary: Library with cross-python path, ini-parsing, io, code, log facilities
33
License: MIT
34
Group: Development/Languages/Python
35
URL: https://github.com/pytest-dev/py
36
Source: https://files.pythonhosted.org/packages/source/p/py/py-%{version}.tar.gz
37
# https://github.com/pytest-dev/py/pull/222
38
Patch0: pr_222.patch
39
# CVE-2022-42969 Remove all traces of svn
40
Patch1: remove-svn-remants.patch
41
BuildRequires: %{python_module apipkg}
42
BuildRequires: %{python_module iniconfig}
43
BuildRequires: %{python_module setuptools_scm}
44
BuildRequires: %{python_module setuptools}
45
Requires: python-apipkg
46
Requires: python-iniconfig
47
BuildRequires: fdupes
48
BuildRequires: python-rpm-macros
49
Obsoletes: %{oldpython}-py-docs
50
BuildArch: noarch
51
%if %{with test}
52
BuildRequires: %{python_module pytest}
53
%endif
54
%python_subpackages
55
56
%description
57
The py lib is a Python development support library featuring
58
the following tools and modules:
59
60
* py.path: uniform local and svn path objects
61
* py.apipkg: explicit API control and lazy-importing
62
* py.iniconfig: easy parsing of .ini files
63
* py.code: dynamic code generation and introspection
64
* py.path: uniform local and svn path objects
65
66
%prep
67
%setup -q -n py-%{version}
68
%autopatch -p1
69
70
rm -rf py.egg-info
71
rm -f tox.ini
72
# https://github.com/pytest-dev/py/issues/162
73
rm -f testing/log/test_warning.py
74
rm -r py/_vendored_packages
75
76
# CVE-2022-42969 Remove all traces of svn
77
pushd py/_path
78
rm svnwc.py svnurl.py
79
popd
80
pushd testing/path
81
rm conftest.py svntestbase.py test_svnauth.py test_svnurl.py test_svnwc.py
82
popd
83
84
%build
85
%python_build
86
87
%install
88
%if !%{with test}
89
%python_install
90
%python_exec %fdupes %{buildroot}%{$python_sitelib}
91
%endif
92
93
%check
94
%if %{with test}
95
export LANG=en_US.UTF-8
96
# In addition to PR 222, there are other tests failing due to changes in pytest 5 & 6
97
# https://github.com/pytest-dev/py/issues/209
98
%pytest -k 'not (test_getdimensions or test_format_excinfo or test_excinfo_repr or test_excinfo_str or test_syntaxerror_rerepresentation or test_len or test_power or test_comments)'
99
%endif
100
101
%if !%{with test}
102
%files %{python_files}
103
%doc README.rst
104
%license LICENSE
105
%{python_sitelib}/*
106
%endif
107
108
%changelog
109