Skip to content

Commit 2557f7b

Browse files
committed
Merge branch 'main' into benchmarks
2 parents 83ddd09 + 8b8ac73 commit 2557f7b

Some content is hidden

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

42 files changed

+757
-211
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: weekly
12+
- package-ecosystem: pip
13+
directory: /
14+
schedule:
15+
interval: weekly

.github/workflows/CompatHelper.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
run: which julia
1616
continue-on-error: true
1717
- name: Install Julia, but only if it is not already available in the PATH
18-
uses: julia-actions/setup-julia@v1
18+
uses: julia-actions/setup-julia@v2
1919
with:
2020
version: '1'
2121
arch: ${{ runner.arch }}

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
name: Documentation
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v2
20-
- uses: julia-actions/setup-julia@v1
19+
- uses: actions/checkout@v4
20+
- uses: julia-actions/setup-julia@v2
2121
with:
2222
version: '1'
2323
- run: |

.github/workflows/docscleanup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Checkout gh-pages branch
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313
with:
1414
ref: gh-pages
1515

.github/workflows/register-pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
register:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
with:
1616
ref: ${{ inputs.git_ref }}
1717
- name: Set up Python
18-
uses: actions/setup-python@v3
18+
uses: actions/setup-python@v5
1919
with:
2020
python-version: "3.10"
2121
- name: Install build

.github/workflows/tests-nightly.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
os: [ubuntu-latest, windows-latest, macos-latest]
2020
jlversion: ['~1.9.0-0', 'nightly']
2121
steps:
22-
- uses: actions/checkout@v2
23-
- uses: julia-actions/setup-julia@v1
22+
- uses: actions/checkout@v4
23+
- uses: julia-actions/setup-julia@v2
2424
with:
2525
version: ${{ inputs.jl_version }}
2626
arch: ${{ matrix.arch }}
27-
- uses: actions/cache@v1
27+
- uses: actions/cache@v4
2828
env:
2929
cache-name: cache-artifacts
3030
with:
@@ -38,7 +38,8 @@ jobs:
3838
- uses: julia-actions/julia-runtest@v1
3939
env:
4040
JULIA_DEBUG: PythonCall
41+
JULIA_NUM_THREADS: '2'
4142
- uses: julia-actions/julia-processcoverage@v1
42-
- uses: codecov/codecov-action@v1
43+
- uses: codecov/codecov-action@v5
4344
with:
4445
file: lcov.info

.github/workflows/tests.yml

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,70 +19,82 @@ jobs:
1919
matrix:
2020
arch: [x64] # x86 unsupported by MicroMamba
2121
os: [ubuntu-latest, windows-latest, macos-latest]
22-
jlversion: ['1','1.6']
22+
jlversion: ['1','1.9']
23+
2324
steps:
24-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v4
26+
2527
- name: Set up Julia ${{ matrix.jlversion }}
26-
uses: julia-actions/setup-julia@v1
28+
uses: julia-actions/setup-julia@v2
2729
with:
2830
version: ${{ matrix.jlversion }}
2931
arch: ${{ matrix.arch }}
30-
- uses: actions/cache@v1
31-
env:
32-
cache-name: cache-artifacts
33-
with:
34-
path: ~/.julia/artifacts
35-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
36-
restore-keys: |
37-
${{ runner.os }}-test-${{ env.cache-name }}-
38-
${{ runner.os }}-test-
39-
${{ runner.os }}-
32+
33+
- uses: julia-actions/cache@v2
34+
4035
- name: Build package
4136
uses: julia-actions/julia-buildpkg@v1
37+
4238
- name: Run tests
4339
uses: julia-actions/julia-runtest@v1
4440
env:
4541
JULIA_DEBUG: PythonCall
42+
JULIA_NUM_THREADS: '2'
43+
4644
- name: Process coverage
4745
uses: julia-actions/julia-processcoverage@v1
46+
4847
- name: Upload coverage to Codecov
49-
uses: codecov/codecov-action@v2
48+
uses: codecov/codecov-action@v5
5049
env:
5150
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
51+
5252
python:
5353
name: Test (${{ matrix.os }}, python ${{ matrix.pyversion }})
5454
runs-on: ${{ matrix.os }}
5555
strategy:
5656
fail-fast: true
5757
matrix:
5858
os: [ubuntu-latest, windows-latest, macos-latest]
59-
pyversion: ["3.x", "3.8"]
59+
pyversion: [">=3.8", "3.8"]
60+
6061
steps:
61-
- uses: actions/checkout@v3
62+
- uses: actions/checkout@v4
63+
6264
- name: Set up Python ${{ matrix.pyversion }}
63-
uses: actions/setup-python@v4
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version: ${{ matrix.pyversion }}
68+
69+
- name: Set up uv
70+
uses: astral-sh/setup-uv@v5
6471
with:
6572
python-version: ${{ matrix.pyversion }}
73+
6674
- name: Set up Julia
67-
uses: julia-actions/setup-julia@v1
75+
uses: julia-actions/setup-julia@v2
6876
with:
6977
version: '1'
78+
7079
- name: Install dependencies
7180
run: |
72-
python -m pip install --upgrade pip
73-
pip install flake8 pytest pytest-cov nbval numpy
7481
cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json
75-
pip install -e .
82+
uv sync --dev
83+
7684
- name: Lint with flake8
7785
run: |
7886
# stop the build if there are Python syntax errors or undefined names
79-
flake8 . --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics
87+
uv run flake8 ./pysrc ./pytest --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics
8088
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
81-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
89+
uv run flake8 ./pysrc ./pytest --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
90+
8291
- name: Run tests
8392
run: |
84-
pytest -s --nbval --cov=pysrc ./pytest/
93+
uv run pytest -s --nbval --cov=pysrc ./pytest/
94+
env:
95+
PYTHON_JULIACALL_THREADS: '2'
96+
8597
- name: Upload coverage to Codecov
86-
uses: codecov/codecov-action@v2
98+
uses: codecov/codecov-action@v5
8799
env:
88100
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ build/
66
dist/
77
.CondaPkg/
88
/jltest.*
9+
uv.lock

