Update arcade new template to pass linting (#201)
This commit is contained in:
parent
8795871d51
commit
5022d339a2
14 changed files with 14 additions and 7 deletions
|
|
@ -12,3 +12,4 @@ max_line_length = 100 # This is also set in .ruff.toml for ruff
|
||||||
[*.{json,jsonc,yml,yaml}]
|
[*.{json,jsonc,yml,yaml}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2 # This is also set in .prettierrc.toml
|
indent_size = 2 # This is also set in .prettierrc.toml
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -164,3 +164,4 @@ cython_debug/
|
||||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,3 +16,4 @@ repos:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [--fix]
|
args: [--fix]
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
# Ignore Python files for Prettier
|
# Ignore Python files for Prettier
|
||||||
*.py
|
*.py
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,3 +13,4 @@ files = [ "*.json", "*.jsonc", "*.yml", "*.yaml" ]
|
||||||
|
|
||||||
[overrides.options]
|
[overrides.options]
|
||||||
tabWidth = 2
|
tabWidth = 2
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,3 +42,4 @@ select = [
|
||||||
[format]
|
[format]
|
||||||
preview = true
|
preview = true
|
||||||
skip-magic-trailing-comma = false
|
skip-magic-trailing-comma = false
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,3 +51,4 @@ check: ## Run code quality tools.
|
||||||
@poetry run pre-commit run -a
|
@poetry run pre-commit run -a
|
||||||
@echo "🚀 Static type checking: Running mypy"
|
@echo "🚀 Static type checking: Running mypy"
|
||||||
@poetry run mypy --config-file=pyproject.toml
|
@poetry run mypy --config-file=pyproject.toml
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,3 +71,4 @@
|
||||||
```bash
|
```bash
|
||||||
arcade evals --host localhost --details
|
arcade evals --host localhost --details
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,3 +7,4 @@ coverage:
|
||||||
default:
|
default:
|
||||||
target: 90%
|
target: 90%
|
||||||
threshold: 0.5%
|
threshold: 0.5%
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,12 +36,7 @@ def {{ toolkit_name }}_eval_suite() -> EvalSuite:
|
||||||
suite.add_case(
|
suite.add_case(
|
||||||
name="Saying hello",
|
name="Saying hello",
|
||||||
user_message="He's actually right here, say hi to him!",
|
user_message="He's actually right here, say hi to him!",
|
||||||
expected_tool_calls=[
|
expected_tool_calls=[ExpectedToolCall(func=say_hello, args={"name": "John Doe"})],
|
||||||
ExpectedToolCall(
|
|
||||||
func=say_hello,
|
|
||||||
args={"name": "John Doe"}
|
|
||||||
)
|
|
||||||
],
|
|
||||||
rubric=rubric,
|
rubric=rubric,
|
||||||
critics=[
|
critics=[
|
||||||
SimilarityCritic(critic_field="name", weight=0.5),
|
SimilarityCritic(critic_field="name", weight=0.5),
|
||||||
|
|
|
||||||
|
|
@ -37,3 +37,4 @@ testpaths = ["tests"]
|
||||||
|
|
||||||
[tool.coverage.report]
|
[tool.coverage.report]
|
||||||
skip_empty = true
|
skip_empty = true
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ from {{ package_name }}.tools.hello import say_hello
|
||||||
def test_hello() -> None:
|
def test_hello() -> None:
|
||||||
assert say_hello("developer") == "Hello, developer!"
|
assert say_hello("developer") == "Hello, developer!"
|
||||||
|
|
||||||
|
|
||||||
def test_hello_raises_error() -> None:
|
def test_hello_raises_error() -> None:
|
||||||
with pytest.raises(ToolExecutionError):
|
with pytest.raises(ToolExecutionError):
|
||||||
say_hello(1)
|
say_hello(1)
|
||||||
|
|
|
||||||
|
|
@ -14,4 +14,4 @@ allowlist_externals = poetry
|
||||||
commands =
|
commands =
|
||||||
poetry install -v --all-extras
|
poetry install -v --all-extras
|
||||||
pytest --doctest-modules tests --cov --cov-config=pyproject.toml --cov-report=xml
|
pytest --doctest-modules tests --cov --cov-config=pyproject.toml --cov-report=xml
|
||||||
# mypy
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue