Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/actions/setup-python-bindings/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Setup Python bindings
description: Install Python headers, create venv, install maturin, and build the taxonomy Python extension

runs:
using: composite
steps:
- name: Install python headers
run: sudo apt-get update && sudo apt-get install -y python3-dev python3-pip python3-venv
shell: bash

- name: Install maturin
run: |
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install maturin downloads pytest
pip show maturin
shell: bash

- name: Add library to venv
run: |
. venv/bin/activate
maturin develop --features=python
shell: bash
16 changes: 2 additions & 14 deletions .github/workflows/test_ncbi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,8 @@ jobs:
toolchain: stable
override: true

- name: Install python headers
run: sudo apt-get update && sudo apt-get install python3-dev python3-pip python3-venv

- name: Install python dependencies
run: |
python3 -m venv venv
. venv/bin/activate
pip3 install maturin downloads pytest
pip3 show maturin

- name: Add library to venv
run: |
. venv/bin/activate
maturin develop --features=python
- name: Setup Python bindings
uses: ./.github/actions/setup-python-bindings

- name: Test Python bindings with latest NCBI taxonomy
run: |
Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,12 @@ jobs:
- name: version info
run: rustc --version; cargo --version;

- name: Setup Python bindings
uses: ./.github/actions/setup-python-bindings

- name: Run all tests
run: cargo test --features=python_test

- name: Install python headers
run: sudo apt-get update && sudo apt-get install python3-dev python3-pip python3-venv

- name: Install maturin
run: |
python3 -m venv venv
. venv/bin/activate
pip3 install maturin downloads pytest
pip3 show maturin

- name: add library to venv
run: |
. venv/bin/activate
maturin develop --features=python

- name: Run the python tests
run: |
. venv/bin/activate
Expand Down
Loading