From f848bc4e7aa195c2dffa25585458487dbe7c3873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Cassiers?= Date: Tue, 6 Apr 2021 16:06:34 +0200 Subject: [PATCH 1/5] Support ndarray 0.15 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 40379726a..a314ec383 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ cfg-if = "0.1" libc = "0.2" num-complex = ">= 0.2, < 0.4" num-traits = "0.2" -ndarray = ">= 0.13, < 0.15" +ndarray = ">= 0.13, < 0.16" pyo3 = "0.13" [features] From e2bfdaf21cdfbe1327f92c6d2ec135a9e2e9fe7f Mon Sep 17 00:00:00 2001 From: kngwyu Date: Sat, 5 Jun 2021 17:15:26 +0900 Subject: [PATCH 2/5] Update ndarray in examples --- .github/workflows/ci.yml | 9 +++++---- Cargo.toml | 3 +-- examples/linalg/Cargo.toml | 5 +++-- examples/simple-extension/Cargo.toml | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b57d6a1ce..4a911ee49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,19 +87,20 @@ jobs: run: pip install maturin poetry toml - name: Create an isolated example directory run: cp -r examples/simple-extension/ ../simple-extension-msrv - - name: Edit Cargo.toml + - name: Edit Cargo.toml and change the path of rust-numpy run: | import toml cargo_toml = toml.load("Cargo.toml") + cargo_toml["dependencies"]["numpy"]["path"] = "../rust-numpy" cargo_toml["dependencies"]["ndarray"] = "0.13.1" cargo_toml["dependencies"]["num-complex"] = "0.2.4" - cargo_toml["dependencies"]["numpy"]["path"] = "../rust-numpy" with open("Cargo.toml", "w") as f: toml.dump(cargo_toml, f) working-directory: ../simple-extension-msrv shell: python - - name: Remove ndarray 0.14.0 - run: cargo update -p ndarray:0.14.0 --precise 0.13.1 + - name: Use ndarray 0.13.1 and num-complex 0.2.0 + run: | + cargo update -p ndarray:0.15.2 --precise 0.13.1 working-directory: ../simple-extension-msrv - name: Test Example run: | diff --git a/Cargo.toml b/Cargo.toml index d4e1ad976..79c114f1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,5 @@ pyo3 = "0.13" default = [] rayon = ["ndarray/rayon"] - [workspace] -members = ["examples/*"] +members = ["examples/*"] \ No newline at end of file diff --git a/examples/linalg/Cargo.toml b/examples/linalg/Cargo.toml index 848ecec3a..7d15ab44e 100644 --- a/examples/linalg/Cargo.toml +++ b/examples/linalg/Cargo.toml @@ -10,8 +10,9 @@ crate-type = ["cdylib"] [dependencies] numpy = { path = "../.." } -ndarray = "0.14" -ndarray-linalg = { version = "0.13", features = ["openblas-static"] } +ndarray = "0.15" +# ndarray-linalg = { version = "0.13", features = ["openblas-static"] } +ndarray-linalg = { git = "https://github.com/rust-ndarray/ndarray-linalg", features = ["openblas-static"] } [dependencies.pyo3] version = "0.13" diff --git a/examples/simple-extension/Cargo.toml b/examples/simple-extension/Cargo.toml index a7304a4a5..6136b7952 100644 --- a/examples/simple-extension/Cargo.toml +++ b/examples/simple-extension/Cargo.toml @@ -10,8 +10,8 @@ crate-type = ["cdylib"] [dependencies] numpy = { path = "../.." } -ndarray = "0.14" -num-complex = "0.3" +ndarray = "0.15.2" +num-complex = "0.4.0" [dependencies.pyo3] version = "0.13" From 13f6f3911b1949e2db79c085e065f0330403b76b Mon Sep 17 00:00:00 2001 From: messense Date: Sun, 6 Jun 2021 13:30:04 +0800 Subject: [PATCH 3/5] Update .github/workflows/ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a911ee49..5b476dbda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,7 +100,7 @@ jobs: shell: python - name: Use ndarray 0.13.1 and num-complex 0.2.0 run: | - cargo update -p ndarray:0.15.2 --precise 0.13.1 + cargo update -p ndarray:0.15.3 --precise 0.13.1 working-directory: ../simple-extension-msrv - name: Test Example run: | From 5a75488df9b84274e7ffeb441e6ab5ccf3adc3f6 Mon Sep 17 00:00:00 2001 From: Yuji Kanagawa Date: Mon, 7 Jun 2021 11:26:00 +0900 Subject: [PATCH 4/5] Use a hack in MSRV test --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b476dbda..3875df1e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,9 +98,8 @@ jobs: toml.dump(cargo_toml, f) working-directory: ../simple-extension-msrv shell: python - - name: Use ndarray 0.13.1 and num-complex 0.2.0 - run: | - cargo update -p ndarray:0.15.3 --precise 0.13.1 + - name: Use ndarray 0.13.1 + run: cargo update -p (cargo pkgid -p ndarray 2>&1 >/dev/null | grep 0.15 | sed -e 's/^[ \t]*//') --precise 0.13.1 working-directory: ../simple-extension-msrv - name: Test Example run: | From 0b6c506e516e544136ae3e268dbf059698c11c59 Mon Sep 17 00:00:00 2001 From: Yuji Kanagawa Date: Mon, 7 Jun 2021 11:30:31 +0900 Subject: [PATCH 5/5] Fix the shell hack --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3875df1e6..4f3bc32d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,7 +99,9 @@ jobs: working-directory: ../simple-extension-msrv shell: python - name: Use ndarray 0.13.1 - run: cargo update -p (cargo pkgid -p ndarray 2>&1 >/dev/null | grep 0.15 | sed -e 's/^[ \t]*//') --precise 0.13.1 + run: | + cargo generate-lockfile + cargo update -p $(cargo pkgid -p ndarray 2>&1 >/dev/null | grep 0.15 | sed -e 's/^[ \t]*//') --precise 0.13.1 working-directory: ../simple-extension-msrv - name: Test Example run: |