-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Gradual typing #1217
base: main
Are you sure you want to change the base?
Gradual typing #1217
Changes from all commits
d6ae467
ea33df3
4ed26cb
5ff40a6
e19b889
60c480d
1b7fcb3
e060fc1
1e9ee36
fd9d5cf
c568cb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
name: Linting | ||
|
||
on: | ||
push: | ||
paths-ignore: | ||
- 'aider/website/**' | ||
- README.md | ||
- HISTORY.md | ||
branches: | ||
- main | ||
pull_request: | ||
paths-ignore: | ||
- 'aider/website/**' | ||
- README.md | ||
branches: | ||
- main | ||
|
||
jobs: | ||
mypy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use a matrix like in the other workflows |
||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install '.[browser,dev,playwright,mypy]' | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add flake8 and black checks as they are in the pre-commit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to just add https://github.com/pre-commit/action |
||
- name: Run Mypy | ||
uses: wearerequired/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
mypy: true | ||
mypy_args: "." | ||
continue_on_error: false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
from .ask_prompts import AskPrompts | ||
from .base_coder import Coder | ||
from .base_prompts import CoderPrompts | ||
|
||
|
||
class AskCoder(Coder): | ||
"""Ask questions about code without making any changes.""" | ||
|
||
edit_format = "ask" | ||
gpt_prompts = AskPrompts() | ||
gpt_prompts: CoderPrompts = AskPrompts() |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,3 +1,6 @@ | ||||||
from __future__ import annotations | ||||||
|
||||||
|
||||||
class CoderPrompts: | ||||||
system_reminder = "" | ||||||
|
||||||
|
@@ -37,7 +40,7 @@ class CoderPrompts: | |||||
" stop and wait for your approval." | ||||||
) | ||||||
|
||||||
repo_content_prefix = """Here are summaries of some files present in my git repository. | ||||||
repo_content_prefix: str | None = """Here are summaries of some files present in my git repository. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The type union syntax
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On line 1 of this file, I've added from __future__ import annotations which makes sure There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to put that in the tests too it looks like:
|
||||||
Do not propose changes to these files, treat them as *read-only*. | ||||||
If you need to edit any of these files, ask me to *add them to the chat* first. | ||||||
""" | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
class ExInfo: | ||
name: str | ||
retry: bool | ||
description: str | ||
description: str | None | ||
|
||
|
||
EXCEPTIONS = [ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,4 @@ def _load_litellm(self): | |
|
||
litellm = LazyLiteLLM() | ||
|
||
__all__ = [litellm] | ||
__all__ = ["litellm"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[mypy] | ||
exclude = (?x)( | ||
^\.git/ | ||
| ^benchmark/$ | ||
| ^build/$ | ||
| ^dist/$ | ||
| ^scripts/$ | ||
) | ||
allow_untyped_globals = True | ||
check_untyped_defs = False | ||
|
||
[mypy-configargparse] | ||
ignore_missing_imports = True | ||
|
||
[mypy-diff_match_patch] | ||
ignore_missing_imports = True | ||
|
||
[mypy-diskcache] | ||
ignore_missing_imports = True | ||
|
||
[mypy-grep_ast.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-imgcat] | ||
ignore_missing_imports = True | ||
|
||
[mypy-llama_index.*] | ||
ignore_missing_imports = True | ||
|
||
[mypy-mixpanel] | ||
ignore_missing_imports = True | ||
|
||
[mypy-pydub] | ||
ignore_missing_imports = True | ||
|
||
[mypy-pypandoc] | ||
ignore_missing_imports = True | ||
|
||
[mypy-pyperclip] | ||
ignore_missing_imports = True | ||
|
||
[mypy-soundfile] | ||
ignore_missing_imports = True | ||
|
||
[mypy-sounddevice] | ||
ignore_missing_imports = True |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-c ../requirements.txt | ||
|
||
mypy | ||
types-Pygments | ||
types-PyYAML | ||
types-beautifulsoup4 | ||
types-jsonschema | ||
types-networkx | ||
types-pexpect | ||
types-psutil | ||
types-requests | ||
types-tqdm | ||
types-tree-sitter-languages |
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.
Not sure why we need this on push, just PR right?