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
76 changes: 64 additions & 12 deletions .github/workflows/python-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,32 +87,58 @@ jobs:

- name: Setup virtual environment
working-directory: crates/terraphim_automata_py
shell: bash
run: |
unset CONDA_PREFIX
uv venv
source .venv/bin/activate
if [[ "$RUNNER_OS" == "Windows" ]]; then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi

- name: Install maturin
working-directory: crates/terraphim_automata_py
shell: bash
run: |
source .venv/bin/activate
if [[ "$RUNNER_OS" == "Windows" ]]; then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi
uv pip install maturin

- name: Build Python package
working-directory: crates/terraphim_automata_py
shell: bash
run: |
source .venv/bin/activate
maturin develop
if [[ "$RUNNER_OS" == "Windows" ]]; then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi
maturin develop --target native

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Remove invalid maturin target override

maturin develop --target native passes an invalid Rust target triple; cargo does not recognize a target named native, so this step will fail on every runner before building the bindings (the default host target is already used when --target is omitted). The same flag is used again in the release build later in the workflow, so both steps will break CI until the target override is removed or replaced with a real triple.

Useful? React with πŸ‘Β / πŸ‘Ž.


- name: Install test dependencies
working-directory: crates/terraphim_automata_py
shell: bash
run: |
source .venv/bin/activate
if [[ "$RUNNER_OS" == "Windows" ]]; then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi
uv pip install pytest pytest-cov

- name: Run tests
working-directory: crates/terraphim_automata_py
shell: bash
run: |
source .venv/bin/activate
if [[ "$RUNNER_OS" == "Windows" ]]; then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi
pytest python/tests/ -v --cov=terraphim_automata --cov-report=xml --cov-report=term

- name: Upload coverage to Codecov
Expand Down Expand Up @@ -151,26 +177,47 @@ jobs:

- name: Setup virtual environment
working-directory: crates/terraphim_automata_py
shell: bash
run: |
unset CONDA_PREFIX
uv venv
source .venv/bin/activate
if [[ "$RUNNER_OS" == "Windows" ]]; then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi

- name: Install maturin
working-directory: crates/terraphim_automata_py
shell: bash
run: |
source .venv/bin/activate
if [[ "$RUNNER_OS" == "Windows" ]]; then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi
uv pip install maturin

- name: Build Python package (release mode)
working-directory: crates/terraphim_automata_py
shell: bash
run: |
source .venv/bin/activate
maturin develop --release
if [[ "$RUNNER_OS" == "Windows" ]]; then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi
maturin develop --release --target native

- name: Install benchmark dependencies
working-directory: crates/terraphim_automata_py
shell: bash
run: |
source .venv/bin/activate
if [[ "$RUNNER_OS" == "Windows" ]]; then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi
uv pip install pytest pytest-benchmark

- name: Install Rust target for benchmarks
Expand All @@ -179,8 +226,13 @@ jobs:

- name: Run benchmarks
working-directory: crates/terraphim_automata_py
shell: bash
run: |
source .venv/bin/activate
if [[ "$RUNNER_OS" == "Windows" ]]; then
source .venv/Scripts/activate
else
source .venv/bin/activate
fi
pytest python/benchmarks/ -v --benchmark-only \
--benchmark-json=benchmark-results.json \
--benchmark-columns=min,max,mean,stddev,median,ops
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import json

import pytest

from terraphim_automata import build_index


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import json

import pytest

from terraphim_automata import extract_paragraphs, find_all_matches, replace_with_links


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Tests for autocomplete functionality"""

import pytest

from terraphim_automata import build_index

# Sample thesaurus for testing
Expand Down
1 change: 0 additions & 1 deletion crates/terraphim_automata_py/python/tests/test_matcher.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Tests for text matching and replacement functionality"""

import pytest

from terraphim_automata import extract_paragraphs, find_all_matches, replace_with_links

# Sample thesaurus for testing
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Tests for thesaurus loading functionality"""

import pytest

from terraphim_automata import build_index, load_thesaurus


Expand Down
Loading