- Switch to github tarball to get tests and license

- Run the tests

- Format with spec cleaner
- Add patch to work with python 3.8:
  * python38.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-helpdev?expand=0&rev=2
This commit is contained in:
Tomáš Chvátal
2020-01-28 08:42:10 +00:00
committed by Git OBS Bridge
parent fb49a411ab
commit 9d841b1982
5 changed files with 53 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-helpdev
#
# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,38 +12,40 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-helpdev
Version: 0.6.10
Release: 0
License: MIT and CC-BY-4.0
Summary: HelpDev - Extracts information about the Python environment easily
Url: https://gitlab.com/dpizetta/helpdev
License: MIT AND CC-BY-4.0
Group: Development/Languages/Python
Source: https://files.pythonhosted.org/packages/source/h/helpdev/helpdev-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module devel}
URL: https://gitlab.com/dpizetta/helpdev
Source0: https://gitlab.com/dpizetta/helpdev/-/archive/v%{version}/helpdev-v%{version}.tar.gz
Patch0: python38.patch
BuildRequires: %{python_module setuptools}
# SECTION test requirements
BuildRequires: %{python_module importlib_metadata}
BuildRequires: %{python_module psutil >= 5.6}
# /SECTION
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-importlib_metadata
Requires: python-psutil >= 5.6
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module importlib_metadata}
BuildRequires: %{python_module psutil >= 5.6}
BuildRequires: %{python_module pytest}
# /SECTION
%python_subpackages
%description
HelpDev - Extracts information about the Python environment easily.
%prep
%setup -q -n helpdev-%{version}
sed -i '1{\,^#!/usr/bin/env python,d}' helpdev/*.py
%setup -q -n helpdev-v%{version}
%patch0 -p1
sed -i '1{\,^#!%{_bindir}/env python,d}' helpdev/*.py
%build
%python_build
@@ -52,6 +54,10 @@ sed -i '1{\,^#!/usr/bin/env python,d}' helpdev/*.py
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
#test_check_python_packages needs the binary
%pytest -k 'not test_check_python_packages'
%files %{python_files}
%doc README.rst
%python3_only %{_bindir}/helpdev