Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint all toolkits #183

Merged
merged 15 commits into from
Dec 20, 2024
Merged

Lint all toolkits #183

merged 15 commits into from
Dec 20, 2024

Conversation

EricGustin
Copy link
Contributor

@EricGustin EricGustin commented Dec 20, 2024

PR Description

  • Adds/updates the following files to all toolkits:
    • .pre-commit-config.yaml
    • .ruff.toml
    • LICENSE
    • Makefile
    • pyproject.toml
  • Lint all toolkits such that they pass make check and make test (a total doozy). This includes adding some unit tests and evals.
  • Github workflow for testing toolkits before merge into main (courtesy of @sdreyer)
  • Added a QOL improvement for tool developers for when they need to get the context's auth token.
  • Minor updates to arcade new template.

@EricGustin EricGustin marked this pull request as ready for review December 20, 2024 00:57
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@EricGustin EricGustin mentioned this pull request Dec 20, 2024
with:
python-version: '3.12'
cache: 'pip'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdreyer I removed the pip install ./arcade step since all of the toolkits installed the most recent version of arcade-ai

@@ -234,6 +234,10 @@ class ToolContext(BaseModel):
user_id: str | None = None
"""The user ID for the tool invocation (if any)."""

def get_auth_token_or_empty(self) -> str:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be a tool developer QOL improvement. I can't use them in the toolkits today since arcade-ai and toolkits are no longer released on the same schedule, but after the next arcade-ai release I will update the toolkits to use this. For now, you will see a lot of the following the toolkits: context.authorization.token if context.authorization and context.authorization.token else ""

]

[lint.per-file-ignores]
"*" = ["TRY003", "B904"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to exclude these two from the linter. Both like to complain whenever RetryableToolError is used. It seemed like a bad experience to need to # noqa: B904 and # noqa: TRY003 whenever the RetryableToolError was used in code.

@EricGustin EricGustin requested a review from a team December 20, 2024 01:34
@EricGustin EricGustin merged commit ab889f9 into main Dec 20, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants