Skip to content

Commit

Permalink
Get rid of setuptools_scm_git_archive (#290)
Browse files Browse the repository at this point in the history
Get rid of setuptools_scm_git_archive

Also install flexmock from RPM on EL9.
Fixes #289.

Reviewed-by: František Lachman <[email protected]>
  • Loading branch information
softwarefactory-project-zuul[bot] authored Sep 26, 2023
2 parents d186594 + 4f2bec5 commit 3410b4d
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 30 deletions.
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true)$
ref-names: $Format:%D$
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Needed for setuptools-scm-git-archive
# Needed for setuptools-scm
.git_archival.txt export-subst
4 changes: 1 addition & 3 deletions epel8/python-specfile.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
9 changes: 4 additions & 5 deletions fedora/python-specfile.spec
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -46,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}
Expand Down
5 changes: 1 addition & 4 deletions files/tasks/rpm-test-deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 0 additions & 8 deletions plans/full.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions plans/packit-integration.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
5 changes: 0 additions & 5 deletions tests/full.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3410b4d

Please sign in to comment.