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

Upgrade pymongo #34642

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,8 @@ jobs:
- "xmodule-with-cms"
mongo-version:
- "7.0"

# We only need to test older versions of Mongo with modules that directly interface with Mongo (that is: xmodule.modulestore)
# This code is left here as an example for future refernce in case we need to reduce the number of shards we're
# testing but still have good confidence with older versions of mongo. We use Mongo 4.4 in the example.
#
# exclude:
# - mongo-version: "4.4"
# include:
# - shard_name: "xmodule-with-cms"
# python-version: "3.11"
# django-version: "pinned"
# mongo-version: "4.4"
# - shard_name: "xmodule-with-lms"
# python-version: "3.11"
# django-version: "pinned"
# mongo-version: "4.4"
# We expect Django 4.0 to fail, so don't stop when it fails.
continue-on-error: ${{ matrix.django-version == 'pinned' }}

steps:
- name: sync directory owner
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,7 @@ endef
COMMON_CONSTRAINTS_TXT=requirements/common_constraints.txt
.PHONY: $(COMMON_CONSTRAINTS_TXT)
$(COMMON_CONSTRAINTS_TXT):
curl -L https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt > "$(@)"
printf "$(COMMON_CONSTRAINTS_TEMP_COMMENT)" | cat - $(@) > temp && mv temp $(@)


