Hello fellow Open edX developers!
We are giving away this badge which can be proudly displayed on these forums as a medal of competence and moral integrity:
Icon made by Vitaly Gorbachev from www.flaticon.com
But there is a catch To earn this badge you will have to create and merge a pull request that helps resolve a certain issue: when running any Open edX command, running tests, or running a platform in production, the console is flooded by warning messages. As an example, here is what I get when I run a trivial management command in the LMS container of the devstack:
root@lms:/edx/app/edxapp/edx-platform# ./manage.py lms shell -c "print('hello')"
2020-10-27 18:50:08,031 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py:127: SysPathHackWarning: Importing lms_initialization instead of lms.djangoapps.lms_initialization is deprecated
return _bootstrap._gcd_import(name[level:], package, level)
2020-10-27 18:50:08,032 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py:127: SysPathHackWarning: Importing lms_initialization.apps instead of lms.djangoapps.lms_initialization.apps is deprecated
return _bootstrap._gcd_import(name[level:], package, level)
2020-10-27 18:50:08,220 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/newrelic/console.py:84: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
prototype = wrapper.__name__[3:] + ' ' + inspect.formatargspec(
2020-10-27 18:50:08,317 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/course_wiki/plugins/markdownedx/__init__.py:4: SysPathHackWarning: Importing course_wiki.plugins instead of lms.djangoapps.course_wiki.plugins is deprecated
from course_wiki.plugins.markdownedx.wiki_plugin import ExtendMarkdownPlugin
2020-10-27 18:50:08,318 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/course_wiki/plugins/markdownedx/__init__.py:4: SysPathHackWarning: Importing course_wiki.plugins.markdownedx instead of lms.djangoapps.course_wiki.plugins.markdownedx is deprecated
from course_wiki.plugins.markdownedx.wiki_plugin import ExtendMarkdownPlugin
2020-10-27 18:50:08,318 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/course_wiki/plugins/markdownedx/__init__.py:4: SysPathHackWarning: Importing course_wiki.plugins.markdownedx.wiki_plugin instead of lms.djangoapps.course_wiki.plugins.markdownedx.wiki_plugin is deprecated
from course_wiki.plugins.markdownedx.wiki_plugin import ExtendMarkdownPlugin
2020-10-27 18:50:08,332 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/course_wiki/plugins/markdownedx/wiki_plugin.py:7: SysPathHackWarning: Importing course_wiki.plugins.markdownedx.mdx_mathjax instead of lms.djangoapps.course_wiki.plugins.markdownedx.mdx_mathjax is deprecated
from course_wiki.plugins.markdownedx import mdx_mathjax, mdx_video
2020-10-27 18:50:08,333 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/course_wiki/plugins/markdownedx/wiki_plugin.py:7: SysPathHackWarning: Importing course_wiki.plugins.markdownedx.mdx_video instead of lms.djangoapps.course_wiki.plugins.markdownedx.mdx_video is deprecated
from course_wiki.plugins.markdownedx import mdx_mathjax, mdx_video
2020-10-27 18:50:09,466 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py:127: SysPathHackWarning: Importing survey instead of lms.djangoapps.survey is deprecated
return _bootstrap._gcd_import(name[level:], package, level)
2020-10-27 18:50:09,467 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py:127: SysPathHackWarning: Importing survey.apps instead of lms.djangoapps.survey.apps is deprecated
return _bootstrap._gcd_import(name[level:], package, level)
2020-10-27 18:50:09,669 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py:127: SysPathHackWarning: Importing mailing instead of lms.djangoapps.mailing is deprecated
return _bootstrap._gcd_import(name[level:], package, level)
2020-10-27 18:50:09,678 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py:127: SysPathHackWarning: Importing gating instead of lms.djangoapps.gating is deprecated
return _bootstrap._gcd_import(name[level:], package, level)
2020-10-27 18:50:09,679 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py:127: SysPathHackWarning: Importing gating.apps instead of lms.djangoapps.gating.apps is deprecated
return _bootstrap._gcd_import(name[level:], package, level)
2020-10-27 18:50:09,681 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py:127: SysPathHackWarning: Importing learner_dashboard instead of lms.djangoapps.learner_dashboard is deprecated
return _bootstrap._gcd_import(name[level:], package, level)
2020-10-27 18:50:09,684 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py:127: SysPathHackWarning: Importing email_marketing instead of lms.djangoapps.email_marketing is deprecated
return _bootstrap._gcd_import(name[level:], package, level)
2020-10-27 18:50:09,685 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py:127: SysPathHackWarning: Importing email_marketing.apps instead of lms.djangoapps.email_marketing.apps is deprecated
return _bootstrap._gcd_import(name[level:], package, level)
2020-10-27 18:50:09,695 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/experiments/flags.py:14: SysPathHackWarning: Importing experiments instead of lms.djangoapps.experiments is deprecated
from experiments.stable_bucketing import stable_bucketing_hash_group
2020-10-27 18:50:09,695 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/experiments/flags.py:14: SysPathHackWarning: Importing experiments.stable_bucketing instead of lms.djangoapps.experiments.stable_bucketing is deprecated
from experiments.stable_bucketing import stable_bucketing_hash_group
2020-10-27 18:50:10,440 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/certificates/models.py:72: SysPathHackWarning: Importing badges instead of lms.djangoapps.badges is deprecated
from badges.events.course_complete import course_badge_check
2020-10-27 18:50:10,441 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/certificates/models.py:72: SysPathHackWarning: Importing badges.events instead of lms.djangoapps.badges.events is deprecated
from badges.events.course_complete import course_badge_check
2020-10-27 18:50:10,442 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/certificates/models.py:72: SysPathHackWarning: Importing badges.events.course_complete instead of lms.djangoapps.badges.events.course_complete is deprecated
from badges.events.course_complete import course_badge_check
2020-10-27 18:50:10,444 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/badges/events/course_complete.py:15: SysPathHackWarning: Importing badges.models instead of lms.djangoapps.badges.models is deprecated
from badges.models import BadgeAssertion, BadgeClass, CourseCompleteImageConfiguration
2020-10-27 18:50:10,445 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/badges/models.py:23: SysPathHackWarning: Importing badges.utils instead of lms.djangoapps.badges.utils is deprecated
from badges.utils import deserialize_count_specs
2020-10-27 18:50:10,454 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/certificates/models.py:73: SysPathHackWarning: Importing badges.events.course_meta instead of lms.djangoapps.badges.events.course_meta is deprecated
from badges.events.course_meta import completion_check, course_group_check
2020-10-27 18:50:10,668 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/courseware/courses.py:26: SysPathHackWarning: Importing branding instead of lms.djangoapps.branding is deprecated
import branding
2020-10-27 18:50:10,683 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/courseware/access.py:46: SysPathHackWarning: Importing mobile_api instead of lms.djangoapps.mobile_api is deprecated
from mobile_api.models import IgnoreMobileAvailableFlagConfig
2020-10-27 18:50:10,684 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/courseware/access.py:46: SysPathHackWarning: Importing mobile_api.models instead of lms.djangoapps.mobile_api.models is deprecated
from mobile_api.models import IgnoreMobileAvailableFlagConfig
2020-10-27 18:50:10,803 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/certificates/api.py:19: SysPathHackWarning: Importing branding.api instead of lms.djangoapps.branding.api is deprecated
from branding import api as branding_api
2020-10-27 18:50:10,804 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/branding/api.py:26: SysPathHackWarning: Importing branding.models instead of lms.djangoapps.branding.models is deprecated
from branding.models import BrandingApiConfig
2020-10-27 18:50:11,128 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/lms_xblock/runtime.py:13: SysPathHackWarning: Importing badges.service instead of lms.djangoapps.badges.service is deprecated
from badges.service import BadgingService
2020-10-27 18:50:11,345 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/openedx/features/discounts/utils.py:15: SysPathHackWarning: Importing experiments.models instead of lms.djangoapps.experiments.models is deprecated
from experiments.models import ExperimentData
2020-10-27 18:50:11,400 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/courseware/courses.py:63: SysPathHackWarning: Importing survey.utils instead of lms.djangoapps.survey.utils is deprecated
from survey.utils import SurveyRequiredAccessError, check_survey_required_and_unanswered
2020-10-27 18:50:11,400 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/survey/utils.py:10: SysPathHackWarning: Importing survey.models instead of lms.djangoapps.survey.models is deprecated
from survey.models import SurveyAnswer, SurveyForm
2020-10-27 18:50:11,401 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/survey/models.py:18: SysPathHackWarning: Importing survey.exceptions instead of lms.djangoapps.survey.exceptions is deprecated
from survey.exceptions import SurveyFormNameAlreadyExists, SurveyFormNotFound
2020-10-27 18:50:11,696 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/sorl/thumbnail/conf/__init__.py:16: RemovedInDjango30Warning: The DEFAULT_CONTENT_TYPE setting is deprecated.
setattr(self, attr, getattr(obj, attr))
2020-10-27 18:50:11,697 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/site-packages/sorl/thumbnail/conf/__init__.py:16: RemovedInDjango31Warning: The FILE_CHARSET setting is deprecated. Starting with Django 3.1, all files read from disk must be UTF-8 encoded.
setattr(self, attr, getattr(obj, attr))
2020-10-27 18:50:11,830 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/email_marketing/tasks.py:17: SysPathHackWarning: Importing email_marketing.models instead of lms.djangoapps.email_marketing.models is deprecated
from email_marketing.models import EmailMarketingConfiguration
2020-10-27 18:50:11,986 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/bulk_email/tasks.py:43: SysPathHackWarning: Importing bulk_email instead of lms.djangoapps.bulk_email is deprecated
from bulk_email.models import CourseEmail, Optout
2020-10-27 18:50:11,987 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/bulk_email/tasks.py:43: SysPathHackWarning: Importing bulk_email.models instead of lms.djangoapps.bulk_email.models is deprecated
from bulk_email.models import CourseEmail, Optout
2020-10-27 18:50:11,987 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/bulk_email/tasks.py:44: SysPathHackWarning: Importing bulk_email.api instead of lms.djangoapps.bulk_email.api is deprecated
from bulk_email.api import get_unsubscribed_link
2020-10-27 18:50:11,988 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/bulk_email/api.py:12: SysPathHackWarning: Importing bulk_email.models_api instead of lms.djangoapps.bulk_email.models_api is deprecated
from bulk_email.models_api import (
2020-10-27 18:50:11,997 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/instructor_task/tasks_helper/grades.py:13: SysPathHackWarning: Importing course_blocks instead of lms.djangoapps.course_blocks is deprecated
from course_blocks.api import get_course_blocks
2020-10-27 18:50:11,998 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/instructor_task/tasks_helper/grades.py:13: SysPathHackWarning: Importing course_blocks.api instead of lms.djangoapps.course_blocks.api is deprecated
from course_blocks.api import get_course_blocks
2020-10-27 18:50:12,050 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/bulk_email/admin.py:9: SysPathHackWarning: Importing bulk_email.forms instead of lms.djangoapps.bulk_email.forms is deprecated
from bulk_email.forms import CourseAuthorizationAdminForm, CourseEmailTemplateForm
2020-10-27 18:50:12,063 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/venvs/edxapp/lib/python3.8/importlib/__init__.py:127: SysPathHackWarning: Importing course_wiki.editors instead of lms.djangoapps.course_wiki.editors is deprecated
return _bootstrap._gcd_import(name[level:], package, level)
2020-10-27 18:50:12,078 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/rss_proxy/admin.py:8: SysPathHackWarning: Importing rss_proxy instead of lms.djangoapps.rss_proxy is deprecated
from rss_proxy.models import WhitelistedRssUrl
2020-10-27 18:50:12,078 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/rss_proxy/admin.py:8: SysPathHackWarning: Importing rss_proxy.models instead of lms.djangoapps.rss_proxy.models is deprecated
from rss_proxy.models import WhitelistedRssUrl
2020-10-27 18:50:12,297 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/gating/apps.py:17: SysPathHackWarning: Importing gating.signals instead of lms.djangoapps.gating.signals is deprecated
from gating import signals # pylint: disable=unused-import
2020-10-27 18:50:12,298 WARNING 122 [py.warnings] [user None] [ip None] warnings.py:109 - /edx/app/edxapp/edx-platform/lms/djangoapps/gating/tasks.py:13: SysPathHackWarning: Importing gating.api instead of lms.djangoapps.gating.api is deprecated
from gating import api as gating_api
hello
There are about 50 warnings in there, resulting in 150 lines of non-informative output.
Similarly, when running unit tests the console is filled with such warnings, preventing developers from efficiently analyzing test failures:
root@lms:/edx/app/edxapp/edx-platform# pytest openedx/core/djangoapps/credentials/ > pytest-credentials-warnings.txt
root@lms:/edx/app/edxapp/edx-platform# wc -l pytest-credentials-warnings.txt
373 pytest-credentials-warnings.txt
That’s 373 lines for 85 warnings and just 38 unit tests! And of course the problem becomes even worse when running the full unit test suite: in this particular run the warnings (at the end) take 12800 lines! That’s 1.6 Mb of text!
(To put things in perspective, Windows 3.1 fitted on a 1.4 Mb floppy disk when it was released. And there are are people who create truly extraordinary stuff with less an 1kb of text)
In other words, this is WAY too much.
Which is why I invite you to join me in my quest to get rid of these warnings:
- Identify a warning that you would like to get rid of: there should not already be an answer in this topic that mentions this warning.
- Fix the warning: not by silencing it, but by resolving the underlying issue.
- Create a pull request with your changes: a good title would be something similar to “Squash … warning”.
- Post a link to your PR here in the comments. List the warnings that you are squashing such that other developers can see what you are working on.
- Get in merged in time for the Koa release: that’s December 9, but you should have your PR ready by Nov 25 to leave us time to backport your change in the release.
Those who achieve these steps will earn “Warning Squasher” badge above. This badge is granted for eternity and will never be deprecated.
So what are you waiting for?