Fix quality failures with pylint 2.13.5 (#30197)
* build: update pylint-checks ci workflow * fix: fix quality failures with new pylint version * chore: remove pylint constraint * chore: Updating Python Requirements (#30196) Co-authored-by: edX requirements bot <49161187+edx-requirements-bot@users.noreply.github.com>
This commit is contained in:
2
.github/workflows/pylint-checks.yml
vendored
2
.github/workflows/pylint-checks.yml
vendored
@@ -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
|
||||
|
||||
@@ -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
|
||||
"""
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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.
|
||||
|
||||
0
openedx/core/djangoapps/coursegraph/__init__.py
Normal file
0
openedx/core/djangoapps/coursegraph/__init__.py
Normal file
@@ -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.
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user