Port to pyproject macros

This commit is contained in:
Petr Viktorin 2020-09-16 17:20:33 +02:00 committed by Miro Hrončok
parent 5977032a51
commit 72b7ad559c

View File

@ -10,7 +10,7 @@
Name: python-requests Name: python-requests
Version: 2.24.0 Version: 2.24.0
Release: 3%{?dist} Release: 4%{?dist}
Summary: HTTP library, written in Python, for human beings Summary: HTTP library, written in Python, for human beings
License: ASL 2.0 License: ASL 2.0
@ -44,11 +44,8 @@ Summary: HTTP library, written in Python, for human beings
%{?python_provide:%python_provide python%{python3_pkgversion}-requests} %{?python_provide:%python_provide python%{python3_pkgversion}-requests}
BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python3dist(chardet) BuildRequires: pyproject-rpm-macros
BuildRequires: python3dist(urllib3)
BuildRequires: python3dist(idna)
BuildRequires: python3dist(pygments)
BuildRequires: python3dist(setuptools)
%if %{with tests} %if %{with tests}
BuildRequires: python3dist(pytest) BuildRequires: python3dist(pytest)
BuildRequires: python3dist(pytest-cov) BuildRequires: python3dist(pytest-cov)
@ -63,7 +60,15 @@ cumbersome. Pythons built-in urllib2 module provides most of the HTTP
capabilities you should need, but the API is thoroughly broken. This library is capabilities you should need, but the API is thoroughly broken. This library is
designed to make HTTP requests easy for developers. designed to make HTTP requests easy for developers.
%{?python_extras_subpkg:%python_extras_subpkg -n python%{python3_pkgversion}-requests -i %{python3_sitelib}/*.egg-info security socks} %pyproject_extras_subpkg -n python%{python3_pkgversion}-requests security socks
%generate_buildrequires
%if %{with tests}
%pyproject_buildrequires -r
%else
%pyproject_buildrequires
%endif
%prep %prep
%autosetup -p1 -n requests-%{version} %autosetup -p1 -n requests-%{version}
@ -80,11 +85,12 @@ sed -i '/#!\/usr\/.*python/d' requests/certs.py
sed -i 's/ --doctest-modules//' pytest.ini sed -i 's/ --doctest-modules//' pytest.ini
%build %build
%py3_build %pyproject_wheel
%install %install
%py3_install %pyproject_install
%pyproject_save_files requests
%if %{with tests} %if %{with tests}
@ -93,14 +99,16 @@ sed -i 's/ --doctest-modules//' pytest.ini
%pytest -v -k "not test_https_warnings" %pytest -v -k "not test_https_warnings"
%endif # tests %endif # tests
%files -n python%{python3_pkgversion}-requests
%files -n python%{python3_pkgversion}-requests -f %{pyproject_files}
%license LICENSE %license LICENSE
%doc README.md HISTORY.md %doc README.md HISTORY.md
%{python3_sitelib}/*.egg-info/
%{python3_sitelib}/requests/
%changelog %changelog
* Fri Sep 18 2020 Petr Viktorin <pviktori@redhat.com> - 2.24.0-4
- Port to pyproject macros
* Fri Sep 18 2020 Miro Hrončok <mhroncok@redhat.com> - 2.24.0-3 * Fri Sep 18 2020 Miro Hrončok <mhroncok@redhat.com> - 2.24.0-3
- Build with pytest 6, older version is no longer required - Build with pytest 6, older version is no longer required