Skip to content

Commit a9b0e83

Browse files
author
Christopher Doris
committed
Merge remote-tracking branch 'origin/main' into pr/mkitti/616
2 parents c73eacb + a9b77e4 commit a9b0e83

Some content is hidden

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

89 files changed

+3929
-924
lines changed

.github/workflows/benchmark_pr.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Benchmark PR
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
bench:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: MilesCranmer/AirspeedVelocity.jl@action-v1
10+
with:
11+
julia-version: "1"
12+
tune: "true"
13+
# Post to "summary" tab of workflow run:
14+
job-summary: "true"
15+
# Run benchmark using PR's version of the script:
16+
bench-on: ${{ github.event.pull_request.head.sha }}

.github/workflows/docs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ jobs:
1616
name: Documentation
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020
- uses: julia-actions/setup-julia@v2
2121
with:
2222
version: '1'
2323
- run: |
2424
julia --project=docs -e '
2525
using Pkg
26-
Pkg.develop(PackageSpec(path=pwd()))
2726
Pkg.instantiate()'
2827
- run: |
2928
julia --project=docs -e '

.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@v4
12+
uses: actions/checkout@v5
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@v4
14+
- uses: actions/checkout@v5
1515
with:
1616
ref: ${{ inputs.git_ref }}
1717
- name: Set up Python
18-
uses: actions/setup-python@v5
18+
uses: actions/setup-python@v6
1919
with:
2020
python-version: "3.10"
2121
- name: Install build

.github/workflows/tests-nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
jobs:
1212
tests:
13-
name: Test (${{ matrix.os }}-${{ matrix.arch }}, julia ${{ matrix.jlversion }})
13+
name: Test Julia (${{ matrix.jlversion }}, ${{ matrix.os }}-${{ matrix.arch }})
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
fail-fast: false
@@ -19,7 +19,7 @@ jobs:
1919
os: [ubuntu-latest, windows-latest, macos-latest]
2020
jlversion: ['~1.9.0-0', 'nightly']
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@v5
2323
- uses: julia-actions/setup-julia@v2
2424
with:
2525
version: ${{ inputs.jl_version }}

.github/workflows/tests.yml

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,70 +12,121 @@ on:
1212

