Skip to content

Commit 9c4c534

Browse files
voorhsSamoedgithub-actions[bot]
authored
lazy import heavy dependencies (#267)
* add `require` utility * implement catboost lazy importing * implement peft lazy importing * update dev dependencies installation shortcut * implement lazy importing transformers * fix typing errors * run code formatter * employ better multi-label stratifier than skmultilearn * make sentence-transformers an optional dependency * run ruff * make tests runnable even without sentence-transformers dependency * bug fix tests * fixes after merging * remove duplicates in optional dependencies * move openai * add dependencies to tests * lint * some skip * skip * lint * more skip * more skip * add installs * small fixes * fixes * fix typing * fix docs * remove require * fix typing * Feat/hashing vectorizer (#268) * add embedder * add test embedder config * update tests * update assertions in some tests * Feat/extras matrix for tests (#269) * add dependencies matrix * add pipeline tests for each scoring module * bug fix * upd extras installation in gh actions * upd extras in mypy ci * fix issues with dependencies for bert scorer test * fix gcn scorer tests * fix typing errors * upd assertions about catboost predictions * upd ci with presets tests * try to fix unit tests * Feat/extras matrix for tests (#270) * add dependencies matrix * add pipeline tests for each scoring module * bug fix * upd extras installation in gh actions * upd extras in mypy ci * fix issues with dependencies for bert scorer test * fix gcn scorer tests * fix typing errors * upd assertions about catboost predictions * upd ci with presets tests * try to fix unit tests * try to fix mypy * fix catboost test * skip incremental evolver tests for now * upd callback test * run ruff * add missing transformers dependency to embedder ci * update test for tunable decision module * move callback testing to the env with sentence-transformers installed * fix embedder tests * remove catboost from classic-medium * lint * small fixes * lint --------- Co-authored-by: Roman Solomatin <36135455+Samoed@users.noreply.github.com> * fix import * fix import * fix pyproject * move peft * move peft * add concurrency * fix catboost test * set seed without transformers * test fixes * fix typing * fix test * try to reuse reusable test * try to reuse reusable test * remove most importorskip * fix typing * Update optimizer_config.schema.json * lint * change gcn to hashing * lint * try to fail tests --------- Co-authored-by: Roman Solomatin <36135455+Samoed@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 1124fe4 commit 9c4c534

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+4645
-880
lines changed

.github/workflows/build-docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949

5050
- name: Install dependencies
5151
run: |
52-
uv sync --group docs
52+
uv sync --group docs --extra catboost --extra peft --extra transformers --extra sentence-transformers --extra openai
5353
5454
- name: Run tests
5555
if: github.event_name != 'workflow_dispatch'

.github/workflows/reusable-test.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ on:
77
required: true
88
type: string
99
description: 'Command to run tests'
10+
extras:
11+
required: false
12+
type: string
13+
default: ''
14+
description: 'Space-separated --extra flags (e.g., "--extra transformers --extra peft")'
15+
16+
concurrency:
17+
group: reusable-test-${{ github.workflow }}-${{ github.ref }}-${{ inputs.extras }}
18+
cancel-in-progress: true
1019

1120
jobs:
1221
test:
@@ -15,7 +24,7 @@ jobs:
1524
fail-fast: false
1625
matrix:
1726
os: [ ubuntu-latest ]
18-
python-version: [ "3.10", "3.11", "3.12", "3.13", ]
27+
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14", ]
1928
include:
2029
- os: windows-latest
2130
python-version: "3.10"
@@ -40,8 +49,8 @@ jobs:
4049
- name: Install dependencies for Python ${{ matrix.python-version }}
4150
run: |
4251
uv python pin ${{ matrix.python-version }}
43-
uv sync --group test
52+
uv sync --group test ${{ inputs.extras }}
4453
4554
- name: Run tests
4655
run: |
47-
uv run ${{ inputs.test_command }}
56+
uv run ${{ inputs.test_command }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: test embedder
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
uses: ./.github/workflows/reusable-test.yaml
12+
with:
13+
test_command: pytest -n auto tests/embedder/ tests/callback/
14+
extras: --extra sentence-transformers --extra transformers

.github/workflows/test-inference.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ jobs:
1111
uses: ./.github/workflows/reusable-test.yaml
1212
with:
1313
test_command: pytest -n auto tests/pipeline/test_inference.py
14+
extras: --extra catboost --extra peft --extra transformers --extra sentence-transformers

.github/workflows/test-optimization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ jobs:
1111
uses: ./.github/workflows/reusable-test.yaml
1212
with:
1313
test_command: pytest -n auto tests/pipeline/test_optimization.py
14+
extras: --extra catboost --extra peft --extra transformers --extra sentence-transformers

.github/workflows/test-presets.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ jobs:
1111
uses: ./.github/workflows/reusable-test.yaml
1212
with:
1313
test_command: pytest -n auto tests/pipeline/test_presets.py
14+
extras: --extra catboost --extra peft --extra transformers --extra sentence-transformers
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: test scorers
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
dependency-group: [ "base", "transformers", "peft", "catboost" ]
15+
uses: ./.github/workflows/reusable-test.yaml
16+
with:
17+
test_command: pytest -n auto tests/modules/scoring/
18+
extras: ${{ matrix.dependency-group != 'base' && format('--extra {0}', matrix.dependency-group) || '' }}

.github/workflows/typing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Install dependencies
1919
run: |
2020
uv lock
21-
uv sync --group typing
21+
uv sync --group typing --extra catboost --extra peft --extra transformers --extra sentence-transformers --extra openai
2222
2323
- name: Run mypy
2424
run: uv run mypy src/autointent

.github/workflows/unit-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ jobs:
1010
test:
1111
uses: ./.github/workflows/reusable-test.yaml
1212
with:
13-
test_command: pytest -n auto --ignore=tests/nodes --ignore=tests/pipeline
13+
test_command: pytest -n auto --ignore=tests/modules/scoring/ --ignore=tests/pipeline --ignore=tests/embedder

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sh = uv run --no-sync --frozen
88
.PHONY: install
99
install:
1010
rm -rf uv.lock
11-
uv sync --all-groups
11+
uv sync --all-groups --extra catboost --extra peft --extra sentence-transformers --extra transformers
1212

1313
.PHONY: test
1414
test:

0 commit comments

Comments
 (0)