Skip to content

Commit ac95036

Browse files
committed
fixup! Add options for the Julia binary and project path
1 parent 22688ee commit ac95036

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ jobs:
9393

9494
- name: Set up Julia
9595
id: setup_julia
96-
if: ${{ matrix.juliaexe == 'julia' }}
9796
uses: julia-actions/setup-julia@v2
9897
with:
9998
version: '1'

docs/src/juliacall.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ be configured in two ways:
135135
| `-X juliacall-warn-overwrite=<yes\|no>` | `PYTHON_JULIACALL_WARN_OVERWRITE=<yes\|no>` | Enable or disable method overwrite warnings. |
136136
| `-X juliacall-autoload-ipython-extension=<yes\|no>` | `PYTHON_JULIACALL_AUTOLOAD_IPYTHON_EXTENSION=<yes\|no>` | Enable or disable IPython extension autoloading. |
137137
| `-X juliacall-heap-size-hint=<N>` | `PYTHON_JULIACALL_HEAP_SIZE_HINT=<N>` | Hint for initial heap size in bytes. |
138-
| `-X juliacall-exepath=<file>` | `PYTHON_JULIACALL_EXEPATH=<file>` | Path to Julia binary to use (overrides JuliaPkg). |
138+
| `-X juliacall-exe=<file>` | `PYTHON_JULIACALL_EXE=<file>` | Path to Julia binary to use (overrides JuliaPkg). |
139139
| `-X juliacall-project=<dir>` | `PYTHON_JULIACALL_PROJECT=<dir>` | Path to the Julia project to use (overrides JuliaPkg). |
140140

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

pysrc/juliacall/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def int_option(name, *, accept_auto=False, **kw):
110110
raise ValueError(f'{s}: expecting an int'+(' or auto' if accept_auto else ""))
111111

112112
def args_from_config(config):
113-
argv = [config['exe']]
113+
argv = [config['exepath']]
114114
for opt, val in config.items():
115115
if opt.startswith('opt_'):
116116
if val is None:
@@ -148,31 +148,31 @@ def args_from_config(config):
148148
CONFIG['opt_startup_file'] = choice('startup_file', ['yes', 'no'])[0]
149149
CONFIG['opt_heap_size_hint'] = option('heap_size_hint')[0]
150150
CONFIG['project'] = path_option('project', check_exists=True)[0]
151-
CONFIG['exe'] = path_option('exe', check_exists=True)[0]
151+
CONFIG['exepath'] = path_option('exe', 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
157+
have_exepath = CONFIG['exepath'] is not None
158158
have_project = CONFIG['project'] is not None
159-
if not have_exe and not have_project:
159+
if not have_exepath 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
162-
# `exe` and `project` are set by the user.
162+
# `exepath` and `project` are set by the user.
163163
import juliapkg
164164

165165
# Find the Julia executable and project
166-
CONFIG['exe'] = juliapkg.executable()
166+
CONFIG['exepath'] = juliapkg.executable()
167167
CONFIG['project'] = juliapkg.project()
168-
elif (not have_exe and have_project) or (have_exe and not have_project):
168+
elif (not have_exepath and have_project) or (have_exepath and not have_project):
169169
raise Exception("Both PYTHON_JULIACALL_PROJECT and PYTHON_JULIACALL_EXE must be set together, not only one of them.")
170170

171-
exe = CONFIG['exe']
171+
exepath = CONFIG['exepath']
172172
project = CONFIG['project']
173173

174174
# Find the Julia library
175-
cmd = [exe, '--project='+project, '--startup-file=no', '-O0', '--compile=min',
175+
cmd = [exepath, '--project='+project, '--startup-file=no', '-O0', '--compile=min',
176176
'-e', 'import Libdl; print(abspath(Libdl.dlpath("libjulia")), "\\0", Sys.BINDIR)']
177177
libpath, default_bindir = subprocess.run(cmd, check=True, capture_output=True, encoding='utf8').stdout.split('\0')
178178
assert os.path.exists(libpath)

0 commit comments

Comments
 (0)