-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
undocument C.CTX and provide alternatives
- Loading branch information
Christopher Doris
committed
Nov 7, 2023
1 parent
b28afc1
commit 045b94c
Showing
5 changed files
with
51 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
python_executable_path() | ||
Path to the Python interpreter, or `missing` if not known. | ||
""" | ||
python_executable_path() = CTX.exe_path | ||
|
||
""" | ||
python_library_path() | ||
Path to libpython, or `missing` if not known. | ||
""" | ||
python_library_path() = CTX.lib_path | ||
|
||
""" | ||
python_library_handle() | ||
Handle to the open libpython, or `C_NULL` if not known. | ||
""" | ||
python_library_handle() = CTX.lib_ptr | ||
|
||
""" | ||
python_version() | ||
The version of Python, or `missing` if not known. | ||
""" | ||
python_version() = CTX.version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
# TODO | ||
@testitem "python info" begin | ||
@testset "python_executable_path" begin | ||
@test PythonCall.python_executable_path() isa String | ||
@test occursin("python", PythonCall.python_executable_path()) | ||
end | ||
@testset "python_library_path" begin | ||
@test PythonCall.python_library_path() isa String | ||
@test occursin("python", PythonCall.python_library_path()) | ||
end | ||
@testset "python_library_handle" begin | ||
@test PythonCall.python_library_handle() isa Ptr{Cvoid} | ||
@test PythonCall.python_library_handle() != C_NULL | ||
end | ||
@testset "python_version" begin | ||
@test PythonCall.python_version() isa VersionNumber | ||
@test PythonCall.python_version().major == 3 | ||
end | ||
end |