-
Notifications
You must be signed in to change notification settings - Fork 15
Activate ruff rules on SSI/auto-injection #6805
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
base: main
Are you sure you want to change the base?
Changes from all commits
11d17af
0ff05c2
9bed3b9
b8b3ea8
6781018
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 |
|---|---|---|
| @@ -1,12 +1,13 @@ | ||
| import os | ||
| import signal | ||
| import sys | ||
| import types | ||
|
|
||
| from django.http import HttpResponse | ||
| from django.http import HttpRequest, HttpResponse | ||
| from django.urls import path | ||
|
|
||
|
|
||
| def handle_sigterm(signo, sf): | ||
| def handle_sigterm(signo: int, sf: types.FrameType | None) -> None: | ||
|
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 new annotation Useful? React with 👍 / 👎. |
||
| sys.exit(0) | ||
|
|
||
|
|
||
|
|
@@ -20,7 +21,7 @@ def handle_sigterm(signo, sf): | |
| ALLOWED_HOSTS = ["*"] | ||
|
|
||
|
|
||
| def index(request): | ||
| def index(request: HttpRequest): | ||
| import ddtrace | ||
|
|
||
| if ddtrace.__version__ != "1.12.0": | ||
|
|
||
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.
This module now adds runtime type annotations (for example
def handle_sigterm(signo: int, ...)) even thoughlib-injection/build/docker/python/dd-lib-python-init-test-django-27/Dockerfileruns it withFROM python:2.7. Python 2.7 cannot parse function annotations, so the Django settings module will fail to import and this auto-injection variant will fail to start before any tests execute.Useful? React with 👍 / 👎.