Skip to content

Commit 811b5a2

Browse files
committed
Merge branch 'maintenance/ancient-build-in-rpm-spec' into devel
PR #759
2 parents 2959959 + b48276a commit 811b5a2

File tree

4 files changed

+72
-256
lines changed

4 files changed

+72
-256
lines changed

.github/workflows/ci-cd.yml

Lines changed: 43 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -996,9 +996,6 @@ jobs:
996996
- tag: fedora:40
997997
- tag: fedora:41
998998
- tag: fedora:42
999-
# No matching package to install: 'python3dist(wheel)'
1000-
# - tag: centos/centos:stream9
1001-
# registry: quay.io
1002999
- tag: ubi9/ubi:9.0.0
10031000
registry: registry.access.redhat.com
10041001
- tag: ubi9/ubi:9.1
@@ -1030,43 +1027,24 @@ jobs:
10301027
matrix.target-container.tag
10311028
}}
10321029
1033-
continue-on-error: >- # Stub for in-matrix "allowed-failures"
1034-
${{
1035-
contains(matrix.target-container.tag, '--DISABLED--')
1036-
&& true
1037-
|| false
1038-
}}
1039-
10401030
steps:
10411031
- name: Produce artifact name
10421032
id: distribution-meta
10431033
run: |
10441034
dist_tag=$(rpm --eval '%{?dist}')
10451035
echo "dist-tag=${dist_tag}" >> "${GITHUB_OUTPUT}"
10461036
1047-
- name: Enable EPEL repository
1048-
if: contains(matrix.target-container.tag, 'centos')
1049-
run: dnf install --assumeyes epel-release
1050-
10511037
- name: Install build tooling
10521038
run: >-
10531039
dnf install
10541040
--assumeyes
10551041
dnf-plugins-core
10561042
rpm-build
1057-
${{
1058-
!contains(matrix.target-container.tag, 'ubi')
1059-
&& 'rpmdevtools rpmlint'
1060-
|| ''
1061-
}}
1043+
rpmdevtools
1044+
rpmlint
10621045
1063-
- name: Create rpmbuild directory structure on a community distro
1064-
if: >-
1065-
!contains(matrix.target-container.tag, 'ubi')
1046+
- name: Create rpmbuild directory structure
10661047
run: rpmdev-setuptree
1067-
- name: Create rpmbuild directory structure on RHEL
1068-
if: contains(matrix.target-container.tag, 'ubi')
1069-
run: mkdir -pv ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
10701048

10711049
- name: Retrieve the project source from an sdist inside the GHA artifact
10721050
uses: re-actors/checkout-python-sdist@release/v2
@@ -1089,8 +1067,6 @@ jobs:
10891067
merge-multiple: true
10901068

10911069
- name: Lint the RPM spec file
1092-
if: >-
1093-
!contains(matrix.target-container.tag, 'ubi')
10941070
run: rpmlint packaging/rpm/ansible-pylibssh.spec
10951071

