From ade09317840db3824195d2627c3c7e1fefb6249f Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Wed, 17 May 2023 06:39:43 -0500 Subject: [PATCH] Migrate to pyproject-rpm-macros for build requirements Signed-off-by: Major Hayden --- cloud-init.spec | 50 ++++++++++++++----------------------------------- 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/cloud-init.spec b/cloud-init.spec index 9047f88..496d75c 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -6,7 +6,7 @@ Name: cloud-init Version: 23.1.2 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Cloud instance init scripts License: Apache-2.0 or GPL-3.0-only URL: https://github.com/canonical/cloud-init @@ -31,38 +31,19 @@ Patch4: Do-not-enable-dhcp6-on-EC2.patch BuildArch: noarch -BuildRequires: pkgconfig(systemd) BuildRequires: systemd-rpm-macros BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: systemd +BuildRequires: pkgconfig(systemd) -# For tests -BuildRequires: python3-configobj -# https://bugzilla.redhat.com/show_bug.cgi?id=1695953 -BuildRequires: python3-distro -# https://bugzilla.redhat.com/show_bug.cgi?id=1417029 -BuildRequires: python3-jinja2 -BuildRequires: python3-jsonpatch -BuildRequires: python3-jsonschema -BuildRequires: python3-oauthlib -BuildRequires: python3-prettytable -BuildRequires: python3-pyserial -BuildRequires: python3-PyYAML -BuildRequires: python3-requests -BuildRequires: python3-six -BuildRequires: python3-netifaces %if %{with tests} BuildRequires: iproute BuildRequires: passwd -BuildRequires: python3-httpretty >= 0.8.14-2 -BuildRequires: python3-pytest -BuildRequires: python3-pytest-mock -BuildRequires: python3-responses -BuildRequires: python3-tox # dnf is needed to make cc_ntp unit tests work # https://bugs.launchpad.net/cloud-init/+bug/1721573 BuildRequires: /usr/bin/dnf +BuildRequires: python3dist(pytest) +BuildRequires: python3dist(pytest-mock) +BuildRequires: python3dist(responses) %endif Requires: dhcp-client @@ -73,18 +54,6 @@ Requires: python3-libselinux Requires: net-tools Requires: policycoreutils-python3 Requires: procps -Requires: python3-configobj -# https://bugzilla.redhat.com/show_bug.cgi?id=1695953 -Requires: python3-distro -Requires: python3-jinja2 -Requires: python3-jsonpatch -Requires: python3-jsonschema -Requires: python3-oauthlib -Requires: python3-prettytable -Requires: python3-pyserial -Requires: python3-PyYAML -Requires: python3-requests -Requires: python3-six Requires: shadow-utils Requires: util-linux Requires: xfsprogs @@ -116,6 +85,11 @@ sed -i -e 's|#!/usr/bin/python||' cloudinit/cmd/main.py find tests/ -type f | xargs sed -i s/unittest2/unittest/ find tests/ -type f | xargs sed -i s/assertItemsEqual/assertCountEqual/ + +%generate_buildrequires +%pyproject_buildrequires + + %build %py3_build @@ -147,6 +121,7 @@ done cp -a %{buildroot}/etc/systemd %{buildroot}/usr/lib rm -rf %{buildroot}/etc/systemd + %check %if %{with tests} python3 -m pytest tests/unittests @@ -204,6 +179,9 @@ python3 -m pytest tests/unittests %changelog +* Tue May 16 2023 Major Hayden - 23.1.2-7 +- Migrate to pyproject-rpm-macros for build requirements + * Tue May 16 2023 Major Hayden - 23.1.2-6 - Add patch to disable DHCPv6 on EC2 to fix BZ 2092459.