Blob Blame History Raw
%global srcname twine

Name:           python-%{srcname}
Version:        1.12.2
Release:        1%{?dist}
Summary:        Collection of utilities for interacting with PyPI

License:        ASL 2.0
URL:            https://github.com/pypa/%{srcname}
Source0:        %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
# There's a shebang in twine/__main__.py which generates rpmlint warnings.
Patch0:         0001-Remove-shebang-from-__main__.py.patch
BuildArch:      noarch

%description
Twine is a utility for interacting with PyPI.
Currently it only supports registering projects and uploading distributions.


# This was mis-packaged in the past and provided a Python 2 and Python 3 variant
# despite it not being a library. Unfortunately a package depends on the Python 2
# build and uses it as a library. In the future there should only be a "twine"
# RPM.
%package -n python3-%{srcname}
Summary:        The Python 3 build for the twine package
Requires:       %{py3_dist keyring pkginfo readme-renderer requests requests-toolbelt setuptools tqdm}
BuildRequires:  python3-devel
BuildRequires:  %{py3_dist keyring pkginfo readme-renderer requests requests-toolbelt setuptools tqdm}
BuildRequires:  %{py3_dist releases sphinx}
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}
The Python 3 build for the twine package.


%package -n python2-%{srcname}
Summary:        The Python 2 build for the twine package
Requires:       %{py2_dist keyring pkginfo readme-renderer requests requests-toolbelt setuptools tqdm}
BuildRequires:  python2-devel
BuildRequires:  %{py2_dist keyring pkginfo readme-renderer requests requests-toolbelt setuptools tqdm}
BuildRequires:  %{py2_dist releases sphinx}
%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{srcname}
The Python 2 build for the twine package.


%package -n %{srcname}
Summary:        %{summary}
Requires:       python3-%{srcname} = %{version}-%{release}

# There used to be a doc sub-package, but the CLI should ship with man pages
Provides: %{name}-doc = %{version}-%{release}
Obsoletes: %{name}-doc < 1.9.1-3

%description -n %{srcname}
Twine is a utility for interacting with PyPI.
Currently it only supports registering projects and uploading distributions.


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


%build
%py2_build
%py3_build
make %{?_smp_mflags} -C docs SPHINXBUILD=sphinx-build-3 man PYTHONPATH=$(pwd)


%install
# Order matters here, we want the Python 3 binary, not the Python 2 one.
%py2_install
%py3_install
install -p -D -T -m 0644 docs/_build/man/%{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}.1


%check
%{__python3} setup.py test


%files -n %{srcname}
%license LICENSE
%doc README.rst AUTHORS
%doc %{_mandir}/man1/%{srcname}.1*
%{_bindir}/twine

%files -n python3-%{srcname}
%license LICENSE
%doc README.rst AUTHORS
%{python3_sitelib}/*

%files -n python2-%{srcname}
%license LICENSE
%doc README.rst AUTHORS
%{python2_sitelib}/*


%changelog
* Wed Dec 05 2018 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.12.2-1
- Update to 1.12.2 (#1551178).
- https://github.com/pypa/twine/blob/1.12.2/docs/changelog.rst

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.10.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 1.10.0-2
- Rebuilt for Python 3.7

* Thu Mar 08 2018 Jeremy Cline <jeremy@jcline.org> - 1.10.0-1
- Update to latest upstream

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Tue Nov 14 2017 Jeremy Cline <jeremy@jcline.org> - 1.9.1-4
- Re-add the Python 2 package (rhbz #1512552)

* Tue Oct 31 2017 Jeremy Cline <jeremy@jcline.org> - 1.9.1-3
- Drop pythonX- subpackages as Twine is a CLI (rhbz #1507815)

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.9.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Thu Jun 01 2017 Jeremy Cline <jeremy@jcline.org> - 1.9.1-1
- Update to 1.9.1 (#1448841)
- Add python-keyring and python-tqdm as dependencies
- Remove python-clint as a dependency

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 1.8.1-2
- Rebuild for Python 3.6

* Tue Aug 09 2016 Jeremy Cline <jeremy@jcline.org> - 1.8.1-1
- Update to 1.8.1

* Mon Jul 18 2016 Jeremy Cline <jeremy@jcline.org> - 1.7.4-3
- Keep objects.inv to support intersphinx documentation

* Mon Jul 18 2016 Jeremy Cline <jeremy@jcline.org> - 1.7.4-2
- Add clint as a build dependency so the tests pass

* Fri Jul 15 2016 Jeremy Cline <jeremy@jcline.org> - 1.7.4-1
- Update to the latest upstream release
- Add clint as a dependency

* Tue Jul 12 2016 Jeremy Cline <jeremy@jcline.org> - 1.6.5-5
- Remove unnecessary shebang in __main__.py that caused rpmlint errors

* Mon Jul 11 2016 Jeremy Cline <jeremy@jcline.org> - 1.6.5-4
- Mark man pages as docs

* Mon Jul 11 2016 Jeremy Cline <jeremy@jcline.org> - 1.6.5-3
- Use python_version macro rather than hardcoding version numbers.

* Fri Jul 08 2016 Jeremy Cline <jeremy@jcline.org> - 1.6.5-2
- Update Source0 url to the <name>-<version>.tar.gz format

* Thu Jun 09 2016 Jeremy Cline <jeremy@jcline.org> - 1.6.5-1
- Initial commit