10961072
- name: Copy sdist to the sources dir
@@ -1099,85 +1075,73 @@ jobs:
10991075
'dist/${{ needs.pre-setup.outputs.sdist-artifact-name }}'
11001076
~/rpmbuild/SOURCES/
11011077
1102-
- name: Install static test dependencies missing from UBI9
1103-
if: contains(matrix.target-container.tag, 'ubi9')
1078+
- name: Install transitive deps for build deps in external repos
1079+
if: contains(matrix.target-container.tag, 'ubi')
1080+
run: >-
1081+
dnf install
1082+
--assumeyes
1083+
python3-packaging
1084+
python3-pluggy
1085+
python3-py
1086+
python3-tomli
1087+
1088+
- name: Install static test dependencies missing from all UBIs
1089+
if: contains(matrix.target-container.tag, 'ubi')
11041090
run: >-
11051091
rpm
11061092
-ivh
11071093
--nodeps
1108-
https://rpmfind.net/linux/centos-stream/"$(
1094+
https://rpmfind.net/linux/epel/"$(
11091095
rpm --eval '%{rhel}'
1110-
)"-stream/AppStream/x86_64/os/Packages/python3-pytest-6.2.2-6${{
1096+
)"/Everything/x86_64/Packages/p/python3-pytest-cov-4.0.0-2${{
11111097
steps.distribution-meta.outputs.dist-tag
11121098
}}.noarch.rpm
1113-
https://rpmfind.net/linux/centos-stream/"$(
1099+
https://rpmfind.net/linux/epel/"$(
11141100
rpm --eval '%{rhel}'
1115-
)"-stream/CRB/x86_64/os/Packages/python3-wheel-0.36.2-7${{
1101+
)"/Everything/x86_64/Packages/p/python3-pytest-xdist-2.5.0-2${{
11161102
steps.distribution-meta.outputs.dist-tag
11171103
}}.noarch.rpm
1118-
1119-
- name: Install static test dependencies missing from all UBIs
1120-
if: contains(matrix.target-container.tag, 'ubi')
1121-
run: >-
1122-
rpm
1123-
-ivh
1124-
--nodeps
11251104
https://rpmfind.net/linux/epel/"$(
11261105
rpm --eval '%{rhel}'
1127-
)"/Everything/x86_64/Packages/p/python3-pytest-cov-${{
1128-
contains(matrix.target-container.tag, 'ubi9')
1129-
&& '4.0.0-2'
1130-
|| '2.6.0-1'
1131-
}}${{ steps.distribution-meta.outputs.dist-tag }}.noarch.rpm
1106+
)"/Everything/x86_64/Packages/t/tox-3.28.0-1${{
1107+
steps.distribution-meta.outputs.dist-tag
1108+
}}.noarch.rpm
11321109
https://rpmfind.net/linux/epel/"$(
11331110
rpm --eval '%{rhel}'
1134-
)"/Everything/x86_64/Packages/p/python3-pytest-xdist-${{
1135-
contains(matrix.target-container.tag, 'ubi9')
1136-
&& '2.5.0-2'
1137-
|| '1.24.1-1'
1138-
}}${{ steps.distribution-meta.outputs.dist-tag }}.noarch.rpm
1111+
)"/Everything/x86_64/Packages/p/python3-filelock-3.7.1-1${{
1112+
steps.distribution-meta.outputs.dist-tag
1113+
}}.noarch.rpm
11391114
https://rpmfind.net/linux/epel/"$(
11401115
rpm --eval '%{rhel}'
1141-
)"/Everything/x86_64/Packages/t/tox-${{
1142-
contains(matrix.target-container.tag, 'ubi9')
1143-
&& '3.28.0-1'
1144-
|| '3.4.0-2'
1145-
}}${{ steps.distribution-meta.outputs.dist-tag }}.noarch.rpm
1116+
)"/Everything/x86_64/Packages/p/python3-tox-current-env-0.0.16-1${{
1117+
steps.distribution-meta.outputs.dist-tag
1118+
}}.noarch.rpm
11461119
https://rpmfind.net/linux/epel/"$(
11471120
rpm --eval '%{rhel}'
1148-
)"/Everything/x86_64/Packages/p/python3-execnet-${{
1149-
contains(matrix.target-container.tag, 'ubi9')
1150-
&& '1.9.0-3'
1151-
|| '1.7.1-1'
1152-
}}${{ steps.distribution-meta.outputs.dist-tag }}.noarch.rpm
1121+
)"/Everything/x86_64/Packages/p/python3-execnet-1.9.0-3${{
1122+
steps.distribution-meta.outputs.dist-tag
1123+
}}.noarch.rpm
11531124
https://rpmfind.net/linux/epel/"$(
11541125
rpm --eval '%{rhel}'
1155-
)"/Everything/x86_64/Packages/p/python3-coverage-${{
1156-
contains(matrix.target-container.tag, 'ubi9')
1157-
&& '6.2-1'
1158-
|| '4.5.1-9'
1159-
}}${{ steps.distribution-meta.outputs.dist-tag }}.x86_64.rpm
1126+
)"/Everything/x86_64/Packages/p/python3-coverage-6.2-1${{
1127+
steps.distribution-meta.outputs.dist-tag
1128+
}}.x86_64.rpm
11601129
https://rpmfind.net/linux/epel/"$(
11611130
rpm --eval '%{rhel}'
1162-
)"/Everything/x86_64/Packages/p/python3-apipkg-${{
1163-
contains(matrix.target-container.tag, 'ubi9')
1164-
&& '2.1.1-1'
1165-
|| '1.5-6'
1166-
}}${{ steps.distribution-meta.outputs.dist-tag }}.noarch.rpm
1131+
)"/Everything/x86_64/Packages/p/python3-expandvars-0.12.0-1${{
1132+
steps.distribution-meta.outputs.dist-tag
1133+
}}.noarch.rpm
11671134
11681135
- name: Install static build requirements
11691136
run: dnf builddep --assumeyes --spec packaging/rpm/ansible-pylibssh.spec
11701137

