Skip to content

Commit 3ac5f4d

Browse files
author
Christopher Doris
committed
Merge branch 'main' into v1
2 parents 1df6867 + 045b94c commit 3ac5f4d

75 files changed

Lines changed: 142 additions & 235 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/src/pycall.md

Lines changed: 1 addition & 1 deletion

pysrc/juliacall/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ def convert(T, x):
2424
def interactive(enable=True):
2525
"Allow the Julia event loop to run in the background of the Python REPL."
2626
if enable:
27-
PythonCall._set_python_input_hook()
27+
PythonCall.Compat._set_python_input_hook()
2828
else:
29-
PythonCall._unset_python_input_hook()
29+
PythonCall.Compat._unset_python_input_hook()
3030

3131
class JuliaError(Exception):
3232
"An error arising in Julia code."

pysrc/juliacall/ipython.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def load_ipython_extension(ip):
9595
ip.events.register('post_execute', PythonCall._ipython._flush_stdio)
9696
# push displays
9797
PythonCall.seval("""begin
98-
pushdisplay(_compat.PythonDisplay())
99-
pushdisplay(_compat.IPythonDisplay())
98+
pushdisplay(Compat.PythonDisplay())
99+
pushdisplay(Compat.IPythonDisplay())
100100
nothing
101101
end""")

src/CPython/_.jl renamed to src/C/C.jl

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
2-
module _CPython
2+
module PythonCall.C
33
44
This module provides a direct interface to the Python C API.
55
"""
6-
module _CPython
6+
module C
77

88
using Base: @kwdef
99
using UnsafePointers: UnsafePtr
@@ -12,16 +12,12 @@ using Pkg: Pkg
1212
using Requires: @require
1313
using Libdl: dlpath, dlopen, dlopen_e, dlclose, dlsym, dlsym_e, RTLD_LAZY, RTLD_DEEPBIND, RTLD_GLOBAL
1414

15-
# import Base: @kwdef
16-
# import CondaPkg
17-
# import Pkg
18-
# using Libdl, Requires, UnsafePointers, Serialization, ..Utils
19-
2015
include("consts.jl")
2116
include("pointers.jl")
2217
include("extras.jl")
2318
include("context.jl")
2419
include("gil.jl")
20+
include("api.jl")
2521

2622
function __init__()
2723
init_context()

src/C/api.jl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""
2+
python_executable_path()
3+
4+
Path to the Python interpreter, or `missing` if not known.
5+
"""
6+
python_executable_path() = CTX.exe_path
7+
8+
"""
9+
python_library_path()
10+
11+
Path to libpython, or `missing` if not known.
12+
"""
13+
python_library_path() = CTX.lib_path
14+
15+
"""
16+
python_library_handle()
17+
18+
Handle to the open libpython, or `C_NULL` if not known.
19+
"""
20+
python_library_handle() = CTX.lib_ptr
21+
22+
"""
23+
python_version()
24+
25+
The version of Python, or `missing` if not known.
26+
"""
27+
python_version() = CTX.version
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)