Skip to content

Commit

Permalink
ci: fix commandLine usage in build.gradle (#8510)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored Jul 26, 2023
1 parent c585a1b commit 2495b50
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions metadata-ingestion-modules/airflow-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ task installPackage(type: Exec, dependsOn: environmentSetup) {
// 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} install 'Cython<3.0' 'PyYAML<6' --no-build-isolation && " +
"${pip_install_command} -e ."
}

task install(dependsOn: [installPackage])
Expand Down
14 changes: 9 additions & 5 deletions metadata-ingestion/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,27 @@ task checkPythonVersion(type: Exec) {
task environmentSetup(type: Exec, dependsOn: checkPythonVersion) {
inputs.file file('setup.py')
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) {
def sentinel_file = ".preflight_sentinel"
outputs.file(sentinel_file)
commandLine "scripts/datahub_preflight.sh"
commandLine 'bash', '-c', "touch ${sentinel_file}"
commandLine 'bash', '-c',
"scripts/datahub_preflight.sh && " +
"touch ${sentinel_file}"
}

task installPackageOnly(type: Exec, dependsOn: runPreFlightScript) {
def sentinel_file = "${venv_name}/.build_install_package_only_sentinel"
inputs.file file('setup.py')
outputs.dir("${venv_name}")
outputs.file(sentinel_file)
commandLine 'bash', '-x', '-c', "${venv_name}/bin/pip install -e ."
commandLine 'bash', '-c', "touch ${sentinel_file}"
commandLine 'bash', '-x', '-c',
"${venv_name}/bin/pip install -e . &&" +
"touch ${sentinel_file}"
}

task installPackage(type: Exec, dependsOn: installPackageOnly) {
Expand Down

0 comments on commit 2495b50

Please sign in to comment.