1171-
- name: Fetch sources and patches on a community distro
1172-
if: >-
1173-
!contains(matrix.target-container.tag, 'ubi')
1138+
- name: Fetch sources and patches
11741139
run: >-
11751140
spectool --all --get-files --sourcedir
11761141
packaging/rpm/ansible-pylibssh.spec
11771142
1178-
- name: Resolve and install dynamic build deps and build an SRPM on Fedora
1143+
- name: Resolve and install dynamic build deps and build an SRPM
11791144
# Ref: https://github.com/rpm-software-management/rpm/commit/58dcfdd
1180-
if: contains(matrix.target-container.tag, 'fedora')
11811145
run: |
11821146
while :
11831147
do
@@ -1195,38 +1159,25 @@ jobs:
11951159
}}.buildreqs.nosrc.rpm
11961160
done
11971161
1198-
- name: Build an SRPM on RHELish
1199-
if: >-
1200-
!contains(matrix.target-container.tag, 'fedora')
1201-
run: >-
1202-
rpmbuild
1203-
${{
1204-
contains(matrix.target-container.tag, 'ubi')
1205-
&& '--undefine=_disable_source_fetch'
1206-
|| ''
1207-
}}
1208-
-bs
1209-
packaging/rpm/ansible-pylibssh.spec
1210-
12111162
- name: Build binary RPMs
12121163
run: >-
12131164
rpmbuild
12141165
--rebuild
1215-
$HOME/rpmbuild/SRPMS/python-ansible-pylibssh-${{
1166+
"$HOME/rpmbuild/SRPMS/python-ansible-pylibssh-${{
12161167
needs.pre-setup.outputs.dist-version
12171168
}}-1${{
12181169
steps.distribution-meta.outputs.dist-tag
1219-
}}.src.rpm
1170+
}}.src.rpm"
12201171
- name: Install the packaged binary RPM on the system
12211172
run: >-
12221173
dnf
12231174
install
12241175
--assumeyes
1225-
$HOME/rpmbuild/RPMS/x86_64/python3-ansible-pylibssh-${{
1176+
"$HOME/rpmbuild/RPMS/x86_64/python3-ansible-pylibssh-${{
12261177
needs.pre-setup.outputs.dist-version
12271178
}}-1${{
12281179
steps.distribution-meta.outputs.dist-tag
1229-
}}.x86_64.rpm
1180+
}}.x86_64.rpm"
12301181
12311182
- name: Smoke-test the installed library
12321183
run: >-
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The CI/CD jobs for smoke-testing RPMs have been simplified
2+
and now, they execute the same steps for all distro types.
3+
They make use of ``pyproject-rpm-macros`` even under RHEL.
4+
Installing external RPMs is the only conditional step that
5+
is skipped on Fedora.
6+
7+
-- by :user:`webknjaz`
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
The RPM spec file no longer makes use of unpackaged dists
2+
from PyPI on RHEL. The configuration is almost identical to
3+
the one for Fedora. Only the ``setuptools-scm`` spec is
4+
temporarily patched to allow older versions under RHEL.
5+
6+
-- by :user:`webknjaz`

0 commit comments

Comments
 (0)