-
Notifications
You must be signed in to change notification settings - Fork 214
Remove python 3.9 #2081
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
Merged
Merged
Remove python 3.9 #2081
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
84d78ff
remove python 3.9
vyagubov 7d94bde
Merge branch 'master' into remove_old_python
haritamar 6d860ce
silence mypy error when subclassing click.MultiCommand
vyagubov 349432b
Merge branch 'master' into remove_old_python
haritamar 645fb9b
use newer actions/setup-python version
vyagubov 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
🧩 Analysis chain
🌐 Web query:
click types-click MultiCommand mypy typing issue 2025💡 Result:
The most common cause is having
types-clickinstalled while usingclick>=8.0.clickships its own type hints/stubs since v8.0, sotypes-clickis no longer needed and can conflict with Click’s bundled annotations (often showing up around classes likeclick.MultiCommand). [1]types-click(and then re-run mypy), keeping onlyclickinstalled. If you must usetypes-click, you generally need to pinclick<8. [1]If the problem is an actual stub bug, the
types-clickstubs come from typeshed, and fixes should be filed/contributed there. [1][2]Sources:
[1] https://pypi.org/project/types-click/
[2] https://github.com/python/typeshed
🌐 Web query:
click library Python type hints MultiCommand subclassing support💡 Result:
Yes—Click supports subclassing
click.MultiCommand(andclick.Group) and it has type-hint support:list_commands(ctx)andget_command(ctx, cmd_name). Click’s docs explicitly describe this extension point forGroup/MultiCommand. [2]types-clickon modern Click). [1]MultiCommandAPI: In the Click API docs,get_commandis documented as returningCommand | Noneandlist_commandsasList[str], which is what type checkers will expect your overrides to match. [3]Sources:
[1] https://pypi.org/project/types-click/
[2] https://pocoo-click.readthedocs.io/en/latest/advanced/
[3] https://dokk.org/documentation/pallets-click/8.1.7/api/
🏁 Script executed:
Repository: elementary-data/elementary
Length of output: 52
🏁 Script executed:
Repository: elementary-data/elementary
Length of output: 52
🏁 Script executed:
Repository: elementary-data/elementary
Length of output: 402
🏁 Script executed:
Repository: elementary-data/elementary
Length of output: 2653
🏁 Script executed:
Repository: elementary-data/elementary
Length of output: 109
🏁 Script executed:
Repository: elementary-data/elementary
Length of output: 52
🏁 Script executed:
Repository: elementary-data/elementary
Length of output: 52
🏁 Script executed:
Repository: elementary-data/elementary
Length of output: 80
🏁 Script executed:
Repository: elementary-data/elementary
Length of output: 366
🏁 Script executed:
# Check mypy.ini configuration cat ./mypy.iniRepository: elementary-data/elementary
Length of output: 358
🏁 Script executed:
Repository: elementary-data/elementary
Length of output: 2271
Scoped type ignore is good practice, but reconsider the explanatory comment.
Using specific error codes (
misc,valid-type) rather than a blanket ignore is correct. However, the suggested comment is inaccurate—Click 8.0+ has full type stub support forMultiCommandsubclassing. The actual issue is likely method return type mismatches:list_commands()returnsdict_keysbut the type stub expectsSequence[str], andget_command()may have signature mismatches.If the type ignore is still necessary, a more accurate comment would be:
# type: ignore[misc, valid-type] # Method signatures differ from click.MultiCommand stubs. Alternatively, consider adjusting method signatures to match Click's type expectations (returnlist()fromlist_commands(), explicitly typeget_command()return asCommand | None).🤖 Prompt for AI Agents