Project.toml

Lines changed: 2 additions & 4 deletions
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.21"
4+
version = "0.9.25"
55

66
[deps]
77
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
@@ -10,7 +10,6 @@ Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
1010
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
1111
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
1212
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
13-
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
1413
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1514
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
1615
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
@@ -24,14 +23,13 @@ Libdl = "1"
2423
MacroTools = "0.5"
2524
Markdown = "1"
2625
Pkg = "1"
27-
REPL = "1"
2826
Requires = "1"
2927
Serialization = "1"
3028
Tables = "1"
3129
Test = "1"
3230
TestItemRunner = "0 - 999"
3331
UnsafePointers = "1"
34-
julia = "1.6.1"
32+
julia = "1.9"
3533

3634
[extras]
3735
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"

README.md

Lines changed: 3 additions & 4 deletions
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.6.1 upwards and Python 3.8 upwards.
17+
- Supports modern systems: tested on Windows, MacOS and Linux, 64-bit, Julia 1.9 upwards and Python 3.8 upwards.
1818

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

@@ -40,9 +40,8 @@ In this example we use the Python module JuliaCall from an IPython notebook to t
4040

4141
## What about PyCall?
4242

43-
The existing package [PyCall](https://github.com/JuliaPy/PyCall.jl) is another similar interface to Python. Here we note some key differences, but a more detailed comparison is in the documentation.
43+
The existing package [PyCall](https://github.com/JuliaPy/PyCall.jl) is another similar interface to Python. Here we note some key differences:.
4444
- PythonCall supports a wider range of conversions between Julia and Python, and the conversion mechanism is extensible.
4545
- PythonCall by default never copies mutable objects when converting, but instead directly wraps the mutable object. This means that modifying the converted object modifies the original, and conversion is faster.
4646
- PythonCall does not usually automatically convert results to Julia values, but leaves them as Python objects. This makes it easier to do Pythonic things with these objects (e.g. accessing methods) and is type-stable.
47-
- PythonCall installs dependencies into a separate Conda environment for each Julia project. This means each Julia project can have an isolated set of Python dependencies.
48-
- PythonCall supports Julia 1.6.1+ and Python 3.8+ whereas PyCall supports Julia 0.7+ and Python 2.7+.
47+
- PythonCall installs dependencies into a separate Conda environment for each Julia project using [CondaPkg](https://github.com/JuliaPy/CondaPkg.jl). This means each Julia project can have an isolated set of Python dependencies.

0 commit comments

Comments
 (0)