From 9d841b198257dcfadbe846509b20eb1685b56c7ac9e7d0f0a475655d0ca35205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Tue, 28 Jan 2020 08:42:10 +0000 Subject: [PATCH] - 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 --- helpdev-0.6.10.tar.gz | 3 --- helpdev-v0.6.10.tar.gz | 3 +++ python-helpdev.changes | 13 +++++++++++++ python-helpdev.spec | 34 ++++++++++++++++++++-------------- python38.patch | 17 +++++++++++++++++ 5 files changed, 53 insertions(+), 17 deletions(-) delete mode 100644 helpdev-0.6.10.tar.gz create mode 100644 helpdev-v0.6.10.tar.gz create mode 100644 python38.patch diff --git a/helpdev-0.6.10.tar.gz b/helpdev-0.6.10.tar.gz deleted file mode 100644 index 1836175..0000000 --- a/helpdev-0.6.10.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9e61d24458b7506809670222ca656b139e67d46c530cd227a899780152d7b44e -size 12864 diff --git a/helpdev-v0.6.10.tar.gz b/helpdev-v0.6.10.tar.gz new file mode 100644 index 0000000..11d9512 --- /dev/null +++ b/helpdev-v0.6.10.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f6fb296b650b935356f4fcfeb25a0428da840d3e64855601fa2f628a942e736 +size 368265 diff --git a/python-helpdev.changes b/python-helpdev.changes index 2f6d67f..04bf7f3 100644 --- a/python-helpdev.changes +++ b/python-helpdev.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Jan 28 08:38:12 UTC 2020 - Tomáš Chvátal + +- Switch to github tarball to get tests and license +- Run the tests + +------------------------------------------------------------------- +Tue Jan 28 08:20:21 UTC 2020 - Tomáš Chvátal + +- Format with spec cleaner +- Add patch to work with python 3.8: + * python38.patch + ------------------------------------------------------------------- Sat Jan 25 14:53:04 UTC 2020 - Sebastian Wagner diff --git a/python-helpdev.spec b/python-helpdev.spec index 070e9e0..52c3515 100644 --- a/python-helpdev.spec +++ b/python-helpdev.spec @@ -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 diff --git a/python38.patch b/python38.patch new file mode 100644 index 0000000..f9075cf --- /dev/null +++ b/python38.patch @@ -0,0 +1,17 @@ +diff --git a/helpdev/__init__.py b/helpdev/__init__.py +index ca739c8ee30e8899a33ef98a60a59d458b376261..41bf220cf890fae1eb1aae557c75e8d404dd9a13 100644 +--- a/helpdev/__init__.py ++++ b/helpdev/__init__.py +@@ -26,7 +26,11 @@ import sys + import time + import warnings + +-import importlib_metadata ++try: ++ import importlib.metadata as importlib_metadata ++except ImportError: ++ # python < 3.8 ++ import importlib_metadata + + if sys.version_info >= (3, 4): + import importlib.util