Accepting request 1141097 from devel:languages:python

- Switch to pyproject macros.
- Clean up Python 2 leftovers.
- Use pytest to run the testsuite.

OBS-URL: https://build.opensuse.org/request/show/1141097
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-HeapDict?expand=0&rev=5
This commit is contained in:
Ana Guerrero 2024-01-24 18:05:32 +00:00 committed by Git OBS Bridge
commit 41c2589757
2 changed files with 16 additions and 17 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Jan 24 02:11:04 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- Switch to pyproject macros.
- Clean up Python 2 leftovers.
- Use pytest to run the testsuite.
-------------------------------------------------------------------
Thu Dec 24 00:35:44 UTC 2020 - Benjamin Greiner <code@bnavigator.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package python-HeapDict
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,28 +16,20 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%bcond_without python2
Name: python-HeapDict
Version: 1.0.1
Release: 0
Summary: A heap with decrease-key and increase-key operations
License: BSD-3-Clause
Group: Development/Languages/Python
URL: http://stutzbachenterprises.com/
Source: https://files.pythonhosted.org/packages/source/H/HeapDict/HeapDict-%{version}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module testsuite}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# These packages contain module test from stdlib,
# it has nothing to do with this package being noarch
%if ! %{with python2}
# TW has without python2 defined and will have multiple python3 flavors
BuildRequires: %{python_module testsuite}
%else
BuildRequires: python2-devel
BuildRequires: python3-testsuite
%endif
BuildArch: noarch
%python_subpackages
@ -55,20 +47,20 @@ important for many algorithms such as Dijkstra's Algorithm and A*.
%setup -q -n HeapDict-%{version}
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
%python_exec test_heap.py
%pytest -k 'not test_main' test_heap.py
%files %{python_files}
%license LICENSE
%doc README.rst
%{python_sitelib}/heapdict.py*
%pycache_only %{python_sitelib}/__pycache__/heapdict*
%{python_sitelib}/HeapDict-%{version}*-info
%{python_sitelib}/HeapDict-%{version}.dist-info
%changelog