Skip to content

Commit

Permalink
Remove old python wrapper binaries and windows python wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherp committed Apr 6, 2024
1 parent b90c66d commit bf87495
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 1,072 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void setOutdatedWrapperDetectedWarningShown() {
}

private void detectOutdatedWrapper() {
List<String> wrapperFilenames = Arrays.asList("NZBHydra2.exe", "NZBHydra2 Console.exe", "nzbhydra2", "nzbhydra2wrapper.py", "nzbhydra2wrapperPy3.py");
List<String> wrapperFilenames = Arrays.asList("NZBHydra2.exe", "NZBHydra2 Console.exe", "nzbhydra2wrapper.py", "nzbhydra2wrapperPy3.py");
Set<String> expectedHashes;
try {
expectedHashes = Jackson.JSON_MAPPER.readValue(OutdatedWrapperDetector.class.getResource("/wrapperHashes2.json"), new TypeReference<>() {
Expand Down
6 changes: 6 additions & 0 deletions core/src/main/resources/changelog.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#@formatter:off
- version: "v6.0.1"
changes:
- type: "fix"
text: "Exit codes < 0 are now correctly handled in the python wrapper."
- type: "note"
text: "The linux binary nzbhydra2 is now deprecated. Please switch to directly running nzbhydra2wrapperPy3.py. "
- version: "v6.0.0"
changes:
- type: "feature"
Expand Down
1 change: 1 addition & 0 deletions core/src/main/resources/config/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@
<logger name="org.springframework.web.filter.CommonsRequestLoggingFilter" level="DEBUG"/>
<logger name="org.reflections" level="WARN"/>
<logger name="com.gargoylesoftware.htmlunit" level="off"/>
<logger name="org.apache.catalina.loader.WebappClassLoaderBase" level="ERROR"/>

<root level="INFO">
<appender-ref ref="CONSOLE"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ public class ReleaseMojo extends AbstractMojo {
@Parameter(property = "changelogYamlFile", required = true)
protected File changelogYamlFile;

@Parameter(property = "linuxAmd64Executable", required = false)
protected File linuxAmd64Executable;
// @Parameter(property = "linuxArm64Executable", required = false)
// protected File linuxArm64Executable;
@Parameter(property = "windowsExecutable", required = false)
protected File windowsExecutable;
@Parameter(property = "windowsConsoleExecutable", required = false)
Expand Down Expand Up @@ -176,17 +172,8 @@ protected void executePrechecks() throws MojoExecutionException {
return;
}
try {
final Instant linuxAmd64ExecutableCreationTime = Files.readAttributes(linuxAmd64Executable.toPath(), BasicFileAttributes.class).creationTime().toInstant();
// final Instant linuxArm64ExecutableCreationTime = Files.readAttributes(linuxArm64Executable.toPath(), BasicFileAttributes.class).creationTime().toInstant();
final Instant windowsExecutableCreationTime = Files.readAttributes(windowsExecutable.toPath(), BasicFileAttributes.class).creationTime().toInstant();
final Instant windowsConsoleExecutableCreationTime = Files.readAttributes(windowsConsoleExecutable.toPath(), BasicFileAttributes.class).creationTime().toInstant();
final Instant py3CreationTime = Files.readAttributes(py3.toPath(), BasicFileAttributes.class).creationTime().toInstant();
final Instant goWrapperCreationTime = Files.readAttributes(goWrapper.toPath(), BasicFileAttributes.class).creationTime().toInstant();
verifyIsYounger(linuxAmd64Executable, py3);
// verifyIsYounger(linuxArm64Executable, py3);
verifyIsYounger(windowsExecutable, py3);
verifyIsYounger(windowsExecutable, goWrapper);
verifyIsYounger(windowsConsoleExecutable, py3);
verifyIsYounger(windowsConsoleExecutable, goWrapper);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

public class PrecheckMojoTest extends AbstractMojoTestCase {

Expand Down Expand Up @@ -34,40 +36,38 @@ public void testThatExecutableTimesAreChecked() throws Exception {
precheckMojo = (PrecheckMojo) configureMojo(precheckMojo, extractPluginConfiguration("github-release-plugin", pom
));

precheckMojo.py3 = Files.createTempFile("hydra", "executable").toFile();
precheckMojo.py3 = getTempFile().toFile();
IOUtils.write("py3", new FileWriter(precheckMojo.py3));
Thread.sleep(10);

precheckMojo.goWrapper = Files.createTempFile("hydra", "executable").toFile();
precheckMojo.goWrapper = getTempFile().toFile();
IOUtils.write("goWrapper", new FileWriter(precheckMojo.goWrapper));
Thread.sleep(10);

precheckMojo.windowsExecutable = Files.createTempFile("hydra", "executable").toFile();
precheckMojo.windowsExecutable = getTempFile().toFile();
IOUtils.write("windowsExecutable", new FileWriter(precheckMojo.windowsExecutable));
Thread.sleep(10);

precheckMojo.linuxAmd64Executable = Files.createTempFile("hydra", "executable").toFile();
IOUtils.write("linuxAmd64Executable", new FileWriter(precheckMojo.linuxAmd64Executable));
Thread.sleep(10);

precheckMojo.windowsConsoleExecutable = Files.createTempFile("hydra", "executable").toFile();
precheckMojo.windowsConsoleExecutable = getTempFile().toFile();
IOUtils.write("windowsConsoleExecutable", new FileWriter(precheckMojo.windowsConsoleExecutable));


precheckMojo.execute();


precheckMojo.py3 = Files.createTempFile("hydra", "executable").toFile();
IOUtils.write("py3", new FileWriter(precheckMojo.py3));
precheckMojo.goWrapper = getTempFile().toFile();
IOUtils.write("goWrapper", new FileWriter(precheckMojo.goWrapper));

try {
precheckMojo.execute();
fail("Expected exception because py3 was changed after executables");
fail("Expected exception because goWrapper was changed after executables");
} catch (MojoExecutionException e) {
//
}
}


private static Path getTempFile() throws IOException {
Path tempFile = Files.createTempFile("hydra", "executable");
tempFile.toFile().deleteOnExit();
return tempFile;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<tagName>v1.0.0</tagName>
<githubToken>token</githubToken>
<changelogYamlFile>${basedir}/src/test/resources/org/nzbhydra/github/mavenreleaseplugin/changelogOld.yaml</changelogYamlFile>
<linuxAmd64Executable>${basedir}/releases/linux-amd64-release/include/executables/nzbhydra2</linuxAmd64Executable>
<windowsExecutable>${basedir}/releases/windows-release/include/NZBHydra2.exe</windowsExecutable>
<windowsConsoleExecutable>${basedir}/releases/windows-release/include/NZBHydra2 Console.exe</windowsConsoleExecutable>
<py3>${basedir}/other/wrapper/nzbhydra2wrapperPy3.py</py3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<tagName>v1.0.0</tagName>
<githubTokenFile>${basedir}/src/test/resources/org/nzbhydra/github/mavenreleaseplugin/tokenFile.txt</githubTokenFile>
<changelogYamlFile>${basedir}/src/test/resources/org/nzbhydra/github/mavenreleaseplugin/changelog.yaml</changelogYamlFile>
<linuxAmd64Executable>${basedir}/releases/linux-amd64-release/include/executables/nzbhydra2</linuxAmd64Executable>
<windowsExecutable>${basedir}/releases/windows-release/include/NZBHydra2.exe</windowsExecutable>
<windowsConsoleExecutable>${basedir}/releases/windows-release/include/NZBHydra2 Console.exe</windowsConsoleExecutable>
<py3>${basedir}/other/wrapper/nzbhydra2wrapperPy3.py</py3>
Expand Down
12 changes: 1 addition & 11 deletions other/wrapper/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,4 @@


**/.cache
nzbhydra.pid
#Ignore wrapper files copied to folders for pyinstaller to find
/pyInstaller/**/*.py
!/pyInstaller/windows/nzbhydra2wrapperWindows.py
!/pyInstaller/windows/systemTray.py
/pyInstaller/**/*.ico
/pyInstaller/**/VersionInfo*.txt
/**/dist/
/venv
/venv_py3
pyInstaller/venv_py3
nzbhydra.pid
Loading

0 comments on commit bf87495

Please sign in to comment.