Skip to content

Commit c942ff5

Browse files
author
Christopher Doris
committed
Merge remote-tracking branch 'origin/main' into pr/Liozou/677
2 parents 8a86e37 + e6dba51 commit c942ff5

File tree

24 files changed

+248
-37
lines changed

24 files changed

+248
-37
lines changed

.github/workflows/tests.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
matrix:
2020
arch: [x64] # x86 unsupported by MicroMamba
2121
os: [ubuntu-latest, windows-latest, macos-latest]
22-
jlversion: ['1','1.9']
22+
jlversion: ['1','1.10']
2323
pythonexe: ['@CondaPkg']
2424
include:
2525
- arch: x64
@@ -66,7 +66,7 @@ jobs:
6666
fail-fast: false
6767
matrix:
6868
os: [ubuntu-latest, windows-latest, macos-latest]
69-
pyversion: ["3", "3.9"]
69+
pyversion: ["3", "3.10"]
7070
juliaexe: ["@JuliaPkg"]
7171
include:
7272
- os: ubuntu-latest
@@ -84,17 +84,25 @@ jobs:
8484
uses: actions/setup-python@v6
8585
with:
8686
python-version: ${{ matrix.pyversion }}
87+
88+
- name: Check Python OpenSSL version (see setup_julia)
89+
shell: python
90+
run: |
91+
import ssl
92+
assert ssl.OPENSSL_VERSION_INFO < (3, 5)
8793
8894
- name: Set up uv
89-
uses: astral-sh/setup-uv@v6
95+
uses: astral-sh/setup-uv@v7
9096
with:
9197
python-version: ${{ matrix.pyversion }}
9298

9399
- name: Set up Julia
94100
id: setup_julia
95101
uses: julia-actions/setup-julia@v2
96102
with:
97-
version: '1'
103+
# Python in the GitHub runners ships with OpenSSL 3.0. Julia 1.12 requires
104+
# OpenSSL 3.5. Therefore juliapkg requires Julia 1.11 or lower.
105+
version: '1.11'
98106

99107
- name: Set up test Julia project
100108
if: ${{ matrix.juliaexe == 'julia' }}

CondaPkg.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
[deps.libstdcxx]
1+
2+
[deps.openssl]
23
version = "<=julia"
34

4-
[deps.libstdcxx-ng]
5+
[deps.libstdcxx]
56
version = "<=julia"
67

7-
[deps.openssl]
8+
[deps.libstdcxx-ng]
89
version = "<=julia"
910

1011
[deps.python]
1112
build = "**cpython**"
12-
version = ">=3.9,<4"
13+
version = ">=3.10,<4"
14+
15+
[dev.deps]
16+
matplotlib = ""
17+
pyside6 = ""

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ UnsafePointers = "e17b2a0c-0bdf-430a-bd0c-3a23cae4ff39"
1717
[compat]
1818
Aqua = "0 - 999"
1919
CategoricalArrays = "0.10, 1"
20-
CondaPkg = "0.2.30"
20+
CondaPkg = "0.2.33"
2121
Dates = "1"
2222
Libdl = "1"
2323
MacroTools = "0.5"
@@ -29,7 +29,7 @@ Tables = "1"
2929
Test = "1"
3030
TestItemRunner = "0 - 999"
3131
UnsafePointers = "1"
32-
julia = "1.9"
32+
julia = "1.10"
3333

3434
[extensions]
3535
PyCallExt = "PyCall"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Bringing [**Python®**](https://www.python.org/) and [**Julia**](https://juliala
1414
- Fast non-copying conversion of numeric arrays in either direction: modify Python arrays (e.g. `bytes`, `array.array`, `numpy.ndarray`) from Julia or Julia arrays from Python.
1515
- Helpful wrappers: interpret Python sequences, dictionaries, arrays, dataframes and IO streams as their Julia counterparts, and vice versa.
1616
- Beautiful stack-traces.
17-
- Supports modern systems: tested on Windows, MacOS and Linux, 64-bit, Julia 1.9 upwards and Python 3.9 upwards.
17+
- Supports modern systems: tested on Windows, MacOS and Linux, 64-bit, Julia 1.10 upwards and Python 3.10 upwards.
1818

1919
⭐ If you like this, a GitHub star would be lovely thank you. ⭐
2020

docs/src/faq.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,11 @@ using PythonCall
108108

109109
np = pyimport("numpy")
110110
```
111+
112+
## What versions of Python and Julia do you support?
113+
114+
Each release of PythonCall and JuliaCall will support and require:
115+
- Any currently supported version of Python, [see here](https://devguide.python.org/versions/). Currently 3.10+.
116+
- The current Julia LTS version and newer, [see here](https://julialang.org/downloads/#long_term_support_release). Currently 1.10+.
117+
118+
Only the latest patch release within each minor version is supported.

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ Bringing [**Python®**](https://www.python.org/) and [**Julia**](https://juliala
77
- Fast non-copying conversion of numeric arrays in either direction: modify Python arrays (e.g. `bytes`, `array.array`, `numpy.ndarray`) from Julia or Julia arrays from Python.
88
- Helpful wrappers: interpret Python sequences, dictionaries, arrays, dataframes and IO streams as their Julia counterparts, and vice versa.
99
- Beautiful stack-traces.
10-
- Works anywhere: tested on Windows, MacOS and Linux, 32- and 64-bit, Julia Julia 1.9 upwards and Python 3.9 upwards.
10+
- Works anywhere: tested on Windows, MacOS and Linux, 32- and 64-bit, Julia Julia 1.10 upwards and Python 3.10 upwards.

docs/src/juliacall-reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,13 @@ This wraps any Julia `AbstractVector` value. It is a subclass of `juliacall.Arra
158158

159159
`````@customdoc
160160
juliacall.DictValue - Class
161-
This wraps any Julia `AbstractDict` value. It is a subclass of `collections.abc.Mapping` and
161+
This wraps any Julia `AbstractDict` value. It is a subclass of `collections.abc.MutableMapping` and
162162
behaves similar to a Python `dict`.
163163
`````
164164

165165
`````@customdoc
166166
juliacall.SetValue - Class
167-
This wraps any Julia `AbstractSet` value. It is a subclass of `collections.abc.Set` and
167+
This wraps any Julia `AbstractSet` value. It is a subclass of `collections.abc.MutableSet` and
168168
behaves similar to a Python `set`.
169169
`````
170170

docs/src/juliacall.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ It's as simple as
77
pip install juliacall
88
```
99

10+
If you prefer Conda, there is a community effort to also release this on conda-forge:
11+
```bash
12+
conda install conda-forge::pyjuliapkg
13+
```
14+
1015
Developers may wish to clone the repo (https://github.com/JuliaPy/PythonCall.jl) directly
1116
and pip install the module in editable mode. You should add `"dev":true, "path":"../.."` to
1217
`pysrc/juliacall/juliapkg.json` to ensure you use the development version of PythonCall
@@ -140,6 +145,10 @@ be configured in two ways:
140145

141146
## [Multi-threading](@id py-multi-threading)
142147

148+
!!! warning
149+
150+
Multi-threading support is experimental and can change without notice.
151+
143152
From v0.9.22, JuliaCall supports multi-threading in Julia and/or Python, with some
144153
caveats.
145154

docs/src/pythoncall.md

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This package is in the general registry, so to install just type `]` in the Juli
88
pkg> add PythonCall
99
```
1010

