Skip to content
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

feat: disable obnoxious "imghdr" warning in edx-platform #1187

Merged
merged 5 commits into from
Jan 9, 2025

Conversation

regisb
Copy link
Contributor

@regisb regisb commented Jan 8, 2025

This warning was popping up with every manage.py command. E.g:

$ ./manage.py lms shell -c "print(1)"
2025-01-08 08:33:37,921 WARNING 33 [py.warnings] [user None] [ip None] warnings.py:110 - /openedx/venv/lib/python3.11/site-packages/pgpy/constants.py:5: DeprecationWarning: 'imghdr' is deprecated and slated for removal in Python 3.13                                                                                                                                       import imghdr

With this change, we explicitely ignore this warning. We also get rid
of warning removal which no longer makes sense in Sumac and Django 4.

We also fix pylint checking and remove a couple of irrelevant TODO items.

regisb added 4 commits January 8, 2025 09:56
This warning was popping up with every manage.py command. E.g:

    $ ./manage.py lms shell -c "print(1)"
    2025-01-08 08:33:37,921 WARNING 33 [py.warnings] [user None] [ip None] warnings.py:110 - /openedx/venv/lib/python3.11/site-packages/pgpy/constants.py:5: DeprecationWarning: 'imghdr' is deprecated and slated for removal in Python 3.13                                                                                                                                       import imghdr

With this change, we explicitely ignore this warning. We also get rid
of warning removal which no longer makes sense in Sumac and Django 4.
In our pylint checks, `--errors-only` was effectively overriding our
custom list of warnings. I realised this while editing a file in my IDE
and a warning popped up. To resolve this issue, we:

- disable everything
- enable errors
- enable a select list of warnings

We also include a new warning, which is unnecessary f-string
interpolation.
Following the latest changes in pylint configuration, a number of
warnings were being reported.
These TODO items are no longer relevant.
Copy link
Collaborator

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@regisb regisb merged commit 40579db into release Jan 9, 2025
2 checks passed
@regisb regisb deleted the regisb/sumac-warnings branch January 9, 2025 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants