Skip to content

Commit

Permalink
Merge branch 'main' into cc
Browse files Browse the repository at this point in the history
  • Loading branch information
eliassjogreen authored Aug 14, 2024
2 parents 8348407 + 1e2e1ad commit a9c91d8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <file>
deno run -A --unstable-ffi <file>
```

### Usage in Bun
Expand Down
18 changes: 9 additions & 9 deletions deno.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
2 changes: 1 addition & 1 deletion src/ffi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
);
}
Expand Down

0 comments on commit a9c91d8

Please sign in to comment.