Skip to content

Commit 2b1f6d7

Browse files
committed
fixup! Add options for the Julia binary and project path
1 parent 69b90ca commit 2b1f6d7

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

.github/workflows/tests.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ jobs:
6767
matrix:
6868
os: [ubuntu-latest, windows-latest, macos-latest]
6969
pyversion: ["3", "3.9"]
70+
jlinstaller: ["@JuliaPkg"]
71+
include:
72+
- arch: x64
73+
os: ubuntu-latest
74+
pyversion: 3
75+
jlinstaller: manual
76+
env:
77+
MANUAL_TEST_PROJECT: /tmp/juliacall-test-project
7078

7179
steps:
7280
- uses: actions/checkout@v5
@@ -82,10 +90,18 @@ jobs:
8290
python-version: ${{ matrix.pyversion }}
8391

8492
- name: Set up Julia
93+
id: setup_julia
94+
if: ${{ matrix.jlinstaller == "manual" }}
8595
uses: julia-actions/setup-julia@v2
8696
with:
8797
version: '1'
8898

99+
- name: Set up test Julia project
100+
if: ${{ matrix.jlinstaller == "manual" }}
101+
run: |
102+
mkdir ${{ MANUAL_TEST_PROJECT }}
103+
julia --project=${{ MANUAL_TEST_PROJECT }} -e 'import Pkg; Pkg.dev(path="."); Pkg.instantiate()'
104+
89105
- name: Install dependencies
90106
run: |
91107
cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json
@@ -104,6 +120,8 @@ jobs:
104120
env:
105121
PYTHON_JULIACALL_THREADS: '2'
106122
PYTHON_JULIACALL_HANDLE_SIGNALS: 'yes'
123+
PYTHON_JULIACALL_EXE: "${{ steps.setup_julia.outputs.julia_bindir }}${{ matrix.jlinstaller == 'manual' && '/julia' || '' }}"
124+
PYTHON_JULIACALL_PROJECT: "${{ matrix.jlinstaller == 'manual' && env.MANUAL_TEST_PROJECT || '' }}"
107125

108126
- name: Upload coverage to Codecov
109127
uses: codecov/codecov-action@v5

pysrc/juliacall/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,15 +147,15 @@ def args_from_config(config):
147147
CONFIG['opt_handle_signals'] = choice('handle_signals', ['yes', 'no'])[0]
148148
CONFIG['opt_startup_file'] = choice('startup_file', ['yes', 'no'])[0]
149149
CONFIG['opt_heap_size_hint'] = option('heap_size_hint')[0]
150-
CONFIG['project'] = path_option('project', check_exists=True)[0]
151-
CONFIG['exe'] = path_option('exe', check_exists=True)[0]
150+
CONFIG['project'] = path_option('project', default="", check_exists=True)[0]
151+
CONFIG['exe'] = path_option('exe', default="", check_exists=True)[0]
152152

153153
# Stop if we already initialised
154154
if CONFIG['inited']:
155155
return
156156

157-
have_exe = CONFIG['exe'] is not None
158-
have_project = CONFIG['project'] is not None
157+
have_exe = len(CONFIG['exe']) > 0
158+
have_project = len(CONFIG['project']) > 0
159159
if not have_exe and not have_project:
160160
# we don't import this at the top level because it is not required when
161161
# juliacall is loaded by PythonCall and won't be available, or if both

0 commit comments

Comments
 (0)