ci: fix commandLine usage in build.gradle (#8510)

This commit is contained in:
Harshal Sheth 2023-07-25 22:42:22 -07:00 committed by GitHub
parent c585a1bcc7
commit 2495b50f8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 7 deletions

View File

@ -25,8 +25,9 @@ task installPackage(type: Exec, dependsOn: environmentSetup) {
// Workaround for https://github.com/yaml/pyyaml/issues/601. // Workaround for https://github.com/yaml/pyyaml/issues/601.
// See https://github.com/yaml/pyyaml/issues/601#issuecomment-1638509577. // See https://github.com/yaml/pyyaml/issues/601#issuecomment-1638509577.
// and https://github.com/datahub-project/datahub/pull/8435. // 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',
commandLine 'bash', '-x', '-c', "${pip_install_command} -e ." "${pip_install_command} install 'Cython<3.0' 'PyYAML<6' --no-build-isolation && " +
"${pip_install_command} -e ."
} }
task install(dependsOn: [installPackage]) task install(dependsOn: [installPackage])

View File

@ -23,14 +23,17 @@ task checkPythonVersion(type: Exec) {
task environmentSetup(type: Exec, dependsOn: checkPythonVersion) { task environmentSetup(type: Exec, dependsOn: checkPythonVersion) {
inputs.file file('setup.py') inputs.file file('setup.py')
outputs.dir("${venv_name}") outputs.dir("${venv_name}")
commandLine 'bash', '-c', "${python_executable} -m venv ${venv_name} && ${venv_name}/bin/python -m pip install --upgrade pip wheel 'setuptools>=63.0.0'" commandLine 'bash', '-c',
"${python_executable} -m venv ${venv_name} && " +
"${venv_name}/bin/python -m pip install --upgrade pip wheel 'setuptools>=63.0.0'"
} }
task runPreFlightScript(type: Exec, dependsOn: environmentSetup) { task runPreFlightScript(type: Exec, dependsOn: environmentSetup) {
def sentinel_file = ".preflight_sentinel" def sentinel_file = ".preflight_sentinel"
outputs.file(sentinel_file) outputs.file(sentinel_file)
commandLine "scripts/datahub_preflight.sh" commandLine 'bash', '-c',
commandLine 'bash', '-c', "touch ${sentinel_file}" "scripts/datahub_preflight.sh && " +
"touch ${sentinel_file}"
} }
task installPackageOnly(type: Exec, dependsOn: runPreFlightScript) { task installPackageOnly(type: Exec, dependsOn: runPreFlightScript) {
@ -38,8 +41,9 @@ task installPackageOnly(type: Exec, dependsOn: runPreFlightScript) {
inputs.file file('setup.py') inputs.file file('setup.py')
outputs.dir("${venv_name}") outputs.dir("${venv_name}")
outputs.file(sentinel_file) outputs.file(sentinel_file)
commandLine 'bash', '-x', '-c', "${venv_name}/bin/pip install -e ." commandLine 'bash', '-x', '-c',
commandLine 'bash', '-c', "touch ${sentinel_file}" "${venv_name}/bin/pip install -e . &&" +
"touch ${sentinel_file}"
} }
task installPackage(type: Exec, dependsOn: installPackageOnly) { task installPackage(type: Exec, dependsOn: installPackageOnly) {