Skip to content

Commit 19119b6

Browse files
author
Christopher Doris
committed
Merge branch 'main' into v1
2 parents bd7e81a + d001fe6 commit 19119b6

File tree

13 files changed

+61
-23
lines changed

13 files changed

+61
-23
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ jobs:
6363
uses: actions/setup-python@v4
6464
with:
6565
python-version: ${{ matrix.pyversion }}
66+
- name: Set up Julia 1.10.0
67+
uses: julia-actions/setup-julia@v1
68+
with:
69+
version: '1.10.0'
6670
- name: Install dependencies
6771
run: |
6872
python -m pip install --upgrade pip

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "PythonCall"
22
uuid = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
33
authors = ["Christopher Doris <github.com/cjdoris>"]
4-
version = "0.9.15"
4+
version = "0.9.17"
55

66
[deps]
77
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"

bump.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ bumpver("pysrc/juliacall/__init__.py", "__version__ = '{}'\n", oldver, newver)
2727
bumpver("pysrc/juliacall/juliapkg.json", "\"version\": \"={}\"", oldver, newver)
2828
bumpver("pysrc/juliacall/juliapkg-dev.json", "\"version\": \"={}\"", oldver, newver)
2929
bumpver("src/PythonCall.jl", "VERSION = v\"{}\"", oldver, newver)
30+
bumpver("src/Core/Core.jl", "VERSION = v\"{}\"", oldver, newver)
3031
bump("docs/src/releasenotes.md", "## Unreleased", "## $newver ($(today()))")

docs/src/releasenotes.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
## Unreleased (v1)
44
* `PythonCall.GC` is now more like `Base.GC`: `enable(true)` replaces `enable()`, `enable(false)` replaces `disable()`, and `gc()` is added.
55

6-
## Unreleased
6+
## 0.9.17 (2024-03-16)
7+
* Bug fixes.
8+
9+
## 0.9.16 (2024-03-14)
10+
* Big internal refactor.
711
* New unexported functions: `python_executable_path`, `python_library_path`, `python_library_handle` and `python_version`.
812
* `Py` is now treated as a scalar when broadcasting.
913
* `PyArray` is now serializable.
14+
* Removed compatibility with Julia 1.10.1 and 1.10.2 (to be fixed in 1.10.3 and 1.11.0) due to an upstream bug.
1015
* Bug fixes.
1116

1217
## 0.9.15 (2023-10-25)

pysrc/juliacall/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This module gets modified by PythonCall when it is loaded, e.g. to include Core, Base
22
# and Main modules.
33

4-
__version__ = '0.9.15'
4+
__version__ = '0.9.17'
55

66
_newmodule = None
77

@@ -18,7 +18,7 @@ def convert(T, x):
1818
"Convert x to a Julia T."
1919
global _convert
2020
if _convert is None:
21-
_convert = PythonCall.seval("pyjlcallback((T,x)->pyjl(pyconvert(pyjlvalue(T)::Type,x)))")
21+
_convert = PythonCall.JlWrap.seval("pyjlcallback((T,x)->pyjl(pyconvert(pyjlvalue(T)::Type,x)))")
2222
return _convert(T, x)
2323

2424
def interactive(enable=True):

pysrc/juliacall/juliapkg-dev.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"julia": "1.6.1",
2+
"julia": "~1.6.1, ~1.7, ~1.8, ~1.9, =1.10.0",
33
"packages": {
44
"PythonCall": {
55
"uuid": "6099a3de-0909-46bc-b1f4-468b9a2dfc0d",
6-
"version": "=0.9.15",
6+
"version": "=0.9.17",
77
"path": "../..",
88
"dev": true
99
}

pysrc/juliacall/juliapkg.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"julia": "1.6.1",
2+
"julia": "~1.6.1, ~1.7, ~1.8, ~1.9, =1.10.0",
33
"packages": {
44
"PythonCall": {
55
"uuid": "6099a3de-0909-46bc-b1f4-468b9a2dfc0d",
6-
"version": "=0.9.15"
6+
"version": "=0.9.17"
77
}
88
}
99
}

