Skip to content

Commit 416da17

Browse files
committed
Work around the fact that libpython is not found under Anaconda
1 parent 34afc6e commit 416da17

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

Diff for: .github/workflows/rust.yml

+14-19
Original file line numberDiff line numberDiff line change
@@ -45,34 +45,29 @@ jobs:
4545
python-version: '3.12'
4646
if: ${{ ! startsWith(matrix.build, 'anaconda') }}
4747
- name: Install Matplotlib (pip)
48-
if: ${{ ! startsWith(matrix.build, 'anaconda') }}
4948
run: python3 -m pip install -U matplotlib
49+
if: ${{ ! startsWith(matrix.build, 'anaconda') }}
5050
- name: Setup Miniconda
51+
uses: conda-incubator/[email protected]
5152
if: startsWith(matrix.build, 'anaconda macos')
52-
uses: conda-incubator/[email protected]
5353
- name: Install Matplotlib (Anaconda)
54-
if: startsWith(matrix.build, 'anaconda')
5554
run: $CONDA/bin/conda install conda-forge::matplotlib
56-
- name: Install Rust (rustup)
57-
run: |
58-
rustup update --no-self-update
59-
rustup default ${{ matrix.rust }}
60-
- run: cargo build -v
55+
if: startsWith(matrix.build, 'anaconda')
56+
- name: Install Rust ${{ matrix.rust }}
57+
uses: dtolnay/rust-toolchain@stable
58+
with:
59+
toolchain: ${{ matrix.rust }}
60+
- run: cargo build
61+
if: ${{ ! startsWith(matrix.build, 'anaconda') }}
6162
- run: cargo test
6263
if: ${{ ! startsWith(matrix.build, 'anaconda') }}
6364
- run: cargo run --example a_simple_example
6465
if: ${{ ! startsWith(matrix.build, 'anaconda') }}
65-
- name: Run example with Anaconda on Linux
66-
if: startsWith(matrix.build, 'anaconda linux')
67-
run: |
68-
eval "$($CONDA/bin/conda shell.bash activate)"
69-
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib
70-
cargo run --example a_simple_example
71-
- name: Run example with Anaconda on MacOS
72-
continue-on-error: true
73-
if: startsWith(matrix.build, 'anaconda macos')
66+
- name: Run example with Anaconda
67+
if: startsWith(matrix.build, 'anaconda')
68+
shell: bash
7469
run: |
7570
eval "$($CONDA/bin/conda shell.bash activate)"
76-
export DYLD_LIBRARY_PATH=$CONDA_PREFIX/lib
71+
mkdir -p target/debug/deps
72+
ln -s $CONDA_PREFIX/lib/libpython* target/debug/deps
7773
cargo run --example a_simple_example
78-
cargo run --example flower

0 commit comments

Comments
 (0)