Skip to content

Commit ffafc87

Browse files
authored
Merge pull request #134 from SaInekK/pr/ci-hygiene
CI hygiene: drop dead env, bump actions, cache pip, enforce ruff
2 parents 9458a02 + f108132 commit ffafc87

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

‎.github/workflows/docker.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,5 @@ jobs:
2525
- name: Run tests inside Docker container
2626
run: |
2727
docker run \
28-
-e HARMONY_LITE=no_transformers \
2928
-e PYTHONPATH=/app/src \
3029
harmony-test

‎.github/workflows/test.yml‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ on:
1212
paths-ignore:
1313
- README.md
1414
workflow_dispatch:
15-
env:
16-
HARMONY_LITE: no_transformers
17-
15+
1816
jobs:
1917
build:
2018
runs-on: ubuntu-latest
@@ -23,11 +21,17 @@ jobs:
2321
python: [3.10.11]
2422

2523
steps:
26-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
2725
- name: Setup Python
28-
uses: actions/setup-python@v2
26+
uses: actions/setup-python@v5
2927
with:
3028
python-version: ${{ matrix.python }}
29+
cache: 'pip'
30+
cache-dependency-path: pyproject.toml
31+
- name: Lint with ruff
32+
run: |
33+
pip install ruff
34+
ruff check src tests
3135
- name: Install Tox
3236
run: pip install tox
3337
- name: Setup Java

‎src/harmony/__init__.py‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
__version__ = "1.0.7"
2323
# TODO: make these configurable at package level
2424
import os
25+
import warnings
2526
from .examples import example_instruments
2627
from .schemas import *
2728
from .util.instrument_helper import create_instrument_from_list, import_instrument_into_harmony_web
@@ -58,4 +59,9 @@ def generate_basic_harmony_report(*args, **kwargs):
5859
try:
5960
from .matching.default_matcher import match_instruments
6061
except ModuleNotFoundError:
61-
print("Warning: transformers not available. To use transformers, run pip install sentence-transformers")
62+
warnings.warn(
63+
"transformers not available. To use transformers, run "
64+
"pip install sentence-transformers",
65+
ImportWarning,
66+
stacklevel=2,
67+
)

0 commit comments

Comments
 (0)