|
|
.PHONY: contrib quality style test |
|
|
|
|
|
|
|
|
check_dirs := contrib src tests utils setup.py |
|
|
|
|
|
|
|
|
quality: |
|
|
ruff check $(check_dirs) |
|
|
ruff format --check $(check_dirs) |
|
|
mypy src |
|
|
python utils/check_contrib_list.py |
|
|
python utils/check_static_imports.py |
|
|
python utils/generate_async_inference_client.py |
|
|
|
|
|
style: |
|
|
ruff check --fix $(check_dirs) |
|
|
ruff format $(check_dirs) |
|
|
python utils/check_contrib_list.py --update |
|
|
python utils/check_static_imports.py --update |
|
|
python utils/generate_async_inference_client.py --update |
|
|
|
|
|
repocard: |
|
|
python utils/push_repocard_examples.py |
|
|
|
|
|
|
|
|
test: |
|
|
pytest ./tests/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CONTRIB_LIBS := sentence_transformers spacy timm |
|
|
CONTRIB_JOBS := $(addprefix contrib_,${CONTRIB_LIBS}) |
|
|
CONTRIB_CLEAR_JOBS := $(addprefix contrib_clear_,${CONTRIB_LIBS}) |
|
|
CONTRIB_SETUP_JOBS := $(addprefix contrib_setup_,${CONTRIB_LIBS}) |
|
|
CONTRIB_TEST_JOBS := $(addprefix contrib_test_,${CONTRIB_LIBS}) |
|
|
|
|
|
contrib_clear_%: |
|
|
rm -rf contrib/$*/.venv |
|
|
|
|
|
contrib_setup_%: |
|
|
python3 -m venv contrib/$*/.venv |
|
|
./contrib/$*/.venv/bin/pip install -r contrib/$*/requirements.txt |
|
|
./contrib/$*/.venv/bin/pip uninstall -y huggingface_hub |
|
|
./contrib/$*/.venv/bin/pip install -e .[testing] |
|
|
|
|
|
contrib_test_%: |
|
|
./contrib/$*/.venv/bin/python -m pytest contrib/$* |
|
|
|
|
|
contrib_%: |
|
|
make contrib_setup_$* |
|
|
make contrib_test_$* |
|
|
|
|
|
contrib: ${CONTRIB_JOBS}; |
|
|
contrib_clear: ${CONTRIB_CLEAR_JOBS}; echo "Successful contrib tests." |
|
|
contrib_setup: ${CONTRIB_SETUP_JOBS}; echo "Successful contrib setup." |
|
|
contrib_test: ${CONTRIB_TEST_JOBS}; echo "Successful contrib tests." |
|
|
|