From 5abe8b0438d1c2ba60a2599ad836cc982b04ba88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Mon, 25 Sep 2023 12:48:42 +0200 Subject: [PATCH 1/3] Install flexmock on EL9 from RPM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nikola Forró --- fedora/python-specfile.spec | 5 ----- files/tasks/rpm-test-deps.yaml | 5 +---- plans/full.fmf | 8 -------- plans/packit-integration.fmf | 4 ++-- tests/full.fmf | 5 ----- 5 files changed, 3 insertions(+), 24 deletions(-) diff --git a/fedora/python-specfile.spec b/fedora/python-specfile.spec index 5540d06..b49f31e 100644 --- a/fedora/python-specfile.spec +++ b/fedora/python-specfile.spec @@ -1,9 +1,4 @@ -%if 0%{?rhel} == 9 -# RHEL 9 is missing python-flexmock -%bcond_with tests -%else %bcond_without tests -%endif %global desc %{expand: diff --git a/files/tasks/rpm-test-deps.yaml b/files/tasks/rpm-test-deps.yaml index e951ec3..19f6e80 100644 --- a/files/tasks/rpm-test-deps.yaml +++ b/files/tasks/rpm-test-deps.yaml @@ -4,8 +4,5 @@ name: - python3-pytest - python3-pytest-cov + - python3-flexmock become: true -- name: Pip install test dependencies - ansible.builtin.pip: - name: - - flexmock # RHBZ#2120251 diff --git a/plans/full.fmf b/plans/full.fmf index 0b0a12f..36b58ec 100644 --- a/plans/full.fmf +++ b/plans/full.fmf @@ -2,11 +2,3 @@ summary: Unit & integration tests discover+: filter: tier:1 -adjust: - - when: "distro == rhel-9 or distro == centos-9 or distro == centos-stream-9" - because: "flexmock is not in EPEL 9: https://bugzilla.redhat.com/show_bug.cgi?id=2120251" - prepare: - - how: install - package: python3-pip - - how: shell - script: pip3 install flexmock diff --git a/plans/packit-integration.fmf b/plans/packit-integration.fmf index dd2fb9e..efadce2 100644 --- a/plans/packit-integration.fmf +++ b/plans/packit-integration.fmf @@ -19,12 +19,12 @@ adjust: directory: noarch/ - when: "distro == rhel-9 or distro == centos-9 or distro == centos-stream-9" - because: "flexmock and deepdiff are not in EPEL 9: https://bugzilla.redhat.com/show_bug.cgi?id=2120251" + because: "deepdiff is not in EPEL 9: https://bugzilla.redhat.com/show_bug.cgi?id=2120251" prepare+: - how: install package: python3-pip - how: shell - script: pip3 install flexmock deepdiff + script: pip3 install deepdiff - when: "distro == rhel-8 or distro == centos-8 or distro == centos-stream-8" because: "packit doesn't support EL 8" diff --git a/tests/full.fmf b/tests/full.fmf index 606a40f..dfd2fb0 100644 --- a/tests/full.fmf +++ b/tests/full.fmf @@ -6,11 +6,6 @@ require: - python3-pytest - python3-pytest-cov - python3-specfile -adjust: - - when: "distro == rhel-9 or distro == centos-9 or distro == centos-stream-9" - because: "flexmock is not in EPEL 9: https://bugzilla.redhat.com/show_bug.cgi?id=2120251" - require-: - - python3-flexmock tag: - basic tier: 1 From cdd5313c28d0e0e3569ea5123e9dff26dfdff6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Mon, 25 Sep 2023 12:49:28 +0200 Subject: [PATCH 2/3] Remove no longer necessary dependency replacement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nikola Forró --- epel8/python-specfile.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/epel8/python-specfile.spec b/epel8/python-specfile.spec index 64ab17e..f783c51 100644 --- a/epel8/python-specfile.spec +++ b/epel8/python-specfile.spec @@ -37,8 +37,6 @@ Summary: %{summary} %prep %autosetup -p1 -n specfile-%{version} -# Use packaged RPM python bindings downstream -sed -i 's/rpm-py-installer/rpm/' setup.cfg # Remove bundled egg-info rm -rf specfile.egg-info From 4f2bec5fd6b54cf4b2133f57a29e8e95eca04428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Mon, 25 Sep 2023 12:50:45 +0200 Subject: [PATCH 3/3] Stop depending on setuptools_scm_git_archive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nikola Forró --- .git_archival.txt | 3 +++ .gitattributes | 2 +- epel8/python-specfile.spec | 2 +- fedora/python-specfile.spec | 4 ++++ pyproject.toml | 4 ++-- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.git_archival.txt b/.git_archival.txt index 95cb3ee..3994ec0 100644 --- a/.git_archival.txt +++ b/.git_archival.txt @@ -1 +1,4 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true)$ ref-names: $Format:%D$ diff --git a/.gitattributes b/.gitattributes index 9e8fe43..4e843cb 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ -# Needed for setuptools-scm-git-archive +# Needed for setuptools-scm .git_archival.txt export-subst diff --git a/epel8/python-specfile.spec b/epel8/python-specfile.spec index f783c51..7d2eb1a 100644 --- a/epel8/python-specfile.spec +++ b/epel8/python-specfile.spec @@ -17,7 +17,7 @@ Source0: %{pypi_source specfile} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: %{py3_dist setuptools setuptools-scm setuptools-scm-git-archive} +BuildRequires: %{py3_dist setuptools setuptools-scm} BuildRequires: %{py3_dist importlib-metadata dataclasses rpm typing-extensions} BuildRequires: %{py3_dist flexmock pytest} BuildRequires: git-core diff --git a/fedora/python-specfile.spec b/fedora/python-specfile.spec index b49f31e..f2675f2 100644 --- a/fedora/python-specfile.spec +++ b/fedora/python-specfile.spec @@ -41,6 +41,10 @@ Summary: %{summary} %prep %autosetup -p1 -n specfile-%{version} +# since we are building from PyPI source, we don't need git-archive +# support in setuptools_scm +sed -i 's/setuptools_scm\[toml\]>=7/setuptools_scm[toml]/' pyproject.toml + %generate_buildrequires %pyproject_buildrequires %{?with_tests: -x testing} diff --git a/pyproject.toml b/pyproject.toml index 282a1c0..7b37385 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] requires = [ "setuptools>=45", - "setuptools_scm[toml]", - "setuptools_scm_git_archive", + # setuptools_scm added git-archive support in version 7 + "setuptools_scm[toml]>=7", ] build-backend = "setuptools.build_meta"