File bundlewrap.spec of Package bundlewrap

#
# spec file for package bundlewrap
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%if 0%{?suse_version} >= 1699
%define pythons python3
%else
%{?sle15_python_module_pythons}
%endif
Name:           bundlewrap
Version:        4.24.0
Release:        0
Summary:        Config management with Python
License:        GPL-3.0-or-later
URL:            https://github.com/bundlewrap/bundlewrap
Source:         https://github.com/bundlewrap/bundlewrap/archive/refs/tags/%{version}.tar.gz#/bundlewrap-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module wheel}
#
BuildRequires:  %{python_module Jinja2}
BuildRequires:  %{python_module Mako}
BuildRequires:  %{python_module PyYAML}
BuildRequires:  %{python_module bcrypt}
BuildRequires:  %{python_module cryptography}
BuildRequires:  %{python_module librouteros >= 3.0.0}
BuildRequires:  %{python_module passlib}
BuildRequires:  %{python_module requests >= 1.0.0}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module tomlkit}
# SECTION test requirements
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module mkdocs}
# /SECTION
BuildRequires:  fdupes
Requires(post): update-alternatives
Requires(postun): update-alternatives
# as this package does not use the python subpackages macro,
# these dependencies are taken as is. On Tumbleweed, this translates
# to the default python, currently 3.11
# The package does not yet build for 15.x, so we can figure something out later...
Requires:       python3-Jinja2
Requires:       python3-Mako
Requires:       python3-PyYAML
Requires:       python3-bcrypt
Requires:       python3-cryptography
Requires:       python3-librouteros >= 3.0.0
Requires:       python3-packaging
Requires:       python3-passlib
Requires:       python3-requests >= 1.0.0
Requires:       python3-setuptools
Requires:       python3-tomlkit
BuildArch:      noarch
Provides:       bw = %{version}

%description
BundleWrap is a decentralized configuration management system that is designed
to be powerful, easy to extend and extremely versatile.

%prep
%autosetup -p1 -n bundlewrap-%{version}

%build
%python_build

%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/bw
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%check
IGNORED_CHECKS="test_action_success"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_action_pipe_binary"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_action_pipe_utf8"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_action_return_codes"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_only_bundle_with_dep"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_skip_bundle"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_skip_id"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_skip_tag"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_skip_type"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_skip_trigger"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_after"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_before"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_before_fail_no_skip"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_after_fail_no_skip"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_before_fail_skip_with_needs"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_after_fail_skip_with_needed_by"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_chain_skip"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_chain_skip_no_cascade"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_purge"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_purge_special_chars"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_any_content_create"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_any_content_exists"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_binary_inline_content"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_binary_template_content"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_delete"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_mako_template_content"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_mako_template_content_with_secret"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_text_template_content"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_fault_content_unavailable_skipped"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_deploy_from_url"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_cannot_deploy_into_purged"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_precedes"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_precedes_unless"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_precedes_unless2"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_precedes_unless3"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_precedes_unless4"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_precedes_action"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_fault_content"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_fault_content_mako"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_fault_content_mako_metadata"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_fault_content_jinja2"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_fault_content_skipped"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_fault_content_skipped_mako"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_skip_attr_no_cascade"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_skip_attr_action"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_create"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_fix"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_fix_dir"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_fix_dir_target"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_empty_tags"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_add_lock_apply_remove"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_run_ok"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_run_fail"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_empty_verify"
# tests requiring ssh
IGNORED_CHECKS="${IGNORED_CHECKS} or test_file_owner_uid"
IGNORED_CHECKS="${IGNORED_CHECKS} or test_file_group_gid"

%pytest -k "not (${IGNORED_CHECKS})" tests/

%post
%python_install_alternative bw

%postun
%python_uninstall_alternative bw

%files
%doc CHANGELOG.md README.md
%python_alternative %{_bindir}/bw
%{python_sitelib}/bundlewrap
%{python_sitelib}/bundlewrap-%{version}*-info

%changelog

openSUSE Build Service is sponsored by