I have the following exec commands in my gradle.build file.
exec {
workingDir System.getProperty("user.dir")
commandLine 'python3.6', 'buildscript.py'
}
exec {
workingDir System.getProperty("user.dir")
commandLine 'python3.6', '-m', 'virtualenv', 'env'
}
exec {
workingDir System.getProperty("user.dir")
commandLine 'source', 'env/bin/activate'
}
exec {
workingDir System.getProperty("user.dir")
commandLine 'pip3.6', 'install', 'pybuilder'
}
exec {
workingDir System.getProperty("user.dir")
commandLine 'pyb', '-E', 'env', '-X'
}
These are all within a build task that runs when executing gradle build. Theoretically this should run a script I created that creates all of the files necessary for building my python program, it should then create a virtual environment, activate it, install pybuilder to it, and then run pybuilder. However, the command:
exec {
workingDir System.getProperty("user.dir")
commandLine 'source', 'env/bin/activate'
}
Seems to be failing. It claims that the directory/file does not exist despite it working via command line. I'm not sure why this is the case. The whole point of this is to force Pybuilder to install my programs dependencies to the virtual environment I create. pyb -E env should technically be activating the virtual environment for me, but for whatever reason it's not installing my dependencies to that virtual environment. On our Jenkins node this is a problem as we don't want these installed globally, not to mention, I don't have root user privileges anyways.
Any help would be greatly greatly appreciated. If you know of another way to get Pybuilder to work correctly, that would be equally good.