oncall-engine/engine/pyproject.toml
Joey Orlando 7c4b40a046
upgrade to Python 3.12 (#3456)
# What this PR does

Upgrade to Python 3.12 + fix several invalid test assertions that lead
to test failures in the latest version of `pytest`:
```
AttributeError: 'called_once_with' is not a valid assertion. Use a spec for the mock if 'called_once_with' is meant to be an attribute.. Did you mean: 'assert_called_once_with'?
```

## Checklist

- [ ] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-11-30 13:47:41 +00:00

84 lines
2 KiB
TOML

[tool.isort]
profile = "black"
line_length=120
float_to_top=true
# TODO: update py_version to 312 once isort supports it
py_version=311
extend_skip_glob = "**/migrations/**"
[tool.black]
line-length = 120
target-version = ["py312"]
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",
"operator",
"return-value",
"typeddict-item",
"union-attr",
]
# 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_migration_linter",
"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"