-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtox.ini
52 lines (48 loc) · 2.58 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
[tox]
min_version = 4.0
env_list =
py{311,310,39,38}
skipsdist = true
skip_install = true
[testenv]
description = run unittests
allowlist_externals =
rm
poetry
pytest
commands_pre =
poetry install --with dev --all-extras
pip install torch --index-url https://download.pytorch.org/whl/cpu
commands =
pytest -c pyproject.toml -x --cov-append tests
coverage report -m --rcfile pyproject.toml
rm .coverage
[testenv:format]
description = run formatting
commands_pre = poetry install --only dev
commands =
python scripts/copyright_header.py friendli tests scripts
isort --settings-path pyproject.toml friendli tests scripts
black --config pyproject.toml friendli tests scripts
[testenv:lint]
description = run linters
commands_pre =
poetry install --with dev --all-extras
pip install torch --index-url https://download.pytorch.org/whl/cpu
commands =
isort --settings-path pyproject.toml --check friendli tests scripts
black --config pyproject.toml --check friendli tests scripts
mypy --config-file pyproject.toml --show-traceback friendli
pylint -j 4 --rcfile pyproject.toml friendli
pydocstyle --config pyproject.toml friendli
[testenv:codegen]
description = run protobuf codegen
commands_pre = poetry install
commands =
python -m grpc_tools.protoc -Iproto --python_out=friendli/schema/api/v1/codegen --pyi_out=friendli/schema/api/v1/codegen proto/chat_completions.proto proto/response_format.proto proto/text_to_image.proto
python -m grpc_tools.protoc -Iproto --python_out=friendli/schema/api/v1/codegen --pyi_out=friendli/schema/api/v1/codegen --grpc_python_out=friendli/schema/api/v1/codegen proto/completions.proto
python scripts/fix_imports.py --source-path friendli/schema/api/v1/codegen/chat_completions_pb2.py --prefix-to-attach friendli.schema.api.v1.codegen --imports-to-fix response_format_pb2
python scripts/fix_imports.py --source-path friendli/schema/api/v1/codegen/chat_completions_pb2.pyi --prefix-to-attach friendli.schema.api.v1.codegen --imports-to-fix response_format_pb2
python scripts/fix_imports.py --source-path friendli/schema/api/v1/codegen/completions_pb2.py --prefix-to-attach friendli.schema.api.v1.codegen --imports-to-fix response_format_pb2
python scripts/fix_imports.py --source-path friendli/schema/api/v1/codegen/completions_pb2.pyi --prefix-to-attach friendli.schema.api.v1.codegen --imports-to-fix response_format_pb2
python scripts/fix_imports.py --source-path friendli/schema/api/v1/codegen/completions_pb2_grpc.py --prefix-to-attach friendli.schema.api.v1.codegen --imports-to-fix completions_pb2