Use pyproject-rpm-macros

This commit is contained in:
Miro Hrončok 2020-09-04 00:29:05 +02:00
parent 7d6939cf33
commit 81771194d4

View File

@ -7,7 +7,7 @@ toml file.
Name: python-%{pypi_name} Name: python-%{pypi_name}
Version: 0.10.1 Version: 0.10.1
Release: 2%{?dist} Release: 3%{?dist}
Summary: Python Library for Tom's Obvious, Minimal Language Summary: Python Library for Tom's Obvious, Minimal Language
License: MIT License: MIT
@ -17,56 +17,61 @@ Source0: %{pypi_source}
BuildArch: noarch BuildArch: noarch
BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: pyproject-rpm-macros
%bcond_without tests %bcond_without tests
%if %{with tests} %if %{with tests}
BuildRequires: python%{python3_pkgversion}-numpy
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: /usr/bin/toml-test BuildRequires: /usr/bin/toml-test
%endif %endif
%description %description
%desc %desc
%package -n python%{python3_pkgversion}-%{pypi_name} %package -n python%{python3_pkgversion}-%{pypi_name}
Summary: %{summary} Summary: %{summary}
BuildRequires: python%{python3_pkgversion}-devel
%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} %{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}}
%description -n python%{python3_pkgversion}-%{pypi_name} %description -n python%{python3_pkgversion}-%{pypi_name}
%desc %desc
%prep %prep
%setup -q -n %{pypi_name}-%{version} %autosetup -p1 -n %{pypi_name}-%{version}
%generate_buildrequires
%pyproject_buildrequires %{?with_tests:-t}
%build %build
%py3_build %pyproject_wheel
%install %install
%py3_install %pyproject_install
%pyproject_save_files %{pypi_name}
%if %{with tests} %if %{with tests}
%check %check
ln -s /usr/share/toml-test/ . # python tests require test cases here ln -s /usr/share/toml-test/ . # python tests require test cases here
%pytest %tox
# Also using the language independent toml-test suite to launch tests # Also using the language independent toml-test suite to launch tests
ln -s /usr/share/toml-test/tests/* tests/ # toml-test requires them here ln -s /usr/share/toml-test/tests/* tests/ # toml-test requires them here
toml-test $(pwd)/tests/decoding_test3.sh toml-test $(pwd)/tests/decoding_test3.sh
%endif %endif
%files -n python%{python3_pkgversion}-%{pypi_name} %files -n python%{python3_pkgversion}-%{pypi_name} -f %{pyproject_files}
%license LICENSE %license LICENSE
%doc README.rst %doc README.rst
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/%{pypi_name}/
%changelog %changelog
* Thu Sep 03 2020 Miro Hrončok <mhroncok@redhat.com> - 0.10.1-3
- Use pyproject-rpm-macros
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-2 * Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild