Skip to content

Commit 1672826

Browse files
committed
Refactor documentation of extension autoloading
1 parent dfe5b84 commit 1672826

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

docs/src/compat.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ The `juliacall` IPython extension adds these features to your IPython session:
6767

6868
The extension is experimental and unstable - the API can change at any time.
6969

70-
Enable the extension with `%load_ext juliacall`.
71-
See [the IPython docs](https://ipython.readthedocs.io/en/stable/config/extensions/).
70+
You can explicitly enable the extension with `%load_ext juliacall`, but
71+
it will automatically be loaded if `juliacall` is imported and IPython is detected.
72+
You can disable this behavior with an [environment variable](@ref julia-config).
7273

7374
The `%%julia` cell magic can synchronise variables between Julia and Python by listing them
7475
on the first line:
@@ -88,6 +89,9 @@ In [5]: z
8889
Out[5]: '2^8 = 256'
8990
```
9091

92+
Also see [the IPython docs](https://ipython.readthedocs.io/en/stable/config/extensions/)
93+
for more information on extensions.
94+
9195
## Asynchronous Julia code (including Makie)
9296

9397
Asynchronous Julia code will not normally run while Python is executing, unless it is in a

docs/src/juliacall.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,4 @@ be configured in two ways:
123123
| `-X juliacall-sysimage=<file>` | `PYTHON_JULIACALL_SYSIMAGE=<file>` | Use the given system image. |
124124
| `-X juliacall-threads=<N\|auto>` | `PYTHON_JULIACALL_THREADS=<N\|auto>` | Launch N threads. |
125125
| `-X juliacall-warn-overwrite=<yes\|no>` | `PYTHON_JULIACALL_WARN_OVERWRITE=<yes\|no>` | Enable or disable method overwrite warnings. |
126+
| `-X juliacall-autoload-ipython-extension=<yes\|no>` | `PYTHON_JULIACALL_AUTOLOAD_IPYTHON_EXTENSION=<yes\|no>` | Enable or disable IPython extension autoloading. |

pysrc/juliacall/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,11 +257,7 @@ def jlstr(x):
257257
if CONFIG['autoload_ipython_extension'] is None:
258258
# Only let the user know if it was not explicitly set
259259
print(
260-
"Detected IPython. Loading juliacall extension. To disable, you can either "
261-
"set the environment variable PYTHON_JULIACALL_AUTOLOAD_IPYTHON_EXTENSION=no or pass the "
262-
"command line argument '-X juliacall-autoload-ipython-extension=no'. Inside Jupyter, you can "
263-
"do this with `import os; os.environ['PYTHON_JULIACALL_AUTOLOAD_IPYTHON_EXTENSION'] = 'no'`. "
264-
"To suppress this message, set PYTHON_JULIACALL_AUTOLOAD_IPYTHON_EXTENSION=yes."
260+
"Detected IPython. Loading juliacall extension. See https://juliapy.github.io/PythonCall.jl/stable/compat/#IPython"
265261
)
266262

267263
load_ipython_extension(get_ipython())

0 commit comments

Comments
 (0)