Skip to content

Commit 0667e19

Browse files
committed
fixup! Add options for the Julia binary and project path
1 parent 4a68b62 commit 0667e19

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

.github/workflows/tests.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6161

6262
python:
63-
name: Test Python (${{ matrix.pyversion }}, ${{ matrix.os }})
63+
name: Test Python (${{ matrix.pyversion }}, ${{ matrix.os }}, ${{ matrix.jlinstaller }})
6464
runs-on: ${{ matrix.os }}
6565
strategy:
6666
fail-fast: false
@@ -75,6 +75,8 @@ jobs:
7575
jlinstaller: manual
7676
env:
7777
MANUAL_TEST_PROJECT: /tmp/juliacall-test-project
78+
PYTHON_JULIACALL_THREADS: '2'
79+
PYTHON_JULIACALL_HANDLE_SIGNALS: 'yes'
7880

7981
steps:
8082
- uses: actions/checkout@v5
@@ -114,14 +116,18 @@ jobs:
114116
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
115117
uv run flake8 ./pysrc ./pytest --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
116118
117-
- name: Run tests
119+
- name: Run tests (with JuliaPkg)
120+
if: ${{ matrix.jlinstaller == '@JuliaPkg' }}
121+
run: |
122+
uv run pytest -s --nbval --cov=pysrc ./pytest/
123+
124+
- name: Run tests (without JuliaPkg)
125+
if: ${{ matrix.jlinstaller == 'manual' }}
118126
run: |
119127
uv run pytest -s --nbval --cov=pysrc ./pytest/
120128
env:
121-
PYTHON_JULIACALL_THREADS: '2'
122-
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 || '' }}"
129+
PYTHON_JULIACALL_EXE: "${{ steps.setup_julia.outputs.julia_bindir }}/julia"
130+
PYTHON_JULIACALL_PROJECT: ${{ env.MANUAL_TEST_PROJECT }}
125131

126132
- name: Upload coverage to Codecov
127133
uses: codecov/codecov-action@v5

pysrc/juliacall/__init__.py

Lines changed: 3 additions & 3 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', default="")[0]
150+
CONFIG['project'] = path_option('project', default="", check_exists=True)[0]
151151
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 = len(CONFIG['exe']) > 0
158-
have_project = len(CONFIG['project']) > 0
157+
have_exe = CONFIG['exe'] is not None
158+
have_project = CONFIG['project']) is not None
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)