Skip to content

Commit 4391fbc

Browse files
authored
Add a constraints.txt file to limit python-daemon to versions < 3.0.0 (#3448)
Add it to the agent Makefile and to the pip invocation in the agent spec file. Tested by installing the resulting RPM and running an end-to-end smoke test (register tools, run pbench-user-benchmark, push results) on RHEL7.9, RHEL8.7, RHEL8.8, RHEL9.2, CentOS Stream 8, CentOS Stream 9, Fedora 37 and Fedora 38.
1 parent c560bdf commit 4391fbc

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

agent/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ install-lib:
244244
# For some reason, this only seems to be a problem on RHEL platforms prior to 9.
245245
pver = $(shell /usr/bin/python3 -c 'import sys; print(f"python{sys.version_info.major}.{sys.version_info.minor}")')
246246
install-python3-setup: install-util-scripts install-lib
247-
${COPY} requirements.txt ${DESTDIR}
247+
${COPY} requirements.txt constraints.txt ${DESTDIR}
248248
mkdir -p ${DESTDIR}/python3
249249
cd .. && PYTHONPATH=${DESTDIR}/python3/lib/${pver}/site-packages \
250250
/usr/bin/python3 -m pip install --prefix=${DESTDIR}/python3 -e .

agent/constraints.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-daemon<3.0.0

agent/rpm/pbench-agent.spec.j2

+2-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ if pip3 show configtools > /dev/null 2>&1 ;then pip3 uninstall -y configtools ;f
115115
%post
116116

117117
# Install python dependencies
118-
%{__python3} -m pip --no-cache-dir install --prefix=/%{installdir} -r /%{installdir}/requirements.txt > /%{installdir}/pip3-install.log 2>&1
118+
%{__python3} -m pip --no-cache-dir install --prefix=/%{installdir} -c /%{installdir}/constraints.txt -r /%{installdir}/requirements.txt > /%{installdir}/pip3-install.log 2>&1
119119

120120
# link the pbench profile, so it'll automatically be sourced on login
121121
ln -sf /%{installdir}/profile /etc/profile.d/pbench-agent.sh
@@ -151,6 +151,7 @@ fi
151151
/%{installdir}/SHA1
152152
/%{installdir}/profile
153153
/%{installdir}/requirements.txt
154+
/%{installdir}/constraints.txt
154155

155156
%config(noreplace) %attr(0664,root,root) /%{installdir}/config/pbench-agent.cfg
156157

0 commit comments

Comments
 (0)