From 0d21f78e9eed7bb398ce6aaa8d2cb2612eea518e17f8d92326d7fa0728171dfe Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 11 Mar 2024 21:35:05 +0000 Subject: [PATCH] Accepting request 1156454 from home:bnavigator:branches:devel:languages:python:pytest - Fix requirements for python39 (yes really) - Make brittle test "fix" depending on the undocumented value of unexpanded %python_bin_suffix more robust OBS-URL: https://build.opensuse.org/request/show/1156454 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-console-scripts?expand=0&rev=25 --- python-pytest-console-scripts.changes | 7 +++++++ python-pytest-console-scripts.spec | 22 +++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/python-pytest-console-scripts.changes b/python-pytest-console-scripts.changes index f24d7f8..f266bda 100644 --- a/python-pytest-console-scripts.changes +++ b/python-pytest-console-scripts.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Mar 8 20:17:05 UTC 2024 - Ben Greiner + +- Fix requirements for python39 (yes really) +- Make brittle test "fix" depending on the undocumented value of + unexpanded %python_bin_suffix more robust + ------------------------------------------------------------------- Wed Jul 19 13:34:19 UTC 2023 - ecsos diff --git a/python-pytest-console-scripts.spec b/python-pytest-console-scripts.spec index e448326..9d39c71 100644 --- a/python-pytest-console-scripts.spec +++ b/python-pytest-console-scripts.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytest-console-scripts # -# Copyright (c) 2023 SUSE LLC +# 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 @@ -24,14 +24,17 @@ Summary: Pytest plugin for testing console scripts License: MIT URL: https://github.com/kvas-it/pytest-console-scripts Source: https://files.pythonhosted.org/packages/source/p/pytest-console-scripts/pytest-console-scripts-%{version}.tar.gz +BuildRequires: %{python_module importlib-metadata >= 3.6 if %python-base < 3.10} BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest >= 4.0.0} +BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-pytest >= 4.0.0 +Requires: (python-importlib-metadata >= 3.6 if python-base < 3.10) BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module pytest >= 4.0.0} BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module virtualenv >= 20} # /SECTION @@ -57,17 +60,18 @@ much as possible. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%if 0%{?suse_version} > 1500 -sed -i 's:env python:env python3:' tests/test_run_scripts.py -%else -sed -i 's:env python:env python%{python_bin_suffix}:' tests/test_run_scripts.py -%endif -%pytest +cp tests/test_run_scripts.py template_run_scripts.py +export PYTHONDONTWRITEBYTECODE=1 +%{python_expand # +export PYTHONPATH=%{buildroot}%{$python_sitelib} +sed 's|env python|$python|' template_run_scripts.py > tests/test_run_scripts.py +$python -m pytest -v +} %files %{python_files} %license LICENSE %doc README.md %{python_sitelib}/pytest_console_scripts -%{python_sitelib}/pytest_console_scripts-%{version}*-info +%{python_sitelib}/pytest_console_scripts-%{version}.dist-info %changelog