diff --git a/.github/workflows/pylint-checks.yml b/.github/workflows/pylint-checks.yml index c6ddd9a238..350d42503c 100644 --- a/.github/workflows/pylint-checks.yml +++ b/.github/workflows/pylint-checks.yml @@ -19,7 +19,7 @@ jobs: - module-name: lms-2 path: "lms/djangoapps/gating/ lms/djangoapps/grades/ lms/djangoapps/instructor/ lms/djangoapps/instructor_analytics/ lms/djangoapps/discussion/ lms/djangoapps/edxnotes/ lms/djangoapps/email_marketing/ lms/djangoapps/experiments/ lms/djangoapps/instructor_task/ lms/djangoapps/learner_dashboard/ lms/djangoapps/lms_initialization/ lms/djangoapps/lms_xblock/ lms/djangoapps/lti_provider/ lms/djangoapps/mailing/ lms/djangoapps/mobile_api/ lms/djangoapps/monitoring/ lms/djangoapps/ora_staff_grader/ lms/djangoapps/program_enrollments/ lms/djangoapps/rss_proxy lms/djangoapps/static_template_view/ lms/djangoapps/staticbook/ lms/djangoapps/support/ lms/djangoapps/survey/ lms/djangoapps/teams/ lms/djangoapps/tests/ lms/djangoapps/user_tours/ lms/djangoapps/verify_student/ lms/envs/ lms/lib/ lms/tests.py" - module-name: openedx-1 - path: "openedx/core/types/ openedx/core/djangoapps/ace_common/ openedx/core/djangoapps/agreements/ openedx/core/djangoapps/api_admin/ openedx/core/djangoapps/auth_exchange/ openedx/core/djangoapps/bookmarks/ openedx/core/djangoapps/cache_toolbox/ openedx/core/djangoapps/catalog/ openedx/core/djangoapps/ccxcon/ openedx/core/djangoapps/commerce/ openedx/core/djangoapps/common_initialization/ openedx/core/djangoapps/common_views/ openedx/core/djangoapps/config_model_utils/ openedx/core/djangoapps/content/ openedx/core/djangoapps/content_libraries/ openedx/core/djangoapps/contentserver/ openedx/core/djangoapps/cookie_metadata/ openedx/core/djangoapps/cors_csrf/ openedx/core/djangoapps/course_apps/ openedx/core/djangoapps/course_date_signals/ openedx/core/djangoapps/course_groups/ openedx/core/djangoapps/coursegraph/ openedx/core/djangoapps/courseware_api/ openedx/core/djangoapps/crawlers/ openedx/core/djangoapps/credentials/ openedx/core/djangoapps/credit/ openedx/core/djangoapps/dark_lang/ openedx/core/djangoapps/debug/ openedx/core/djangoapps/demographics/ openedx/core/djangoapps/discussions/ openedx/core/djangoapps/django_comment_common/ openedx/core/djangoapps/embargo/ openedx/core/djangoapps/enrollments/ openedx/core/djangoapps/external_user_ids/ openedx/core/djangoapps/zendesk_proxy/ openedx/core/djangolib/ openedx/core/lib/ openedx/core/tests/ openedx/core/djangoapps/kafka_consumer/ openedx/core/djangoapps/course_live/" + path: "openedx/core/types/ openedx/core/djangoapps/ace_common/ openedx/core/djangoapps/agreements/ openedx/core/djangoapps/api_admin/ openedx/core/djangoapps/auth_exchange/ openedx/core/djangoapps/bookmarks/ openedx/core/djangoapps/cache_toolbox/ openedx/core/djangoapps/catalog/ openedx/core/djangoapps/ccxcon/ openedx/core/djangoapps/commerce/ openedx/core/djangoapps/common_initialization/ openedx/core/djangoapps/common_views/ openedx/core/djangoapps/config_model_utils/ openedx/core/djangoapps/content/ openedx/core/djangoapps/content_libraries/ openedx/core/djangoapps/contentserver/ openedx/core/djangoapps/cookie_metadata/ openedx/core/djangoapps/cors_csrf/ openedx/core/djangoapps/course_apps/ openedx/core/djangoapps/course_date_signals/ openedx/core/djangoapps/course_groups/ openedx/core/djangoapps/coursegraph/ openedx/core/djangoapps/courseware_api/ openedx/core/djangoapps/crawlers/ openedx/core/djangoapps/credentials/ openedx/core/djangoapps/credit/ openedx/core/djangoapps/dark_lang/ openedx/core/djangoapps/debug/ openedx/core/djangoapps/demographics/ openedx/core/djangoapps/discussions/ openedx/core/djangoapps/django_comment_common/ openedx/core/djangoapps/embargo/ openedx/core/djangoapps/enrollments/ openedx/core/djangoapps/external_user_ids/ openedx/core/djangoapps/zendesk_proxy/ openedx/core/djangolib/ openedx/core/lib/ openedx/core/tests/ openedx/core/djangoapps/course_live/" - module-name: openedx-2 path: "openedx/core/djangoapps/geoinfo/ openedx/core/djangoapps/header_control/ openedx/core/djangoapps/heartbeat/ openedx/core/djangoapps/lang_pref/ openedx/core/djangoapps/models/ openedx/core/djangoapps/monkey_patch/ openedx/core/djangoapps/oauth_dispatch/ openedx/core/djangoapps/olx_rest_api/ openedx/core/djangoapps/password_policy/ openedx/core/djangoapps/plugin_api/ openedx/core/djangoapps/plugins/ openedx/core/djangoapps/profile_images/ openedx/core/djangoapps/programs/ openedx/core/djangoapps/safe_sessions/ openedx/core/djangoapps/schedules/ openedx/core/djangoapps/self_paced/ openedx/core/djangoapps/service_status/ openedx/core/djangoapps/session_inactivity_timeout/ openedx/core/djangoapps/signals/ openedx/core/djangoapps/site_configuration/ openedx/core/djangoapps/system_wide_roles/ openedx/core/djangoapps/theming/ openedx/core/djangoapps/user_api/ openedx/core/djangoapps/user_authn/ openedx/core/djangoapps/util/ openedx/core/djangoapps/verified_track_content/ openedx/core/djangoapps/video_config/ openedx/core/djangoapps/video_pipeline/ openedx/core/djangoapps/waffle_utils/ openedx/core/djangoapps/xblock/ openedx/core/djangoapps/xmodule_django/ openedx/core/tests/ openedx/features/ openedx/testing/ openedx/tests/" - module-name: common diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index d904cdbddf..b243083f79 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -2840,7 +2840,7 @@ class LinkedInAddToProfileConfiguration(ConfigurationModel): ), ) - def is_enabled(self, *key_fields): + def is_enabled(self, *key_fields): # pylint: disable=arguments-differ """ Checks both the model itself and share_settings to see if LinkedIn Add to Profile is enabled """ diff --git a/lms/djangoapps/courseware/student_field_overrides.py b/lms/djangoapps/courseware/student_field_overrides.py index 31b0b8b774..4eceebf9fc 100644 --- a/lms/djangoapps/courseware/student_field_overrides.py +++ b/lms/djangoapps/courseware/student_field_overrides.py @@ -22,7 +22,7 @@ class IndividualStudentOverrideProvider(FieldOverrideProvider): return get_override_for_user(self.user, block, name, default) @classmethod - def enabled_for(cls, course): + def enabled_for(cls, course): # pylint: disable=arguments-differ """This simple override provider is always enabled""" return True diff --git a/lms/djangoapps/courseware/tests/test_course_info.py b/lms/djangoapps/courseware/tests/test_course_info.py index 88db559336..635b845665 100644 --- a/lms/djangoapps/courseware/tests/test_course_info.py +++ b/lms/djangoapps/courseware/tests/test_course_info.py @@ -293,7 +293,7 @@ class CourseInfoTitleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase): assert expected_title == content('.page-title').contents()[0].strip() if expected_subtitle is None: - assert [] == content('.page-subtitle') + assert not content('.page-subtitle') else: assert expected_subtitle == content('.page-subtitle').contents()[0].strip() diff --git a/lms/djangoapps/courseware/tests/test_field_overrides.py b/lms/djangoapps/courseware/tests/test_field_overrides.py index a58dbe5050..34efe70686 100644 --- a/lms/djangoapps/courseware/tests/test_field_overrides.py +++ b/lms/djangoapps/courseware/tests/test_field_overrides.py @@ -39,7 +39,7 @@ class TestOverrideProvider(FieldOverrideProvider): return default @classmethod - def enabled_for(cls, course): + def enabled_for(cls, course): # pylint: disable=arguments-differ return True diff --git a/lms/djangoapps/courseware/tests/test_user_state_client.py b/lms/djangoapps/courseware/tests/test_user_state_client.py index 84cb7e8616..89071d2c7f 100644 --- a/lms/djangoapps/courseware/tests/test_user_state_client.py +++ b/lms/djangoapps/courseware/tests/test_user_state_client.py @@ -27,7 +27,7 @@ class TestDjangoUserStateClient(UserStateClientTestBase, ModuleStoreTestCase): def _user(self, user_idx): # lint-amnesty, pylint: disable=arguments-differ return self.users[user_idx].username - def _block_type(self, block): + def _block_type(self, block): # pylint: disable=arguments-differ # We only record block state history in DjangoUserStateClient # when the block type is 'problem' return 'problem' diff --git a/lms/djangoapps/instructor/views/api.py b/lms/djangoapps/instructor/views/api.py index b59b425ceb..efa6deee2b 100644 --- a/lms/djangoapps/instructor/views/api.py +++ b/lms/djangoapps/instructor/views/api.py @@ -963,9 +963,9 @@ def bulk_beta_modify_access(request, course_id): # Tabulate the action result of this email address results.append({ 'identifier': identifier, - 'error': error, - 'userDoesNotExist': user_does_not_exist, - 'is_active': user_active + 'error': error, # pylint: disable=used-before-assignment + 'userDoesNotExist': user_does_not_exist, # pylint: disable=used-before-assignment + 'is_active': user_active # pylint: disable=used-before-assignment }) response_payload = { diff --git a/lms/djangoapps/instructor_task/api_helper.py b/lms/djangoapps/instructor_task/api_helper.py index 506833e6de..d85e222863 100644 --- a/lms/djangoapps/instructor_task/api_helper.py +++ b/lms/djangoapps/instructor_task/api_helper.py @@ -88,7 +88,7 @@ def _reserve_task(course_id, task_type, task_key, task_input, requester): "No duplicate tasks found: task_type %s, task_key %s, and most recent task_id = %s", task_type, task_key, - most_recent_id + most_recent_id # pylint: disable=used-before-assignment ) # Create log entry now, so that future requests will know it's running. diff --git a/openedx/core/djangoapps/coursegraph/__init__.py b/openedx/core/djangoapps/coursegraph/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openedx/core/djangoapps/user_authn/views/login.py b/openedx/core/djangoapps/user_authn/views/login.py index 22b24dce4d..c28b20629e 100644 --- a/openedx/core/djangoapps/user_authn/views/login.py +++ b/openedx/core/djangoapps/user_authn/views/login.py @@ -492,7 +492,7 @@ def enterprise_selection_page(request, user, next_url): rate=settings.LOGISTRATION_RATELIMIT_RATE, method='POST', ) # lint-amnesty, pylint: disable=too-many-statements -def login_user(request, api_version='v1'): +def login_user(request, api_version='v1'): # pylint: disable=too-many-statements """ AJAX request to log in the user. diff --git a/openedx/features/content_type_gating/field_override.py b/openedx/features/content_type_gating/field_override.py index d27ebd907f..8b9830635e 100644 --- a/openedx/features/content_type_gating/field_override.py +++ b/openedx/features/content_type_gating/field_override.py @@ -66,6 +66,6 @@ class ContentTypeGatingFieldOverride(FieldOverrideProvider): return original_group_access @classmethod - def enabled_for(cls, course): + def enabled_for(cls, course): # pylint: disable=arguments-differ """Check our stackable config for this specific course""" return ContentTypeGatingConfig.enabled_for_course(course_key=course.scope_ids.usage_id.course_key) diff --git a/openedx/features/personalized_learner_schedules/show_answer/show_answer_field_override.py b/openedx/features/personalized_learner_schedules/show_answer/show_answer_field_override.py index 545e3422cf..31ac000df5 100644 --- a/openedx/features/personalized_learner_schedules/show_answer/show_answer_field_override.py +++ b/openedx/features/personalized_learner_schedules/show_answer/show_answer_field_override.py @@ -38,6 +38,6 @@ class ShowAnswerFieldOverride(FieldOverrideProvider): return mapping.get(current_show_answer_value, default) @classmethod - def enabled_for(cls, course): + def enabled_for(cls, course): # pylint: disable=arguments-differ """ Enabled only for Self-Paced courses using Personalized User Schedules. """ return course and course.self_paced and RELATIVE_DATES_FLAG.is_enabled(course.id) diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 04b71e46e9..b592670977 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -108,6 +108,3 @@ mistune<2.0.0 # The PR https://github.com/celery/django-celery-results/pull/292 fixing this issue has been merged but # new version hasn't been released yet with the fix so pinning the version until django-celery-results>2.3.0 is out. django-celery-results<2.3.0 - -# Pinning the pylint version for now so the quality issues can be fixed in a separate PR -pylint<2.13.0 diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 87602f508d..5a6a34d6c5 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -65,7 +65,7 @@ asgiref==3.5.0 # -r requirements/edx/testing.txt # django # uvicorn -astroid==2.9.3 +astroid==2.11.2 # via # -r requirements/edx/testing.txt # pylint @@ -256,6 +256,10 @@ diff-cover==4.0.0 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/testing.txt +dill==0.3.4 + # via + # -r requirements/edx/testing.txt + # pylint distlib==0.3.4 # via # -r requirements/edx/testing.txt @@ -886,7 +890,7 @@ maxminddb==2.2.0 # via # -r requirements/edx/testing.txt # geoip2 -mccabe==0.6.1 +mccabe==0.7.0 # via # -r requirements/edx/testing.txt # pylint @@ -1080,9 +1084,8 @@ pylatexenc==2.10 # via # -r requirements/edx/testing.txt # olxcleaner -pylint==2.12.2 +pylint==2.13.5 # via - # -c requirements/edx/../constraints.txt # -r requirements/edx/testing.txt # edx-lint # pylint-celery @@ -1453,7 +1456,6 @@ text-unidecode==1.3 toml==0.10.2 # via # -r requirements/edx/testing.txt - # pylint # tox # vulture tomli==2.0.1 @@ -1463,6 +1465,7 @@ tomli==2.0.1 # coverage # mypy # pep517 + # pylint # pytest tox==3.24.5 # via diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index 713428e6c6..9b1c8a5fbe 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -61,7 +61,7 @@ asgiref==3.5.0 # -r requirements/edx/base.txt # django # uvicorn -astroid==2.9.3 +astroid==2.11.2 # via # pylint # pylint-celery @@ -248,6 +248,8 @@ diff-cover==4.0.0 # via # -c requirements/edx/../constraints.txt # -r requirements/edx/coverage.txt +dill==0.3.4 + # via pylint distlib==0.3.4 # via virtualenv # via @@ -844,7 +846,7 @@ maxminddb==2.2.0 # via # -r requirements/edx/base.txt # geoip2 -mccabe==0.6.1 +mccabe==0.7.0 # via pylint mock==4.0.3 # via @@ -1018,9 +1020,8 @@ pylatexenc==2.10 # via # -r requirements/edx/base.txt # olxcleaner -pylint==2.12.2 +pylint==2.13.5 # via - # -c requirements/edx/../constraints.txt # edx-lint # pylint-celery # pylint-django @@ -1345,12 +1346,11 @@ text-unidecode==1.3 # -r requirements/edx/base.txt # python-slugify toml==0.10.2 - # via - # pylint - # tox + # via tox tomli==2.0.1 # via # coverage + # pylint # pytest tox==3.24.5 # via