Skip to content

Commit db4f765

Browse files
committed
add venv for executing zarrita to CI
1 parent 5b8ca3e commit db4f765

File tree

3 files changed

+3
-47
lines changed

3 files changed

+3
-47
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ jobs:
3535

3636
- name: Install zarrita
3737
run: |
38-
python -m pip install --upgrade pip
39-
pip install zarrita
38+
python -m venv venv_zarrita
39+
venv_zarrita/bin/pip install zarrita
4040
4141
- name: Download blosc jar
4242
run: |

src/test/java/dev/zarr/zarrjava/ZarrTest.java

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -51,54 +51,11 @@ public static void clearTestoutputFolder() throws IOException {
5151
Files.createDirectory(TESTOUTPUT);
5252
}
5353

54-
//@BeforeAll
55-
//TODO: might be needed for Windows
56-
public static void installZarritaInCondaEnv() throws IOException {
57-
Process process = Runtime.getRuntime().exec("conda run -n " + CONDA_ENVIRONMENT + " pip install zarrita");
58-
//Process process = Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "conda run -n " + CONDA_ENVIRONMENT + " pip install zarrita"});
59-
60-
BufferedReader stdError = new BufferedReader(new InputStreamReader(process.getErrorStream()));
61-
String s;
62-
boolean environmentLocationNotFound = false;
63-
while ((s = stdError.readLine()) != null) {
64-
System.err.println(s);
65-
if (s.contains("EnvironmentLocationNotFound")) {
66-
environmentLocationNotFound = true;
67-
68-
}
69-
}
70-
if (environmentLocationNotFound) {
71-
System.out.println("creating conda environment: " + CONDA_ENVIRONMENT);
72-
process = Runtime.getRuntime().exec("conda create --name " + CONDA_ENVIRONMENT + " -y");
73-
System.out.println("exec: conda create --name " + CONDA_ENVIRONMENT + " -y");
74-
BufferedReader stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
75-
while ((s = stdInput.readLine()) != null) {
76-
System.out.println(s);
77-
}
78-
stdError = new BufferedReader(new InputStreamReader(process.getErrorStream()));
79-
while ((s = stdError.readLine()) != null) {
80-
System.err.println(s);
81-
}
82-
83-
process = Runtime.getRuntime().exec("conda run -n " + CONDA_ENVIRONMENT + " pip install zarrita");
84-
System.out.println("exec: conda run -n " + CONDA_ENVIRONMENT + " pip install zarrita");
85-
86-
stdInput = new BufferedReader(new InputStreamReader(process.getInputStream()));
87-
while ((s = stdInput.readLine()) != null) {
88-
System.out.println(s);
89-
}
90-
stdError = new BufferedReader(new InputStreamReader(process.getErrorStream()));
91-
while ((s = stdError.readLine()) != null) {
92-
System.err.println(s);
93-
}
94-
}
95-
}
96-
9754
@ParameterizedTest
9855
@ValueSource(strings = {"blosc", "gzip", "zstd", "bytes", "transpose", "sharding", "crc32c"})
9956
public void testReadFromZarrita(String codec) throws IOException, ZarrException, InterruptedException {
100-
String command = "zarrita/bin/python";
10157

58+
String command = "venv_zarrita/bin/python";
10259
ProcessBuilder pb = new ProcessBuilder(command, ZARRITA_WRITE_PATH.toString(), codec, TESTOUTPUT.toString());
10360
Process process = pb.start();
10461

src/test/java/dev/zarr/zarrjava/zarrita_write.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
store = zarrita.LocalStore(sys.argv[2])
2626
testdata = np.arange(16 * 16, dtype='int32').reshape((16, 16))
27-
print(f"{codec=}")
2827

2928
a = zarrita.Array.create(
3029
store / 'read_from_zarrita' / codec_string,

0 commit comments

Comments
 (0)