File python-b2.spec of Package python-b2
#
# spec file for package python-b2
#
# 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/
#
Name: python-b2
Version: 4.4.1
Release: 0
Summary: Command Line Tool for Backblaze B2
License: MIT
URL: https://github.com/Backblaze/B2_Command_Line_Tool
Source: B2_Command_Line_Tool-%{version}.tar.gz
BuildRequires: python-rpm-macros
BuildRequires: %{python_module pdm-backend}
BuildRequires: %{python_module pip}
# SECTION test requirements
BuildRequires: %{python_module argcomplete >= 3.5.2}
BuildRequires: %{python_module arrow >= 1.0.2}
BuildRequires: %{python_module b2sdk >= 2.9.4}
BuildRequires: %{python_module docutils >= 0.18.1}
BuildRequires: %{python_module phx-class-registry >= 4.0}
BuildRequires: %{python_module platformdirs >= 3.11.0}
BuildRequires: %{python_module rst2ansi == 0.1.5}
BuildRequires: %{python_module tabulate == 0.9.0}
BuildRequires: %{python_module tqdm >= 4.65.0}
BuildRequires: %{python_module pydantic >= 2.0.1}
BuildRequires: %{python_module coverage >= 7.2.7}
BuildRequires: %{python_module pexpect >= 4.9.0}
BuildRequires: %{python_module pytest >= 8.3.3}
BuildRequires: %{python_module pytest-cov >= 3.0.0}
BuildRequires: %{python_module pytest-forked >= 1.6.0}
BuildRequires: %{python_module pytest-xdist >= 2.5.0}
BuildRequires: %{python_module pytest-watch >= 0.4.3}
BuildRequires: %{python_module backoff >= 2.1.2}
BuildRequires: %{python_module more-itertools >= 8.13.0}
# /SECTION
BuildRequires: fdupes
Requires: python-argcomplete >= 3.5.2
Requires: python-arrow >= 1.0.2
Requires: python-b2sdk >= 2.9.4
Requires: python-docutils >= 0.18.1
Requires: python-phx-class-registry >= 4.0
Requires: python-platformdirs >= 3.11.0
Requires: python-rst2ansi >= 0.1.5
Requires: python-tabulate >= 0.9.0
Requires: python-tqdm >= 4.65.0
Requires: python-pydantic >= 2.0.1
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
%python_subpackages
%description
The command-line tool that gives easy access to all of the capabilities
of B2 Cloud Storage.
This program provides command-line access to the B2 service.
%prep
%autosetup -p1 -n B2_Command_Line_Tool-%{version}
%build
export PDM_BUILD_SCM_VERSION=%{version}
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/b2
%python_clone -a %{buildroot}%{_bindir}/b2v4
%python_clone -a %{buildroot}%{_bindir}/b2v3
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%python_expand %fdupes %{buildroot}%{_bindir}
%check
%pytest test/unit test/static
%post
%python_install_alternative b2 b2v3 b2v4
%postun
%python_uninstall_alternative b2 b2v3 b2v4
%files %{python_files}
%doc README.md
%license LICENSE
%python_alternative %{_bindir}/b2
%python_alternative %{_bindir}/b2v3
%python_alternative %{_bindir}/b2v4
%{python_sitelib}/b2
%{python_sitelib}/b2-%{version}.dist-info
%changelog