Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions sdks/python/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ applyPythonNature()

task buildPython(dependsOn: 'setupVirtualenv') {
doLast {
println 'Building Python Dependencies'
logger.info('Building Python Dependencies')
exec {
executable 'sh'
args '-c', ". ${project.ext.envdir}/bin/activate && python setup.py build --build-base ${project.buildDir}"
Expand All @@ -50,7 +50,7 @@ task sdist {

// we need a fixed name for the artifact
copy { from collection.singleFile; into project.buildDir; rename { tarball } }
println "Create distribution tar file ${tarball} in ${project.buildDir}"
logger.info('Create distribution tar file {} in {}', tarball, project.buildDir)
}
inputs.files project.pythonSdkDeps
outputs.file "${project.buildDir}/${tarball}"
Expand All @@ -68,11 +68,13 @@ artifacts {
// Results will be stored in files under Gradle build directory.
task depSnapshot(dependsOn: 'installGcpTest') {
doLast {
println 'Snapshoting full dependencies requirements with versions info to requirements.txt.'
def requirements_file = new File("${project.buildDir}/requirements.txt")
requirements_file.createNewFile()
logger.info('Snapshoting full dependencies requirements with versions info to build/requirements.txt.')
exec {
// Remove useless item "pkg-resources" from file which is introduced by a bug in Ubuntu.
executable 'sh'
args '-c', ". ${project.ext.envdir}/bin/activate && pip freeze --local --all | grep -v \"pkg-resources\" > ${project.buildDir}/requirements.txt"
args '-c', ". ${project.ext.envdir}/bin/activate && pip freeze --local --all | grep -v \"pkg-resources\" > ${requirements_file}"
}
}
}
Expand Down