1313
jobs:
1414
julia:
15-
name: Test (${{ matrix.os }}, julia ${{ matrix.jlversion }})
15+
name: Test Julia (${{ matrix.jlversion }}, ${{ matrix.os }}, ${{ matrix.pythonexe }})
1616
runs-on: ${{ matrix.os }}
1717
strategy:
18-
fail-fast: true
18+
fail-fast: false
1919
matrix:
2020
arch: [x64] # x86 unsupported by MicroMamba
2121
os: [ubuntu-latest, windows-latest, macos-latest]
2222
jlversion: ['1','1.9']
23+
pythonexe: ['@CondaPkg']
24+
include:
25+
- arch: x64
26+
os: ubuntu-latest
27+
jlversion: '1'
28+
pythonexe: python
29+
2330
steps:
24-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v5
32+
2533
- name: Set up Julia ${{ matrix.jlversion }}
2634
uses: julia-actions/setup-julia@v2
2735
with:
2836
version: ${{ matrix.jlversion }}
2937
arch: ${{ matrix.arch }}
38+
3039
- uses: julia-actions/cache@v2
40+
3141
- name: Build package
3242
uses: julia-actions/julia-buildpkg@v1
43+
env:
44+
PYTHON: python
45+
3346
- name: Run tests
3447
uses: julia-actions/julia-runtest@v1
3548
env:
3649
JULIA_DEBUG: PythonCall
3750
JULIA_NUM_THREADS: '2'
51+
PYTHON: python
52+
JULIA_PYTHONCALL_EXE: ${{ matrix.pythonexe }}
53+
3854
- name: Process coverage
3955
uses: julia-actions/julia-processcoverage@v1
56+
4057
- name: Upload coverage to Codecov
4158
uses: codecov/codecov-action@v5
4259
env:
4360
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
61+
4462
python:
45-
name: Test (${{ matrix.os }}, python ${{ matrix.pyversion }})
63+
name: Test Python (${{ matrix.pyversion }}, ${{ matrix.os }}, ${{ matrix.juliaexe }})
4664
runs-on: ${{ matrix.os }}
4765
strategy:
48-
fail-fast: true
66+
fail-fast: false
4967
matrix:
5068
os: [ubuntu-latest, windows-latest, macos-latest]
51-
pyversion: ["3.x", "3.8"]
69+
pyversion: ["3", "3.9"]
70+
juliaexe: ["@JuliaPkg"]
71+
include:
72+
- os: ubuntu-latest
73+
pyversion: 3
74+
juliaexe: julia
75+
env:
76+
MANUAL_TEST_PROJECT: /tmp/juliacall-test-project
77+
PYTHON_JULIACALL_THREADS: '2'
78+
PYTHON_JULIACALL_HANDLE_SIGNALS: 'yes'
79+
5280
steps:
53-
- uses: actions/checkout@v4
81+
- uses: actions/checkout@v5
82+
5483
- name: Set up Python ${{ matrix.pyversion }}
55-
uses: actions/setup-python@v5
84+
uses: actions/setup-python@v6
5685
with:
5786
python-version: ${{ matrix.pyversion }}
87+
88+
- name: Set up uv
89+
uses: astral-sh/setup-uv@v6
90+
with:
91+
python-version: ${{ matrix.pyversion }}
92+
5893
- name: Set up Julia
94+
id: setup_julia
5995
uses: julia-actions/setup-julia@v2
6096
with:
6197
version: '1'
98+
99+
- name: Set up test Julia project
100+
if: ${{ matrix.juliaexe == 'julia' }}
101+
run: |
102+
mkdir ${{ env.MANUAL_TEST_PROJECT }}
103+
julia --project=${{ env.MANUAL_TEST_PROJECT }} -e 'import Pkg; Pkg.develop(path="."); Pkg.instantiate()'
104+
62105
- name: Install dependencies
63106
run: |
64-
python -m pip install --upgrade pip
65-
pip install flake8 pytest pytest-cov nbval numpy
66107
cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json
67-
pip install -e .
108+
uv sync --dev
109+
68110
- name: Lint with flake8
69111
run: |
70112
# stop the build if there are Python syntax errors or undefined names
71-
flake8 . --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics
113+
uv run flake8 ./pysrc ./pytest --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics
72114
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
73-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
74-
- name: Run tests
115+
uv run flake8 ./pysrc ./pytest --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
116+
117+
- name: Run tests (with JuliaPkg)
118+
if: ${{ matrix.juliaexe == '@JuliaPkg' }}
75119
run: |
76-
pytest -s --nbval --cov=pysrc ./pytest/
120+
uv run pytest -s --nbval --cov=pysrc ./pytest/
121+
122+
- name: Run tests (without JuliaPkg)
123+
if: ${{ matrix.juliaexe == 'julia' }}
124+
run: |
125+
uv run pytest -s --nbval --cov=pysrc ./pytest/
77126
env:
78-
PYTHON_JULIACALL_THREADS: '2'
127+
PYTHON_JULIACALL_EXE: "${{ steps.setup_julia.outputs.julia-bindir }}/julia"
128+
PYTHON_JULIACALL_PROJECT: ${{ env.MANUAL_TEST_PROJECT }}
129+
79130
- name: Upload coverage to Codecov
80131
uses: codecov/codecov-action@v5
81132
env:

CondaPkg.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[deps.libstdcxx]
2+
version = "<=julia"
3+
14
[deps.libstdcxx-ng]
25
version = "<=julia"
36

@@ -6,4 +9,4 @@ version = "<=julia"
69

710
[deps.python]
811
build = "**cpython**"
9-
version = ">=3.8,<4"
12+
version = ">=3.9,<4"

Project.toml

Lines changed: 15 additions & 5 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.25"
4+
version = "0.9.27"
55

66
[deps]
77
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
@@ -10,31 +10,41 @@ 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-
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1413
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
1514
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1615
UnsafePointers = "e17b2a0c-0bdf-430a-bd0c-3a23cae4ff39"
1716

1817
[compat]
1918
Aqua = "0 - 999"
20-
CondaPkg = "0.2.23"
19+
CategoricalArrays = "0.10, 1"
20+
CondaPkg = "0.2.30"
2121
Dates = "1"
2222
Libdl = "1"
2323
MacroTools = "0.5"
2424
Markdown = "1"
2525
Pkg = "1"
26-
Requires = "1"
26+
PyCall = "1"
2727
Serialization = "1"
2828
Tables = "1"
2929
Test = "1"
3030
TestItemRunner = "0 - 999"
3131
UnsafePointers = "1"
3232
julia = "1.9"
3333

34+
[extensions]
35+
PyCallExt = "PyCall"
36+
CategoricalArraysExt = "CategoricalArrays"
37+
3438
[extras]
3539
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
40+
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
41+
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
3642
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3743
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
3844

3945
[targets]
40-
test = ["Aqua", "Test", "TestItemRunner"]
46+
test = ["Aqua", "PyCall", "Test", "TestItemRunner"]
47+
48+
[weakdeps]
49+
CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
50+
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"

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.8 upwards.
17+
- Supports modern systems: tested on Windows, MacOS and Linux, 64-bit, Julia 1.9 upwards and Python 3.9 upwards.
1818

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

benchmark/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[deps]
2+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"

0 commit comments

Comments
 (0)