litellm
litellm copied to clipboard
Guide check for contribution
Enable the checks for code quality locally.
- Add pre-commit to run git hooks for flake8, black and mypy.
- Fix: async pytest requires pytest-asyncio library to handle coroutines.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
litellm | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 12, 2024 3:07am |
hey @edwinjosegeorge we already have this with pre-commit hooks
I don't think you need to run
poetry run flake8
poetry run pytest .
pre-commit should take care of this - https://github.com/BerriAI/litellm/blob/9b7db7ea47156b74a42fac9c0af2cc634943ac8b/.pre-commit-config.yaml#L4
Hi @krrishdholakia
Thanks for the quick response ❤️ . Upon cloning the repository, I found that there was no mention of pre-commit
as a guide but I found the config file. The config file does runs black
, flake8
and mypy
, but does not run 'pytest'. Installing and configuring pre-commit
will surely run these, but not the test files. Maybe we can tag black
, flake8
on commit hook and mypy
, 'pytest' on push hook.
I also found couple of libraries that is imported, but not used. Running linters pylint
can catch a lot of inconsistency improving the code quality.
closing as outdated