diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6b62d0c..9bdb59d 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -65,8 +65,13 @@ jobs: python-version: '3.12' - name: Install NumPy + if: ${{ matrix.os != 'macos-latest' }} run: python3 -m pip install numpy + - name: Install NumPy on MacOs + if: ${{ matrix.os == 'macos-latest' }} + run: python3 -m pip install --user --break-system-packages numpy + - name: Run deno test run: deno task test diff --git a/README.md b/README.md index b7df25d..10b48ca 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,13 @@ plt.plot(xpoints, ypoints); plt.show(); ``` -When running, you **must** specify `--allow-ffi`, `--allow-env` and `--unstable` -flags. Alternatively, you may also just specify `-A` instead of specific -permissions since enabling FFI effectively escapes the permissions sandbox. +When running, you **must** specify `--allow-ffi`, `--allow-env` and +`--unstable-ffi` flags. Alternatively, you may also just specify `-A` instead of +specific permissions since enabling FFI effectively escapes the permissions +sandbox. ```shell -deno run -A --unstable +deno run -A --unstable-ffi ``` ### Usage in Bun diff --git a/deno.json b/deno.json index 5093226..500bf91 100644 --- a/deno.json +++ b/deno.json @@ -1,14 +1,14 @@ { "tasks": { "check": "deno task check:mod && deno task check:ext && deno task check:examples", - "check:mod": "deno check --unstable mod.ts", - "check:ext": "deno check --unstable ext/*.ts", - "check:examples": "deno check --unstable examples/*.ts", - "test": "deno test --unstable -A test/test.ts", - "example:hello_python": "deno run -A --unstable examples/hello_python.ts", - "example:matplotlib": "deno run -A --unstable examples/matplotlib.ts", - "example:pip_import": "deno run -A --unstable examples/pip_import.ts", - "example:run_code": "deno run -A --unstable examples/run_code.ts", - "example:tensorflow": "deno run -A --unstable examples/tensorflow.ts" + "check:mod": "deno check --unstable-ffi mod.ts", + "check:ext": "deno check --unstable-ffi ext/*.ts", + "check:examples": "deno check --unstable-ffi examples/*.ts", + "test": "deno test --unstable-ffi -A test/test.ts", + "example:hello_python": "deno run -A --unstable-ffi examples/hello_python.ts", + "example:matplotlib": "deno run -A --unstable-ffi examples/matplotlib.ts", + "example:pip_import": "deno run -A --unstable-ffi examples/pip_import.ts", + "example:run_code": "deno run -A --unstable-ffi examples/run_code.ts", + "example:tensorflow": "deno run -A --unstable-ffi examples/tensorflow.ts" } } diff --git a/src/ffi.ts b/src/ffi.ts index 4f26421..b4367cf 100644 --- a/src/ffi.ts +++ b/src/ffi.ts @@ -44,7 +44,7 @@ for (const path of searchPath) { } catch (err) { if (err instanceof TypeError && !("Bun" in globalThis)) { throw new Error( - "Cannot load dynamic library because --unstable flag was not set", + "Cannot load dynamic library because --unstable-ffi flag was not set", { cause: err }, ); }