Skip to content

Commit 90a03a1

Browse files
author
Christopher Rowley
committed
Fix v1 CI after merging main
1 parent edd64e2 commit 90a03a1

5 files changed

Lines changed: 22 additions & 9 deletions

File tree

‎.github/workflows/tests.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ jobs:
5454
with:
5555
python-version: ${{ matrix.pyversion }}
5656

57+
# Cached Conda build metadata can outlive its uncached root environment.
58+
- name: Rebuild Conda
59+
run: julia --project=test -e 'import Pkg; Pkg.build("Conda")'
60+
5761
- name: Build PyCall
5862
if: ${{ matrix.pythonexe == 'python' }}
5963
run: |

‎AGENTS.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@
99

1010
The majority of tests live in the Julia package; Python tests cover functionality that cannot be exercised from Julia (e.g., JuliaCall-specific behavior). Run both suites—typically Julia first—in whichever order makes sense.
1111

12+
## Branch and CI compatibility
13+
- On `v1`, JuliaCall uses `jl_eval` (returning a Julia wrapper), whereas `main` uses `seval`. Adapt tests brought over from `main` accordingly.
14+
- The benchmark suite is shared across the compared revisions: `main` uses `pydel!`, while `v1` uses `unsafe_pydel`.
15+
- Julia CI caches can preserve Conda's build metadata without its root environment. Rebuild `Conda` before building `PyCall` or running tests to recreate that directory.
16+
- In the restricted agent environment, Julia and uv tests need approval to write their caches outside the repository.
17+
1218
## Meta instructions
1319
- When you discover environment quirks, false assumptions, process fixes, or any other generally useful info, update this AGENTS.md so future coding agents have the information.

‎benchmark/benchmarks.jl‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
using BenchmarkTools
22
using PythonCall
3-
using PythonCall: unsafe_pydel, pyimport, pydict, pystr, pyrange
3+
using PythonCall: pyimport, pydict, pystr, pyrange
4+
5+
# The same suite runs against main and v1, which use different names.
6+
const benchmark_pydel = isdefined(PythonCall, :pydel!) ? PythonCall.pydel! : PythonCall.unsafe_pydel
47

58
const SUITE = BenchmarkGroup()
69

@@ -23,10 +26,10 @@ function test_pydict_pydel()
2326
r = random()
2427
v = i + r
2528
x[k] = v
26-
unsafe_pydel(k)
27-
unsafe_pydel(r)
28-
unsafe_pydel(v)
29-
unsafe_pydel(i)
29+
benchmark_pydel(k)
30+
benchmark_pydel(r)
31+
benchmark_pydel(v)
32+
benchmark_pydel(i)
3033
end
3134
return x
3235
end
@@ -40,7 +43,7 @@ SUITE["basic"]["julia"]["pydict"]["pydel"] = @benchmarkable test_pydict_pydel()
4043
x = {}
4144
for i in range(1000)
4245
x[str(i)] = i + random()
43-
$(use_pydel ? :(@jl PythonCall.unsafe_pydel(i)) : :(nothing))
46+
$(use_pydel ? :(@jl benchmark_pydel(i)) : :(nothing))
4447
end
4548
x
4649
end

‎pytest/test_all.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def test_pythoncall_executable_runs_python():
2121
'''
2222
result = subprocess.run(
2323
[
24-
str(jl.seval("first(Base.julia_cmd().exec)")),
25-
"--project=" + str(jl.seval("dirname(Base.active_project())")),
24+
str(jl.jl_eval("first(Base.julia_cmd().exec)")),
25+
"--project=" + str(jl.jl_eval("dirname(Base.active_project())")),
2626
"--startup-file=no",
2727
"-e",
2828
code,

‎pytest/test_issue_816.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
4343
from juliacall import Main
4444
45-
assert Main.seval("1 + 1") == 2
45+
assert Main.jl_eval("1 + 1") == 2
4646
"""
4747

4848

0 commit comments

Comments
 (0)