Skip to content

Commit 324a51a

Browse files
fniephausmsimacek
authored andcommitted
Minor documentation improvements.
1 parent bcdefec commit 324a51a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

docs/user/Embedding-Permissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Python native extensions run by default as native binaries, with full access to
7777
See [Embedding limitations](Native-Extensions.md#embedding-limitations)
7878

7979
The context permissions needed to run native extensions are:
80-
```
80+
```java
8181
.allowIO(IOAccess.ALL)
8282
.allowCreateThread(true)
8383
.allowNativeAccess(true)

docs/user/Native-Extensions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ permalink: /reference-manual/python/Native-Extensions/
77

88
# Native Extensions Support
99

10-
CPython provides a [native extensions API](https://docs.python.org/3/c-api/index.html) for writing Python extensions in C/C++.
10+
CPython provides a [native extensions API](https://docs.python.org/3/c-api/index.html){:target="_blank"} for writing Python extensions in C/C++.
1111
GraalPy provides experimental support for this API, which allows many packages like NumPy and PyTorch to work well for many use cases.
1212
The support extends only to the API, not the binary interface (ABI), so extensions built for CPython are not binary compatible with GraalPy.
13-
Packages that use the native API have to be built and installed with GraalPy, and the prebuilt wheels for CPython from pypi.org cannot be used.
14-
For best results it is crucial that you only use the `pip` command that comes preinstalled in GraalPy virtualenvs to install packages.
13+
Packages that use the native API must be built and installed with GraalPy, and the prebuilt wheels for CPython from pypi.org cannot be used.
14+
For best results, it is crucial that you only use the `pip` command that comes preinstalled in GraalPy virtualenvs to install packages.
1515
The version of `pip` shipped with GraalPy applies additional patches to packages upon installation to fix known compatibility issues and it is preconfigured to use an additional repository from graalvm.org where we publish a selection of prebuilt wheels for GraalPy.
16-
Do not update `pip` or use alternative tools such as `uv`.
16+
Please do not update `pip` or use alternative tools such as `uv`.
1717

1818
## Embedding limitations
1919

2020
Python native extensions run by default as native binaries, with full access to the underlying system.
2121
Native code is not sandboxed and can circumvent any protections Truffle or the JVM may provide, up to and including aborting the entire process.
2222
Native data structures are not subject to the Java GC and the combination of them with Java data structures may lead to memory leaks.
2323
Native libraries generally cannot be loaded multiple times into the same process, and they may contain global state that cannot be safely reset.
24-
Thus, it's not possible to create multiple GraalPy contexts that access native modules within the same JVM.
25-
This includes the case when you create a context, close it and then create another context.
24+
Thus, it is not possible to create multiple GraalPy contexts that access native modules within the same JVM.
25+
This includes the case when you create a context, close it, and then create another context.
2626
The second context will not be able to access native extensions.

0 commit comments

Comments
 (0)