pytest/test_all.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,45 @@
11
def test_import():
22
import juliacall
33

4+
def test_newmodule():
5+
import juliacall
6+
jl = juliacall.Main
7+
m = juliacall.newmodule("TestModule")
8+
assert isinstance(m, juliacall.ModuleValue)
9+
assert jl.isa(m, jl.Module)
10+
assert str(jl.nameof(m)) == "TestModule"
11+
12+
def test_convert():
13+
import juliacall
14+
jl = juliacall.Main
15+
for (x, t) in [(None, jl.Nothing), (True, jl.Bool), ([1,2,3], jl.Vector)]:
16+
y = juliacall.convert(t, x)
17+
assert isinstance(y, juliacall.AnyValue)
18+
assert jl.isa(y, t)
19+
20+
def test_interactive():
21+
import juliacall
22+
juliacall.interactive(True)
23+
juliacall.interactive(False)
24+
25+
def test_JuliaError():
26+
import juliacall
27+
jl = juliacall.Main
28+
assert isinstance(juliacall.JuliaError, type)
29+
assert issubclass(juliacall.JuliaError, Exception)
30+
try:
31+
juliacall.Base.error("test error")
32+
err = None
33+
except juliacall.JuliaError as e:
34+
err = e
35+
assert err is not None
36+
assert isinstance(err, juliacall.JuliaError)
37+
exc = err.exception
38+
assert jl.isa(exc, jl.ErrorException)
39+
assert str(exc.msg) == "test error"
40+
bt = err.backtrace
41+
assert bt is not None
42+
443
def test_issue_394():
544
"https://github.com/JuliaPy/PythonCall.jl/issues/394"
645
from juliacall import Main as jl

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = juliacall
3-
version = 0.9.15
3+
version = 0.9.17
44
description = Julia and Python in seamless harmony
55
long_description = file: README.md
66
long_description_content_type = text/markdown

src/C/context.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function init_context()
122122
break
123123
end
124124
end
125-
CTX.lib_path === nothing && error("""
125+
CTX.lib_path === missing && error("""
126126
Could not find Python library for Python executable $(repr(CTX.exe_path)).
127127
128128
If you know where the library is, set environment variable 'JULIA_PYTHONCALL_LIB' to its path.

src/Core/Core.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Defines the `Py` type and directly related functions.
55
"""
66
module Core
77

8-
const VERSION = v"0.9.15"
8+
const VERSION = v"0.9.17"
99
const ROOT_DIR = dirname(dirname(@__DIR__))
1010

1111
using ..PythonCall: PythonCall # needed for docstring cross-refs

src/Core/stdlib.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,7 @@ function init_stdlib()
1818
# if Python is interactive, ensure Julia is too
1919
if pyhasattr(pysysmodule, "ps1")
2020
Base.eval(:(is_interactive = true))
21-
REPL = Base.require(Base.PkgId(Base.UUID("3fa0cd96-eef1-5676-8a61-b3b8758bbffb"), "REPL"))
22-
# adapted from run_main_repl() in julia/base/client.jl
2321
Base.load_InteractiveUtils()
24-
term_env = get(ENV, "TERM", Sys.iswindows() ? "" : "dumb")
25-
term = REPL.Terminals.TTYTerminal(term_env, stdin, stdout, stderr)
26-
if term.term_type == "dumb"
27-
repl = REPL.BasicREPL(term)
28-
else
29-
repl = REPL.LineEditREPL(term, get(stdout, :color, false), true)
30-
repl.history_file = false
31-
end
32-
pushdisplay(REPL.REPLDisplay(repl))
3322
end
3423

3524
else

src/PythonCall.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module PythonCall
22

3-
const VERSION = v"0.9.15"
3+
const VERSION = v"0.9.17"
44
const ROOT_DIR = dirname(@__DIR__)
55

66
include("Utils/Utils.jl")

0 commit comments

Comments
 (0)