-
Notifications
You must be signed in to change notification settings - Fork 32
Add type hinting across the package #565
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
Draft
bmtcril
wants to merge
12
commits into
main
Choose a base branch
from
bmtcril/type_hints
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
ec26750
style: Add type hinting infrastructure, mypy
8b4f4f0
style: Type hints for exceptions.py
b56a821
style: Annotate utils.py
af61ce6
style: Annotate data.py
2bb757e
style: Add annotations for analytics and enterprise
e2a771d
style: Add annotations for content_authoring
38e2b4a
style: Add annotations for learning
4cbee9e
style: Update annotations in Avro
93e7cef
style: Annotate tooling.py
0dec41b
style: Fix annotation for SIMPLE_PYTHON_TYPE_TO_AVRO_MAPPING
e4b961a
style: Update annotations for commands, apps, testing.py
1103790
style: Update annotations for tests
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| [mypy] | ||
| python_version = 3.12 | ||
| ; Start permissive at the project level — tighten per-module as each phase lands | ||
| warn_return_any = True | ||
| warn_unused_ignores = True | ||
| warn_unused_configs = True | ||
| warn_redundant_casts = True | ||
| disallow_untyped_defs = False | ||
| disallow_incomplete_defs = False | ||
| check_untyped_defs = True | ||
| no_implicit_optional = True | ||
| strict_equality = True | ||
|
|
||
| plugins = | ||
| mypy_django_plugin.main | ||
|
|
||
| [mypy.plugins.django-stubs] | ||
| django_settings_module = test_utils.test_settings | ||
|
|
||
| ; ----------------------------------------------------------------------- | ||
| ; Third-party packages without type stubs — silence missing-import errors | ||
| ; ----------------------------------------------------------------------- | ||
|
|
||
| [mypy-fastavro.*] | ||
| ignore_missing_imports = True | ||
|
|
||
| [mypy-ccx_keys.*] | ||
| ignore_missing_imports = True | ||
|
|
||
| [mypy-opaque_keys.*] | ||
| ignore_missing_imports = True | ||
|
|
||
| [mypy-edx_django_utils.*] | ||
| ignore_missing_imports = True | ||
|
|
||
| [mypy-ddt] | ||
| ignore_missing_imports = True | ||
|
|
||
|
|
||
| ; ----------------------------------------------------------------------- | ||
| ; Per-module strictness overrides | ||
| ; Flip disallow_untyped_defs = True module-by-module as annotations land. | ||
| ; ----------------------------------------------------------------------- | ||
|
|
||
| [mypy-openedx_events.exceptions] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.utils] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.data] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.analytics.data] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.enterprise.data] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.content_authoring.data] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.learning.data] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.event_bus.avro.types] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.event_bus.avro.custom_serializers] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.event_bus.avro.schema] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.event_bus.avro.serializer] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.event_bus.avro.deserializer] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.tooling] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.event_bus] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.apps] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.testing] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.management.commands.consume_events] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.management.commands.generate_avro_schemas] | ||
| disallow_untyped_defs = True | ||
|
|
||
| [mypy-openedx_events.analytics.signals] | ||
| disallow_untyped_defs = False | ||
|
|
||
| [mypy-openedx_events.enterprise.signals] | ||
| disallow_untyped_defs = False | ||
|
|
||
| [mypy-openedx_events.content_authoring.signals] | ||
| disallow_untyped_defs = False | ||
|
|
||
| [mypy-openedx_events.learning.signals] | ||
| disallow_untyped_defs = False | ||
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.
opaque-keys has type info now, so we shouldn't need this.