Skip to content

Commit

Permalink
Add a constraints.txt file to limit python-daemon to versions < 3.0.0 (
Browse files Browse the repository at this point in the history
…#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.
  • Loading branch information
ndokos authored Jun 5, 2023
1 parent c560bdf commit 4391fbc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion agent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ install-lib:
# For some reason, this only seems to be a problem on RHEL platforms prior to 9.
pver = $(shell /usr/bin/python3 -c 'import sys; print(f"python{sys.version_info.major}.{sys.version_info.minor}")')
install-python3-setup: install-util-scripts install-lib
${COPY} requirements.txt ${DESTDIR}
${COPY} requirements.txt constraints.txt ${DESTDIR}
mkdir -p ${DESTDIR}/python3
cd .. && PYTHONPATH=${DESTDIR}/python3/lib/${pver}/site-packages \
/usr/bin/python3 -m pip install --prefix=${DESTDIR}/python3 -e .
Expand Down
1 change: 1 addition & 0 deletions agent/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-daemon<3.0.0
3 changes: 2 additions & 1 deletion agent/rpm/pbench-agent.spec.j2
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ if pip3 show configtools > /dev/null 2>&1 ;then pip3 uninstall -y configtools ;f
%post

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

# link the pbench profile, so it'll automatically be sourced on login
ln -sf /%{installdir}/profile /etc/profile.d/pbench-agent.sh
Expand Down Expand Up @@ -151,6 +151,7 @@ fi
/%{installdir}/SHA1
/%{installdir}/profile
/%{installdir}/requirements.txt
/%{installdir}/constraints.txt

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

Expand Down

0 comments on commit 4391fbc

Please sign in to comment.