From 9bf53753290d334e1b5928eaef181f478242e899 Mon Sep 17 00:00:00 2001 From: Austin Richardson Date: Wed, 11 Mar 2026 11:32:58 -0700 Subject: [PATCH 1/3] (Hopefully) fix CI --- .github/workflows/tests.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b7cba3a..90de246 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,18 +39,19 @@ jobs: - name: version info run: rustc --version; cargo --version; + - name: Install python headers + run: sudo apt-get update && sudo apt-get install -y python3-dev python3-pip python3-venv + - 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 + pip install --upgrade pip + pip install maturin downloads pytest + pip show maturin - name: add library to venv run: | From c5af62421494556ecc213f14c3b11291e61af119 Mon Sep 17 00:00:00 2001 From: Austin Richardson Date: Wed, 11 Mar 2026 11:49:24 -0700 Subject: [PATCH 2/3] Fix 2 --- .github/workflows/test_ncbi.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_ncbi.yml b/.github/workflows/test_ncbi.yml index c01204a..541fd38 100644 --- a/.github/workflows/test_ncbi.yml +++ b/.github/workflows/test_ncbi.yml @@ -21,14 +21,15 @@ jobs: override: true - name: Install python headers - run: sudo apt-get update && sudo apt-get install python3-dev python3-pip python3-venv + run: sudo apt-get update && sudo apt-get install -y 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 + pip install --upgrade pip + pip install maturin downloads pytest + pip show maturin - name: Add library to venv run: | From 03dc732e221c410151231de5eb0b0df21e7800ba Mon Sep 17 00:00:00 2001 From: Austin Richardson Date: Wed, 11 Mar 2026 11:52:47 -0700 Subject: [PATCH 3/3] DRY up workflows --- .../actions/setup-python-bindings/action.yml | 24 +++++++++++++++++++ .github/workflows/test_ncbi.yml | 17 ++----------- .github/workflows/tests.yml | 17 ++----------- 3 files changed, 28 insertions(+), 30 deletions(-) create mode 100644 .github/actions/setup-python-bindings/action.yml diff --git a/.github/actions/setup-python-bindings/action.yml b/.github/actions/setup-python-bindings/action.yml new file mode 100644 index 0000000..57a1fa9 --- /dev/null +++ b/.github/actions/setup-python-bindings/action.yml @@ -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 diff --git a/.github/workflows/test_ncbi.yml b/.github/workflows/test_ncbi.yml index 541fd38..b2ece7f 100644 --- a/.github/workflows/test_ncbi.yml +++ b/.github/workflows/test_ncbi.yml @@ -20,21 +20,8 @@ jobs: toolchain: stable override: true - - name: Install python headers - run: sudo apt-get update && sudo apt-get install -y python3-dev python3-pip python3-venv - - - name: Install python dependencies - run: | - python3 -m venv venv - . venv/bin/activate - pip install --upgrade pip - pip install maturin downloads pytest - pip 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: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 90de246..447513c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,25 +39,12 @@ jobs: - name: version info run: rustc --version; cargo --version; - - name: Install python headers - run: sudo apt-get update && sudo apt-get install -y python3-dev python3-pip python3-venv + - name: Setup Python bindings + uses: ./.github/actions/setup-python-bindings - name: Run all tests run: cargo test --features=python_test - - name: Install maturin - run: | - python3 -m venv venv - . venv/bin/activate - pip install --upgrade pip - pip install maturin downloads pytest - pip show maturin - - - name: add library to venv - run: | - . venv/bin/activate - maturin develop --features=python - - name: Run the python tests run: | . venv/bin/activate