Blame python-fedora-messaging.spec

31e8db
#
31e8db
# spec file for package python-fedora-messaging
31e8db
#
fbf0ec
# Copyright (c) 2024 SUSE LLC
31e8db
#
31e8db
# All modifications and additions to the file contributed by third parties
31e8db
# remain the property of their copyright owners, unless otherwise agreed
31e8db
# upon. The license for this file, and modifications and additions to the
31e8db
# file, is the same license as for the pristine package itself (unless the
31e8db
# license for the pristine package is not an Open Source License, in which
31e8db
# case the license is the MIT License). An "Open Source License" is a
31e8db
# license that conforms to the Open Source Definition (Version 1.9)
31e8db
# published by the Open Source Initiative.
31e8db
31e8db
# Please submit bugfixes or comments via https://bugs.opensuse.org/
31e8db
#
31e8db
31e8db
31e8db
Name:           python-fedora-messaging
fbf0ec
Version:        3.4.1
31e8db
Release:        0
31e8db
Summary:        Python tools for Fedora's messaging infrastructure
31e8db
License:        GPL-2.0-or-later
31e8db
URL:            https://github.com/fedora-infra/fedora-messaging
fbf0ec
Source:         https://github.com/fedora-infra/fedora-messaging/archive/refs/tags/v%{version}.tar.gz#/fedora-messaging-%{version}.tar.gz
fbf0ec
BuildRequires:  %{python_module pip}
31e8db
BuildRequires:  %{python_module setuptools}
fbf0ec
BuildRequires:  %{python_module wheel}
31e8db
BuildRequires:  fdupes
31e8db
BuildRequires:  python-rpm-macros
31e8db
Requires:       python-Twisted
31e8db
Requires:       python-blinker
31e8db
Requires:       python-click
31e8db
Requires:       python-crochet
31e8db
Requires:       python-jsonschema
31e8db
Requires:       python-pika >= 1.0.1
31e8db
Requires:       python-pyOpenSSL
31e8db
Requires:       python-pytz
31e8db
Requires:       python-service_identity
fbf0ec
Requires:       python-setuptools
fbf0ec
Requires:       python-tomli
31e8db
BuildArch:      noarch
31e8db
# SECTION test requirements
31e8db
BuildRequires:  %{python_module Sphinx}
31e8db
BuildRequires:  %{python_module Twisted}
31e8db
BuildRequires:  %{python_module blinker}
31e8db
BuildRequires:  %{python_module click}
31e8db
BuildRequires:  %{python_module coverage}
31e8db
BuildRequires:  %{python_module crochet}
31e8db
BuildRequires:  %{python_module jsonschema}
31e8db
BuildRequires:  %{python_module pika >= 1.0.1}
31e8db
BuildRequires:  %{python_module pyOpenSSL}
fbf0ec
BuildRequires:  %{python_module pytest-mock}
31e8db
BuildRequires:  %{python_module pytest-twisted}
31e8db
BuildRequires:  %{python_module pytest}
31e8db
BuildRequires:  %{python_module pytz}
31e8db
BuildRequires:  %{python_module service_identity}
fbf0ec
BuildRequires:  %{python_module setuptools}
fbf0ec
BuildRequires:  %{python_module tomli}
31e8db
BuildRequires:  %{python_module towncrier}
31e8db
BuildRequires:  %{python_module treq}
31e8db
# /SECTION
5c54cc
Requires(post): update-alternatives
fbf0ec
Requires(postun): update-alternatives
31e8db
%python_subpackages
31e8db
31e8db
%description
31e8db
A set of Python tools for using Fedora's messaging infrastructure.
31e8db
31e8db
%prep
fbf0ec
%autosetup -p1 -n fedora-messaging-%{version}
31e8db
31e8db
%build
fbf0ec
%pyproject_wheel
31e8db
31e8db
%install
fbf0ec
%pyproject_install
31e8db
%python_clone -a %{buildroot}%{_bindir}/fedora-messaging
31e8db
%{python_expand rm -r %{buildroot}%{$python_sitelib}/fedora_messaging/tests/
31e8db
%fdupes %{buildroot}%{$python_sitelib}
31e8db
}
31e8db
31e8db
%post
31e8db
%python_install_alternative fedora-messaging
31e8db
31e8db
%postun
31e8db
%python_uninstall_alternative fedora-messaging
31e8db
31e8db
%check
31e8db
export PATH=$PATH:%{buildroot}%{_bindir}
31e8db
export PYTHONDONTWRITEBYTECODE=1
31e8db
export LANG=en_US.UTF-8
fbf0ec
# to avoid import collision
fbf0ec
pushd fedora_messaging
fbf0ec
# Tests that fails on python 3.12 because unittest.mock
fbf0ec
donttest="test_bindings_dict"
fbf0ec
donttest+=" or test_bindings_list_of_dict"
fbf0ec
donttest+=" or test_defaults"
fbf0ec
donttest+=" or test_with_queues"
fbf0ec
donttest+=" or test_wrap_bindings"
fbf0ec
donttest+=" or test_app_name"
fbf0ec
donttest+=" or test_callable_getattr_failure"
fbf0ec
donttest+=" or test_cli_callable_import_failure_cli_opt"
fbf0ec
donttest+=" or test_cli_callable_wrong_format"
fbf0ec
donttest+=" or test_missing_cli_and_conf_callable"
fbf0ec
%pytest -k "not ($donttest)" tests/unit
fbf0ec
popd
31e8db
31e8db
%files %{python_files}
31e8db
%doc README.rst
31e8db
%license LICENSE
31e8db
%python_alternative %{_bindir}/fedora-messaging
5c54cc
%{python_sitelib}/fedora_messaging
5c54cc
%{python_sitelib}/fedora_messaging-%{version}*-info
31e8db
31e8db
%changelog