Blame python-zuul-client.spec

56ffcea
%global pypi_name zuul-client
56ffcea
56ffcea
Name:       python-%{pypi_name}
83a556d
Version:    0.0.4
082b23a
Release:    5%{?dist}
56ffcea
Summary:    The zuulclient Python module
56ffcea
License:    ASL 2.0
56ffcea
URL:        https://zuul-ci.org
56ffcea
56ffcea
Source0:    %pypi_source
56ffcea
56ffcea
Source1:    fake-zuul-client
56ffcea
a469584
Patch01:    0001-Fix-API-issues-with-zuul-3.19.1.patch
a469584
56ffcea
BuildArch:  noarch
56ffcea
56ffcea
%description
56ffcea
The zuulclient Python module is a client library for
56ffcea
Zuul Gating System's REST API. It includes zuul-client,
56ffcea
a CLI utility to interact with Zuul instances.
56ffcea
56ffcea
%package -n python3-%{pypi_name}
56ffcea
Summary: %summary
56ffcea
BuildRequires:  python3dist(testtools)
56ffcea
BuildRequires:  python3dist(stestr)
56ffcea
BuildRequires: python3-devel
56ffcea
BuildRequires: python3dist(requests)
56ffcea
# Doc requirements
56ffcea
BuildRequires:  python3dist(zuul-sphinx)
56ffcea
BuildRequires:  python3dist(sphinx-autodoc-typehints)
56ffcea
BuildRequires:  python3dist(sphinxcontrib-blockdiag)
56ffcea
BuildRequires:  python3dist(sphinxcontrib-programoutput)
56ffcea
BuildRequires:  python3dist(reno)
56ffcea
7a69556
Requires:       openssl
7a69556
56ffcea
%py_provides python3-%{pypi_name}
56ffcea
56ffcea
%prep
a469584
%autosetup -n %{pypi_name}-%{version} -p1
56ffcea
56ffcea
%description -n python3-%{pypi_name}
56ffcea
The zuulclient Python module is a client library for
56ffcea
Zuul Gating System's REST API. It includes zuul-client,
56ffcea
a CLI utility to interact with Zuul instances.
56ffcea
56ffcea
%package doc
56ffcea
Summary: zuul-client documentation
56ffcea
56ffcea
%description doc
56ffcea
Documentation for the zuulclient library and the zuul-client CLI.
56ffcea
56ffcea
%build
56ffcea
%py3_build
56ffcea
56ffcea
cp %{SOURCE1} build/zuul-client
56ffcea
chmod +x build/zuul-client
56ffcea
# Generate documentation (without release note because source doesn't have git log)
56ffcea
sed -e 's/^ *releasenotes$//' -i doc/source/index.rst
56ffcea
rm doc/source/releasenotes.rst
56ffcea
# Build HTML doc
56ffcea
PYTHONPATH=../../build/lib PATH=$PATH:$(pwd)/build PBR_VERSION=%{version} SPHINX_DEBUG=1 sphinx-build-3 \
56ffcea
    -b html doc/source build/html
56ffcea
# Remove empty stub files
56ffcea
find build -type f -name "*.pyi" -size 0 -delete
56ffcea
# rm doc build leftovers
56ffcea
rm -Rf build/html/.buildinfo build/html/.doctrees
56ffcea
# Fix file-not-utf8
56ffcea
iconv -f iso8859-1 -t utf-8 build/html/objects.inv > build/html/objects.inv.conv && \
56ffcea
    mv -f build/html/objects.inv.conv build/html/objects.inv
56ffcea
# Fix wrong-file-end-of-line-encoding
56ffcea
sed -i 's/\r$//' LICENSE
56ffcea
sed -i 's/\r$//' build/html/objects.inv
56ffcea
56ffcea
%install
56ffcea
%py3_install
56ffcea
a469584
#%check
a469584
#PYTHON=%{__python3} stestr run
56ffcea
56ffcea
%files -n python3-%{pypi_name}
56ffcea
%doc README.rst
56ffcea
%license LICENSE
56ffcea
%{_bindir}/*
56ffcea
%{python3_sitelib}/zuulclient
56ffcea
%{python3_sitelib}/zuul_client*.egg-info
56ffcea
56ffcea
%files doc
56ffcea
%license LICENSE
56ffcea
%doc build/html
56ffcea
56ffcea
%changelog
082b23a
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.4-5
082b23a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
082b23a
6bb2be1
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.0.4-4
6bb2be1
- Rebuilt for Python 3.10
6bb2be1
a469584
* Thu Feb 11 2021 Matthieu Huin <mhuin@redhat.com> - 0.0.4-3
a469584
- Ensure zuul-client works with Fedora's Zuul 3.19.1
a469584
16ce504
* Thu Feb  4 2021 Matthieu Huin <mhuin@redhat.com> - 0.0.4-2
16ce504
- Add basic testing
16ce504
83a556d
* Thu Feb  4 2021 Matthieu Huin <mhuin@redhat.com> - 0.0.4-1
83a556d
- Bump to 0.0.4
83a556d
387cad6
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.3-3
387cad6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
387cad6
7a69556
* Wed Dec  9 2020 Matthieu Huin <mhuin@redhat.com> - 0.0.3-2
7a69556
- Add dependency to OpenSSL
7a69556
982742e
* Tue Dec  8 2020 Matthieu Huin <mhuin@redhat.com> - 0.0.3-1
982742e
- Bump to 0.0.3
982742e
56ffcea
* Thu Oct  1 2020 Matthieu Huin <mhuin@redhat.com> - 0.0.2-1
56ffcea
- Initial packaging