-
Notifications
You must be signed in to change notification settings - Fork 806
fix: suppress ruff PLC0415 for conditional gevent import #3842
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?
Conversation
The generate_instrumentation_bootstrap.py script was failing with a ruff linting error (PLC0415: import should be at top-level) when checking the auto_instrumentation module. Add noqa comment to suppress this error for the gevent monkey patch import, which is intentionally inside a try-except block for conditional loading. This allows the bootstrap generation script to complete successfully.
|
@lukeina2z any idea on why our tooling does not raise that? |
I guess he is running a newer ruff version than the one we run in CI. When running with 0.6.9 I don't get the warnings |
@emdneto you are right, I manually installed the missing packages. Here is my pip list: (.venv) anyio 4.11.0 7cf34de09d4c % python --version |
|
@lukeina2z could you please bump ruff version like in open-telemetry/opentelemetry-python#4782 ? |
Description
The generate_instrumentation_bootstrap.py script was failing with a ruff linting error (PLC0415: import should be at top-level) when checking the auto_instrumentation module.
Fixes #3878
Add noqa comment to suppress this error for the gevent monkey patch import, which is intentionally inside a try-except block for conditional loading. This allows the bootstrap generation script to complete successfully.
Error while running generate_instrumentation_bootstrap.py