Open rohit-karthik opened 3 years ago
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
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 ')':![image](https://user-images.githubusercontent.com/63020497/104140666-68356a00-5367-11eb-8732-a27145619c3a.png)
The error in the console:![image](https://user-images.githubusercontent.com/63020497/104140681-74b9c280-5367-11eb-8dc0-cb5a0f146604.png)
My build.gradle:![image](https://user-images.githubusercontent.com/63020497/104140694-80a58480-5367-11eb-9b5c-67491a92518c.png)
I'm using VS Code as my editor on Mac OS 11.0.1. Any help would be appreciated. Thanks!