File python-twine.spec of Package python-twine

#
# spec file for package python-twine
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-twine
Version:        1.9.1
Release:        0
Summary:        Collection of utilities for interacting with PyPI
License:        Apache-2.0
Group:          Development/Languages/Python
Url:            https://github.com/pypa/twine
Source:         https://files.pythonhosted.org/packages/source/t/twine/twine-%{version}.tar.gz
BuildRequires:  %{python_module setuptools >= 0.7.0}
BuildRequires:  python-rpm-macros
Requires(post): update-alternatives
Requires(postun): update-alternatives
Requires:       python-pkginfo >= 1.0
Requires:       python-requests-toolbelt >= 0.8.0
Requires:       python-tqdm >= 4.11
Recommends:     python-keyring
%if 0%{suse_version} <= 1320
Recommends:     python-pyblake2
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%python_subpackages

%description
Twine is a utility for interacting with PyPI.

Currently it only supports registering projects and uploading distributions.

%prep
%setup -q -n twine-%{version}
sed -i '1s/^#!.*//' twine/__main__.py

%build
%python_build

%install
%python_install
%python_clone -a %{buildroot}%{_bindir}/twine

%post
%python_install_alternative twine

%postun
%python_uninstall_alternative twine

%files %{python_files}
%defattr(-,root,root,-)
%doc AUTHORS README.rst
%if 0%{?leap_version} >= 420200 || 0%{?suse_version} > 1320
%license LICENSE
%else
%doc LICENSE
%endif
%{python_sitelib}/*
%python_alternative %{_bindir}/twine

%changelog
openSUSE Build Service is sponsored by