oncall-engine/engine/pyproject.toml
Joey Orlando 1ca71fa40a
fix import mypy errors (#2407)
# What this PR does

Fix the following pre-existing `import` `mypy` errors (related to
#2392):
```bash
❯ mypy .
settings/prod_without_db.py:4: error: Cannot find implementation or library stub for module named "uwsgi"  [import]
engine/logging/formatters.py:2: error: Skipping analyzing "pythonjsonlogger": module is installed, but missing library stubs or py.typed marker  [import]
engine/logging/formatters.py:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
engine/celery.py:7: error: Skipping analyzing "celery.utils.debug": module is installed, but missing library stubs or py.typed marker  [import]
Found 3 errors in 3 files (checked 595 source files)
```

## Which issue(s) this PR fixes

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-07-14 06:00:02 -04:00

86 lines
2 KiB
TOML

[tool.isort]
profile = "black"
line_length=120
# TODO: upgrade this to python 3.11
py_version=39
extend_skip_glob = "**/migrations/**"
[tool.black]
line-length = 120
# TODO: upgrade this to python 3.11
target-version = ["py39"]
force-exclude = "migrations"
[tool.mypy]
mypy_path = "$MYPY_CONFIG_FILE_DIR/type_stubs"
implicit_reexport = true
plugins = [
"mypy_django_plugin.main",
"mypy_drf_plugin.main",
]
exclude = [
# TOML's double-quoted strings require escaping backslashes
"tests/test_.*\\.py$", # test files
"migrations/\\d*.*\\.py", # migration files
]
disable_error_code = [
"abstract",
"annotation-unchecked",
"arg-type",
"assignment",
"attr-defined",
"call-arg",
"call-overload",
"has-type",
"index",
"misc",
"name-defined",
"no-redef",
"operator",
"return-value",
"typeddict-item",
"union-attr",
"valid-type",
"var-annotated",
]
# mypy per-module options
[[tool.mypy.overrides]]
module = [
# the following setting should eventually be removed, one module at a time.
# It's only being added to temporarily surpress the:
# "module is installed, but missing library stubs or py.typed marker" errors
# we can slowly either start to add library stubs ourselves, or try and upgrade these libraries to see if
# a newer version includes type stubs
"anymail.*",
"celery.utils.debug",
"debug_toolbar.*",
"django_deprecate_fields.*",
"django_sns_view.*",
"factory.*",
"fcm_django.*",
"firebase_admin.*",
"humanize.*",
"ipware.*",
"markdown2.*",
"mirage.*",
"ordered_model.*",
"phonenumbers.*",
"polymorphic.*",
"pyroscope.*",
"ratelimit.*",
"recurring_ical_events.*",
"rest_polymorphic.*",
"slackclient.*",
"slackviewer.*",
"social_core.*",
"social_django.*",
"twilio.*",
"uwsgidecorators.*",
"whitenoise.*",
"uwsgi.*",
]
ignore_missing_imports = true
[tool.django-stubs]
django_settings_module = "settings.dev"