From d9e166603315b6c6e8be9003bde461e497673c2901d6a2b47004e66063d63a2b Mon Sep 17 00:00:00 2001 From: Axel Braun Date: Wed, 17 Aug 2022 12:15:48 +0000 Subject: [PATCH] Accepting request 997441 from home:bnavigator:branches:devel:languages:python - Implement python packaging best practices for build requirements, testing and files section As suggested on ML OBS-URL: https://build.opensuse.org/request/show/997441 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pydyf?expand=0&rev=6 --- python-pydyf.changes | 6 ++++++ python-pydyf.spec | 22 ++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/python-pydyf.changes b/python-pydyf.changes index 7b8411d..ac6a829 100644 --- a/python-pydyf.changes +++ b/python-pydyf.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Aug 16 20:25:37 UTC 2022 - Ben Greiner + +- Implement python packaging best practices for build requirements, + testing and files section + ------------------------------------------------------------------- Sat Aug 13 11:44:53 UTC 2022 - Axel Braun diff --git a/python-pydyf.spec b/python-pydyf.spec index 42267c6..d3f2fdf 100644 --- a/python-pydyf.spec +++ b/python-pydyf.spec @@ -17,9 +17,6 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define skip_python2 1 - Name: python-pydyf Version: 0.2.0 Release: 0 @@ -27,19 +24,18 @@ Summary: A low-level PDF generator License: BSD-3-Clause URL: https://www.courtbouillon.org/pydyf Source: https://files.pythonhosted.org/packages/source/p/pydyf/pydyf-%{version}.tar.gz -BuildRequires: %{python_module flit} +BuildRequires: %{python_module base >= 3.7} +BuildRequires: %{python_module flit-core} BuildRequires: %{python_module pip} -BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros - BuildArch: noarch -## Testing +# SECTION Testing BuildRequires: %{python_module Pillow} -BuildRequires: %{python_module pytest-isort} +BuildRequires: %{python_module pytest-xdist} BuildRequires: %{python_module pytest} BuildRequires: gs - +# /SECTION %python_subpackages %description @@ -47,6 +43,8 @@ A low-level PDF generator written in Python and based on PDF specification 1.7. %prep %setup -q -n pydyf-%{version} +sed -i 's:--isort --flake8::' pyproject.toml +chmod -x pydyf/__init__.py %build %pyproject_wheel @@ -56,12 +54,12 @@ A low-level PDF generator written in Python and based on PDF specification 1.7. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -sed -i 's:--flake8 --numprocesses=auto::' pyproject.toml -%pytest tests/test_pydyf.py +%pytest %files %{python_files} %doc README.rst %license LICENSE -%{python_sitelib}/* +%{python_sitelib}/pydyf +%{python_sitelib}/pydyf-%{version}*-info %changelog