11-
## Getting started
11+
## [Getting started](@id py_getting_started)
1212

1313
Import the module with:
1414

@@ -91,6 +91,52 @@ Python: ValueError('some error')
9191
With the functions introduced so far, you have access to the vast majority of Python's
9292
functionality.
9393

94+
## Executing Python scripts
95+
96+
A common use case is calling multiple blocks of Python code from Julia interactively. This can be accomplished in PythonCall via the [@pyexec](@ref) macro. For example, the sentence parsing application in the [Getting started](@ref py_getting_started) section could be rewritten as:
97+
98+
```julia-repl
99+
julia> @pyexec """
100+
global re
101+
import re
102+
103+
def my_sentence(s):
104+
words = re.findall("[a-zA-Z]+", s)
105+
sentence = " ".join(words)
106+
return sentence
107+
""" => my_sentence
108+
Python: <function my_sentence at 0x7d83bb1b01a0>
109+
110+
julia> sentence = my_sentence("PythonCall.jl is very useful!")
111+
Python: 'PythonCall jl is very useful'
112+
```
113+
114+
Note the use of the `global` keyword to make the `re` package accessible in global scope, and the `=> my_sentence` syntax to create a Julia function named `my_sentence` that calls to the Python function of the same name. This syntax also supports calling to multiple functions and passing data back-and-forth:
115+
116+
```julia-repl
117+
julia> @pyexec (num=10) => """
118+
def add(a, b):
119+
return a + b
120+
121+
def subtract(a, b):
122+
return a - b
123+
124+
plusone = num + 1
125+
""" => (add, subtract, plusone::Float64)
126+
(add = <py function add at 0x721b001a7cc0>, subtract = <py function subtract at 0x721b001a7d70>, plusone = 11.0)
127+
128+
julia> add(4, 3)
129+
Python: 7
130+
131+
julia> subtract(4, 3)
132+
Python: 1
133+
134+
julia> plusone
135+
11.0
136+
```
137+
138+
Here we demonstrate passing a named variable, `num`, via the use of the `=>` syntax again, and returning named output, with the last element, `plusone`, being cast to a Julia object via the `::` syntax. See [@pyexec](@ref), [@pyeval](@ref), and their functional forms [pyexec](@ref) and [pyeval](@ref), for more.
139+
94140
## Conversion between Julia and Python
95141

96142
A Julia object can be converted to a Python one either explicitly (such as `Py(x)`) or
@@ -369,6 +415,10 @@ See [Installing Python packages](@ref python-deps).
369415

370416
## [Multi-threading](@id jl-multi-threading)
371417

418+
!!! warning
419+
420+
Multi-threading support is experimental and can change without notice.
421+
372422
From v0.9.22, PythonCall supports multi-threading in Julia and/or Python, with some
373423
caveats.
374424

docs/src/releasenotes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Release Notes
22

3+
## Unreleased
4+
* Minimum supported Python version is now 3.10.
5+
* Minimum supported Julia version is now 1.10.
6+
* Showing `Py` now respects the `compact` option - output is limited to a single line of
7+
at most the display width.
8+
* Support policy now documented in the FAQ.
9+
* Bug fixes.
10+
311
## 0.9.28 (2025-09-17)
412
* Added `NumpyDates`: NumPy-compatible DateTime64/TimeDelta64 types and units.
513
* Added `pyconvert` rules for NumpyDates types.

0 commit comments

Comments
 (0)