From b8e3d496d111d8039860eeb023f7f2de1f41819b Mon Sep 17 00:00:00 2001 From: edX requirements bot <49161187+edx-requirements-bot@users.noreply.github.com> Date: Mon, 4 Mar 2024 02:37:38 -0500 Subject: [PATCH] chore: python requirements update (#4282) * chore: python requirements update * test: quality updates and CSV loader test update --- .../apps/api/tests/test_mixins.py | 2 +- .../data_loaders/tests/test_csv_loader.py | 5 +- .../commands/populate_course_length.py | 3 +- .../commands/refresh_course_reviews.py | 3 +- .../apps/course_metadata/tests/test_admin.py | 1 - requirements/common_constraints.txt | 2 +- requirements/docs.txt | 4 +- requirements/local.txt | 65 ++++++++++--------- requirements/pip.txt | 2 +- requirements/pip_tools.txt | 2 +- requirements/production.txt | 43 ++++++------ 11 files changed, 67 insertions(+), 65 deletions(-) diff --git a/course_discovery/apps/api/tests/test_mixins.py b/course_discovery/apps/api/tests/test_mixins.py index 2ebd3466b1..ec65daf897 100644 --- a/course_discovery/apps/api/tests/test_mixins.py +++ b/course_discovery/apps/api/tests/test_mixins.py @@ -18,7 +18,7 @@ class TestAPIView(AnonymousUserThrottleAuthenticatedEndpointMixin, APIView): permission_classes = () authentication_classes = () - def get(self, request, *_args, **_kwargs): # pylint: disable=unused-argument + def get(self, request, *_args, **_kwargs): return Response( status=status.HTTP_200_OK, data="Hello, World" diff --git a/course_discovery/apps/course_metadata/data_loaders/tests/test_csv_loader.py b/course_discovery/apps/course_metadata/data_loaders/tests/test_csv_loader.py index bbb361f21b..b64340db48 100644 --- a/course_discovery/apps/course_metadata/data_loaders/tests/test_csv_loader.py +++ b/course_discovery/apps/course_metadata/data_loaders/tests/test_csv_loader.py @@ -462,7 +462,10 @@ def test_ingest_flow_for_preexisting_published_course_with_new_run_creation(self CourseRunFactory( course=course, start=datetime.datetime(2014, 3, 1, tzinfo=UTC), - end=datetime.datetime(2024, 3, 1, tzinfo=UTC), + # 2050 end date is to ensure the course run is present among active runs and thus + # non-draft entries are created. If the discovery is there till 2050, you would need to update the + # tests after Jan 1, 2050. + end=datetime.datetime(2050, 1, 1, tzinfo=UTC), key=self.COURSE_RUN_KEY, type=self.course_run_type, status='published', diff --git a/course_discovery/apps/course_metadata/management/commands/populate_course_length.py b/course_discovery/apps/course_metadata/management/commands/populate_course_length.py index 3385538e66..5215e0830b 100644 --- a/course_discovery/apps/course_metadata/management/commands/populate_course_length.py +++ b/course_discovery/apps/course_metadata/management/commands/populate_course_length.py @@ -45,8 +45,7 @@ def get_query_results_from_snowflake(self): try: cs.execute(SNOWFLAKE_POPULATE_COURSE_LENGTH_QUERY) rows = cs.fetchall() - for row in rows: - yield row + yield from rows finally: cs.close() ctx.close() diff --git a/course_discovery/apps/course_metadata/management/commands/refresh_course_reviews.py b/course_discovery/apps/course_metadata/management/commands/refresh_course_reviews.py index 7cb10ef2f5..79011dc9d3 100644 --- a/course_discovery/apps/course_metadata/management/commands/refresh_course_reviews.py +++ b/course_discovery/apps/course_metadata/management/commands/refresh_course_reviews.py @@ -46,8 +46,7 @@ def get_query_results_from_snowflake(self): try: cs.execute(SNOWFLAKE_REFRESH_COURSE_REVIEWS_QUERY) rows = cs.fetchall() - for row in rows: - yield row + yield from rows finally: cs.close() ctx.close() diff --git a/course_discovery/apps/course_metadata/tests/test_admin.py b/course_discovery/apps/course_metadata/tests/test_admin.py index 52985c1899..625f523d5e 100644 --- a/course_discovery/apps/course_metadata/tests/test_admin.py +++ b/course_discovery/apps/course_metadata/tests/test_admin.py @@ -29,7 +29,6 @@ from course_discovery.apps.course_metadata.tests import factories -# pylint: disable=no-member @ddt.ddt class AdminTests(SiteMixin, TestCase): """ Tests Admin page.""" diff --git a/requirements/common_constraints.txt b/requirements/common_constraints.txt index 28b842258a..0718f74b1e 100644 --- a/requirements/common_constraints.txt +++ b/requirements/common_constraints.txt @@ -13,7 +13,7 @@ # using LTS django version - +Django<5.0 # elasticsearch>=7.14.0 includes breaking changes in it which caused issues in discovery upgrade process. # elastic search changelog: https://www.elastic.co/guide/en/enterprise-search/master/release-notes-7.14.0.html diff --git a/requirements/docs.txt b/requirements/docs.txt index ed2dde8447..514df380bd 100644 --- a/requirements/docs.txt +++ b/requirements/docs.txt @@ -56,7 +56,7 @@ pygments==2.17.2 # accessible-pygments # pydata-sphinx-theme # sphinx -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via elasticsearch-dsl pytz==2024.1 # via babel @@ -91,7 +91,7 @@ sphinxcontrib-qthelp==1.0.3 # via sphinx sphinxcontrib-serializinghtml==1.1.5 # via sphinx -typing-extensions==4.9.0 +typing-extensions==4.10.0 # via pydata-sphinx-theme urllib3==1.26.18 # via diff --git a/requirements/local.txt b/requirements/local.txt index 5e60fc70d5..0d118c5d44 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -28,9 +28,10 @@ asgiref==3.7.2 # django # django-cors-headers # django-countries + # django-simple-history asn1crypto==1.5.1 # via snowflake-connector-python -astroid==3.0.3 +astroid==3.1.0 # via # pylint # pylint-celery @@ -75,15 +76,15 @@ boltons==21.0.0 # face # glom # semgrep -boto3==1.34.44 +boto3==1.34.54 # via django-ses -botocore==1.34.44 +botocore==1.34.54 # via # boto3 # s3transfer bracex==2.4 # via wcmatch -cachetools==5.3.2 +cachetools==5.3.3 # via # google-auth # tox @@ -147,11 +148,11 @@ colorama==0.4.6 # tox contentful==2.1.1 # via -r requirements/base.in -coverage[toml]==7.4.1 +coverage[toml]==7.4.3 # via # -r requirements/test.in # pytest-cov -cryptography==41.0.7 +cryptography==42.0.5 # via # paramiko # pyjwt @@ -161,7 +162,7 @@ cryptography==41.0.7 # social-auth-core cssselect2==0.7.0 # via cairosvg -ddt==1.7.1 +ddt==1.7.2 # via -r requirements/test.in defusedxml==0.7.1 # via @@ -177,6 +178,7 @@ distlib==0.3.8 distro==1.9.0 # via docker-compose # via + # -c requirements/common_constraints.txt # -c requirements/constraints.txt # -r requirements/base.in # algoliasearch-django @@ -227,7 +229,7 @@ django-admin-sortable2==2.1.10 # via -r requirements/base.in django-appconf==1.0.6 # via django-compressor -django-autocomplete-light==3.9.7 +django-autocomplete-light==3.11.0 # via -r requirements/base.in django-choices==2.0.0 # via @@ -298,7 +300,7 @@ django-parler==2.3 # via -r requirements/base.in django-ses==3.5.2 # via taxonomy-connector -django-simple-history==3.4.0 +django-simple-history==3.5.0 # via -r requirements/base.in django-solo==2.2.0 # via @@ -364,7 +366,7 @@ drf-yasg==1.21.7 # via # -r requirements/base.in # edx-api-doc-tools -edx-analytics-data-api-client==0.18.2 +edx-analytics-data-api-client==0.18.3 # via -r requirements/base.in edx-api-doc-tools==1.7.0 # via -r requirements/base.in @@ -437,7 +439,7 @@ face==22.0.0 # via glom factory-boy==3.3.0 # via -r requirements/test.in -faker==23.2.1 +faker==23.3.0 # via factory-boy fastavro==1.9.4 # via openedx-events @@ -458,9 +460,9 @@ glom==22.1.0 # via semgrep google-api-core==2.17.1 # via google-api-python-client -google-api-python-client==2.118.0 +google-api-python-client==2.120.0 # via -r requirements/base.in -google-auth==2.28.0 +google-auth==2.28.1 # via # google-api-core # google-api-python-client @@ -479,7 +481,7 @@ gspread==6.0.2 # via -r requirements/base.in h11==0.14.0 # via wsproto -html2text==2020.1.16 +html2text==2024.2.26 # via -r requirements/base.in httplib2==0.22.0 # via @@ -551,7 +553,7 @@ multidict==6.0.5 # yarl mysqlclient==2.2.4 # via -r requirements/test.in -newrelic==9.6.0 +newrelic==9.7.0 # via edx-django-utils oauthlib==3.2.2 # via @@ -564,7 +566,7 @@ openai==0.28.1 # taxonomy-connector openedx-atlas==0.6.0 # via -r requirements/base.in -openedx-events==9.5.1 +openedx-events==9.5.2 # via # edx-event-bus-kafka # edx-event-bus-redis @@ -648,7 +650,7 @@ pyjwt[crypto]==2.8.0 # simple-salesforce # snowflake-connector-python # social-auth-core -pylint==3.0.3 +pylint==3.1.0 # via # edx-lint # pylint-celery @@ -672,7 +674,7 @@ pynacl==1.5.0 # via # edx-django-utils # paramiko -pyopenssl==23.3.0 +pyopenssl==24.0.0 # via snowflake-connector-python pyparsing==3.1.1 # via @@ -684,7 +686,7 @@ pyrsistent==0.20.0 # via jsonschema pysocks==1.7.1 # via urllib3 -pytest==8.0.1 +pytest==8.1.0 # via # -r requirements/test.in # pytest-cov @@ -704,7 +706,7 @@ pytest-xdist==3.4.0 # via # -c requirements/constraints.txt # -r requirements/test.in -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via # -r requirements/base.in # botocore @@ -742,7 +744,7 @@ pytz==2024.1 # snowflake-connector-python # taxonomy-connector # zeep -pywatchman==1.4.1 +pywatchman==2.0.0 # via -r requirements/local.in pyyaml==5.4.1 # via @@ -754,7 +756,7 @@ pyyaml==5.4.1 # responses rcssmin==1.1.1 # via django-compressor -redis==5.0.1 +redis==5.0.2 # via # -r requirements/base.in # walrus @@ -820,7 +822,6 @@ simple-salesforce==1.12.5 # via -r requirements/base.in six==1.16.0 # via - # django-autocomplete-light # django-elasticsearch-dsl # django-elasticsearch-dsl-drf # dockerpty @@ -836,11 +837,11 @@ six==1.16.0 # websocket-client slumber==0.7.1 # via edx-rest-api-client -sniffio==1.3.0 +sniffio==1.3.1 # via trio snowballstemmer==2.2.0 # via sphinx -snowflake-connector-python==3.7.0 +snowflake-connector-python==3.7.1 # via -r requirements/base.in social-auth-app-django==5.4.0 # via @@ -880,7 +881,7 @@ sqlparse==0.4.4 # via # django # django-debug-toolbar -stevedore==5.1.0 +stevedore==5.2.0 # via # code-annotations # edx-django-utils @@ -889,13 +890,13 @@ strenum==0.4.15 # via gspread taxonomy-connector==1.46.2 # via -r requirements/base.in -testfixtures==8.0.0 +testfixtures==8.1.0 # via -r requirements/test.in text-unidecode==1.3 # via python-slugify texttable==1.7.0 # via docker-compose -time-machine==2.13.0 +time-machine==2.14.0 # via pendulum tinycss2==1.2.1 # via @@ -908,7 +909,7 @@ tomli==2.0.1 # pyproject-api # pytest # tox -tomlkit==0.12.3 +tomlkit==0.12.4 # via # pylint # snowflake-connector-python @@ -924,7 +925,7 @@ trio==0.24.0 # trio-websocket trio-websocket==0.11.1 # via selenium -typing-extensions==4.9.0 +typing-extensions==4.10.0 # via # asgiref # astroid @@ -964,11 +965,11 @@ vine==5.1.0 # amqp # celery # kombu -virtualenv==20.25.0 +virtualenv==20.25.1 # via tox walrus==0.9.3 # via edx-event-bus-redis -wcmatch==8.5 +wcmatch==8.5.1 # via semgrep wcwidth==0.2.13 # via prompt-toolkit diff --git a/requirements/pip.txt b/requirements/pip.txt index 32e80486d8..ff319b6398 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -10,5 +10,5 @@ wheel==0.42.0 # The following packages are considered to be unsafe in a requirements file: pip==24.0 # via -r requirements/pip.in -setuptools==69.1.0 +setuptools==69.1.1 # via -r requirements/pip.in diff --git a/requirements/pip_tools.txt b/requirements/pip_tools.txt index 1cfa58e87f..2b01bbcab1 100644 --- a/requirements/pip_tools.txt +++ b/requirements/pip_tools.txt @@ -4,7 +4,7 @@ # # pip-compile --output-file=requirements/pip_tools.txt requirements/pip_tools.in # -build==1.0.3 +build==1.1.1 # via pip-tools click==8.1.7 # via pip-tools diff --git a/requirements/production.txt b/requirements/production.txt index 94b1025116..0444a2b72c 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -24,6 +24,7 @@ asgiref==3.7.2 # django # django-cors-headers # django-countries + # django-simple-history asn1crypto==1.5.1 # via snowflake-connector-python async-timeout==4.0.3 @@ -50,13 +51,13 @@ beautifulsoup4==4.12.3 # taxonomy-connector billiard==4.2.0 # via celery -boto3==1.34.44 +boto3==1.34.54 # via django-ses -botocore==1.34.44 +botocore==1.34.54 # via # boto3 # s3transfer -cachetools==5.3.2 +cachetools==5.3.3 # via google-auth cairocffi==1.4.0 # via @@ -102,7 +103,7 @@ code-annotations==1.6.0 # via edx-toggles contentful==2.1.1 # via -r requirements/base.in -cryptography==41.0.7 +cryptography==42.0.5 # via # pyjwt # pyopenssl @@ -119,6 +120,7 @@ defusedxml==0.7.1 # social-auth-core django==4.2.10 # via + # -c requirements/common_constraints.txt # -c requirements/constraints.txt # -r requirements/base.in # algoliasearch-django @@ -167,7 +169,7 @@ django-admin-sortable2==2.1.10 # via -r requirements/base.in django-appconf==1.0.6 # via django-compressor -django-autocomplete-light==3.9.7 +django-autocomplete-light==3.11.0 # via -r requirements/base.in django-choices==2.0.0 # via @@ -233,7 +235,7 @@ django-ses==3.5.2 # via # -r requirements/production.in # taxonomy-connector -django-simple-history==3.4.0 +django-simple-history==3.5.0 # via -r requirements/base.in django-solo==2.2.0 # via @@ -287,7 +289,7 @@ drf-yasg==1.21.7 # via # -r requirements/base.in # edx-api-doc-tools -edx-analytics-data-api-client==0.18.2 +edx-analytics-data-api-client==0.18.3 # via -r requirements/base.in edx-api-doc-tools==1.7.0 # via -r requirements/base.in @@ -359,9 +361,9 @@ gevent==24.2.1 # via -r requirements/production.in google-api-core==2.17.1 # via google-api-python-client -google-api-python-client==2.118.0 +google-api-python-client==2.120.0 # via -r requirements/base.in -google-auth==2.28.0 +google-auth==2.28.1 # via # google-api-core # google-api-python-client @@ -382,7 +384,7 @@ gspread==6.0.2 # via -r requirements/base.in gunicorn==21.2.0 # via -r requirements/production.in -html2text==2020.1.16 +html2text==2024.2.26 # via -r requirements/base.in httplib2==0.22.0 # via @@ -433,7 +435,7 @@ multidict==6.0.5 # yarl mysqlclient==2.2.4 # via -r requirements/production.in -newrelic==9.6.0 +newrelic==9.7.0 # via # -r requirements/production.in # edx-django-utils @@ -448,7 +450,7 @@ openai==0.28.1 # taxonomy-connector openedx-atlas==0.6.0 # via -r requirements/base.in -openedx-events==9.5.1 +openedx-events==9.5.2 # via # edx-event-bus-kafka # edx-event-bus-redis @@ -506,11 +508,11 @@ pymongo==3.13.0 # via edx-opaque-keys pynacl==1.5.0 # via edx-django-utils -pyopenssl==23.3.0 +pyopenssl==24.0.0 # via snowflake-connector-python pyparsing==3.1.1 # via httplib2 -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via # -r requirements/base.in # botocore @@ -549,7 +551,7 @@ pyyaml==6.0.1 # edx-django-release-util rcssmin==1.1.1 # via django-compressor -redis==5.0.1 +redis==5.0.2 # via # -r requirements/base.in # walrus @@ -594,7 +596,6 @@ simple-salesforce==1.12.5 # via -r requirements/base.in six==1.16.0 # via - # django-autocomplete-light # django-elasticsearch-dsl # django-elasticsearch-dsl-drf # edx-auth-backends @@ -606,7 +607,7 @@ six==1.16.0 # python-monkey-business slumber==0.7.1 # via edx-rest-api-client -snowflake-connector-python==3.7.0 +snowflake-connector-python==3.7.1 # via -r requirements/base.in social-auth-app-django==5.4.0 # via @@ -622,7 +623,7 @@ soupsieve==2.5 # via beautifulsoup4 sqlparse==0.4.4 # via django -stevedore==5.1.0 +stevedore==5.2.0 # via # code-annotations # edx-django-utils @@ -633,17 +634,17 @@ taxonomy-connector==1.46.2 # via -r requirements/base.in text-unidecode==1.3 # via python-slugify -time-machine==2.13.0 +time-machine==2.14.0 # via pendulum tinycss2==1.2.1 # via # cairosvg # cssselect2 -tomlkit==0.12.3 +tomlkit==0.12.4 # via snowflake-connector-python tqdm==4.66.2 # via openai -typing-extensions==4.9.0 +typing-extensions==4.10.0 # via # asgiref # django-countries