Issue with creating a virtualenv.
Hello,
I tried to get pygradle working with my project, but couldn't get it to work, as during the build in the "wheel-api.py" file, I get three question marks instead of a ')':

The error in the console:

My build.gradle:

I'm using VS Code as my editor on Mac OS 11.0.1. Any help would be appreciated. Thanks!
I have the same problem on Ubuntu 20.04, looks like this code does not completely write file:
InputStream wheelApiResource = ProbeVenvInfoAction.class.getClassLoader()
.getResourceAsStream("templates/wheel-api.py");
byte[] buffer = new byte[wheelApiResource.available()];
wheelApiResource.read(buffer);
File probeDir = new File(project.getBuildDir(), PROBE_DIR_NAME);
probeDir.mkdirs();
OutputStream outStream = new FileOutputStream(getPythonFileForSupportedWheels(probeDir));
outStream.write(buffer);
Ok, I think I found two solutions to this problem: First is to use JDK8, problem does not occur there.
Another one patching ./pygradle-plugin/src/main/groovy/com/linkedin/gradle/python/tasks/action/ProbeVenvInfoAction.java with following code:
private static void doProbe(Project project, PythonDetails pythonDetails,
EditablePythonAbiContainer editablePythonAbiContainer) throws IOException {
File probeDir = new File(project.getBuildDir(), PROBE_DIR_NAME);
probeDir.mkdirs();
byte[] buffer = new byte[1024];
try(InputStream wheelApiResource = ProbeVenvInfoAction.class.getClassLoader()
.getResourceAsStream("templates/wheel-api.py");
OutputStream outStream = new FileOutputStream(getPythonFileForSupportedWheels(probeDir))) {
int size;
while((size = wheelApiResource.read(buffer)) > 0) {
outStream.write(buffer, 0, size);
}
}
File supportedAbiFormatsFile = getSupportedAbiFormatsFile(probeDir, pythonDetails);
project.exec(execSpec -> {
execSpec.commandLine(pythonDetails.getVirtualEnvInterpreter());
execSpec.args(getPythonFileForSupportedWheels(probeDir));
execSpec.args(supportedAbiFormatsFile.getAbsolutePath());
});
/*
* The code for this function was originally here.
* Still making this call to benefit AbstractPythonInfrastructureDefaultTask,
* although it's not necessary for InstallVirtualEnvironmentTask because
* GetProbedTagsTask will get the tags.
*/
getSavedTags(pythonDetails, editablePythonAbiContainer, supportedAbiFormatsFile);
}
After recompiling and doing ./gradlew publishPluginMavenPublicationToMavenLocal plugin seem to work fine locally.
First is to use JDK8, problem does not occur there.
Tried with jdk8 - same issue