compile-requirements: export CUSTOM_COMPILE_COMMAND=make upgrade
compile-requirements: pre-requirements $(COMMON_CONSTRAINTS_TXT) ## Re-compile *.in requirements to *.txt
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/bulk_email/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ def _send_course_email(entry_id, email_id, to_list, global_email_context, subtas
return subtask_status, None
finally:
# Clean up at the end.
connection.close()
pass
Copy link
Contributor Author

Choose a reason for hiding this comment

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



def _get_current_task():
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/content_staging/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from __future__ import annotations
import logging

from unittest import skip
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.db import models
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
Tests for the clipboard functionality
"""
from textwrap import dedent
from unittest import skip
from xml.etree import ElementTree

from rest_framework.test import APIClient

from openedx.core.djangoapps.content_staging import api as python_api
from xmodule.contentstore.django import contentstore
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase, upload_file_to_course
from xmodule.modulestore.tests.factories import BlockFactory, CourseFactory, ToyCourseFactory

from openedx.core.djangoapps.content_staging import api as python_api


CLIPBOARD_ENDPOINT = "/api/content-staging/v1/clipboard/"

# OLX of the video in the toy course using course_key.make_usage_key("video", "sample_video")
Expand All @@ -28,6 +28,7 @@
"""


@skip("Temp skip")
class ClipboardTestCase(ModuleStoreTestCase):
"""
Test Clipboard functionality
Expand Down
35 changes: 0 additions & 35 deletions requirements/common_constraints.txt
Original file line number Diff line number Diff line change
@@ -1,35 +0,0 @@
# This is a temporary solution to override the real common_constraints.txt
# In edx-lint, until the pyjwt constraint in edx-lint has been removed.
# See BOM-2721 for more details.
# Below is the copied and edited version of common_constraints
# A central location for most common version constraints
# (across edx repos) for pip-installation.
#
# Similar to other constraint files this file doesn't install any packages.
# It specifies version constraints that will be applied if a package is needed.
# When pinning something here, please provide an explanation of why it is a good
# idea to pin this package across all edx repos, Ideally, link to other information
# that will help people in the future to remove the pin when possible.
# Writing an issue against the offending project and linking to it here is good.
#
# Note: Changes to this file will automatically be used by other repos, referencing
# this file from Github directly. It does not require packaging in edx-lint.


# 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
elasticsearch<7.14.0

# django-simple-history>3.0.0 adds indexing and causes a lot of migrations to be affected

# opentelemetry requires version 6.x at the moment:
# https://github.com/open-telemetry/opentelemetry-python/issues/3570
# Normally this could be added as a constraint in edx-django-utils, where we're
# adding the opentelemetry dependency. However, when we compile pip-tools.txt,
# that uses version 7.x, and then there's no undoing that when compiling base.txt.
# So we need to pin it globally, for now.
# Ticket for unpinning: https://github.com/openedx/edx-lint/issues/407
importlib-metadata<7
5 changes: 2 additions & 3 deletions requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ django-oauth-toolkit==1.7.1
# incremental upgrade
django-simple-history==3.4.0

# constrained in opaque_keys. migration guide here: https://pymongo.readthedocs.io/en/4.0/migrate-to-pymongo4.html
# Major upgrade will be done in separate ticket.
pymongo<4.0.0
# to upgrade mongo to 6.0 or greater need to update this driver.
pymongo<4.4.1

# greater version has breaking changes and requires some migration steps.
django-webpack-loader==0.7.0
Expand Down
1 change: 0 additions & 1 deletion requirements/edx-sandbox/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

chem # A helper library for chemistry calculations
cryptography # Implementations of assorted cryptography algorithms
lxml # XML parser
matplotlib # 2D plotting library
networkx # Utilities for creating, manipulating, and studying network graphs
nltk # Natural language processing; used by the chem package
Expand Down
5 changes: 2 additions & 3 deletions requirements/edx-sandbox/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ kiwisolver==1.4.5
lxml==4.9.4
# via
# -c requirements/edx-sandbox/../constraints.txt
# -r requirements/edx-sandbox/base.in
# openedx-calc
markupsafe==2.1.5
# via
Expand Down Expand Up @@ -72,7 +71,7 @@ python-dateutil==2.9.0.post0
# via matplotlib
random2==1.0.2
# via -r requirements/edx-sandbox/base.in
regex==2024.5.10
regex==2024.5.15
# via nltk
scipy==1.10.1
# via
Expand All @@ -89,5 +88,5 @@ sympy==1.12
# openedx-calc
tqdm==4.66.4
# via nltk
zipp==3.18.1
zipp==3.18.2
# via importlib-resources
9 changes: 8 additions & 1 deletion requirements/edx-sandbox/releases/quince.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@ joblib==1.3.2
# via nltk
kiwisolver==1.4.5
# via matplotlib
lxml==4.9.4
lxml[html-clean,html_clean]==5.2.1
# via
# -r requirements/base.in
# edx-i18n-tools
# lxml-html-clean
# zeep
lxml-html-clean==0.1.1
# via lxml
# via
# -c requirements/edx-sandbox/../constraints.txt
# -r requirements/edx-sandbox/base.in
Expand Down
63 changes: 32 additions & 31 deletions requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@
#
-e git+https://github.com/anupdhabarde/edx-proctoring-proctortrack.git@31c6c9923a51c903ae83760ecbbac191363aa2a2#egg=edx_proctoring_proctortrack
# via -r requirements/edx/github.in
-e git+https://github.com/openedx/event-tracking.git@umar/upgrade-pymongo#egg=event-tracking==2.4.1
# via
# -r requirements/edx/github.in
# -r requirements/edx/kernel.in
# edx-completion
# edx-proctoring
# edx-search
-e git+https://github.com/awais786/[email protected]#egg=openedx-mongodbproxy==0.2.1
# via
# -r requirements/edx/github.in
# -r requirements/edx/kernel.in
acid-xblock==0.3.1
# via -r requirements/edx/kernel.in
aiohttp==3.9.5
Expand All @@ -22,7 +33,7 @@ analytics-python==1.4.post1
# via -r requirements/edx/kernel.in
aniso8601==9.0.1
# via edx-tincan-py35
annotated-types==0.6.0
annotated-types==0.7.0
# via pydantic
appdirs==1.4.4
# via fs
Expand Down Expand Up @@ -77,13 +88,13 @@ bleach[css]==6.1.0
# xblock-poll
boto==2.49.0
# via -r requirements/edx/kernel.in
boto3==1.34.104
boto3==1.34.109
# via
# -r requirements/edx/kernel.in
# django-ses
# fs-s3fs
# ora2
botocore==1.34.104
botocore==1.34.109
# via
# -r requirements/edx/kernel.in
# boto3
Expand All @@ -92,7 +103,7 @@ bridgekeeper==0.9
# via -r requirements/edx/kernel.in
camel-converter[pydantic]==3.1.2
# via meilisearch
celery==5.4.0
celery==5.3.6
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
Expand Down Expand Up @@ -167,7 +178,7 @@ cryptography==42.0.7
# pyopenssl
# snowflake-connector-python
# social-auth-core
cssutils==2.10.3
cssutils==2.11.0
# via pynliner
defusedxml==0.7.1
# via
Expand All @@ -178,7 +189,6 @@ defusedxml==0.7.1
# social-auth-core
django==4.2.13
# via
# -c requirements/edx/../common_constraints.txt
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
# django-appconf
Expand Down Expand Up @@ -389,6 +399,10 @@ djangorestframework==3.14.0
# super-csv
djangorestframework-xml==2.0.0
# via edx-enterprise
dnspython==2.6.1
# via
# -r requirements/edx/paver.txt
# pymongo
done-xblock==2.3.0
# via -r requirements/edx/bundled.in
drf-jwt==1.19.2
Expand Down Expand Up @@ -505,7 +519,7 @@ edx-proctoring==4.17.0
# edx-proctoring-proctortrack
edx-rbac==1.9.0
# via edx-enterprise
edx-rest-api-client==5.7.0
edx-rest-api-client==5.6.1
# via
# -r requirements/edx/kernel.in
# edx-enterprise
Expand Down Expand Up @@ -540,20 +554,12 @@ edx-when==2.5.0
# edx-proctoring
edxval==2.5.0
# via -r requirements/edx/kernel.in
elasticsearch==7.13.4
# via
# -c requirements/edx/../common_constraints.txt
# edx-search
elasticsearch==7.17.9
# via edx-search
enmerkar==0.7.1
# via enmerkar-underscore
enmerkar-underscore==2.3.0
# via -r requirements/edx/kernel.in
event-tracking==2.4.0
# via
# -r requirements/edx/kernel.in
# edx-completion
# edx-proctoring
# edx-search
fastavro==1.9.4
# via openedx-events
filelock==3.14.0
Expand Down Expand Up @@ -595,11 +601,8 @@ idna==3.7
# requests
# snowflake-connector-python
# yarl
importlib-metadata==6.11.0
# via
# -c requirements/edx/../common_constraints.txt
# -r requirements/edx/kernel.in
# markdown
importlib-metadata==7.1.0
# via markdown
importlib-resources==5.13.0
# via
# jsonschema
Expand Down Expand Up @@ -667,7 +670,7 @@ loremipsum==1.0.5
# via ora2
lti-consumer-xblock==9.11.0
# via -r requirements/edx/kernel.in
lxml==4.9.4
lxml[html-clean,html_clean]==4.9.4
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
Expand Down Expand Up @@ -779,8 +782,6 @@ openedx-learning==0.9.3
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
openedx-mongodbproxy==0.2.0
# via -r requirements/edx/kernel.in
optimizely-sdk==4.1.1
# via
# -c requirements/edx/../constraints.txt
Expand Down Expand Up @@ -825,7 +826,7 @@ pillow==10.3.0
# edxval
pkgutil-resolve-name==1.3.10
# via jsonschema
platformdirs==4.2.1
platformdirs==4.2.2
# via snowflake-connector-python
polib==1.2.0
# via edx-i18n-tools
Expand Down Expand Up @@ -881,7 +882,7 @@ pylti1p3==2.0.0
# via -r requirements/edx/kernel.in
pymemcache==4.0.0
# via -r requirements/edx/paver.txt
pymongo==3.13.0
pymongo==4.4.0
# via
# -c requirements/edx/../constraints.txt
# -r requirements/edx/kernel.in
Expand Down Expand Up @@ -977,9 +978,9 @@ referencing==0.35.1
# via
# jsonschema
# jsonschema-specifications
regex==2024.5.10
regex==2024.5.15
# via nltk
requests==2.31.0
requests==2.32.1
# via
# -r requirements/edx/paver.txt
# algoliasearch
Expand Down Expand Up @@ -1016,7 +1017,7 @@ ruamel-yaml==0.18.6
# via drf-yasg
ruamel-yaml-clib==0.2.8
# via ruamel-yaml
rules==3.3
rules==3.4
# via
# -r requirements/edx/kernel.in
# edx-enterprise
Expand Down Expand Up @@ -1229,7 +1230,7 @@ xss-utils==0.6.0
# via -r requirements/edx/kernel.in
yarl==1.9.4
# via aiohttp
zipp==3.18.1
zipp==3.18.2
# via
# importlib-metadata
# importlib-resources
Expand Down
Loading
Loading