2011-11-28 17:27:08 +00:00
#
2022-01-23 22:30:58 +00:00
# spec file
2011-11-28 17:27:08 +00:00
#
2023-04-24 09:17:26 +00:00
# Copyright (c) 2023 SUSE LLC
2011-11-28 17:27:08 +00: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.
2012-02-22 14:54:36 +00:00
2018-10-26 13:10:14 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2011-11-28 17:27:08 +00:00
#
2012-02-22 14:54:36 +00:00
2019-02-12 14:51:00 +00:00
%define oldpython python
2019-06-19 10:09:47 +00:00
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
2023-04-24 09:17:26 +00:00
%{?sle15_python_module_pythons}
2019-06-19 10:09:47 +00:00
Name : python-py%{psuffix}
2022-01-23 22:30:58 +00:00
Version : 1.11.0
2011-11-28 17:27:08 +00:00
Release : 0
Summary : Library with cross-python path, ini-parsing, io, code, log facilities
2011-12-06 17:57:07 +00:00
License : MIT
2011-11-28 17:27:08 +00:00
Group : Development/Languages/Python
2018-10-26 13:10:14 +00:00
URL : https://github.com/pytest-dev/py
2017-07-04 09:57:16 +00:00
Source : https://files.pythonhosted.org/packages/source/p/py/py-%{version} .tar.gz
2020-10-19 05:58:33 +00:00
# https://github.com/pytest-dev/py/pull/222
Patch0 : pr_222.patch
BuildRequires : %{python_module apipkg}
BuildRequires : %{python_module iniconfig}
2018-08-07 07:41:04 +00:00
BuildRequires : %{python_module setuptools_scm}
2019-02-12 14:51:00 +00:00
BuildRequires : %{python_module setuptools}
2020-10-19 05:58:33 +00:00
Requires : python-apipkg
Requires : python-iniconfig
2018-06-05 10:49:41 +00:00
BuildRequires : fdupes
2017-02-27 17:32:01 +00:00
BuildRequires : python-rpm-macros
2019-02-12 14:51:00 +00:00
Obsoletes : %{oldpython} -py-docs
2011-11-28 17:27:08 +00:00
BuildArch : noarch
2019-06-19 10:09:47 +00:00
%if %{with test}
2022-11-29 17:05:45 +00:00
BuildRequires : %{python_module py = %{version} }
2019-06-19 10:09:47 +00:00
BuildRequires : %{python_module pytest}
%endif
2017-02-27 17:32:01 +00:00
%python_subpackages
2011-11-28 17:27:08 +00:00
%description
The py lib is a Python development support library featuring
the following tools and modules:
* py.path: uniform local and svn path objects
* py.apipkg: explicit API control and lazy-importing
* py.iniconfig: easy parsing of .ini files
* py.code: dynamic code generation and introspection
* py.path: uniform local and svn path objects
%prep
2022-11-29 17:05:45 +00:00
%autosetup -p1 -n py-%{version}
2019-02-15 11:19:51 +00:00
2017-07-04 09:57:16 +00:00
rm -rf py.egg-info
2019-02-12 14:51:00 +00:00
rm -f tox.ini
2019-02-15 11:19:51 +00:00
# https://github.com/pytest-dev/py/issues/162
2019-02-15 11:01:54 +00:00
rm -f testing/log/test_warning.py
2020-10-19 05:58:33 +00:00
rm -r py/_vendored_packages
2011-11-28 17:27:08 +00:00
%build
2017-02-27 17:32:01 +00:00
%python_build
2011-11-28 17:27:08 +00:00
%install
2019-06-19 10:09:47 +00:00
%if !%{with test}
2017-02-27 17:32:01 +00:00
%python_install
2022-03-15 08:33:56 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitelib}
2019-06-19 10:09:47 +00:00
%endif
2011-11-28 17:27:08 +00:00
2019-02-12 14:51:00 +00:00
%check
2019-06-19 10:09:47 +00:00
%if %{with test}
2019-02-15 11:01:54 +00:00
export LANG=en_US.UTF-8
2020-10-19 05:58:33 +00:00
# In addition to PR 222, there are other tests failing due to changes in pytest 5 & 6
2019-02-15 11:19:51 +00:00
# https://github.com/pytest-dev/py/issues/209
2023-07-26 06:42:53 +00:00
# another failing tests with pytest 7.4: https://github.com/pytest-dev/pytest/commit/cc23ec91d042ee15145b890aea04e96f6e831101 https://github.com/pytest-dev/pytest/commit/0a20452f78a2f5401cf0fc05dad04c8aeee170d7
# ...but the failure comes from py.core, which was integrated to pytest long ago and will probably be dropped soon: https://github.com/pytest-dev/py/issues/288
%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 or test_repr_traceback or test_traceback_getcrashentry)'
2019-06-19 10:09:47 +00:00
%endif
2019-02-12 14:51:00 +00:00
2019-06-19 10:09:47 +00:00
%if !%{with test}
2017-02-27 17:32:01 +00:00
%files %{python_files}
2018-06-05 10:49:41 +00:00
%doc README.rst
%license LICENSE
2022-11-29 17:05:45 +00:00
%{python_sitelib} /py
%{python_sitelib} /py-%{version} *-info
2019-06-19 10:09:47 +00:00
%endif
2011-11-28 17:27:08 +00:00
%changelog