ci: workarounds for pyyaml installation (#8435)

This commit is contained in:
Harshal Sheth 2023-07-17 15:26:43 -07:00 committed by GitHub
parent cf8e44b69a
commit 2a3f6c42d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 4 deletions

View File

@ -17,7 +17,7 @@ ENV SCALA_VERSION 2.13
ENV CUB_CLASSPATH='"/usr/share/java/cp-base-new/*"' ENV CUB_CLASSPATH='"/usr/share/java/cp-base-new/*"'
# Confluent Docker Utils Version (Namely the tag or branch to grab from git to install) # Confluent Docker Utils Version (Namely the tag or branch to grab from git to install)
ARG PYTHON_CONFLUENT_DOCKER_UTILS_VERSION="v0.0.58" ARG PYTHON_CONFLUENT_DOCKER_UTILS_VERSION="v0.0.60"
# This can be overriden for an offline/air-gapped builds # This can be overriden for an offline/air-gapped builds
ARG PYTHON_CONFLUENT_DOCKER_UTILS_INSTALL_SPEC="git+https://github.com/confluentinc/confluent-docker-utils@${PYTHON_CONFLUENT_DOCKER_UTILS_VERSION}" ARG PYTHON_CONFLUENT_DOCKER_UTILS_INSTALL_SPEC="git+https://github.com/confluentinc/confluent-docker-utils@${PYTHON_CONFLUENT_DOCKER_UTILS_VERSION}"
@ -36,7 +36,9 @@ RUN mkdir -p /opt \
&& adduser -DH -s /sbin/nologin kafka \ && adduser -DH -s /sbin/nologin kafka \
&& chown -R kafka: /opt/kafka \ && chown -R kafka: /opt/kafka \
&& echo "===> Installing python packages ..." \ && echo "===> Installing python packages ..." \
&& pip install --no-cache-dir jinja2 requests \ && pip install --no-cache-dir --upgrade pip wheel setuptools \
&& pip install jinja2 requests \
&& pip install "Cython<3.0" "PyYAML<6" --no-build-isolation \
&& pip install --prefer-binary --prefix=/usr/local --upgrade "${PYTHON_CONFLUENT_DOCKER_UTILS_INSTALL_SPEC}" \ && pip install --prefer-binary --prefix=/usr/local --upgrade "${PYTHON_CONFLUENT_DOCKER_UTILS_INSTALL_SPEC}" \
&& rm -rf /tmp/* \ && rm -rf /tmp/* \
&& apk del --purge .build-deps && apk del --purge .build-deps

View File

@ -8,5 +8,6 @@ set -euxo pipefail
python3 -m venv venv python3 -m venv venv
source venv/bin/activate source venv/bin/activate
pip install --upgrade pip wheel setuptools
pip install -r requirements.txt pip install -r requirements.txt
python generate_docker_quickstart.py check-all python generate_docker_quickstart.py check-all

View File

@ -1,3 +1,3 @@
PyYAML==5.4.1 PyYAML==6.0
python-dotenv==0.17.0 python-dotenv==0.17.0
click click

View File

@ -22,6 +22,10 @@ task environmentSetup(type: Exec, dependsOn: checkPythonVersion) {
task installPackage(type: Exec, dependsOn: environmentSetup) { task installPackage(type: Exec, dependsOn: environmentSetup) {
inputs.file file('setup.py') inputs.file file('setup.py')
outputs.dir("${venv_name}") outputs.dir("${venv_name}")
// Workaround for https://github.com/yaml/pyyaml/issues/601.
// See https://github.com/yaml/pyyaml/issues/601#issuecomment-1638509577.
// and https://github.com/datahub-project/datahub/pull/8435.
commandLine 'bash', '-x', '-c', "${pip_install_command} install 'Cython<3.0' 'PyYAML<6' --no-build-isolation"
commandLine 'bash', '-x', '-c', "${pip_install_command} -e ." commandLine 'bash', '-x', '-c', "${pip_install_command} -e ."
} }