-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
ci: added typechecking #1537
Closed
ErikBjare
wants to merge
6
commits into
BerriAI:litellm_stable_dev_09_26_2024
from
ErikBjare:add-typechecking
Closed
ci: added typechecking #1537
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
28904c3
build(deps): added mypy as a dev dependency
ErikBjare 5fbeae9
fix: added py.typed marker file
ErikBjare 2df9c8c
ci: added typecheck workflow
ErikBjare 8beccef
build(deps): added types-* packages to dev deps, set mypy config in p…
ErikBjare 312b3d5
fix: fixed type issues
ErikBjare afc3e7d
ci: set options for mypy with flags since pyproject.toml somehow not …
ErikBjare File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Typecheck | ||
|
||
# If a pull-request is pushed then cancel all previously running jobs related | ||
# to that pull-request | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
|
||
env: | ||
PY_COLORS: 1 | ||
|
||
jobs: | ||
typecheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- uses: actions/[email protected] | ||
with: | ||
python-version: '3.12' | ||
- run: poetry install | ||
- name: Run mypy | ||
# for some strange reason, the config specified in pyproject.toml is not respected | ||
run: poetry run mypy . --ignore-missing-imports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @ErikBjare @jamesbraza is it necessary to add mypy and types in our core dependencies?
for context i'm looking at openai's dependencies and i don't see this there - https://github.com/openai/openai-python/blob/54a5911f5215148a0bdeb10e2bcfb84f635a75b9/pyproject.toml#L10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So these are not the core deps, they're
dev
(developer) deps. Also, #4136 addedmypy
to thedev
group already, so if this PR were rebased atop main this particular line would go away.However, the below type stubs added need to stay in dev group dependencies.
Tho I don't think the type stubs should be so specifically pinned, it's okay with something like
>=
instead of^