From 1ca6298c82d5ad28c530512768f36f312f7650cb Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Mon, 13 Mar 2023 10:19:25 -0500 Subject: [PATCH 1/3] packit: don't build wheel in create-archive action The wheel is not needed here and building it wastes time. --- .packit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.packit.yaml b/.packit.yaml index f5042f5..0cd9d28 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -1,7 +1,7 @@ specfile_path: ansible-bender.spec actions: create-archive: - - "python3 -m build" + - "python3 -m build -s" - "sh -c 'ls -1 dist/ansible-bender-$(python3 -m setuptools_scm).tar.gz'" get-current-version: - "python3 -m setuptools_scm" From d4ba5c1731d9c033ae53c42a316fea2e09038beb Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Mon, 13 Mar 2023 10:26:42 -0500 Subject: [PATCH 2/3] ansible-bender.spec: fix %pypi_source call Calling %{pypi_source} without arguments is deprecated. --- ansible-bender.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible-bender.spec b/ansible-bender.spec index 4be2f64..97882b0 100644 --- a/ansible-bender.spec +++ b/ansible-bender.spec @@ -12,7 +12,7 @@ Summary: Build container images using Ansible playbooks License: MIT URL: https://github.com/ansible-community/ansible-bender -Source0: %{pypi_source} +Source0: %{pypi_source ansible-bender} BuildArch: noarch From 24c04b8b7b17a572f82aff580e41bc9fca758e31 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Mon, 13 Mar 2023 10:27:35 -0500 Subject: [PATCH 3/3] use %generate_buildrequires for test deps Runtime deps are always generated. Install the deps from the `testing` extra when the test bcond is enabled. This moves the %generate_buildrequires definition to after the %prep definition. %generate_buildrequires is always run after %prep, so this makes the specfile chronological. --- ansible-bender.spec | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ansible-bender.spec b/ansible-bender.spec index 97882b0..d6a0be7 100644 --- a/ansible-bender.spec +++ b/ansible-bender.spec @@ -22,12 +22,6 @@ BuildRequires: pyproject-rpm-macros %if %{with check} # These are required for tests: -BuildRequires: python%{python3_pkgversion}-pyyaml -BuildRequires: python%{python3_pkgversion}-tabulate -BuildRequires: python%{python3_pkgversion}-jsonschema -BuildRequires: python%{python3_pkgversion}-pytest -BuildRequires: python%{python3_pkgversion}-flexmock -BuildRequires: python%{python3_pkgversion}-pytest-xdist BuildRequires: ansible-core BuildRequires: podman BuildRequires: buildah @@ -37,8 +31,6 @@ Requires: (ansible-core or ansible) Suggests: ansible-core Requires: buildah -%generate_buildrequires -%pyproject_buildrequires %description This is a tool which bends containers using Ansible playbooks and @@ -52,6 +44,13 @@ tl;dr Ansible is the frontend, buildah is the backend. %prep %autosetup +# Coverage tests should not be run in the RPM build according to the Python +# Packaging Guidelines +sed -i '/pytest-cov/d' setup.cfg + + +%generate_buildrequires +%pyproject_buildrequires %{?with_check:-x testing} %build