From 40ac6e9435705f9c17d3389cb669ea4d2c467351 Mon Sep 17 00:00:00 2001 From: Benjamin A. Beasley Date: Jun 25 2021 18:20:09 +0000 Subject: Use pyproject-rpm-macros --- diff --git a/python-opencensus-proto.spec b/python-opencensus-proto.spec index 1de95c6..2172d70 100644 --- a/python-opencensus-proto.spec +++ b/python-opencensus-proto.spec @@ -22,7 +22,7 @@ URL: https://github.com/census-instrumentation/%{srcname}/ Source0: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz BuildRequires: python3-devel -BuildRequires: %{py3_dist setuptools} +BuildRequires: pyproject-rpm-macros %if %{with codegen} BuildRequires: %{py3_dist grpcio-tools} %endif @@ -31,6 +31,11 @@ BuildArch: noarch %description %{_description} +%generate_buildrequires +cd gen-python/ +%pyproject_buildrequires + + %package -n python3-%{srcname} Summary: Python library generated from OpenCensus cross-language protos @@ -40,9 +45,6 @@ Summary: Python library generated from OpenCensus cross-language protos %prep %autosetup -n %{srcname}-%{version} -# Remove bundled egg-info -rm -rf *.egg-info - %if %{with codegen} find gen-python/opencensus/proto -type f ! -name '__init__.py' -print -delete sed -r -i 's|\bpython |%{__python3} |g' src/mkpygen.sh @@ -56,13 +58,15 @@ pushd src popd %endif pushd gen-python/ -%py3_build +%pyproject_wheel popd %install pushd gen-python/ -%py3_install +%pyproject_install +# %%pyproject_save_files is not useful here: +# https://bugzilla.redhat.com/show_bug.cgi?id=1935266 popd @@ -79,7 +83,7 @@ popd %exclude %{python3_sitelib}/opencensus/{*.py,__pycache__/} %{python3_sitelib}/opencensus/proto/ -%{python3_sitelib}/opencensus_proto-%{version}-py%{python3_version}.egg-info/ +%{python3_sitelib}/opencensus_proto-%{version}.dist-info/ %changelog @@ -90,6 +94,7 @@ popd - Use the srcname macro in the package name - Share ownership of the opencensus namespace package directory - Allow re-generating the Python bindings from .proto sources +- Use pyproject-rpm-macros * Fri Jun 04 2021 Python Maint - 0.3.0-4 - Rebuilt for Python 3.10