From 31229602cbd0012fba35512435ac9d5e845a6808 Mon Sep 17 00:00:00 2001 From: Kyrylo Kholodenko Date: Thu, 14 Dec 2023 00:34:18 +0200 Subject: [PATCH 01/27] feat: [ACI-75] new public events --- ...ing+course+grade+now+failed+v1_schema.avsc | 88 +++++++++++++++++++ ...ing+course+grade+now+passed+v1_schema.avsc | 88 +++++++++++++++++++ openedx_events/learning/data.py | 14 +++ openedx_events/learning/signals.py | 23 +++++ 4 files changed, 213 insertions(+) create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+failed+v1_schema.avsc create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+passed+v1_schema.avsc diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+failed+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+failed+v1_schema.avsc new file mode 100644 index 00000000..ade981c8 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+failed+v1_schema.avsc @@ -0,0 +1,88 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "user_course_data", + "type": { + "name": "UserCourseData", + "type": "record", + "fields": [ + { + "name": "user", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "course", + "type": { + "name": "CourseData", + "type": "record", + "fields": [ + { + "name": "course_key", + "type": "string" + }, + { + "name": "display_name", + "type": "string" + }, + { + "name": "start", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } + } + ] + } + } + ], + "namespace": "org.openedx.learning.course.grade.now.failed.v1" +} \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+passed+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+passed+v1_schema.avsc new file mode 100644 index 00000000..19534cab --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+passed+v1_schema.avsc @@ -0,0 +1,88 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "user_course_data", + "type": { + "name": "UserCourseData", + "type": "record", + "fields": [ + { + "name": "user", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "course", + "type": { + "name": "CourseData", + "type": "record", + "fields": [ + { + "name": "course_key", + "type": "string" + }, + { + "name": "display_name", + "type": "string" + }, + { + "name": "start", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } + } + ] + } + } + ], + "namespace": "org.openedx.learning.course.grade.now.passed.v1" +} \ No newline at end of file diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 2aa03baf..5dbeb40d 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -476,3 +476,17 @@ class ORASubmissionData: id = attr.ib(type=str) file_downloads = attr.ib(type=List[ORAFileDownloadsData], factory=list) + + +@attr.s(frozen=True) +class UserCourseData: + """ + Attributes defined for Open edX user course data object. + + Arguments: + user (UserData): user associated with the Course Enrollment. + course (CourseData): course where the user is enrolled in. + """ + + user = attr.ib(type=UserData) + course = attr.ib(type=CourseData) diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index 9459d891..e433722c 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -20,6 +20,7 @@ ORASubmissionData, PersistentCourseGradeData, ProgramCertificateData, + UserCourseData, UserData, UserNotificationData, XBlockSkillVerificationData, @@ -350,3 +351,25 @@ "submission": ORASubmissionData, }, ) + +# .. event_type: org.openedx.learning.course.grade.now.passed.v1 +# .. event_name: COURSE_GRADE_NOW_PASSED +# .. event_description: Emmited when course grade is passed. +# .. event_data: UserCourseData +COURSE_GRADE_NOW_PASSED = OpenEdxPublicSignal( + event_type="org.openedx.learning.course.grade.now.passed.v1", + data={ + "user_course_data": UserCourseData, + } +) + +# .. event_type: org.openedx.learning.course.grade.now.failed.v1 +# .. event_name: COURSE_GRADE_NOW_FAILED +# .. event_description: Emmited when course grade is failed. +# .. event_data: UserCourseData +COURSE_GRADE_NOW_FAILED = OpenEdxPublicSignal( + event_type="org.openedx.learning.course.grade.now.failed.v1", + data={ + "user_course_data": UserCourseData, + } +) From 4ca494d408ea37e13d83d04acf0f7a300b65a0cd Mon Sep 17 00:00:00 2001 From: Kyrylo Kholodenko Date: Tue, 16 Jan 2024 13:06:16 +0200 Subject: [PATCH 02/27] feat: [ACI-139, ACI-145] new events for badge (#4) * feat: [ACI-75] new public events * feat: [ACI-139, ACI-145] new events for badge --- ...nedx+learning+badge+awarded+v1_schema.avsc | 100 ++++++++++++++++++ ...nedx+learning+badge+revoked+v1_schema.avsc | 100 ++++++++++++++++++ openedx_events/learning/data.py | 36 +++++++ openedx_events/learning/signals.py | 24 +++++ 4 files changed, 260 insertions(+) create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+awarded+v1_schema.avsc create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+revoked+v1_schema.avsc diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+awarded+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+awarded+v1_schema.avsc new file mode 100644 index 00000000..5e374a35 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+awarded+v1_schema.avsc @@ -0,0 +1,100 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "badge", + "type": { + "name": "BadgeData", + "type": "record", + "fields": [ + { + "name": "uuid", + "type": "string" + }, + { + "name": "user", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "template", + "type": { + "name": "BadgeTemplateData", + "type": "record", + "fields": [ + { + "name": "uuid", + "type": "string" + }, + { + "name": "type", + "type": "string" + }, + { + "name": "name", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "description", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "image_url", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } + } + ] + } + } + ], + "namespace": "org.openedx.learning.badge.awarded.v1" +} \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+revoked+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+revoked+v1_schema.avsc new file mode 100644 index 00000000..eade1a70 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+revoked+v1_schema.avsc @@ -0,0 +1,100 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "badge", + "type": { + "name": "BadgeData", + "type": "record", + "fields": [ + { + "name": "uuid", + "type": "string" + }, + { + "name": "user", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "template", + "type": { + "name": "BadgeTemplateData", + "type": "record", + "fields": [ + { + "name": "uuid", + "type": "string" + }, + { + "name": "type", + "type": "string" + }, + { + "name": "name", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "description", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "image_url", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } + } + ] + } + } + ], + "namespace": "org.openedx.learning.badge.revoked.v1" +} \ No newline at end of file diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 5dbeb40d..dcbf663f 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -490,3 +490,39 @@ class UserCourseData: user = attr.ib(type=UserData) course = attr.ib(type=CourseData) + + +@attr.s(frozen=True) +class BadgeTemplateData: + """ + Attributes defined for Open edX badge template data object. + + Arguments: + uuid (str): UUID of the badge template + type (str): type of badge template + name (str): badge name + description (str): badge description + image_url (str): badge image url + """ + + uuid = attr.ib(type=str) + type = attr.ib(type=str) + name = attr.ib(type=str, default=None) + description = attr.ib(type=str, default=None) + image_url = attr.ib(type=str, default=None) + + +@attr.s(frozen=True) +class BadgeData: + """ + Attributes defined for the Open edX badge data object. + + Arguments: + uuid (str): the UUID of the badge + user (UserData): user associated with the badge + template (BadgeTemplateData): badge template data + """ + + uuid = attr.ib(type=str) + user = attr.ib(type=UserData) + template = attr.ib(type=BadgeTemplateData) diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index e433722c..b188c226 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -9,6 +9,7 @@ """ from openedx_events.learning.data import ( + BadgeData, CertificateData, CohortData, CourseAccessRoleData, @@ -373,3 +374,26 @@ "user_course_data": UserCourseData, } ) + +# .. event_type: org.openedx.learning.badge.awarded.v1 +# .. event_name: BADGE_AWARDED +# .. event_description: Emit when a badge is awarded to a learner +# .. event_data: BadgeData +BADGE_AWARDED = OpenEdxPublicSignal( + event_type="org.openedx.learning.badge.awarded.v1", + data={ + "badge": BadgeData, + } +) + + +# .. event_type: org.openedx.learning.badge.revoked.v1 +# .. event_name: BADGE_REVOKED +# .. event_description: Emit when a badge is revoked for a learner +# .. event_data: BadgeData +BADGE_REVOKED = OpenEdxPublicSignal( + event_type="org.openedx.learning.badge.revoked.v1", + data={ + "badge": BadgeData, + } +) From 84760dcceae6c04fa40a9badaa94b6a7b9a53fca Mon Sep 17 00:00:00 2001 From: andrii-hantkovskyi <131773947+andrii-hantkovskyi@users.noreply.github.com> Date: Tue, 26 Mar 2024 15:20:59 +0200 Subject: [PATCH 03/27] feat: [ACI-510, ACI-511, ACI-512] new events and dataclass for ccx course (#5) * feat: [ACI-512] describe ccx course payload dataclass * feat: [ACI-510] define ccx-course-grade-passed signal * feat: [ACI-511] define ccx-course-grade-failed signal * feat: [ACI-510, ACI-511, ACI-512] new events and dataclass for ccx course * style: [ACI-512] fix line-too-long and trailing-whitespace --------- Co-authored-by: Andrii --- ...ccx+course+grade+now+failed+v1_schema.avsc | 87 +++++++++++++++++++ ...ccx+course+grade+now+passed+v1_schema.avsc | 87 +++++++++++++++++++ openedx_events/learning/data.py | 21 +++++ openedx_events/learning/signals.py | 25 ++++++ 4 files changed, 220 insertions(+) create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+failed+v1_schema.avsc create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+passed+v1_schema.avsc diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+failed+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+failed+v1_schema.avsc new file mode 100644 index 00000000..1b6c4ad3 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+failed+v1_schema.avsc @@ -0,0 +1,87 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "ccx_course", + "type": { + "name": "CcxCourseData", + "type": "record", + "fields": [ + { + "name": "course_key", + "type": "string" + }, + { + "name": "master_course_key", + "type": "string" + }, + { + "name": "max_students_allowed", + "type": "long" + }, + { + "name": "coach", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "display_name", + "type": "string" + }, + { + "name": "start", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } + } + ], + "namespace": "org.openedx.learning.ccx.course.grade.now.failed.v1" +} \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+passed+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+passed+v1_schema.avsc new file mode 100644 index 00000000..7bf247d6 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+passed+v1_schema.avsc @@ -0,0 +1,87 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "ccx_course", + "type": { + "name": "CcxCourseData", + "type": "record", + "fields": [ + { + "name": "course_key", + "type": "string" + }, + { + "name": "master_course_key", + "type": "string" + }, + { + "name": "max_students_allowed", + "type": "long" + }, + { + "name": "coach", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "display_name", + "type": "string" + }, + { + "name": "start", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } + } + ], + "namespace": "org.openedx.learning.ccx.course.grade.now.passed.v1" +} \ No newline at end of file diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index dcbf663f..190bd38f 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -526,3 +526,24 @@ class BadgeData: uuid = attr.ib(type=str) user = attr.ib(type=UserData) template = attr.ib(type=BadgeTemplateData) + + +@attr.s(frozen=True) +class CcxCourseData(CourseData): + """ + Attributes defined fir the Open edX custom course data object. + + Arguments: + master_course_key (str): identifier of the master Course object. + max_students_allowed (int): maximum number of students allowed on the custom course + coach (UserData): coach associated with the custom course + """ + + master_course_key = attr.ib(type=CourseKey) + max_students_allowed = attr.ib(type=int) + coach = attr.ib(type=UserData) + + # copypasted from CourseData to avoid ValueError + display_name = attr.ib(type=str, factory=str) + start = attr.ib(type=datetime, default=None) + end = attr.ib(type=datetime, default=None) diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index b188c226..85a7a69e 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -10,6 +10,7 @@ from openedx_events.learning.data import ( BadgeData, + CcxCourseData, CertificateData, CohortData, CourseAccessRoleData, @@ -397,3 +398,27 @@ "badge": BadgeData, } ) + + +# .. event_type: org.openedx.learning.ccx.course.grade.now.passed.v1 +# .. event_name: CCX_COURSE_GRADE_NOW_PASSED +# .. event_description: Emit when a ccx course grade is passed +# .. event_data: CcxCourseData +CCX_COURSE_GRADE_NOW_PASSED = OpenEdxPublicSignal( + event_type="org.openedx.learning.ccx.course.grade.now.passed.v1", + data={ + "ccx_course": CcxCourseData, + } +) + + +# .. event_type: org.openedx.learning.ccx.course.grade.now.failed.v1 +# .. event_name: CCX_COURSE_GRADE_NOW_FAILED +# .. event_description: Emit when a ccx course grade is failed +# .. event_data: CcxCourseData +CCX_COURSE_GRADE_NOW_FAILED = OpenEdxPublicSignal( + event_type="org.openedx.learning.ccx.course.grade.now.failed.v1", + data={ + "ccx_course": CcxCourseData, + } +) From 098ce1d693587b5bbf429987a62af793b2b40679 Mon Sep 17 00:00:00 2001 From: Volodymyr Bergman Date: Tue, 26 Mar 2024 16:55:07 +0200 Subject: [PATCH 04/27] feat: [ACI-512] update CCX events payload (#6) * feat: [ACI-512] update CCX events payload * chore(deps): upgrade dependencies * feat(deps): add edx-ccx-keys library --- openedx_events/learning/data.py | 28 ++++++++++-------- requirements/base.in | 1 + requirements/base.txt | 10 +++++-- requirements/ci.txt | 2 +- requirements/dev.txt | 31 ++++---------------- requirements/doc.txt | 50 +++++++++++++-------------------- requirements/pip-tools.txt | 11 +------- requirements/pip.txt | 2 +- requirements/quality.txt | 24 ++++++---------- requirements/test.txt | 15 ++++++---- 10 files changed, 70 insertions(+), 104 deletions(-) diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 190bd38f..e1c18558 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -8,6 +8,7 @@ from typing import List, Optional import attr +from ccx_keys.locator import CCXLocator from opaque_keys.edx.keys import CourseKey, UsageKey @@ -529,21 +530,24 @@ class BadgeData: @attr.s(frozen=True) -class CcxCourseData(CourseData): +class CcxCourseData: """ - Attributes defined fir the Open edX custom course data object. + Represents data for a CCX (Custom Courses for edX) course. - Arguments: - master_course_key (str): identifier of the master Course object. - max_students_allowed (int): maximum number of students allowed on the custom course - coach (UserData): coach associated with the custom course + Attributes: + ccx_course_key (CCXLocator): The unique identifier for the CCX course. + master_course_key (CourseKey): The unique identifier for the original course from which the CCX is derived. + display_name (str): The name of the CCX course as it should appear to users. + coach_email (str): The email address of the coach (instructor) for the CCX course. + start (str, optional): The start date of the CCX course. Defaults to None, indicating no specific start date. + end (str, optional): The end date of the CCX course. Defaults to None, indicating no specific end date. + max_students_allowed (int, optional): The maximum number of students that can enroll in the CCX course. Defaults to None, indicating no limit. """ + ccx_course_key = attr.ib(type=CCXLocator) master_course_key = attr.ib(type=CourseKey) - max_students_allowed = attr.ib(type=int) - coach = attr.ib(type=UserData) - - # copypasted from CourseData to avoid ValueError display_name = attr.ib(type=str, factory=str) - start = attr.ib(type=datetime, default=None) - end = attr.ib(type=datetime, default=None) + coach_email = attr.ib(type=str, factory=str) + start = attr.ib(type=str, default=None) + end = attr.ib(type=str, default=None) + max_students_allowed = attr.ib(type=int, default=None) diff --git a/requirements/base.in b/requirements/base.in index 5afd59f7..3eb50114 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -6,3 +6,4 @@ django attrs fastavro edx-opaque-keys[django] +edx-ccx-keys \ No newline at end of file diff --git a/requirements/base.txt b/requirements/base.txt index 6e35e604..743280a1 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -29,8 +29,12 @@ django-waffle==4.1.0 # via edx-django-utils edx-django-utils==5.12.0 # via -r requirements/base.in -edx-opaque-keys[django]==2.5.1 +edx-ccx-keys==1.2.1 # via -r requirements/base.in +edx-opaque-keys[django]==2.5.1 + # via + # -r requirements/base.in + # edx-ccx-keys fastavro==1.9.4 # via -r requirements/base.in newrelic==9.8.0 @@ -45,6 +49,8 @@ pymongo==3.13.0 # via edx-opaque-keys pynacl==1.5.0 # via edx-django-utils +six==1.16.0 + # via edx-ccx-keys sqlparse==0.4.4 # via django stevedore==5.2.0 diff --git a/requirements/ci.txt b/requirements/ci.txt index 641296fb..202b59eb 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade diff --git a/requirements/dev.txt b/requirements/dev.txt index 50519892..89288598 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -111,16 +111,16 @@ docutils==0.20.1 # via # -r requirements/quality.txt # readme-renderer +edx-ccx-keys==1.2.1 + # via -r requirements/quality.txt edx-django-utils==5.12.0 # via -r requirements/quality.txt edx-lint==5.3.6 # via -r requirements/quality.txt edx-opaque-keys[django]==2.5.1 - # via -r requirements/quality.txt -exceptiongroup==1.2.0 # via # -r requirements/quality.txt - # pytest + # edx-ccx-keys fastavro==1.9.4 # via -r requirements/quality.txt filelock==3.13.4 @@ -135,10 +135,7 @@ idna==3.6 importlib-metadata==6.11.0 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt - # -r requirements/pip-tools.txt # -r requirements/quality.txt - # build - # keyring # twine importlib-resources==6.4.0 # via @@ -344,6 +341,7 @@ secretstorage==3.3.3 six==1.16.0 # via # -r requirements/quality.txt + # edx-ccx-keys # edx-lint snowballstemmer==2.2.0 # via @@ -363,19 +361,6 @@ text-unidecode==1.3 # via # -r requirements/quality.txt # python-slugify -tomli==2.0.1 - # via - # -r requirements/ci.txt - # -r requirements/pip-tools.txt - # -r requirements/quality.txt - # build - # coverage - # pip-tools - # pylint - # pyproject-api - # pyproject-hooks - # pytest - # tox tomlkit==0.12.4 # via # -r requirements/quality.txt @@ -387,11 +372,7 @@ twine==5.0.0 typing-extensions==4.11.0 # via # -r requirements/quality.txt - # asgiref - # astroid # edx-opaque-keys - # pylint - # rich urllib3==2.2.1 # via # -r requirements/quality.txt @@ -411,10 +392,8 @@ wrapt==1.16.0 # astroid zipp==3.18.1 # via - # -r requirements/pip-tools.txt # -r requirements/quality.txt # importlib-metadata - # importlib-resources # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/doc.txt b/requirements/doc.txt index 06a3a454..2493ab8d 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -1,12 +1,12 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # accessible-pygments==0.0.4 # via pydata-sphinx-theme -alabaster==0.7.13 +alabaster==0.7.16 # via sphinx asgiref==3.8.1 # via @@ -72,21 +72,21 @@ django-waffle==4.1.0 # edx-django-utils doc8==1.1.1 # via -r requirements/doc.in -docutils==0.19 +docutils==0.20.1 # via # doc8 # pydata-sphinx-theme # readme-renderer # restructuredtext-lint # sphinx +edx-ccx-keys==1.2.1 + # via -r requirements/test.txt edx-django-utils==5.12.0 # via -r requirements/test.txt edx-opaque-keys[django]==2.5.1 - # via -r requirements/test.txt -exceptiongroup==1.2.0 # via # -r requirements/test.txt - # pytest + # edx-ccx-keys fastavro==1.9.4 # via -r requirements/test.txt idna==3.6 @@ -96,9 +96,6 @@ imagesize==1.4.1 importlib-metadata==6.11.0 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt - # build - # keyring - # sphinx # twine importlib-resources==6.4.0 # via keyring @@ -168,7 +165,7 @@ pycparser==2.22 # via # -r requirements/test.txt # cffi -pydata-sphinx-theme==0.14.4 +pydata-sphinx-theme==0.15.2 # via sphinx-book-theme pygments==2.17.2 # via @@ -201,8 +198,6 @@ python-slugify==8.0.4 # via # -r requirements/test.txt # code-annotations -pytz==2024.1 - # via babel pyyaml==6.0.1 # via # -r requirements/test.txt @@ -225,12 +220,15 @@ rich==13.7.1 secretstorage==3.3.3 # via keyring six==1.16.0 - # via livereload + # via + # -r requirements/test.txt + # edx-ccx-keys + # livereload snowballstemmer==2.2.0 # via sphinx soupsieve==2.5 # via beautifulsoup4 -sphinx==6.2.1 +sphinx==7.2.6 # via # -r requirements/doc.in # pydata-sphinx-theme @@ -238,27 +236,27 @@ sphinx==6.2.1 # sphinx-book-theme # sphinx-copybutton # sphinxcontrib-contentui -sphinx-autobuild==2021.3.14 +sphinx-autobuild==2024.2.4 # via -r requirements/doc.in -sphinx-book-theme==1.0.1 +sphinx-book-theme==1.1.2 # via -r requirements/doc.in sphinx-copybutton==0.5.2 # via -r requirements/doc.in -sphinxcontrib-applehelp==1.0.4 +sphinxcontrib-applehelp==1.0.8 # via sphinx sphinxcontrib-contentui==0.2.5 # via -r requirements/doc.in -sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-devhelp==1.0.6 # via sphinx -sphinxcontrib-htmlhelp==2.0.1 +sphinxcontrib-htmlhelp==2.0.5 # via sphinx sphinxcontrib-jsmath==1.0.1 # via sphinx sphinxcontrib-mermaid==0.9.2 # via -r requirements/doc.in -sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-qthelp==1.0.7 # via sphinx -sphinxcontrib-serializinghtml==1.1.5 +sphinxcontrib-serializinghtml==1.1.10 # via sphinx sqlparse==0.4.4 # via @@ -275,14 +273,6 @@ text-unidecode==1.3 # via # -r requirements/test.txt # python-slugify -tomli==2.0.1 - # via - # -r requirements/test.txt - # build - # coverage - # doc8 - # pyproject-hooks - # pytest tornado==6.4 # via livereload twine==5.0.0 @@ -290,10 +280,8 @@ twine==5.0.0 typing-extensions==4.11.0 # via # -r requirements/test.txt - # asgiref # edx-opaque-keys # pydata-sphinx-theme - # rich urllib3==2.2.1 # via # requests diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 8ea29a86..18ca69b3 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -8,10 +8,6 @@ build==1.2.1 # via pip-tools click==8.1.7 # via pip-tools -importlib-metadata==6.11.0 - # via - # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt - # build packaging==24.0 # via build pip-tools==7.4.1 @@ -20,11 +16,6 @@ pyproject-hooks==1.0.0 # via # build # pip-tools -tomli==2.0.1 - # via - # build - # pip-tools - # pyproject-hooks wheel==0.43.0 # via pip-tools zipp==3.18.1 diff --git a/requirements/pip.txt b/requirements/pip.txt index cf449024..8d1b8fef 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade diff --git a/requirements/quality.txt b/requirements/quality.txt index 3080054f..fca776ae 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -71,16 +71,16 @@ django-waffle==4.1.0 # edx-django-utils docutils==0.20.1 # via readme-renderer +edx-ccx-keys==1.2.1 + # via -r requirements/test.txt edx-django-utils==5.12.0 # via -r requirements/test.txt edx-lint==5.3.6 # via -r requirements/quality.in edx-opaque-keys[django]==2.5.1 - # via -r requirements/test.txt -exceptiongroup==1.2.0 # via # -r requirements/test.txt - # pytest + # edx-ccx-keys fastavro==1.9.4 # via -r requirements/test.txt idna==3.6 @@ -88,7 +88,6 @@ idna==3.6 importlib-metadata==6.11.0 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt - # keyring # twine importlib-resources==6.4.0 # via keyring @@ -224,7 +223,10 @@ rich==13.7.1 secretstorage==3.3.3 # via keyring six==1.16.0 - # via edx-lint + # via + # -r requirements/test.txt + # edx-ccx-keys + # edx-lint snowballstemmer==2.2.0 # via pydocstyle sqlparse==0.4.4 @@ -241,12 +243,6 @@ text-unidecode==1.3 # via # -r requirements/test.txt # python-slugify -tomli==2.0.1 - # via - # -r requirements/test.txt - # coverage - # pylint - # pytest tomlkit==0.12.4 # via pylint twine==5.0.0 @@ -254,11 +250,7 @@ twine==5.0.0 typing-extensions==4.11.0 # via # -r requirements/test.txt - # asgiref - # astroid # edx-opaque-keys - # pylint - # rich urllib3==2.2.1 # via # requests diff --git a/requirements/test.txt b/requirements/test.txt index 52f4b9bc..1d6e94f3 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade @@ -44,12 +44,14 @@ django-waffle==4.1.0 # via # -r requirements/base.txt # edx-django-utils +edx-ccx-keys==1.2.1 + # via -r requirements/base.txt edx-django-utils==5.12.0 # via -r requirements/base.txt edx-opaque-keys[django]==2.5.1 - # via -r requirements/base.txt -exceptiongroup==1.2.0 - # via pytest + # via + # -r requirements/base.txt + # edx-ccx-keys fastavro==1.9.4 # via -r requirements/base.txt iniconfig==2.0.0 @@ -98,6 +100,10 @@ python-slugify==8.0.4 # via code-annotations pyyaml==6.0.1 # via code-annotations +six==1.16.0 + # via + # -r requirements/base.txt + # edx-ccx-keys sqlparse==0.4.4 # via # -r requirements/base.txt @@ -117,5 +123,4 @@ tomli==2.0.1 typing-extensions==4.11.0 # via # -r requirements/base.txt - # asgiref # edx-opaque-keys From 48b9ed78750e18e059e707eef0876ffb93eb7c27 Mon Sep 17 00:00:00 2001 From: Volodymyr Bergman Date: Tue, 26 Mar 2024 17:26:48 +0200 Subject: [PATCH 05/27] chore: [ACI-473] update badges related payload atttibutes to match data models (#7) --- .../schemas/org+openedx+learning+badge+awarded+v1_schema.avsc | 2 +- .../schemas/org+openedx+learning+badge+revoked+v1_schema.avsc | 2 +- openedx_events/learning/data.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+awarded+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+awarded+v1_schema.avsc index 5e374a35..6bac2197 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+awarded+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+awarded+v1_schema.avsc @@ -62,7 +62,7 @@ "type": "string" }, { - "name": "type", + "name": "origin", "type": "string" }, { diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+revoked+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+revoked+v1_schema.avsc index eade1a70..0cb96323 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+revoked+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+revoked+v1_schema.avsc @@ -62,7 +62,7 @@ "type": "string" }, { - "name": "type", + "name": "origin", "type": "string" }, { diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index e1c18558..d178455e 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -500,14 +500,14 @@ class BadgeTemplateData: Arguments: uuid (str): UUID of the badge template - type (str): type of badge template + origin (str): type of badge template name (str): badge name description (str): badge description image_url (str): badge image url """ uuid = attr.ib(type=str) - type = attr.ib(type=str) + origin = attr.ib(type=str) name = attr.ib(type=str, default=None) description = attr.ib(type=str, default=None) image_url = attr.ib(type=str, default=None) From 5f964151c2f3da71a2c44479cbe76df3d221de45 Mon Sep 17 00:00:00 2001 From: andrii-hantkovskyi <131773947+andrii-hantkovskyi@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:43:47 +0200 Subject: [PATCH 06/27] feat: [ACI-800] implement avro serializer for ccx locator (#9) Co-authored-by: Andrii --- .../event_bus/avro/custom_serializers.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/openedx_events/event_bus/avro/custom_serializers.py b/openedx_events/event_bus/avro/custom_serializers.py index 37a8a150..0ce6bf41 100644 --- a/openedx_events/event_bus/avro/custom_serializers.py +++ b/openedx_events/event_bus/avro/custom_serializers.py @@ -5,6 +5,7 @@ from abc import ABC, abstractmethod from datetime import datetime +from ccx_keys.locator import CCXLocator from opaque_keys.edx.keys import CourseKey, UsageKey from opaque_keys.edx.locator import LibraryLocatorV2, LibraryUsageLocatorV2 @@ -49,6 +50,25 @@ def deserialize(data: str): return CourseKey.from_string(data) +class CcxCourseLocatorAvroSerializer(BaseCustomTypeAvroSerializer): + """ + CustomTypeAvroSerializer for CCXLocator class. + """ + + cls = CCXLocator + field_type = PYTHON_TYPE_TO_AVRO_MAPPING[str] + + @staticmethod + def serialize(obj) -> str: + """Serialize obj into string.""" + return str(obj) + + @staticmethod + def deserialize(data: str): + """Deserialize string into obj.""" + return CCXLocator.from_string(data) + + class DatetimeAvroSerializer(BaseCustomTypeAvroSerializer): """ CustomTypeAvroSerializer for datetime class. @@ -131,6 +151,7 @@ def deserialize(data: str): DEFAULT_CUSTOM_SERIALIZERS = [ CourseKeyAvroSerializer, + CcxCourseLocatorAvroSerializer, DatetimeAvroSerializer, LibraryLocatorV2AvroSerializer, LibraryUsageLocatorV2AvroSerializer, From 42fef33f06b106bf572fe0d58512ff8bdfc0fbfd Mon Sep 17 00:00:00 2001 From: Volodymyr Bergman Date: Fri, 29 Mar 2024 11:58:49 +0200 Subject: [PATCH 07/27] refactor: [ACI-502, ACI-503] redesign course grading events payload (#8) * refactor: [ACI-502, ACI-503] redesign course grading events payload * refactor: include passing status to data class * refactor: merge passing/failing signals to a single status signal * refactor: update avro schemas --- .../event_bus/avro/custom_serializers.py | 2 +- ...ccx+course+grade+now+failed+v1_schema.avsc | 87 ------------------- ...ccx+course+grade+now+passed+v1_schema.avsc | 87 ------------------- ...+ccx+course+passing+status+v1_schema.avsc} | 38 ++++++-- ...ning+course+passing+status+v1_schema.avsc} | 80 +++++++++-------- openedx_events/learning/data.py | 84 +++++++++++------- openedx_events/learning/signals.py | 58 ++++--------- 7 files changed, 152 insertions(+), 284 deletions(-) delete mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+failed+v1_schema.avsc delete mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+passed+v1_schema.avsc rename openedx_events/event_bus/avro/tests/schemas/{org+openedx+learning+course+grade+now+passed+v1_schema.avsc => org+openedx+learning+ccx+course+passing+status+v1_schema.avsc} (68%) rename openedx_events/event_bus/avro/tests/schemas/{org+openedx+learning+course+grade+now+failed+v1_schema.avsc => org+openedx+learning+course+passing+status+v1_schema.avsc} (83%) diff --git a/openedx_events/event_bus/avro/custom_serializers.py b/openedx_events/event_bus/avro/custom_serializers.py index 0ce6bf41..d41616c2 100644 --- a/openedx_events/event_bus/avro/custom_serializers.py +++ b/openedx_events/event_bus/avro/custom_serializers.py @@ -62,7 +62,7 @@ class CcxCourseLocatorAvroSerializer(BaseCustomTypeAvroSerializer): def serialize(obj) -> str: """Serialize obj into string.""" return str(obj) - + @staticmethod def deserialize(data: str): """Deserialize string into obj.""" diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+failed+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+failed+v1_schema.avsc deleted file mode 100644 index 1b6c4ad3..00000000 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+failed+v1_schema.avsc +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "CloudEvent", - "type": "record", - "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", - "fields": [ - { - "name": "ccx_course", - "type": { - "name": "CcxCourseData", - "type": "record", - "fields": [ - { - "name": "course_key", - "type": "string" - }, - { - "name": "master_course_key", - "type": "string" - }, - { - "name": "max_students_allowed", - "type": "long" - }, - { - "name": "coach", - "type": { - "name": "UserData", - "type": "record", - "fields": [ - { - "name": "id", - "type": "long" - }, - { - "name": "is_active", - "type": "boolean" - }, - { - "name": "pii", - "type": { - "name": "UserPersonalData", - "type": "record", - "fields": [ - { - "name": "username", - "type": "string" - }, - { - "name": "email", - "type": "string" - }, - { - "name": "name", - "type": "string" - } - ] - } - } - ] - } - }, - { - "name": "display_name", - "type": "string" - }, - { - "name": "start", - "type": [ - "null", - "string" - ], - "default": null - }, - { - "name": "end", - "type": [ - "null", - "string" - ], - "default": null - } - ] - } - } - ], - "namespace": "org.openedx.learning.ccx.course.grade.now.failed.v1" -} \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+passed+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+passed+v1_schema.avsc deleted file mode 100644 index 7bf247d6..00000000 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+grade+now+passed+v1_schema.avsc +++ /dev/null @@ -1,87 +0,0 @@ -{ - "name": "CloudEvent", - "type": "record", - "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", - "fields": [ - { - "name": "ccx_course", - "type": { - "name": "CcxCourseData", - "type": "record", - "fields": [ - { - "name": "course_key", - "type": "string" - }, - { - "name": "master_course_key", - "type": "string" - }, - { - "name": "max_students_allowed", - "type": "long" - }, - { - "name": "coach", - "type": { - "name": "UserData", - "type": "record", - "fields": [ - { - "name": "id", - "type": "long" - }, - { - "name": "is_active", - "type": "boolean" - }, - { - "name": "pii", - "type": { - "name": "UserPersonalData", - "type": "record", - "fields": [ - { - "name": "username", - "type": "string" - }, - { - "name": "email", - "type": "string" - }, - { - "name": "name", - "type": "string" - } - ] - } - } - ] - } - }, - { - "name": "display_name", - "type": "string" - }, - { - "name": "start", - "type": [ - "null", - "string" - ], - "default": null - }, - { - "name": "end", - "type": [ - "null", - "string" - ], - "default": null - } - ] - } - } - ], - "namespace": "org.openedx.learning.ccx.course.grade.now.passed.v1" -} \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+passed+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc similarity index 68% rename from openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+passed+v1_schema.avsc rename to openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc index 19534cab..5039aadf 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+passed+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc @@ -4,11 +4,15 @@ "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", "fields": [ { - "name": "user_course_data", + "name": "course_passing_status", "type": { - "name": "UserCourseData", + "name": "CcxCoursePassingStatusData", "type": "record", "fields": [ + { + "name": "status", + "type": "string" + }, { "name": "user", "type": { @@ -47,20 +51,36 @@ ] } }, + { + "name": "update_timestamp", + "type": "string" + }, + { + "name": "grading_policy_hash", + "type": "string" + }, { "name": "course", "type": { - "name": "CourseData", + "name": "CcxCourseData", "type": "record", "fields": [ { - "name": "course_key", + "name": "ccx_course_key", + "type": "string" + }, + { + "name": "master_course_key", "type": "string" }, { "name": "display_name", "type": "string" }, + { + "name": "coach_email", + "type": "string" + }, { "name": "start", "type": [ @@ -76,6 +96,14 @@ "string" ], "default": null + }, + { + "name": "max_students_allowed", + "type": [ + "null", + "long" + ], + "default": null } ] } @@ -84,5 +112,5 @@ } } ], - "namespace": "org.openedx.learning.course.grade.now.passed.v1" + "namespace": "org.openedx.learning.ccx.course.passing.status.v1" } \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+failed+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc similarity index 83% rename from openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+failed+v1_schema.avsc rename to openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc index ade981c8..27a5c000 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+grade+now+failed+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc @@ -4,11 +4,48 @@ "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", "fields": [ { - "name": "user_course_data", + "name": "course_passing_status", "type": { - "name": "UserCourseData", + "name": "CoursePassingStatusData", "type": "record", "fields": [ + { + "name": "status", + "type": "string" + }, + { + "name": "course", + "type": { + "name": "CourseData", + "type": "record", + "fields": [ + { + "name": "course_key", + "type": "string" + }, + { + "name": "display_name", + "type": "string" + }, + { + "name": "start", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } + }, { "name": "user", "type": { @@ -48,41 +85,16 @@ } }, { - "name": "course", - "type": { - "name": "CourseData", - "type": "record", - "fields": [ - { - "name": "course_key", - "type": "string" - }, - { - "name": "display_name", - "type": "string" - }, - { - "name": "start", - "type": [ - "null", - "string" - ], - "default": null - }, - { - "name": "end", - "type": [ - "null", - "string" - ], - "default": null - } - ] - } + "name": "update_timestamp", + "type": "string" + }, + { + "name": "grading_policy_hash", + "type": "string" } ] } } ], - "namespace": "org.openedx.learning.course.grade.now.failed.v1" + "namespace": "org.openedx.learning.course.passing.status.v1" } \ No newline at end of file diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index d178455e..37938315 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -8,6 +8,7 @@ from typing import List, Optional import attr +from attr.validators import in_ from ccx_keys.locator import CCXLocator from opaque_keys.edx.keys import CourseKey, UsageKey @@ -75,6 +76,30 @@ class CourseData: end = attr.ib(type=datetime, default=None) +@attr.s(frozen=True) +class CcxCourseData: + """ + Represents data for a CCX (Custom Courses for edX) course. + + Attributes: + ccx_course_key (CCXLocator): The unique identifier for the CCX course. + master_course_key (CourseKey): The unique identifier for the original course from which the CCX is derived. + display_name (str): The name of the CCX course as it should appear to users. + coach_email (str): The email address of the coach (instructor) for the CCX course. + start (str, optional): The start date of the CCX course. Defaults to None, indicating no specific start date. + end (str, optional): The end date of the CCX course. Defaults to None, indicating no specific end date. + max_students_allowed (int, optional): The maximum number of students that can enroll in the CCX course. Defaults to None, indicating no limit. + """ + + ccx_course_key = attr.ib(type=CCXLocator) + master_course_key = attr.ib(type=CourseKey) + display_name = attr.ib(type=str, factory=str) + coach_email = attr.ib(type=str, factory=str) + start = attr.ib(type=str, default=None) + end = attr.ib(type=str, default=None) + max_students_allowed = attr.ib(type=int, default=None) + + @attr.s(frozen=True) class CourseEnrollmentData: """ @@ -480,17 +505,40 @@ class ORASubmissionData: @attr.s(frozen=True) -class UserCourseData: +class CoursePassingStatusData: """ - Attributes defined for Open edX user course data object. + Represents the event data when a user's grade crosses a grading policy threshold in a course. - Arguments: - user (UserData): user associated with the Course Enrollment. - course (CourseData): course where the user is enrolled in. + Attributes: + user (UserData): An instance of UserData containing information about the user whose grade crossed the threshold. + course (CourseData): An instance of CourseData containing details about the course in which the grade threshold was crossed. + update_timestamp (datetime): The timestamp when the grade crossing event was recorded. + grading_policy_hash (str): A hash of the course's grading policy at the time of the event, used for verifying the grading policy has not changed. """ + PASSING = 'passing' + FAILING = 'failing' + STATUSES = [PASSING, FAILING] - user = attr.ib(type=UserData) + status = attr.ib(type=str, validator=in_(STATUSES)) course = attr.ib(type=CourseData) + user = attr.ib(type=UserData) + update_timestamp = attr.ib(type=datetime) + grading_policy_hash = attr.ib(type=str) + + +@attr.s(frozen=True) +class CcxCoursePassingStatusData(CoursePassingStatusData): + """ + Extends CoursePassingStatusData for CCX courses, specifying CCX course data. + + This class is used for events where a user's grade crosses a threshold specifically in a CCX course, + providing a custom course attribute suited for CCX course instances. + + Attributes: + course (CcxCourseData): An instance of CcxCourseData containing details about the CCX course in which the grade threshold was crossed. + All other attributes are inherited from CoursePassingStatusData. + """ + course = attr.ib(type=CcxCourseData) @attr.s(frozen=True) @@ -527,27 +575,3 @@ class BadgeData: uuid = attr.ib(type=str) user = attr.ib(type=UserData) template = attr.ib(type=BadgeTemplateData) - - -@attr.s(frozen=True) -class CcxCourseData: - """ - Represents data for a CCX (Custom Courses for edX) course. - - Attributes: - ccx_course_key (CCXLocator): The unique identifier for the CCX course. - master_course_key (CourseKey): The unique identifier for the original course from which the CCX is derived. - display_name (str): The name of the CCX course as it should appear to users. - coach_email (str): The email address of the coach (instructor) for the CCX course. - start (str, optional): The start date of the CCX course. Defaults to None, indicating no specific start date. - end (str, optional): The end date of the CCX course. Defaults to None, indicating no specific end date. - max_students_allowed (int, optional): The maximum number of students that can enroll in the CCX course. Defaults to None, indicating no limit. - """ - - ccx_course_key = attr.ib(type=CCXLocator) - master_course_key = attr.ib(type=CourseKey) - display_name = attr.ib(type=str, factory=str) - coach_email = attr.ib(type=str, factory=str) - start = attr.ib(type=str, default=None) - end = attr.ib(type=str, default=None) - max_students_allowed = attr.ib(type=int, default=None) diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index 85a7a69e..5064d2d6 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -10,19 +10,19 @@ from openedx_events.learning.data import ( BadgeData, - CcxCourseData, + CcxCoursePassingStatusData, CertificateData, CohortData, CourseAccessRoleData, CourseDiscussionConfigurationData, CourseEnrollmentData, + CoursePassingStatusData, CourseNotificationData, DiscussionThreadData, ExamAttemptData, ORASubmissionData, PersistentCourseGradeData, ProgramCertificateData, - UserCourseData, UserData, UserNotificationData, XBlockSkillVerificationData, @@ -354,28 +354,30 @@ }, ) -# .. event_type: org.openedx.learning.course.grade.now.passed.v1 -# .. event_name: COURSE_GRADE_NOW_PASSED -# .. event_description: Emmited when course grade is passed. -# .. event_data: UserCourseData -COURSE_GRADE_NOW_PASSED = OpenEdxPublicSignal( - event_type="org.openedx.learning.course.grade.now.passed.v1", +# .. event_type: org.openedx.learning.course.passing.status.v1 +# .. event_name: COURSE_PASSING_STATUS_UPDATED +# .. event_description: Emitted when course grade updates. +# .. event_data: CoursePassingStatusData +COURSE_PASSING_STATUS_UPDATED = OpenEdxPublicSignal( + event_type="org.openedx.learning.course.passing.status.v1", data={ - "user_course_data": UserCourseData, + "course_passing_status": CoursePassingStatusData, } ) -# .. event_type: org.openedx.learning.course.grade.now.failed.v1 -# .. event_name: COURSE_GRADE_NOW_FAILED -# .. event_description: Emmited when course grade is failed. -# .. event_data: UserCourseData -COURSE_GRADE_NOW_FAILED = OpenEdxPublicSignal( - event_type="org.openedx.learning.course.grade.now.failed.v1", + +# .. event_type: org.openedx.learning.ccx.course.passing.status.v1 +# .. event_name: CCX_COURSE_PASSING_STATUS_UPDATED +# .. event_description: Emitted when a CCX course grade updates. +# .. event_data: CcxCoursePassingStatusData +CCX_COURSE_PASSING_STATUS_UPDATED = OpenEdxPublicSignal( + event_type="org.openedx.learning.ccx.course.passing.status.v1", data={ - "user_course_data": UserCourseData, + "course_passing_status": CcxCoursePassingStatusData, } ) + # .. event_type: org.openedx.learning.badge.awarded.v1 # .. event_name: BADGE_AWARDED # .. event_description: Emit when a badge is awarded to a learner @@ -398,27 +400,3 @@ "badge": BadgeData, } ) - - -# .. event_type: org.openedx.learning.ccx.course.grade.now.passed.v1 -# .. event_name: CCX_COURSE_GRADE_NOW_PASSED -# .. event_description: Emit when a ccx course grade is passed -# .. event_data: CcxCourseData -CCX_COURSE_GRADE_NOW_PASSED = OpenEdxPublicSignal( - event_type="org.openedx.learning.ccx.course.grade.now.passed.v1", - data={ - "ccx_course": CcxCourseData, - } -) - - -# .. event_type: org.openedx.learning.ccx.course.grade.now.failed.v1 -# .. event_name: CCX_COURSE_GRADE_NOW_FAILED -# .. event_description: Emit when a ccx course grade is failed -# .. event_data: CcxCourseData -CCX_COURSE_GRADE_NOW_FAILED = OpenEdxPublicSignal( - event_type="org.openedx.learning.ccx.course.grade.now.failed.v1", - data={ - "ccx_course": CcxCourseData, - } -) From 6aa6c90a7402d283cd89b05e745a1928e19b9bdb Mon Sep 17 00:00:00 2001 From: Volodymyr Bergman Date: Fri, 29 Mar 2024 19:58:34 +0200 Subject: [PATCH 08/27] refactor: [ACI-820] simplify course grade status event payload (#10) --- ...+learning+ccx+course+passing+status+v1_schema.avsc | 8 -------- ...nedx+learning+course+passing+status+v1_schema.avsc | 8 -------- openedx_events/learning/data.py | 11 ++++------- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc index 5039aadf..2f0056aa 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc @@ -51,14 +51,6 @@ ] } }, - { - "name": "update_timestamp", - "type": "string" - }, - { - "name": "grading_policy_hash", - "type": "string" - }, { "name": "course", "type": { diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc index 27a5c000..085c11c1 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc @@ -83,14 +83,6 @@ } ] } - }, - { - "name": "update_timestamp", - "type": "string" - }, - { - "name": "grading_policy_hash", - "type": "string" } ] } diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 37938315..9595dbf1 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -507,13 +507,12 @@ class ORASubmissionData: @attr.s(frozen=True) class CoursePassingStatusData: """ - Represents the event data when a user's grade crosses a grading policy threshold in a course. + Represents the event data when a user's grade is updated, indicates if current grade is enough for course passing. Attributes: - user (UserData): An instance of UserData containing information about the user whose grade crossed the threshold. - course (CourseData): An instance of CourseData containing details about the course in which the grade threshold was crossed. - update_timestamp (datetime): The timestamp when the grade crossing event was recorded. - grading_policy_hash (str): A hash of the course's grading policy at the time of the event, used for verifying the grading policy has not changed. + status (str): A string containing information about user's current course grade value in comparison to the grading policy threshold. + user (UserData): An instance of UserData containing information about the user whose grade was updated. + course (CourseData): An instance of CourseData containing details about the course in which the grade was updated. """ PASSING = 'passing' FAILING = 'failing' @@ -522,8 +521,6 @@ class CoursePassingStatusData: status = attr.ib(type=str, validator=in_(STATUSES)) course = attr.ib(type=CourseData) user = attr.ib(type=UserData) - update_timestamp = attr.ib(type=datetime) - grading_policy_hash = attr.ib(type=str) @attr.s(frozen=True) From da07adf622f0c851157c067bbc62dbc45d0b0a3f Mon Sep 17 00:00:00 2001 From: Volodymyr Bergman Date: Sun, 31 Mar 2024 16:24:06 +0300 Subject: [PATCH 09/27] refactor: [ACI-814] update course passing events types (#11) --- openedx_events/learning/signals.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index 5064d2d6..78025633 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -354,24 +354,39 @@ }, ) -# .. event_type: org.openedx.learning.course.passing.status.v1 + +# .. event_type: org.openedx.learning.ora.submission.created.v1 +# .. event_name: ORA_SUBMISSION_CREATED +# .. event_description: Emitted when a new ORA submission is created +# .. event_data: ORASubmissionData +# Warning: This event is currently incompatible with the event bus, list/dict cannot be serialized yet +ORA_SUBMISSION_CREATED = OpenEdxPublicSignal( + event_type="org.openedx.learning.ora.submission.created.v1", + data={ + "submission": ORASubmissionData, + }, +) + + + +# .. event_type: org.openedx.learning.course.passing.status.updated.v1 # .. event_name: COURSE_PASSING_STATUS_UPDATED # .. event_description: Emitted when course grade updates. # .. event_data: CoursePassingStatusData COURSE_PASSING_STATUS_UPDATED = OpenEdxPublicSignal( - event_type="org.openedx.learning.course.passing.status.v1", + event_type="org.openedx.learning.course.passing.status.updated.v1", data={ "course_passing_status": CoursePassingStatusData, } ) -# .. event_type: org.openedx.learning.ccx.course.passing.status.v1 +# .. event_type: org.openedx.learning.ccx.course.passing.status.updated.v1 # .. event_name: CCX_COURSE_PASSING_STATUS_UPDATED # .. event_description: Emitted when a CCX course grade updates. # .. event_data: CcxCoursePassingStatusData CCX_COURSE_PASSING_STATUS_UPDATED = OpenEdxPublicSignal( - event_type="org.openedx.learning.ccx.course.passing.status.v1", + event_type="org.openedx.learning.ccx.course.passing.status.updated.v1", data={ "course_passing_status": CcxCoursePassingStatusData, } @@ -399,4 +414,4 @@ data={ "badge": BadgeData, } -) +) \ No newline at end of file From 8558418e230edcf29687661bcdb3def5bb1a58bc Mon Sep 17 00:00:00 2001 From: Kyrylo Kholodenko Date: Sun, 14 Apr 2024 18:10:22 +0300 Subject: [PATCH 10/27] feat: add new learning events for course grades and badges --- .../event_bus/avro/custom_serializers.py | 21 ++++ ...nedx+learning+badge+awarded+v1_schema.avsc | 100 ++++++++++++++++ ...nedx+learning+badge+revoked+v1_schema.avsc | 100 ++++++++++++++++ ...g+ccx+course+passing+status+v1_schema.avsc | 108 ++++++++++++++++++ ...rning+course+passing+status+v1_schema.avsc | 92 +++++++++++++++ openedx_events/learning/data.py | 96 ++++++++++++++++ openedx_events/learning/signals.py | 51 +++++++++ requirements/base.in | 1 + requirements/base.txt | 12 +- requirements/ci.txt | 6 +- requirements/dev.txt | 15 ++- requirements/doc.txt | 17 ++- requirements/pip-tools.txt | 4 + requirements/pip.txt | 4 + requirements/quality.txt | 17 ++- requirements/test.txt | 14 ++- 16 files changed, 646 insertions(+), 12 deletions(-) create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+awarded+v1_schema.avsc create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+revoked+v1_schema.avsc create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc create mode 100644 openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc diff --git a/openedx_events/event_bus/avro/custom_serializers.py b/openedx_events/event_bus/avro/custom_serializers.py index 37a8a150..d41616c2 100644 --- a/openedx_events/event_bus/avro/custom_serializers.py +++ b/openedx_events/event_bus/avro/custom_serializers.py @@ -5,6 +5,7 @@ from abc import ABC, abstractmethod from datetime import datetime +from ccx_keys.locator import CCXLocator from opaque_keys.edx.keys import CourseKey, UsageKey from opaque_keys.edx.locator import LibraryLocatorV2, LibraryUsageLocatorV2 @@ -49,6 +50,25 @@ def deserialize(data: str): return CourseKey.from_string(data) +class CcxCourseLocatorAvroSerializer(BaseCustomTypeAvroSerializer): + """ + CustomTypeAvroSerializer for CCXLocator class. + """ + + cls = CCXLocator + field_type = PYTHON_TYPE_TO_AVRO_MAPPING[str] + + @staticmethod + def serialize(obj) -> str: + """Serialize obj into string.""" + return str(obj) + + @staticmethod + def deserialize(data: str): + """Deserialize string into obj.""" + return CCXLocator.from_string(data) + + class DatetimeAvroSerializer(BaseCustomTypeAvroSerializer): """ CustomTypeAvroSerializer for datetime class. @@ -131,6 +151,7 @@ def deserialize(data: str): DEFAULT_CUSTOM_SERIALIZERS = [ CourseKeyAvroSerializer, + CcxCourseLocatorAvroSerializer, DatetimeAvroSerializer, LibraryLocatorV2AvroSerializer, LibraryUsageLocatorV2AvroSerializer, diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+awarded+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+awarded+v1_schema.avsc new file mode 100644 index 00000000..6bac2197 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+awarded+v1_schema.avsc @@ -0,0 +1,100 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "badge", + "type": { + "name": "BadgeData", + "type": "record", + "fields": [ + { + "name": "uuid", + "type": "string" + }, + { + "name": "user", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "template", + "type": { + "name": "BadgeTemplateData", + "type": "record", + "fields": [ + { + "name": "uuid", + "type": "string" + }, + { + "name": "origin", + "type": "string" + }, + { + "name": "name", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "description", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "image_url", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } + } + ] + } + } + ], + "namespace": "org.openedx.learning.badge.awarded.v1" +} \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+revoked+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+revoked+v1_schema.avsc new file mode 100644 index 00000000..0cb96323 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+badge+revoked+v1_schema.avsc @@ -0,0 +1,100 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "badge", + "type": { + "name": "BadgeData", + "type": "record", + "fields": [ + { + "name": "uuid", + "type": "string" + }, + { + "name": "user", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "template", + "type": { + "name": "BadgeTemplateData", + "type": "record", + "fields": [ + { + "name": "uuid", + "type": "string" + }, + { + "name": "origin", + "type": "string" + }, + { + "name": "name", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "description", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "image_url", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } + } + ] + } + } + ], + "namespace": "org.openedx.learning.badge.revoked.v1" +} \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc new file mode 100644 index 00000000..2f0056aa --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc @@ -0,0 +1,108 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "course_passing_status", + "type": { + "name": "CcxCoursePassingStatusData", + "type": "record", + "fields": [ + { + "name": "status", + "type": "string" + }, + { + "name": "user", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + }, + { + "name": "course", + "type": { + "name": "CcxCourseData", + "type": "record", + "fields": [ + { + "name": "ccx_course_key", + "type": "string" + }, + { + "name": "master_course_key", + "type": "string" + }, + { + "name": "display_name", + "type": "string" + }, + { + "name": "coach_email", + "type": "string" + }, + { + "name": "start", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "max_students_allowed", + "type": [ + "null", + "long" + ], + "default": null + } + ] + } + } + ] + } + } + ], + "namespace": "org.openedx.learning.ccx.course.passing.status.v1" +} \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc new file mode 100644 index 00000000..085c11c1 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc @@ -0,0 +1,92 @@ +{ + "name": "CloudEvent", + "type": "record", + "doc": "Avro Event Format for CloudEvents created with openedx_events/schema", + "fields": [ + { + "name": "course_passing_status", + "type": { + "name": "CoursePassingStatusData", + "type": "record", + "fields": [ + { + "name": "status", + "type": "string" + }, + { + "name": "course", + "type": { + "name": "CourseData", + "type": "record", + "fields": [ + { + "name": "course_key", + "type": "string" + }, + { + "name": "display_name", + "type": "string" + }, + { + "name": "start", + "type": [ + "null", + "string" + ], + "default": null + }, + { + "name": "end", + "type": [ + "null", + "string" + ], + "default": null + } + ] + } + }, + { + "name": "user", + "type": { + "name": "UserData", + "type": "record", + "fields": [ + { + "name": "id", + "type": "long" + }, + { + "name": "is_active", + "type": "boolean" + }, + { + "name": "pii", + "type": { + "name": "UserPersonalData", + "type": "record", + "fields": [ + { + "name": "username", + "type": "string" + }, + { + "name": "email", + "type": "string" + }, + { + "name": "name", + "type": "string" + } + ] + } + } + ] + } + } + ] + } + } + ], + "namespace": "org.openedx.learning.course.passing.status.v1" +} \ No newline at end of file diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 2aa03baf..9595dbf1 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -8,6 +8,8 @@ from typing import List, Optional import attr +from attr.validators import in_ +from ccx_keys.locator import CCXLocator from opaque_keys.edx.keys import CourseKey, UsageKey @@ -74,6 +76,30 @@ class CourseData: end = attr.ib(type=datetime, default=None) +@attr.s(frozen=True) +class CcxCourseData: + """ + Represents data for a CCX (Custom Courses for edX) course. + + Attributes: + ccx_course_key (CCXLocator): The unique identifier for the CCX course. + master_course_key (CourseKey): The unique identifier for the original course from which the CCX is derived. + display_name (str): The name of the CCX course as it should appear to users. + coach_email (str): The email address of the coach (instructor) for the CCX course. + start (str, optional): The start date of the CCX course. Defaults to None, indicating no specific start date. + end (str, optional): The end date of the CCX course. Defaults to None, indicating no specific end date. + max_students_allowed (int, optional): The maximum number of students that can enroll in the CCX course. Defaults to None, indicating no limit. + """ + + ccx_course_key = attr.ib(type=CCXLocator) + master_course_key = attr.ib(type=CourseKey) + display_name = attr.ib(type=str, factory=str) + coach_email = attr.ib(type=str, factory=str) + start = attr.ib(type=str, default=None) + end = attr.ib(type=str, default=None) + max_students_allowed = attr.ib(type=int, default=None) + + @attr.s(frozen=True) class CourseEnrollmentData: """ @@ -476,3 +502,73 @@ class ORASubmissionData: id = attr.ib(type=str) file_downloads = attr.ib(type=List[ORAFileDownloadsData], factory=list) + + +@attr.s(frozen=True) +class CoursePassingStatusData: + """ + Represents the event data when a user's grade is updated, indicates if current grade is enough for course passing. + + Attributes: + status (str): A string containing information about user's current course grade value in comparison to the grading policy threshold. + user (UserData): An instance of UserData containing information about the user whose grade was updated. + course (CourseData): An instance of CourseData containing details about the course in which the grade was updated. + """ + PASSING = 'passing' + FAILING = 'failing' + STATUSES = [PASSING, FAILING] + + status = attr.ib(type=str, validator=in_(STATUSES)) + course = attr.ib(type=CourseData) + user = attr.ib(type=UserData) + + +@attr.s(frozen=True) +class CcxCoursePassingStatusData(CoursePassingStatusData): + """ + Extends CoursePassingStatusData for CCX courses, specifying CCX course data. + + This class is used for events where a user's grade crosses a threshold specifically in a CCX course, + providing a custom course attribute suited for CCX course instances. + + Attributes: + course (CcxCourseData): An instance of CcxCourseData containing details about the CCX course in which the grade threshold was crossed. + All other attributes are inherited from CoursePassingStatusData. + """ + course = attr.ib(type=CcxCourseData) + + +@attr.s(frozen=True) +class BadgeTemplateData: + """ + Attributes defined for Open edX badge template data object. + + Arguments: + uuid (str): UUID of the badge template + origin (str): type of badge template + name (str): badge name + description (str): badge description + image_url (str): badge image url + """ + + uuid = attr.ib(type=str) + origin = attr.ib(type=str) + name = attr.ib(type=str, default=None) + description = attr.ib(type=str, default=None) + image_url = attr.ib(type=str, default=None) + + +@attr.s(frozen=True) +class BadgeData: + """ + Attributes defined for the Open edX badge data object. + + Arguments: + uuid (str): the UUID of the badge + user (UserData): user associated with the badge + template (BadgeTemplateData): badge template data + """ + + uuid = attr.ib(type=str) + user = attr.ib(type=UserData) + template = attr.ib(type=BadgeTemplateData) diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index 9459d891..dc563375 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -9,11 +9,14 @@ """ from openedx_events.learning.data import ( + BadgeData, + CcxCoursePassingStatusData, CertificateData, CohortData, CourseAccessRoleData, CourseDiscussionConfigurationData, CourseEnrollmentData, + CoursePassingStatusData, CourseNotificationData, DiscussionThreadData, ExamAttemptData, @@ -350,3 +353,51 @@ "submission": ORASubmissionData, }, ) + + +# .. event_type: org.openedx.learning.course.passing.status.updated.v1 +# .. event_name: COURSE_PASSING_STATUS_UPDATED +# .. event_description: Emitted when course grade updates. +# .. event_data: CoursePassingStatusData +COURSE_PASSING_STATUS_UPDATED = OpenEdxPublicSignal( + event_type="org.openedx.learning.course.passing.status.updated.v1", + data={ + "course_passing_status": CoursePassingStatusData, + } +) + + +# .. event_type: org.openedx.learning.ccx.course.passing.status.updated.v1 +# .. event_name: CCX_COURSE_PASSING_STATUS_UPDATED +# .. event_description: Emitted when a CCX course grade updates. +# .. event_data: CcxCoursePassingStatusData +CCX_COURSE_PASSING_STATUS_UPDATED = OpenEdxPublicSignal( + event_type="org.openedx.learning.ccx.course.passing.status.updated.v1", + data={ + "course_passing_status": CcxCoursePassingStatusData, + } +) + + +# .. event_type: org.openedx.learning.badge.awarded.v1 +# .. event_name: BADGE_AWARDED +# .. event_description: Emit when a badge is awarded to a learner +# .. event_data: BadgeData +BADGE_AWARDED = OpenEdxPublicSignal( + event_type="org.openedx.learning.badge.awarded.v1", + data={ + "badge": BadgeData, + } +) + + +# .. event_type: org.openedx.learning.badge.revoked.v1 +# .. event_name: BADGE_REVOKED +# .. event_description: Emit when a badge is revoked for a learner +# .. event_data: BadgeData +BADGE_REVOKED = OpenEdxPublicSignal( + event_type="org.openedx.learning.badge.revoked.v1", + data={ + "badge": BadgeData, + } +) \ No newline at end of file diff --git a/requirements/base.in b/requirements/base.in index 5afd59f7..3eb50114 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -6,3 +6,4 @@ django attrs fastavro edx-opaque-keys[django] +edx-ccx-keys \ No newline at end of file diff --git a/requirements/base.txt b/requirements/base.txt index b303fad1..c00093a8 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -4,6 +4,10 @@ # # make upgrade # +--index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ +--extra-index-url https://pypi.python.org/simple +--trusted-host edx.devstack.devpi + asgiref==3.8.1 # via django attrs==23.2.0 @@ -27,10 +31,14 @@ django-crum==0.7.9 # via edx-django-utils django-waffle==4.1.0 # via edx-django-utils +edx-ccx-keys==1.3.0 + # via -r requirements/base.in edx-django-utils==5.12.0 # via -r requirements/base.in edx-opaque-keys[django]==2.5.1 - # via -r requirements/base.in + # via + # -r requirements/base.in + # edx-ccx-keys fastavro==1.9.4 # via -r requirements/base.in newrelic==9.8.0 @@ -45,6 +53,8 @@ pymongo==3.13.0 # via edx-opaque-keys pynacl==1.5.0 # via edx-django-utils +six==1.16.0 + # via edx-ccx-keys sqlparse==0.5.0 # via django stevedore==5.2.0 diff --git a/requirements/ci.txt b/requirements/ci.txt index 641296fb..09583004 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -4,6 +4,10 @@ # # make upgrade # +--index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ +--extra-index-url https://pypi.python.org/simple +--trusted-host edx.devstack.devpi + cachetools==5.3.3 # via tox chardet==5.2.0 @@ -34,5 +38,5 @@ tomli==2.0.1 # tox tox==4.14.2 # via -r requirements/ci.in -virtualenv==20.25.1 +virtualenv==20.25.3 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index c72131bf..d04940c3 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -4,6 +4,10 @@ # # make upgrade # +--index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ +--extra-index-url https://pypi.python.org/simple +--trusted-host edx.devstack.devpi + asgiref==3.8.1 # via # -r requirements/quality.txt @@ -16,7 +20,7 @@ astroid==2.15.8 # pylint-celery attrs==23.2.0 # via -r requirements/quality.txt -backports-tarfile==1.0.0 +backports-tarfile==1.1.0 # via # -r requirements/quality.txt # jaraco-context @@ -111,12 +115,16 @@ docutils==0.20.1 # via # -r requirements/quality.txt # readme-renderer +edx-ccx-keys==1.3.0 + # via -r requirements/quality.txt edx-django-utils==5.12.0 # via -r requirements/quality.txt edx-lint==5.3.6 # via -r requirements/quality.txt edx-opaque-keys[django]==2.5.1 - # via -r requirements/quality.txt + # via + # -r requirements/quality.txt + # edx-ccx-keys exceptiongroup==1.2.0 # via # -r requirements/quality.txt @@ -344,6 +352,7 @@ secretstorage==3.3.3 six==1.16.0 # via # -r requirements/quality.txt + # edx-ccx-keys # edx-lint snowballstemmer==2.2.0 # via @@ -397,7 +406,7 @@ urllib3==2.2.1 # -r requirements/quality.txt # requests # twine -virtualenv==20.25.1 +virtualenv==20.25.3 # via # -r requirements/ci.txt # tox diff --git a/requirements/doc.txt b/requirements/doc.txt index 0072dcf4..3a3a0140 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -4,6 +4,10 @@ # # make upgrade # +--index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ +--extra-index-url https://pypi.python.org/simple +--trusted-host edx.devstack.devpi + accessible-pygments==0.0.4 # via pydata-sphinx-theme alabaster==0.7.13 @@ -18,7 +22,7 @@ babel==2.14.0 # via # pydata-sphinx-theme # sphinx -backports-tarfile==1.0.0 +backports-tarfile==1.1.0 # via jaraco-context backports-zoneinfo==0.2.1 ; python_version < "3.9" # via @@ -79,10 +83,14 @@ docutils==0.19 # readme-renderer # restructuredtext-lint # sphinx +edx-ccx-keys==1.3.0 + # via -r requirements/test.txt edx-django-utils==5.12.0 # via -r requirements/test.txt edx-opaque-keys[django]==2.5.1 - # via -r requirements/test.txt + # via + # -r requirements/test.txt + # edx-ccx-keys exceptiongroup==1.2.0 # via # -r requirements/test.txt @@ -225,7 +233,10 @@ rich==13.7.1 secretstorage==3.3.3 # via keyring six==1.16.0 - # via livereload + # via + # -r requirements/test.txt + # edx-ccx-keys + # livereload snowballstemmer==2.2.0 # via sphinx soupsieve==2.5 diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 8ea29a86..c452de56 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -4,6 +4,10 @@ # # make upgrade # +--index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ +--extra-index-url https://pypi.python.org/simple +--trusted-host edx.devstack.devpi + build==1.2.1 # via pip-tools click==8.1.7 diff --git a/requirements/pip.txt b/requirements/pip.txt index e3ffcc7b..6717a2f6 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -4,6 +4,10 @@ # # make upgrade # +--index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ +--extra-index-url https://pypi.python.org/simple +--trusted-host edx.devstack.devpi + wheel==0.43.0 # via -r requirements/pip.in diff --git a/requirements/quality.txt b/requirements/quality.txt index 31b4ecc2..f176963a 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -4,6 +4,10 @@ # # make upgrade # +--index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ +--extra-index-url https://pypi.python.org/simple +--trusted-host edx.devstack.devpi + asgiref==3.8.1 # via # -r requirements/test.txt @@ -15,7 +19,7 @@ astroid==2.15.8 # pylint-celery attrs==23.2.0 # via -r requirements/test.txt -backports-tarfile==1.0.0 +backports-tarfile==1.1.0 # via jaraco-context backports-zoneinfo==0.2.1 ; python_version < "3.9" # via @@ -71,12 +75,16 @@ django-waffle==4.1.0 # edx-django-utils docutils==0.20.1 # via readme-renderer +edx-ccx-keys==1.3.0 + # via -r requirements/test.txt edx-django-utils==5.12.0 # via -r requirements/test.txt edx-lint==5.3.6 # via -r requirements/quality.in edx-opaque-keys[django]==2.5.1 - # via -r requirements/test.txt + # via + # -r requirements/test.txt + # edx-ccx-keys exceptiongroup==1.2.0 # via # -r requirements/test.txt @@ -224,7 +232,10 @@ rich==13.7.1 secretstorage==3.3.3 # via keyring six==1.16.0 - # via edx-lint + # via + # -r requirements/test.txt + # edx-ccx-keys + # edx-lint snowballstemmer==2.2.0 # via pydocstyle sqlparse==0.5.0 diff --git a/requirements/test.txt b/requirements/test.txt index 09f0eedd..e8f92856 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -4,6 +4,10 @@ # # make upgrade # +--index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ +--extra-index-url https://pypi.python.org/simple +--trusted-host edx.devstack.devpi + asgiref==3.8.1 # via # -r requirements/base.txt @@ -44,10 +48,14 @@ django-waffle==4.1.0 # via # -r requirements/base.txt # edx-django-utils +edx-ccx-keys==1.3.0 + # via -r requirements/base.txt edx-django-utils==5.12.0 # via -r requirements/base.txt edx-opaque-keys[django]==2.5.1 - # via -r requirements/base.txt + # via + # -r requirements/base.txt + # edx-ccx-keys exceptiongroup==1.2.0 # via pytest fastavro==1.9.4 @@ -98,6 +106,10 @@ python-slugify==8.0.4 # via code-annotations pyyaml==6.0.1 # via code-annotations +six==1.16.0 + # via + # -r requirements/base.txt + # edx-ccx-keys sqlparse==0.5.0 # via # -r requirements/base.txt From 9d2a80d92cc2619f430e037fe65488e2ab8bbc4c Mon Sep 17 00:00:00 2001 From: andrii-hantkovskyi <131773947+andrii-hantkovskyi@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:16:19 +0300 Subject: [PATCH 11/27] fix: [ACI-152] fix ci failure (#12) * fix: [ACI-152] fix django tests failure * style: [ACI-152] adjust code style to pylint requirements --------- Co-authored-by: Andrii --- ...x+course+passing+status+updated+v1_schema.avsc} | 2 +- ...g+course+passing+status+updated+v1_schema.avsc} | 2 +- openedx_events/event_bus/avro/tests/test_avro.py | 4 +++- openedx_events/learning/data.py | 14 ++++++++++---- openedx_events/learning/signals.py | 4 ++-- 5 files changed, 17 insertions(+), 9 deletions(-) rename openedx_events/event_bus/avro/tests/schemas/{org+openedx+learning+ccx+course+passing+status+v1_schema.avsc => org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc} (97%) rename openedx_events/event_bus/avro/tests/schemas/{org+openedx+learning+course+passing+status+v1_schema.avsc => org+openedx+learning+course+passing+status+updated+v1_schema.avsc} (97%) diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc similarity index 97% rename from openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc rename to openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc index 2f0056aa..81bc1a2e 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc @@ -104,5 +104,5 @@ } } ], - "namespace": "org.openedx.learning.ccx.course.passing.status.v1" + "namespace": "org.openedx.learning.ccx.course.passing.status.updated.v1" } \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc similarity index 97% rename from openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc rename to openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc index 085c11c1..a20b821f 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc @@ -88,5 +88,5 @@ } } ], - "namespace": "org.openedx.learning.course.passing.status.v1" + "namespace": "org.openedx.learning.course.passing.status.updated.v1" } \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/test_avro.py b/openedx_events/event_bus/avro/tests/test_avro.py index bf2f1836..2596192f 100644 --- a/openedx_events/event_bus/avro/tests/test_avro.py +++ b/openedx_events/event_bus/avro/tests/test_avro.py @@ -5,6 +5,7 @@ from typing import List from unittest import TestCase +from ccx_keys.locator import CCXLocator from fastavro import schemaless_reader, schemaless_writer from fastavro.repository.base import SchemaRepositoryError from fastavro.schema import load_schema @@ -97,7 +98,7 @@ def generate_test_event_data_for_data_type(data_type): # pragma: no cover defaults_per_type = { int: 1, bool: True, - str: "default", + str: "passing", float: 1.0, CourseKey: CourseKey.from_string("course-v1:edX+DemoX.1+2014"), UsageKey: UsageKey.from_string( @@ -107,6 +108,7 @@ def generate_test_event_data_for_data_type(data_type): # pragma: no cover LibraryUsageLocatorV2: LibraryUsageLocatorV2.from_string('lb:MITx:reallyhardproblems:problem:problem1'), List[int]: [1, 2, 3], datetime: datetime.now(), + CCXLocator: CCXLocator(org='edx', course='DemoX', run='Demo_course', ccx='1'), } data_dict = {} for attribute in data_type.__attrs_attrs__: diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 9595dbf1..901dbffb 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -88,7 +88,8 @@ class CcxCourseData: coach_email (str): The email address of the coach (instructor) for the CCX course. start (str, optional): The start date of the CCX course. Defaults to None, indicating no specific start date. end (str, optional): The end date of the CCX course. Defaults to None, indicating no specific end date. - max_students_allowed (int, optional): The maximum number of students that can enroll in the CCX course. Defaults to None, indicating no limit. + max_students_allowed (int, optional): The maximum number of students that can enroll in the CCX course. + Defaults to None, indicating no limit. """ ccx_course_key = attr.ib(type=CCXLocator) @@ -510,10 +511,13 @@ class CoursePassingStatusData: Represents the event data when a user's grade is updated, indicates if current grade is enough for course passing. Attributes: - status (str): A string containing information about user's current course grade value in comparison to the grading policy threshold. + status (str): A string containing information about user's current course grade value + in comparison to the grading policy threshold. user (UserData): An instance of UserData containing information about the user whose grade was updated. - course (CourseData): An instance of CourseData containing details about the course in which the grade was updated. + course (CourseData): An instance of CourseData containing details about the course + in which the grade was updated. """ + PASSING = 'passing' FAILING = 'failing' STATUSES = [PASSING, FAILING] @@ -532,9 +536,11 @@ class CcxCoursePassingStatusData(CoursePassingStatusData): providing a custom course attribute suited for CCX course instances. Attributes: - course (CcxCourseData): An instance of CcxCourseData containing details about the CCX course in which the grade threshold was crossed. + course (CcxCourseData): An instance of CcxCourseData containing details about the CCX course + in which the grade threshold was crossed. All other attributes are inherited from CoursePassingStatusData. """ + course = attr.ib(type=CcxCourseData) diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index dc563375..d3970066 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -16,8 +16,8 @@ CourseAccessRoleData, CourseDiscussionConfigurationData, CourseEnrollmentData, - CoursePassingStatusData, CourseNotificationData, + CoursePassingStatusData, DiscussionThreadData, ExamAttemptData, ORASubmissionData, @@ -400,4 +400,4 @@ data={ "badge": BadgeData, } -) \ No newline at end of file +) From 960877cc4f34e085bffc5e80a3aa6bafaecbd4b6 Mon Sep 17 00:00:00 2001 From: andrii-hantkovskyi <131773947+andrii-hantkovskyi@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:16:19 +0300 Subject: [PATCH 12/27] fix: [ACI-152] fix ci failure (#12) * fix: [ACI-152] fix django tests failure * style: [ACI-152] adjust code style to pylint requirements --------- Co-authored-by: Andrii --- ...x+course+passing+status+updated+v1_schema.avsc} | 2 +- ...g+course+passing+status+updated+v1_schema.avsc} | 2 +- openedx_events/event_bus/avro/tests/test_avro.py | 4 +++- openedx_events/learning/data.py | 14 ++++++++++---- openedx_events/learning/signals.py | 4 ++-- 5 files changed, 17 insertions(+), 9 deletions(-) rename openedx_events/event_bus/avro/tests/schemas/{org+openedx+learning+ccx+course+passing+status+v1_schema.avsc => org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc} (97%) rename openedx_events/event_bus/avro/tests/schemas/{org+openedx+learning+course+passing+status+v1_schema.avsc => org+openedx+learning+course+passing+status+updated+v1_schema.avsc} (97%) diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc similarity index 97% rename from openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc rename to openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc index 2f0056aa..81bc1a2e 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc @@ -104,5 +104,5 @@ } } ], - "namespace": "org.openedx.learning.ccx.course.passing.status.v1" + "namespace": "org.openedx.learning.ccx.course.passing.status.updated.v1" } \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc similarity index 97% rename from openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc rename to openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc index 085c11c1..a20b821f 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc @@ -88,5 +88,5 @@ } } ], - "namespace": "org.openedx.learning.course.passing.status.v1" + "namespace": "org.openedx.learning.course.passing.status.updated.v1" } \ No newline at end of file diff --git a/openedx_events/event_bus/avro/tests/test_avro.py b/openedx_events/event_bus/avro/tests/test_avro.py index bf2f1836..2596192f 100644 --- a/openedx_events/event_bus/avro/tests/test_avro.py +++ b/openedx_events/event_bus/avro/tests/test_avro.py @@ -5,6 +5,7 @@ from typing import List from unittest import TestCase +from ccx_keys.locator import CCXLocator from fastavro import schemaless_reader, schemaless_writer from fastavro.repository.base import SchemaRepositoryError from fastavro.schema import load_schema @@ -97,7 +98,7 @@ def generate_test_event_data_for_data_type(data_type): # pragma: no cover defaults_per_type = { int: 1, bool: True, - str: "default", + str: "passing", float: 1.0, CourseKey: CourseKey.from_string("course-v1:edX+DemoX.1+2014"), UsageKey: UsageKey.from_string( @@ -107,6 +108,7 @@ def generate_test_event_data_for_data_type(data_type): # pragma: no cover LibraryUsageLocatorV2: LibraryUsageLocatorV2.from_string('lb:MITx:reallyhardproblems:problem:problem1'), List[int]: [1, 2, 3], datetime: datetime.now(), + CCXLocator: CCXLocator(org='edx', course='DemoX', run='Demo_course', ccx='1'), } data_dict = {} for attribute in data_type.__attrs_attrs__: diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 9595dbf1..901dbffb 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -88,7 +88,8 @@ class CcxCourseData: coach_email (str): The email address of the coach (instructor) for the CCX course. start (str, optional): The start date of the CCX course. Defaults to None, indicating no specific start date. end (str, optional): The end date of the CCX course. Defaults to None, indicating no specific end date. - max_students_allowed (int, optional): The maximum number of students that can enroll in the CCX course. Defaults to None, indicating no limit. + max_students_allowed (int, optional): The maximum number of students that can enroll in the CCX course. + Defaults to None, indicating no limit. """ ccx_course_key = attr.ib(type=CCXLocator) @@ -510,10 +511,13 @@ class CoursePassingStatusData: Represents the event data when a user's grade is updated, indicates if current grade is enough for course passing. Attributes: - status (str): A string containing information about user's current course grade value in comparison to the grading policy threshold. + status (str): A string containing information about user's current course grade value + in comparison to the grading policy threshold. user (UserData): An instance of UserData containing information about the user whose grade was updated. - course (CourseData): An instance of CourseData containing details about the course in which the grade was updated. + course (CourseData): An instance of CourseData containing details about the course + in which the grade was updated. """ + PASSING = 'passing' FAILING = 'failing' STATUSES = [PASSING, FAILING] @@ -532,9 +536,11 @@ class CcxCoursePassingStatusData(CoursePassingStatusData): providing a custom course attribute suited for CCX course instances. Attributes: - course (CcxCourseData): An instance of CcxCourseData containing details about the CCX course in which the grade threshold was crossed. + course (CcxCourseData): An instance of CcxCourseData containing details about the CCX course + in which the grade threshold was crossed. All other attributes are inherited from CoursePassingStatusData. """ + course = attr.ib(type=CcxCourseData) diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index 78025633..279ce3ad 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -16,8 +16,8 @@ CourseAccessRoleData, CourseDiscussionConfigurationData, CourseEnrollmentData, - CoursePassingStatusData, CourseNotificationData, + CoursePassingStatusData, DiscussionThreadData, ExamAttemptData, ORASubmissionData, @@ -414,4 +414,4 @@ data={ "badge": BadgeData, } -) \ No newline at end of file +) From 75a280a74f4f83ea1a0173872821b9cd59825277 Mon Sep 17 00:00:00 2001 From: wowkalucky Date: Fri, 19 Apr 2024 16:57:12 +0300 Subject: [PATCH 13/27] chore: upgrade dependencies --- requirements/base.txt | 16 +++------- requirements/ci.txt | 6 +--- requirements/dev.txt | 43 +++++--------------------- requirements/doc.txt | 62 +++++++++++++++++--------------------- requirements/pip-tools.txt | 2 -- requirements/pip.txt | 2 +- requirements/quality.txt | 34 +++++---------------- requirements/test.txt | 15 ++------- 8 files changed, 53 insertions(+), 127 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 743280a1..a9c68470 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -8,10 +8,6 @@ asgiref==3.8.1 # via django attrs==23.2.0 # via -r requirements/base.in -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # django cffi==1.16.0 # via pynacl click==8.1.7 @@ -27,9 +23,9 @@ django-crum==0.7.9 # via edx-django-utils django-waffle==4.1.0 # via edx-django-utils -edx-django-utils==5.12.0 +edx-ccx-keys==1.3.0 # via -r requirements/base.in -edx-ccx-keys==1.2.1 +edx-django-utils==5.12.0 # via -r requirements/base.in edx-opaque-keys[django]==2.5.1 # via @@ -37,7 +33,7 @@ edx-opaque-keys[django]==2.5.1 # edx-ccx-keys fastavro==1.9.4 # via -r requirements/base.in -newrelic==9.8.0 +newrelic==9.9.0 # via edx-django-utils pbr==6.0.0 # via stevedore @@ -51,13 +47,11 @@ pynacl==1.5.0 # via edx-django-utils six==1.16.0 # via edx-ccx-keys -sqlparse==0.4.4 +sqlparse==0.5.0 # via django stevedore==5.2.0 # via # edx-django-utils # edx-opaque-keys typing-extensions==4.11.0 - # via - # asgiref - # edx-opaque-keys + # via edx-opaque-keys diff --git a/requirements/ci.txt b/requirements/ci.txt index 202b59eb..3d87408a 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -28,11 +28,7 @@ pluggy==1.4.0 # via tox pyproject-api==1.6.1 # via tox -tomli==2.0.1 - # via - # pyproject-api - # tox tox==4.14.2 # via -r requirements/ci.in -virtualenv==20.25.1 +virtualenv==20.25.3 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 89288598..5a1abcad 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -16,15 +16,6 @@ astroid==2.15.8 # pylint-celery attrs==23.2.0 # via -r requirements/quality.txt -backports-tarfile==1.0.0 - # via - # -r requirements/quality.txt - # jaraco-context -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # -r requirements/quality.txt - # django build==1.2.1 # via # -r requirements/pip-tools.txt @@ -40,7 +31,6 @@ certifi==2024.2.2 cffi==1.16.0 # via # -r requirements/quality.txt - # cryptography # pynacl chardet==5.2.0 # via @@ -76,13 +66,9 @@ coverage[toml]==7.4.4 # via # -r requirements/quality.txt # pytest-cov -cryptography==42.0.5 - # via - # -r requirements/quality.txt - # secretstorage ddt==1.7.2 # via -r requirements/quality.txt -diff-cover==8.0.3 +diff-cover==9.0.0 # via -r requirements/dev.in dill==0.3.8 # via @@ -107,11 +93,11 @@ django-waffle==4.1.0 # via # -r requirements/quality.txt # edx-django-utils -docutils==0.20.1 +docutils==0.21.1 # via # -r requirements/quality.txt # readme-renderer -edx-ccx-keys==1.2.1 +edx-ccx-keys==1.3.0 # via -r requirements/quality.txt edx-django-utils==5.12.0 # via -r requirements/quality.txt @@ -128,7 +114,7 @@ filelock==3.13.4 # -r requirements/ci.txt # tox # virtualenv -idna==3.6 +idna==3.7 # via # -r requirements/quality.txt # requests @@ -137,10 +123,6 @@ importlib-metadata==6.11.0 # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/quality.txt # twine -importlib-resources==6.4.0 - # via - # -r requirements/quality.txt - # keyring iniconfig==2.0.0 # via # -r requirements/quality.txt @@ -157,15 +139,10 @@ jaraco-context==5.3.0 # via # -r requirements/quality.txt # keyring -jaraco-functools==4.0.0 - # via - # -r requirements/quality.txt - # keyring -jeepney==0.8.0 +jaraco-functools==4.0.1 # via # -r requirements/quality.txt # keyring - # secretstorage jinja2==3.1.3 # via # -r requirements/quality.txt @@ -200,7 +177,7 @@ more-itertools==10.2.0 # -r requirements/quality.txt # jaraco-classes # jaraco-functools -newrelic==9.8.0 +newrelic==9.9.0 # via # -r requirements/quality.txt # edx-django-utils @@ -334,10 +311,6 @@ rich==13.7.1 # via # -r requirements/quality.txt # twine -secretstorage==3.3.3 - # via - # -r requirements/quality.txt - # keyring six==1.16.0 # via # -r requirements/quality.txt @@ -347,7 +320,7 @@ snowballstemmer==2.2.0 # via # -r requirements/quality.txt # pydocstyle -sqlparse==0.4.4 +sqlparse==0.5.0 # via # -r requirements/quality.txt # django @@ -378,7 +351,7 @@ urllib3==2.2.1 # -r requirements/quality.txt # requests # twine -virtualenv==20.25.1 +virtualenv==20.25.3 # via # -r requirements/ci.txt # tox diff --git a/requirements/doc.txt b/requirements/doc.txt index 2493ab8d..b1d807ce 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -8,6 +8,10 @@ accessible-pygments==0.0.4 # via pydata-sphinx-theme alabaster==0.7.16 # via sphinx +anyio==4.3.0 + # via + # starlette + # watchfiles asgiref==3.8.1 # via # -r requirements/test.txt @@ -18,13 +22,6 @@ babel==2.14.0 # via # pydata-sphinx-theme # sphinx -backports-tarfile==1.0.0 - # via jaraco-context -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # -r requirements/test.txt - # django beautifulsoup4==4.12.3 # via pydata-sphinx-theme build==1.2.1 @@ -34,7 +31,6 @@ certifi==2024.2.2 cffi==1.16.0 # via # -r requirements/test.txt - # cryptography # pynacl charset-normalizer==3.3.2 # via requests @@ -43,6 +39,7 @@ click==8.1.7 # -r requirements/test.txt # code-annotations # edx-django-utils + # uvicorn code-annotations==1.7.0 # via -r requirements/test.txt colorama==0.4.6 @@ -51,8 +48,6 @@ coverage[toml]==7.4.4 # via # -r requirements/test.txt # pytest-cov -cryptography==42.0.5 - # via secretstorage ddt==1.7.2 # via -r requirements/test.txt django==4.2.11 @@ -79,7 +74,7 @@ docutils==0.20.1 # readme-renderer # restructuredtext-lint # sphinx -edx-ccx-keys==1.2.1 +edx-ccx-keys==1.3.0 # via -r requirements/test.txt edx-django-utils==5.12.0 # via -r requirements/test.txt @@ -89,16 +84,18 @@ edx-opaque-keys[django]==2.5.1 # edx-ccx-keys fastavro==1.9.4 # via -r requirements/test.txt -idna==3.6 - # via requests +h11==0.14.0 + # via uvicorn +idna==3.7 + # via + # anyio + # requests imagesize==1.4.1 # via sphinx importlib-metadata==6.11.0 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # twine -importlib-resources==6.4.0 - # via keyring iniconfig==2.0.0 # via # -r requirements/test.txt @@ -107,12 +104,8 @@ jaraco-classes==3.4.0 # via keyring jaraco-context==5.3.0 # via keyring -jaraco-functools==4.0.0 +jaraco-functools==4.0.1 # via keyring -jeepney==0.8.0 - # via - # keyring - # secretstorage jinja2==3.1.3 # via # -r requirements/test.txt @@ -120,8 +113,6 @@ jinja2==3.1.3 # sphinx keyring==25.1.0 # via twine -livereload==2.6.3 - # via sphinx-autobuild markdown-it-py==3.0.0 # via rich markupsafe==2.1.5 @@ -134,7 +125,7 @@ more-itertools==10.2.0 # via # jaraco-classes # jaraco-functools -newrelic==9.8.0 +newrelic==9.9.0 # via # -r requirements/test.txt # edx-django-utils @@ -217,18 +208,17 @@ rfc3986==2.0.0 # via twine rich==13.7.1 # via twine -secretstorage==3.3.3 - # via keyring six==1.16.0 # via # -r requirements/test.txt # edx-ccx-keys - # livereload +sniffio==1.3.1 + # via anyio snowballstemmer==2.2.0 # via sphinx soupsieve==2.5 # via beautifulsoup4 -sphinx==7.2.6 +sphinx==7.3.7 # via # -r requirements/doc.in # pydata-sphinx-theme @@ -236,7 +226,7 @@ sphinx==7.2.6 # sphinx-book-theme # sphinx-copybutton # sphinxcontrib-contentui -sphinx-autobuild==2024.2.4 +sphinx-autobuild==2024.4.16 # via -r requirements/doc.in sphinx-book-theme==1.1.2 # via -r requirements/doc.in @@ -258,10 +248,12 @@ sphinxcontrib-qthelp==1.0.7 # via sphinx sphinxcontrib-serializinghtml==1.1.10 # via sphinx -sqlparse==0.4.4 +sqlparse==0.5.0 # via # -r requirements/test.txt # django +starlette==0.37.2 + # via sphinx-autobuild stevedore==5.2.0 # via # -r requirements/test.txt @@ -273,8 +265,6 @@ text-unidecode==1.3 # via # -r requirements/test.txt # python-slugify -tornado==6.4 - # via livereload twine==5.0.0 # via -r requirements/doc.in typing-extensions==4.11.0 @@ -286,7 +276,11 @@ urllib3==2.2.1 # via # requests # twine +uvicorn==0.29.0 + # via sphinx-autobuild +watchfiles==0.21.0 + # via sphinx-autobuild +websockets==12.0 + # via sphinx-autobuild zipp==3.18.1 - # via - # importlib-metadata - # importlib-resources + # via importlib-metadata diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 18ca69b3..c139a398 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -18,8 +18,6 @@ pyproject-hooks==1.0.0 # pip-tools wheel==0.43.0 # via pip-tools -zipp==3.18.1 - # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/pip.txt b/requirements/pip.txt index 8d1b8fef..8ed3e673 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -10,5 +10,5 @@ wheel==0.43.0 # The following packages are considered to be unsafe in a requirements file: pip==24.0 # via -r requirements/pip.in -setuptools==69.2.0 +setuptools==69.5.1 # via -r requirements/pip.in diff --git a/requirements/quality.txt b/requirements/quality.txt index fca776ae..26574d7f 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -15,19 +15,11 @@ astroid==2.15.8 # pylint-celery attrs==23.2.0 # via -r requirements/test.txt -backports-tarfile==1.0.0 - # via jaraco-context -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # -r requirements/test.txt - # django certifi==2024.2.2 # via requests cffi==1.16.0 # via # -r requirements/test.txt - # cryptography # pynacl charset-normalizer==3.3.2 # via requests @@ -48,8 +40,6 @@ coverage[toml]==7.4.4 # via # -r requirements/test.txt # pytest-cov -cryptography==42.0.5 - # via secretstorage ddt==1.7.2 # via -r requirements/test.txt dill==0.3.8 @@ -69,9 +59,9 @@ django-waffle==4.1.0 # via # -r requirements/test.txt # edx-django-utils -docutils==0.20.1 +docutils==0.21.1 # via readme-renderer -edx-ccx-keys==1.2.1 +edx-ccx-keys==1.3.0 # via -r requirements/test.txt edx-django-utils==5.12.0 # via -r requirements/test.txt @@ -83,14 +73,12 @@ edx-opaque-keys[django]==2.5.1 # edx-ccx-keys fastavro==1.9.4 # via -r requirements/test.txt -idna==3.6 +idna==3.7 # via requests importlib-metadata==6.11.0 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # twine -importlib-resources==6.4.0 - # via keyring iniconfig==2.0.0 # via # -r requirements/test.txt @@ -103,12 +91,8 @@ jaraco-classes==3.4.0 # via keyring jaraco-context==5.3.0 # via keyring -jaraco-functools==4.0.0 +jaraco-functools==4.0.1 # via keyring -jeepney==0.8.0 - # via - # keyring - # secretstorage jinja2==3.1.3 # via # -r requirements/test.txt @@ -131,7 +115,7 @@ more-itertools==10.2.0 # via # jaraco-classes # jaraco-functools -newrelic==9.8.0 +newrelic==9.9.0 # via # -r requirements/test.txt # edx-django-utils @@ -220,8 +204,6 @@ rfc3986==2.0.0 # via twine rich==13.7.1 # via twine -secretstorage==3.3.3 - # via keyring six==1.16.0 # via # -r requirements/test.txt @@ -229,7 +211,7 @@ six==1.16.0 # edx-lint snowballstemmer==2.2.0 # via pydocstyle -sqlparse==0.4.4 +sqlparse==0.5.0 # via # -r requirements/test.txt # django @@ -258,6 +240,4 @@ urllib3==2.2.1 wrapt==1.16.0 # via astroid zipp==3.18.1 - # via - # importlib-metadata - # importlib-resources + # via importlib-metadata diff --git a/requirements/test.txt b/requirements/test.txt index 1d6e94f3..c6fc81b2 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -10,11 +10,6 @@ asgiref==3.8.1 # django attrs==23.2.0 # via -r requirements/base.txt -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # -r requirements/base.txt - # django cffi==1.16.0 # via # -r requirements/base.txt @@ -44,7 +39,7 @@ django-waffle==4.1.0 # via # -r requirements/base.txt # edx-django-utils -edx-ccx-keys==1.2.1 +edx-ccx-keys==1.3.0 # via -r requirements/base.txt edx-django-utils==5.12.0 # via -r requirements/base.txt @@ -60,7 +55,7 @@ jinja2==3.1.3 # via code-annotations markupsafe==2.1.5 # via jinja2 -newrelic==9.8.0 +newrelic==9.9.0 # via # -r requirements/base.txt # edx-django-utils @@ -104,7 +99,7 @@ six==1.16.0 # via # -r requirements/base.txt # edx-ccx-keys -sqlparse==0.4.4 +sqlparse==0.5.0 # via # -r requirements/base.txt # django @@ -116,10 +111,6 @@ stevedore==5.2.0 # edx-opaque-keys text-unidecode==1.3 # via python-slugify -tomli==2.0.1 - # via - # coverage - # pytest typing-extensions==4.11.0 # via # -r requirements/base.txt From a5bec1cd4122097d448a0ec1d342a5414145a9ea Mon Sep 17 00:00:00 2001 From: wowkalucky Date: Fri, 19 Apr 2024 17:06:49 +0300 Subject: [PATCH 14/27] fix: remove obsolete indexes --- requirements/base.txt | 16 ++---- requirements/ci.txt | 10 +--- requirements/dev.txt | 65 ++----------------------- requirements/doc.txt | 99 ++++++++++++++------------------------ requirements/pip-tools.txt | 17 +------ requirements/pip.txt | 6 +-- requirements/quality.txt | 49 ++----------------- requirements/test.txt | 20 +------- 8 files changed, 52 insertions(+), 230 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index c00093a8..a9c68470 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,21 +1,13 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # ---index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ ---extra-index-url https://pypi.python.org/simple ---trusted-host edx.devstack.devpi - asgiref==3.8.1 # via django attrs==23.2.0 # via -r requirements/base.in -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # django cffi==1.16.0 # via pynacl click==8.1.7 @@ -41,7 +33,7 @@ edx-opaque-keys[django]==2.5.1 # edx-ccx-keys fastavro==1.9.4 # via -r requirements/base.in -newrelic==9.8.0 +newrelic==9.9.0 # via edx-django-utils pbr==6.0.0 # via stevedore @@ -62,6 +54,4 @@ stevedore==5.2.0 # edx-django-utils # edx-opaque-keys typing-extensions==4.11.0 - # via - # asgiref - # edx-opaque-keys + # via edx-opaque-keys diff --git a/requirements/ci.txt b/requirements/ci.txt index 09583004..3d87408a 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,13 +1,9 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # ---index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ ---extra-index-url https://pypi.python.org/simple ---trusted-host edx.devstack.devpi - cachetools==5.3.3 # via tox chardet==5.2.0 @@ -32,10 +28,6 @@ pluggy==1.4.0 # via tox pyproject-api==1.6.1 # via tox -tomli==2.0.1 - # via - # pyproject-api - # tox tox==4.14.2 # via -r requirements/ci.in virtualenv==20.25.3 diff --git a/requirements/dev.txt b/requirements/dev.txt index d04940c3..5a1abcad 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,13 +1,9 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # ---index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ ---extra-index-url https://pypi.python.org/simple ---trusted-host edx.devstack.devpi - asgiref==3.8.1 # via # -r requirements/quality.txt @@ -20,15 +16,6 @@ astroid==2.15.8 # pylint-celery attrs==23.2.0 # via -r requirements/quality.txt -backports-tarfile==1.1.0 - # via - # -r requirements/quality.txt - # jaraco-context -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # -r requirements/quality.txt - # django build==1.2.1 # via # -r requirements/pip-tools.txt @@ -44,7 +31,6 @@ certifi==2024.2.2 cffi==1.16.0 # via # -r requirements/quality.txt - # cryptography # pynacl chardet==5.2.0 # via @@ -80,10 +66,6 @@ coverage[toml]==7.4.4 # via # -r requirements/quality.txt # pytest-cov -cryptography==42.0.5 - # via - # -r requirements/quality.txt - # secretstorage ddt==1.7.2 # via -r requirements/quality.txt diff-cover==9.0.0 @@ -111,7 +93,7 @@ django-waffle==4.1.0 # via # -r requirements/quality.txt # edx-django-utils -docutils==0.20.1 +docutils==0.21.1 # via # -r requirements/quality.txt # readme-renderer @@ -125,10 +107,6 @@ edx-opaque-keys[django]==2.5.1 # via # -r requirements/quality.txt # edx-ccx-keys -exceptiongroup==1.2.0 - # via - # -r requirements/quality.txt - # pytest fastavro==1.9.4 # via -r requirements/quality.txt filelock==3.13.4 @@ -143,15 +121,8 @@ idna==3.7 importlib-metadata==6.11.0 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt - # -r requirements/pip-tools.txt # -r requirements/quality.txt - # build - # keyring # twine -importlib-resources==6.4.0 - # via - # -r requirements/quality.txt - # keyring iniconfig==2.0.0 # via # -r requirements/quality.txt @@ -168,15 +139,10 @@ jaraco-context==5.3.0 # via # -r requirements/quality.txt # keyring -jaraco-functools==4.0.0 - # via - # -r requirements/quality.txt - # keyring -jeepney==0.8.0 +jaraco-functools==4.0.1 # via # -r requirements/quality.txt # keyring - # secretstorage jinja2==3.1.3 # via # -r requirements/quality.txt @@ -211,7 +177,7 @@ more-itertools==10.2.0 # -r requirements/quality.txt # jaraco-classes # jaraco-functools -newrelic==9.8.0 +newrelic==9.9.0 # via # -r requirements/quality.txt # edx-django-utils @@ -345,10 +311,6 @@ rich==13.7.1 # via # -r requirements/quality.txt # twine -secretstorage==3.3.3 - # via - # -r requirements/quality.txt - # keyring six==1.16.0 # via # -r requirements/quality.txt @@ -372,19 +334,6 @@ text-unidecode==1.3 # via # -r requirements/quality.txt # python-slugify -tomli==2.0.1 - # via - # -r requirements/ci.txt - # -r requirements/pip-tools.txt - # -r requirements/quality.txt - # build - # coverage - # pip-tools - # pylint - # pyproject-api - # pyproject-hooks - # pytest - # tox tomlkit==0.12.4 # via # -r requirements/quality.txt @@ -396,11 +345,7 @@ twine==5.0.0 typing-extensions==4.11.0 # via # -r requirements/quality.txt - # asgiref - # astroid # edx-opaque-keys - # pylint - # rich urllib3==2.2.1 # via # -r requirements/quality.txt @@ -420,10 +365,8 @@ wrapt==1.16.0 # astroid zipp==3.18.1 # via - # -r requirements/pip-tools.txt # -r requirements/quality.txt # importlib-metadata - # importlib-resources # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/doc.txt b/requirements/doc.txt index 3a3a0140..b1d807ce 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -1,17 +1,17 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # ---index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ ---extra-index-url https://pypi.python.org/simple ---trusted-host edx.devstack.devpi - accessible-pygments==0.0.4 # via pydata-sphinx-theme -alabaster==0.7.13 +alabaster==0.7.16 # via sphinx +anyio==4.3.0 + # via + # starlette + # watchfiles asgiref==3.8.1 # via # -r requirements/test.txt @@ -22,13 +22,6 @@ babel==2.14.0 # via # pydata-sphinx-theme # sphinx -backports-tarfile==1.1.0 - # via jaraco-context -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # -r requirements/test.txt - # django beautifulsoup4==4.12.3 # via pydata-sphinx-theme build==1.2.1 @@ -38,7 +31,6 @@ certifi==2024.2.2 cffi==1.16.0 # via # -r requirements/test.txt - # cryptography # pynacl charset-normalizer==3.3.2 # via requests @@ -47,6 +39,7 @@ click==8.1.7 # -r requirements/test.txt # code-annotations # edx-django-utils + # uvicorn code-annotations==1.7.0 # via -r requirements/test.txt colorama==0.4.6 @@ -55,8 +48,6 @@ coverage[toml]==7.4.4 # via # -r requirements/test.txt # pytest-cov -cryptography==42.0.5 - # via secretstorage ddt==1.7.2 # via -r requirements/test.txt django==4.2.11 @@ -76,7 +67,7 @@ django-waffle==4.1.0 # edx-django-utils doc8==1.1.1 # via -r requirements/doc.in -docutils==0.19 +docutils==0.20.1 # via # doc8 # pydata-sphinx-theme @@ -91,25 +82,20 @@ edx-opaque-keys[django]==2.5.1 # via # -r requirements/test.txt # edx-ccx-keys -exceptiongroup==1.2.0 - # via - # -r requirements/test.txt - # pytest fastavro==1.9.4 # via -r requirements/test.txt +h11==0.14.0 + # via uvicorn idna==3.7 - # via requests + # via + # anyio + # requests imagesize==1.4.1 # via sphinx importlib-metadata==6.11.0 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt - # build - # keyring - # sphinx # twine -importlib-resources==6.4.0 - # via keyring iniconfig==2.0.0 # via # -r requirements/test.txt @@ -118,12 +104,8 @@ jaraco-classes==3.4.0 # via keyring jaraco-context==5.3.0 # via keyring -jaraco-functools==4.0.0 +jaraco-functools==4.0.1 # via keyring -jeepney==0.8.0 - # via - # keyring - # secretstorage jinja2==3.1.3 # via # -r requirements/test.txt @@ -131,8 +113,6 @@ jinja2==3.1.3 # sphinx keyring==25.1.0 # via twine -livereload==2.6.3 - # via sphinx-autobuild markdown-it-py==3.0.0 # via rich markupsafe==2.1.5 @@ -145,7 +125,7 @@ more-itertools==10.2.0 # via # jaraco-classes # jaraco-functools -newrelic==9.8.0 +newrelic==9.9.0 # via # -r requirements/test.txt # edx-django-utils @@ -176,7 +156,7 @@ pycparser==2.22 # via # -r requirements/test.txt # cffi -pydata-sphinx-theme==0.14.4 +pydata-sphinx-theme==0.15.2 # via sphinx-book-theme pygments==2.17.2 # via @@ -209,8 +189,6 @@ python-slugify==8.0.4 # via # -r requirements/test.txt # code-annotations -pytz==2024.1 - # via babel pyyaml==6.0.1 # via # -r requirements/test.txt @@ -230,18 +208,17 @@ rfc3986==2.0.0 # via twine rich==13.7.1 # via twine -secretstorage==3.3.3 - # via keyring six==1.16.0 # via # -r requirements/test.txt # edx-ccx-keys - # livereload +sniffio==1.3.1 + # via anyio snowballstemmer==2.2.0 # via sphinx soupsieve==2.5 # via beautifulsoup4 -sphinx==6.2.1 +sphinx==7.3.7 # via # -r requirements/doc.in # pydata-sphinx-theme @@ -249,32 +226,34 @@ sphinx==6.2.1 # sphinx-book-theme # sphinx-copybutton # sphinxcontrib-contentui -sphinx-autobuild==2021.3.14 +sphinx-autobuild==2024.4.16 # via -r requirements/doc.in -sphinx-book-theme==1.0.1 +sphinx-book-theme==1.1.2 # via -r requirements/doc.in sphinx-copybutton==0.5.2 # via -r requirements/doc.in -sphinxcontrib-applehelp==1.0.4 +sphinxcontrib-applehelp==1.0.8 # via sphinx sphinxcontrib-contentui==0.2.5 # via -r requirements/doc.in -sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-devhelp==1.0.6 # via sphinx -sphinxcontrib-htmlhelp==2.0.1 +sphinxcontrib-htmlhelp==2.0.5 # via sphinx sphinxcontrib-jsmath==1.0.1 # via sphinx sphinxcontrib-mermaid==0.9.2 # via -r requirements/doc.in -sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-qthelp==1.0.7 # via sphinx -sphinxcontrib-serializinghtml==1.1.5 +sphinxcontrib-serializinghtml==1.1.10 # via sphinx sqlparse==0.5.0 # via # -r requirements/test.txt # django +starlette==0.37.2 + # via sphinx-autobuild stevedore==5.2.0 # via # -r requirements/test.txt @@ -286,30 +265,22 @@ text-unidecode==1.3 # via # -r requirements/test.txt # python-slugify -tomli==2.0.1 - # via - # -r requirements/test.txt - # build - # coverage - # doc8 - # pyproject-hooks - # pytest -tornado==6.4 - # via livereload twine==5.0.0 # via -r requirements/doc.in typing-extensions==4.11.0 # via # -r requirements/test.txt - # asgiref # edx-opaque-keys # pydata-sphinx-theme - # rich urllib3==2.2.1 # via # requests # twine +uvicorn==0.29.0 + # via sphinx-autobuild +watchfiles==0.21.0 + # via sphinx-autobuild +websockets==12.0 + # via sphinx-autobuild zipp==3.18.1 - # via - # importlib-metadata - # importlib-resources + # via importlib-metadata diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index c452de56..c139a398 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,21 +1,13 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # ---index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ ---extra-index-url https://pypi.python.org/simple ---trusted-host edx.devstack.devpi - build==1.2.1 # via pip-tools click==8.1.7 # via pip-tools -importlib-metadata==6.11.0 - # via - # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt - # build packaging==24.0 # via build pip-tools==7.4.1 @@ -24,15 +16,8 @@ pyproject-hooks==1.0.0 # via # build # pip-tools -tomli==2.0.1 - # via - # build - # pip-tools - # pyproject-hooks wheel==0.43.0 # via pip-tools -zipp==3.18.1 - # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/pip.txt b/requirements/pip.txt index 6717a2f6..8ed3e673 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,13 +1,9 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # ---index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ ---extra-index-url https://pypi.python.org/simple ---trusted-host edx.devstack.devpi - wheel==0.43.0 # via -r requirements/pip.in diff --git a/requirements/quality.txt b/requirements/quality.txt index f176963a..26574d7f 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -1,13 +1,9 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # ---index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ ---extra-index-url https://pypi.python.org/simple ---trusted-host edx.devstack.devpi - asgiref==3.8.1 # via # -r requirements/test.txt @@ -19,19 +15,11 @@ astroid==2.15.8 # pylint-celery attrs==23.2.0 # via -r requirements/test.txt -backports-tarfile==1.1.0 - # via jaraco-context -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # -r requirements/test.txt - # django certifi==2024.2.2 # via requests cffi==1.16.0 # via # -r requirements/test.txt - # cryptography # pynacl charset-normalizer==3.3.2 # via requests @@ -52,8 +40,6 @@ coverage[toml]==7.4.4 # via # -r requirements/test.txt # pytest-cov -cryptography==42.0.5 - # via secretstorage ddt==1.7.2 # via -r requirements/test.txt dill==0.3.8 @@ -73,7 +59,7 @@ django-waffle==4.1.0 # via # -r requirements/test.txt # edx-django-utils -docutils==0.20.1 +docutils==0.21.1 # via readme-renderer edx-ccx-keys==1.3.0 # via -r requirements/test.txt @@ -85,10 +71,6 @@ edx-opaque-keys[django]==2.5.1 # via # -r requirements/test.txt # edx-ccx-keys -exceptiongroup==1.2.0 - # via - # -r requirements/test.txt - # pytest fastavro==1.9.4 # via -r requirements/test.txt idna==3.7 @@ -96,10 +78,7 @@ idna==3.7 importlib-metadata==6.11.0 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt - # keyring # twine -importlib-resources==6.4.0 - # via keyring iniconfig==2.0.0 # via # -r requirements/test.txt @@ -112,12 +91,8 @@ jaraco-classes==3.4.0 # via keyring jaraco-context==5.3.0 # via keyring -jaraco-functools==4.0.0 +jaraco-functools==4.0.1 # via keyring -jeepney==0.8.0 - # via - # keyring - # secretstorage jinja2==3.1.3 # via # -r requirements/test.txt @@ -140,7 +115,7 @@ more-itertools==10.2.0 # via # jaraco-classes # jaraco-functools -newrelic==9.8.0 +newrelic==9.9.0 # via # -r requirements/test.txt # edx-django-utils @@ -229,8 +204,6 @@ rfc3986==2.0.0 # via twine rich==13.7.1 # via twine -secretstorage==3.3.3 - # via keyring six==1.16.0 # via # -r requirements/test.txt @@ -252,12 +225,6 @@ text-unidecode==1.3 # via # -r requirements/test.txt # python-slugify -tomli==2.0.1 - # via - # -r requirements/test.txt - # coverage - # pylint - # pytest tomlkit==0.12.4 # via pylint twine==5.0.0 @@ -265,11 +232,7 @@ twine==5.0.0 typing-extensions==4.11.0 # via # -r requirements/test.txt - # asgiref - # astroid # edx-opaque-keys - # pylint - # rich urllib3==2.2.1 # via # requests @@ -277,6 +240,4 @@ urllib3==2.2.1 wrapt==1.16.0 # via astroid zipp==3.18.1 - # via - # importlib-metadata - # importlib-resources + # via importlib-metadata diff --git a/requirements/test.txt b/requirements/test.txt index e8f92856..c6fc81b2 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,24 +1,15 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.12 # by the following command: # # make upgrade # ---index-url http://edx.devstack.devpi:3141/root/pypi/+simple/ ---extra-index-url https://pypi.python.org/simple ---trusted-host edx.devstack.devpi - asgiref==3.8.1 # via # -r requirements/base.txt # django attrs==23.2.0 # via -r requirements/base.txt -backports-zoneinfo==0.2.1 ; python_version < "3.9" - # via - # -c requirements/constraints.txt - # -r requirements/base.txt - # django cffi==1.16.0 # via # -r requirements/base.txt @@ -56,8 +47,6 @@ edx-opaque-keys[django]==2.5.1 # via # -r requirements/base.txt # edx-ccx-keys -exceptiongroup==1.2.0 - # via pytest fastavro==1.9.4 # via -r requirements/base.txt iniconfig==2.0.0 @@ -66,7 +55,7 @@ jinja2==3.1.3 # via code-annotations markupsafe==2.1.5 # via jinja2 -newrelic==9.8.0 +newrelic==9.9.0 # via # -r requirements/base.txt # edx-django-utils @@ -122,12 +111,7 @@ stevedore==5.2.0 # edx-opaque-keys text-unidecode==1.3 # via python-slugify -tomli==2.0.1 - # via - # coverage - # pytest typing-extensions==4.11.0 # via # -r requirements/base.txt - # asgiref # edx-opaque-keys From bd3ea585b3c10bc974c1dedecedbb5221b046663 Mon Sep 17 00:00:00 2001 From: wowkalucky Date: Tue, 23 Apr 2024 13:21:27 +0300 Subject: [PATCH 15/27] docs(ci): manually downgrade alabaster, so it can be found in the cache --- requirements/doc.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/doc.txt b/requirements/doc.txt index b1d807ce..ed823fff 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -6,7 +6,7 @@ # accessible-pygments==0.0.4 # via pydata-sphinx-theme -alabaster==0.7.16 +alabaster==0.7.13 # via sphinx anyio==4.3.0 # via From 201485cbb580c3f028d3f15dcbce5c663e24b9ac Mon Sep 17 00:00:00 2001 From: wowkalucky Date: Tue, 23 Apr 2024 13:28:55 +0300 Subject: [PATCH 16/27] chore: upgrade requirements --- requirements/base.txt | 2 +- requirements/ci.txt | 2 +- requirements/dev.txt | 4 ++-- requirements/doc.txt | 6 +++--- requirements/quality.txt | 4 ++-- requirements/test.txt | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index a9c68470..b99e2e88 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -27,7 +27,7 @@ edx-ccx-keys==1.3.0 # via -r requirements/base.in edx-django-utils==5.12.0 # via -r requirements/base.in -edx-opaque-keys[django]==2.5.1 +edx-opaque-keys[django]==2.8.0 # via # -r requirements/base.in # edx-ccx-keys diff --git a/requirements/ci.txt b/requirements/ci.txt index 3d87408a..1e89b426 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -24,7 +24,7 @@ platformdirs==4.2.0 # via # tox # virtualenv -pluggy==1.4.0 +pluggy==1.5.0 # via tox pyproject-api==1.6.1 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 5a1abcad..aeb2d6d5 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -103,7 +103,7 @@ edx-django-utils==5.12.0 # via -r requirements/quality.txt edx-lint==5.3.6 # via -r requirements/quality.txt -edx-opaque-keys[django]==2.5.1 +edx-opaque-keys[django]==2.8.0 # via # -r requirements/quality.txt # edx-ccx-keys @@ -211,7 +211,7 @@ platformdirs==4.2.0 # pylint # tox # virtualenv -pluggy==1.4.0 +pluggy==1.5.0 # via # -r requirements/ci.txt # -r requirements/quality.txt diff --git a/requirements/doc.txt b/requirements/doc.txt index ed823fff..2ed79c56 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -6,7 +6,7 @@ # accessible-pygments==0.0.4 # via pydata-sphinx-theme -alabaster==0.7.13 +alabaster==0.7.16 # via sphinx anyio==4.3.0 # via @@ -78,7 +78,7 @@ edx-ccx-keys==1.3.0 # via -r requirements/test.txt edx-django-utils==5.12.0 # via -r requirements/test.txt -edx-opaque-keys[django]==2.5.1 +edx-opaque-keys[django]==2.8.0 # via # -r requirements/test.txt # edx-ccx-keys @@ -144,7 +144,7 @@ pbr==6.0.0 # stevedore pkginfo==1.10.0 # via twine -pluggy==1.4.0 +pluggy==1.5.0 # via # -r requirements/test.txt # pytest diff --git a/requirements/quality.txt b/requirements/quality.txt index 26574d7f..b9f56018 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -67,7 +67,7 @@ edx-django-utils==5.12.0 # via -r requirements/test.txt edx-lint==5.3.6 # via -r requirements/quality.in -edx-opaque-keys[django]==2.5.1 +edx-opaque-keys[django]==2.8.0 # via # -r requirements/test.txt # edx-ccx-keys @@ -133,7 +133,7 @@ pkginfo==1.10.0 # via twine platformdirs==4.2.0 # via pylint -pluggy==1.4.0 +pluggy==1.5.0 # via # -r requirements/test.txt # pytest diff --git a/requirements/test.txt b/requirements/test.txt index c6fc81b2..69620ed6 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -43,7 +43,7 @@ edx-ccx-keys==1.3.0 # via -r requirements/base.txt edx-django-utils==5.12.0 # via -r requirements/base.txt -edx-opaque-keys[django]==2.5.1 +edx-opaque-keys[django]==2.8.0 # via # -r requirements/base.txt # edx-ccx-keys @@ -65,7 +65,7 @@ pbr==6.0.0 # via # -r requirements/base.txt # stevedore -pluggy==1.4.0 +pluggy==1.5.0 # via pytest psutil==5.9.8 # via From fbd4b993678b475d26c9201ac95db6f3d927841e Mon Sep 17 00:00:00 2001 From: Kyrylo Kholodenko Date: Wed, 24 Apr 2024 14:27:52 +0300 Subject: [PATCH 17/27] chore: upgrade requirements --- requirements/base.txt | 10 ++++- requirements/ci.txt | 10 +++-- requirements/dev.txt | 49 +++++++++++++++++++--- requirements/doc.txt | 84 +++++++++++++++++++++++--------------- requirements/pip-tools.txt | 13 +++++- requirements/pip.txt | 2 +- requirements/quality.txt | 36 +++++++++++++--- requirements/test.txt | 16 +++++++- 8 files changed, 167 insertions(+), 53 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index b99e2e88..8293f97e 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # make upgrade @@ -8,6 +8,10 @@ asgiref==3.8.1 # via django attrs==23.2.0 # via -r requirements/base.in +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # django cffi==1.16.0 # via pynacl click==8.1.7 @@ -54,4 +58,6 @@ stevedore==5.2.0 # edx-django-utils # edx-opaque-keys typing-extensions==4.11.0 - # via edx-opaque-keys + # via + # asgiref + # edx-opaque-keys diff --git a/requirements/ci.txt b/requirements/ci.txt index 1e89b426..b88bd342 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # make upgrade @@ -20,7 +20,7 @@ packaging==24.0 # via # pyproject-api # tox -platformdirs==4.2.0 +platformdirs==4.2.1 # via # tox # virtualenv @@ -28,7 +28,11 @@ pluggy==1.5.0 # via tox pyproject-api==1.6.1 # via tox +tomli==2.0.1 + # via + # pyproject-api + # tox tox==4.14.2 # via -r requirements/ci.in -virtualenv==20.25.3 +virtualenv==20.26.0 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index aeb2d6d5..3938e0cf 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # make upgrade @@ -16,6 +16,15 @@ astroid==2.15.8 # pylint-celery attrs==23.2.0 # via -r requirements/quality.txt +backports-tarfile==1.1.1 + # via + # -r requirements/quality.txt + # jaraco-context +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # -r requirements/quality.txt + # django build==1.2.1 # via # -r requirements/pip-tools.txt @@ -62,7 +71,7 @@ colorama==0.4.6 # via # -r requirements/ci.txt # tox -coverage[toml]==7.4.4 +coverage[toml]==7.5.0 # via # -r requirements/quality.txt # pytest-cov @@ -93,7 +102,7 @@ django-waffle==4.1.0 # via # -r requirements/quality.txt # edx-django-utils -docutils==0.21.1 +docutils==0.20.1 # via # -r requirements/quality.txt # readme-renderer @@ -107,6 +116,10 @@ edx-opaque-keys[django]==2.8.0 # via # -r requirements/quality.txt # edx-ccx-keys +exceptiongroup==1.2.1 + # via + # -r requirements/quality.txt + # pytest fastavro==1.9.4 # via -r requirements/quality.txt filelock==3.13.4 @@ -121,8 +134,15 @@ idna==3.7 importlib-metadata==6.11.0 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # -r requirements/pip-tools.txt # -r requirements/quality.txt + # build + # keyring # twine +importlib-resources==6.4.0 + # via + # -r requirements/quality.txt + # keyring iniconfig==2.0.0 # via # -r requirements/quality.txt @@ -204,7 +224,7 @@ pkginfo==1.10.0 # via # -r requirements/quality.txt # twine -platformdirs==4.2.0 +platformdirs==4.2.1 # via # -r requirements/ci.txt # -r requirements/quality.txt @@ -334,6 +354,19 @@ text-unidecode==1.3 # via # -r requirements/quality.txt # python-slugify +tomli==2.0.1 + # via + # -r requirements/ci.txt + # -r requirements/pip-tools.txt + # -r requirements/quality.txt + # build + # coverage + # pip-tools + # pylint + # pyproject-api + # pyproject-hooks + # pytest + # tox tomlkit==0.12.4 # via # -r requirements/quality.txt @@ -345,13 +378,17 @@ twine==5.0.0 typing-extensions==4.11.0 # via # -r requirements/quality.txt + # asgiref + # astroid # edx-opaque-keys + # pylint + # rich urllib3==2.2.1 # via # -r requirements/quality.txt # requests # twine -virtualenv==20.25.3 +virtualenv==20.26.0 # via # -r requirements/ci.txt # tox @@ -365,8 +402,10 @@ wrapt==1.16.0 # astroid zipp==3.18.1 # via + # -r requirements/pip-tools.txt # -r requirements/quality.txt # importlib-metadata + # importlib-resources # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/doc.txt b/requirements/doc.txt index 2ed79c56..506307dd 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -1,17 +1,13 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # make upgrade # accessible-pygments==0.0.4 # via pydata-sphinx-theme -alabaster==0.7.16 +alabaster==0.7.13 # via sphinx -anyio==4.3.0 - # via - # starlette - # watchfiles asgiref==3.8.1 # via # -r requirements/test.txt @@ -22,6 +18,13 @@ babel==2.14.0 # via # pydata-sphinx-theme # sphinx +backports-tarfile==1.1.1 + # via jaraco-context +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # -r requirements/test.txt + # django beautifulsoup4==4.12.3 # via pydata-sphinx-theme build==1.2.1 @@ -39,12 +42,11 @@ click==8.1.7 # -r requirements/test.txt # code-annotations # edx-django-utils - # uvicorn code-annotations==1.7.0 # via -r requirements/test.txt colorama==0.4.6 # via sphinx-autobuild -coverage[toml]==7.4.4 +coverage[toml]==7.5.0 # via # -r requirements/test.txt # pytest-cov @@ -67,7 +69,7 @@ django-waffle==4.1.0 # edx-django-utils doc8==1.1.1 # via -r requirements/doc.in -docutils==0.20.1 +docutils==0.19 # via # doc8 # pydata-sphinx-theme @@ -82,20 +84,25 @@ edx-opaque-keys[django]==2.8.0 # via # -r requirements/test.txt # edx-ccx-keys +exceptiongroup==1.2.1 + # via + # -r requirements/test.txt + # pytest fastavro==1.9.4 # via -r requirements/test.txt -h11==0.14.0 - # via uvicorn idna==3.7 - # via - # anyio - # requests + # via requests imagesize==1.4.1 # via sphinx importlib-metadata==6.11.0 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # build + # keyring + # sphinx # twine +importlib-resources==6.4.0 + # via keyring iniconfig==2.0.0 # via # -r requirements/test.txt @@ -113,6 +120,8 @@ jinja2==3.1.3 # sphinx keyring==25.1.0 # via twine +livereload==2.6.3 + # via sphinx-autobuild markdown-it-py==3.0.0 # via rich markupsafe==2.1.5 @@ -156,7 +165,7 @@ pycparser==2.22 # via # -r requirements/test.txt # cffi -pydata-sphinx-theme==0.15.2 +pydata-sphinx-theme==0.14.4 # via sphinx-book-theme pygments==2.17.2 # via @@ -189,6 +198,8 @@ python-slugify==8.0.4 # via # -r requirements/test.txt # code-annotations +pytz==2024.1 + # via babel pyyaml==6.0.1 # via # -r requirements/test.txt @@ -212,13 +223,12 @@ six==1.16.0 # via # -r requirements/test.txt # edx-ccx-keys -sniffio==1.3.1 - # via anyio + # livereload snowballstemmer==2.2.0 # via sphinx soupsieve==2.5 # via beautifulsoup4 -sphinx==7.3.7 +sphinx==6.2.1 # via # -r requirements/doc.in # pydata-sphinx-theme @@ -226,34 +236,32 @@ sphinx==7.3.7 # sphinx-book-theme # sphinx-copybutton # sphinxcontrib-contentui -sphinx-autobuild==2024.4.16 +sphinx-autobuild==2021.3.14 # via -r requirements/doc.in -sphinx-book-theme==1.1.2 +sphinx-book-theme==1.0.1 # via -r requirements/doc.in sphinx-copybutton==0.5.2 # via -r requirements/doc.in -sphinxcontrib-applehelp==1.0.8 +sphinxcontrib-applehelp==1.0.4 # via sphinx sphinxcontrib-contentui==0.2.5 # via -r requirements/doc.in -sphinxcontrib-devhelp==1.0.6 +sphinxcontrib-devhelp==1.0.2 # via sphinx -sphinxcontrib-htmlhelp==2.0.5 +sphinxcontrib-htmlhelp==2.0.1 # via sphinx sphinxcontrib-jsmath==1.0.1 # via sphinx sphinxcontrib-mermaid==0.9.2 # via -r requirements/doc.in -sphinxcontrib-qthelp==1.0.7 +sphinxcontrib-qthelp==1.0.3 # via sphinx -sphinxcontrib-serializinghtml==1.1.10 +sphinxcontrib-serializinghtml==1.1.5 # via sphinx sqlparse==0.5.0 # via # -r requirements/test.txt # django -starlette==0.37.2 - # via sphinx-autobuild stevedore==5.2.0 # via # -r requirements/test.txt @@ -265,22 +273,30 @@ text-unidecode==1.3 # via # -r requirements/test.txt # python-slugify +tomli==2.0.1 + # via + # -r requirements/test.txt + # build + # coverage + # doc8 + # pyproject-hooks + # pytest +tornado==6.4 + # via livereload twine==5.0.0 # via -r requirements/doc.in typing-extensions==4.11.0 # via # -r requirements/test.txt + # asgiref # edx-opaque-keys # pydata-sphinx-theme + # rich urllib3==2.2.1 # via # requests # twine -uvicorn==0.29.0 - # via sphinx-autobuild -watchfiles==0.21.0 - # via sphinx-autobuild -websockets==12.0 - # via sphinx-autobuild zipp==3.18.1 - # via importlib-metadata + # via + # importlib-metadata + # importlib-resources diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index c139a398..8ea29a86 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # make upgrade @@ -8,6 +8,10 @@ build==1.2.1 # via pip-tools click==8.1.7 # via pip-tools +importlib-metadata==6.11.0 + # via + # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # build packaging==24.0 # via build pip-tools==7.4.1 @@ -16,8 +20,15 @@ pyproject-hooks==1.0.0 # via # build # pip-tools +tomli==2.0.1 + # via + # build + # pip-tools + # pyproject-hooks wheel==0.43.0 # via pip-tools +zipp==3.18.1 + # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/requirements/pip.txt b/requirements/pip.txt index 8ed3e673..e3ffcc7b 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # make upgrade diff --git a/requirements/quality.txt b/requirements/quality.txt index b9f56018..0c202401 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # make upgrade @@ -15,6 +15,13 @@ astroid==2.15.8 # pylint-celery attrs==23.2.0 # via -r requirements/test.txt +backports-tarfile==1.1.1 + # via jaraco-context +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # -r requirements/test.txt + # django certifi==2024.2.2 # via requests cffi==1.16.0 @@ -36,7 +43,7 @@ code-annotations==1.7.0 # via # -r requirements/test.txt # edx-lint -coverage[toml]==7.4.4 +coverage[toml]==7.5.0 # via # -r requirements/test.txt # pytest-cov @@ -59,7 +66,7 @@ django-waffle==4.1.0 # via # -r requirements/test.txt # edx-django-utils -docutils==0.21.1 +docutils==0.20.1 # via readme-renderer edx-ccx-keys==1.3.0 # via -r requirements/test.txt @@ -71,6 +78,10 @@ edx-opaque-keys[django]==2.8.0 # via # -r requirements/test.txt # edx-ccx-keys +exceptiongroup==1.2.1 + # via + # -r requirements/test.txt + # pytest fastavro==1.9.4 # via -r requirements/test.txt idna==3.7 @@ -78,7 +89,10 @@ idna==3.7 importlib-metadata==6.11.0 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt + # keyring # twine +importlib-resources==6.4.0 + # via keyring iniconfig==2.0.0 # via # -r requirements/test.txt @@ -131,7 +145,7 @@ pbr==6.0.0 # stevedore pkginfo==1.10.0 # via twine -platformdirs==4.2.0 +platformdirs==4.2.1 # via pylint pluggy==1.5.0 # via @@ -225,6 +239,12 @@ text-unidecode==1.3 # via # -r requirements/test.txt # python-slugify +tomli==2.0.1 + # via + # -r requirements/test.txt + # coverage + # pylint + # pytest tomlkit==0.12.4 # via pylint twine==5.0.0 @@ -232,7 +252,11 @@ twine==5.0.0 typing-extensions==4.11.0 # via # -r requirements/test.txt + # asgiref + # astroid # edx-opaque-keys + # pylint + # rich urllib3==2.2.1 # via # requests @@ -240,4 +264,6 @@ urllib3==2.2.1 wrapt==1.16.0 # via astroid zipp==3.18.1 - # via importlib-metadata + # via + # importlib-metadata + # importlib-resources diff --git a/requirements/test.txt b/requirements/test.txt index 69620ed6..714d02bd 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.12 +# This file is autogenerated by pip-compile with Python 3.8 # by the following command: # # make upgrade @@ -10,6 +10,11 @@ asgiref==3.8.1 # django attrs==23.2.0 # via -r requirements/base.txt +backports-zoneinfo==0.2.1 ; python_version < "3.9" + # via + # -c requirements/constraints.txt + # -r requirements/base.txt + # django cffi==1.16.0 # via # -r requirements/base.txt @@ -21,7 +26,7 @@ click==8.1.7 # edx-django-utils code-annotations==1.7.0 # via -r requirements/test.in -coverage[toml]==7.4.4 +coverage[toml]==7.5.0 # via pytest-cov ddt==1.7.2 # via -r requirements/test.in @@ -47,6 +52,8 @@ edx-opaque-keys[django]==2.8.0 # via # -r requirements/base.txt # edx-ccx-keys +exceptiongroup==1.2.1 + # via pytest fastavro==1.9.4 # via -r requirements/base.txt iniconfig==2.0.0 @@ -111,7 +118,12 @@ stevedore==5.2.0 # edx-opaque-keys text-unidecode==1.3 # via python-slugify +tomli==2.0.1 + # via + # coverage + # pytest typing-extensions==4.11.0 # via # -r requirements/base.txt + # asgiref # edx-opaque-keys From 942e6363a480c09db1fb18818d976c8681267712 Mon Sep 17 00:00:00 2001 From: Kyrylo Kholodenko Date: Wed, 24 Apr 2024 14:40:03 +0300 Subject: [PATCH 18/27] fix: remove unnecessary lines --- openedx_events/learning/data.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 88efb0a9..0de3877b 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -513,8 +513,6 @@ class ORASubmissionData: answer (ORASubmissionAnswer): Answer submitted by the user in the ORA submission. """ - id = attr.ib(type=str) - file_downloads = attr.ib(type=List[ORAFileDownloadsData], factory=list) uuid = attr.ib(type=str) anonymous_user_id = attr.ib(type=str) location = attr.ib(type=str) From f7995b904c59f2302b0c5e1190fa2ca0d738d776 Mon Sep 17 00:00:00 2001 From: wowkalucky Date: Thu, 25 Apr 2024 17:28:02 +0300 Subject: [PATCH 19/27] fix: regenerate requirements --- requirements/base.txt | 14 +++++++++++--- requirements/ci.txt | 4 ++-- requirements/dev.txt | 37 ++++++++++++++++--------------------- requirements/doc.txt | 32 +++++++++++++++++--------------- requirements/quality.txt | 34 ++++++++++++++++++---------------- requirements/test.txt | 20 ++++++++++++++++---- 6 files changed, 80 insertions(+), 61 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 0aa7445d..622ce2c0 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -27,10 +27,16 @@ django-crum==0.7.9 # via edx-django-utils django-waffle==4.1.0 # via edx-django-utils -edx-django-utils==5.12.0 +dnspython==2.6.1 + # via pymongo +edx-ccx-keys==1.3.0 # via -r requirements/base.in -edx-opaque-keys[django]==2.5.1 +edx-django-utils==5.12.0 # via -r requirements/base.in +edx-opaque-keys[django]==2.9.0 + # via + # -r requirements/base.in + # edx-ccx-keys fastavro==1.9.4 # via -r requirements/base.in newrelic==9.9.0 @@ -41,10 +47,12 @@ psutil==5.9.8 # via edx-django-utils pycparser==2.22 # via cffi -pymongo==3.13.0 +pymongo==4.4.0 # via edx-opaque-keys pynacl==1.5.0 # via edx-django-utils +six==1.16.0 + # via edx-ccx-keys sqlparse==0.5.0 # via django stevedore==5.2.0 diff --git a/requirements/ci.txt b/requirements/ci.txt index 6f05147f..b88bd342 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -20,7 +20,7 @@ packaging==24.0 # via # pyproject-api # tox -platformdirs==4.2.0 +platformdirs==4.2.1 # via # tox # virtualenv @@ -34,5 +34,5 @@ tomli==2.0.1 # tox tox==4.14.2 # via -r requirements/ci.in -virtualenv==20.25.3 +virtualenv==20.26.0 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 79fd2be6..f3391e72 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -16,7 +16,7 @@ astroid==2.15.8 # pylint-celery attrs==23.2.0 # via -r requirements/quality.txt -backports-tarfile==1.1.0 +backports-tarfile==1.1.1 # via # -r requirements/quality.txt # jaraco-context @@ -40,7 +40,6 @@ certifi==2024.2.2 cffi==1.16.0 # via # -r requirements/quality.txt - # cryptography # pynacl chardet==5.2.0 # via @@ -72,14 +71,10 @@ colorama==0.4.6 # via # -r requirements/ci.txt # tox -coverage[toml]==7.4.4 +coverage[toml]==7.5.0 # via # -r requirements/quality.txt # pytest-cov -cryptography==42.0.5 - # via - # -r requirements/quality.txt - # secretstorage ddt==1.7.2 # via -r requirements/quality.txt diff-cover==9.0.0 @@ -107,16 +102,24 @@ django-waffle==4.1.0 # via # -r requirements/quality.txt # edx-django-utils +dnspython==2.6.1 + # via + # -r requirements/quality.txt + # pymongo docutils==0.20.1 # via # -r requirements/quality.txt # readme-renderer +edx-ccx-keys==1.3.0 + # via -r requirements/quality.txt edx-django-utils==5.12.0 # via -r requirements/quality.txt edx-lint==5.3.6 # via -r requirements/quality.txt -edx-opaque-keys[django]==2.5.1 - # via -r requirements/quality.txt +edx-opaque-keys[django]==2.9.0 + # via + # -r requirements/quality.txt + # edx-ccx-keys exceptiongroup==1.2.1 # via # -r requirements/quality.txt @@ -164,11 +167,6 @@ jaraco-functools==4.0.1 # via # -r requirements/quality.txt # keyring -jeepney==0.8.0 - # via - # -r requirements/quality.txt - # keyring - # secretstorage jinja2==3.1.3 # via # -r requirements/quality.txt @@ -230,7 +228,7 @@ pkginfo==1.10.0 # via # -r requirements/quality.txt # twine -platformdirs==4.2.0 +platformdirs==4.2.1 # via # -r requirements/ci.txt # -r requirements/quality.txt @@ -282,7 +280,7 @@ pylint-plugin-utils==0.8.2 # -r requirements/quality.txt # pylint-celery # pylint-django -pymongo==3.13.0 +pymongo==4.4.0 # via # -r requirements/quality.txt # edx-opaque-keys @@ -337,13 +335,10 @@ rich==13.7.1 # via # -r requirements/quality.txt # twine -secretstorage==3.3.3 - # via - # -r requirements/quality.txt - # keyring six==1.16.0 # via # -r requirements/quality.txt + # edx-ccx-keys # edx-lint snowballstemmer==2.2.0 # via @@ -397,7 +392,7 @@ urllib3==2.2.1 # -r requirements/quality.txt # requests # twine -virtualenv==20.25.3 +virtualenv==20.26.0 # via # -r requirements/ci.txt # tox diff --git a/requirements/doc.txt b/requirements/doc.txt index 3a01a5b5..c4f9ba2d 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -18,7 +18,7 @@ babel==2.14.0 # via # pydata-sphinx-theme # sphinx -backports-tarfile==1.1.0 +backports-tarfile==1.1.1 # via jaraco-context backports-zoneinfo==0.2.1 ; python_version < "3.9" # via @@ -34,7 +34,6 @@ certifi==2024.2.2 cffi==1.16.0 # via # -r requirements/test.txt - # cryptography # pynacl charset-normalizer==3.3.2 # via requests @@ -47,12 +46,10 @@ code-annotations==1.7.0 # via -r requirements/test.txt colorama==0.4.6 # via sphinx-autobuild -coverage[toml]==7.4.4 +coverage[toml]==7.5.0 # via # -r requirements/test.txt # pytest-cov -cryptography==42.0.5 - # via secretstorage ddt==1.7.2 # via -r requirements/test.txt django==4.2.11 @@ -70,6 +67,10 @@ django-waffle==4.1.0 # via # -r requirements/test.txt # edx-django-utils +dnspython==2.6.1 + # via + # -r requirements/test.txt + # pymongo doc8==1.1.1 # via -r requirements/doc.in docutils==0.19 @@ -79,10 +80,14 @@ docutils==0.19 # readme-renderer # restructuredtext-lint # sphinx -edx-django-utils==5.12.0 +edx-ccx-keys==1.3.0 # via -r requirements/test.txt -edx-opaque-keys[django]==2.5.1 +edx-django-utils==5.12.0 # via -r requirements/test.txt +edx-opaque-keys[django]==2.9.0 + # via + # -r requirements/test.txt + # edx-ccx-keys exceptiongroup==1.2.1 # via # -r requirements/test.txt @@ -112,10 +117,6 @@ jaraco-context==5.3.0 # via keyring jaraco-functools==4.0.1 # via keyring -jeepney==0.8.0 - # via - # keyring - # secretstorage jinja2==3.1.3 # via # -r requirements/test.txt @@ -178,7 +179,7 @@ pygments==2.17.2 # readme-renderer # rich # sphinx -pymongo==3.13.0 +pymongo==4.4.0 # via # -r requirements/test.txt # edx-opaque-keys @@ -222,10 +223,11 @@ rfc3986==2.0.0 # via twine rich==13.7.1 # via twine -secretstorage==3.3.3 - # via keyring six==1.16.0 - # via livereload + # via + # -r requirements/test.txt + # edx-ccx-keys + # livereload snowballstemmer==2.2.0 # via sphinx soupsieve==2.5 diff --git a/requirements/quality.txt b/requirements/quality.txt index c8c347e9..47cd6e50 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -15,7 +15,7 @@ astroid==2.15.8 # pylint-celery attrs==23.2.0 # via -r requirements/test.txt -backports-tarfile==1.1.0 +backports-tarfile==1.1.1 # via jaraco-context backports-zoneinfo==0.2.1 ; python_version < "3.9" # via @@ -27,7 +27,6 @@ certifi==2024.2.2 cffi==1.16.0 # via # -r requirements/test.txt - # cryptography # pynacl charset-normalizer==3.3.2 # via requests @@ -44,12 +43,10 @@ code-annotations==1.7.0 # via # -r requirements/test.txt # edx-lint -coverage[toml]==7.4.4 +coverage[toml]==7.5.0 # via # -r requirements/test.txt # pytest-cov -cryptography==42.0.5 - # via secretstorage ddt==1.7.2 # via -r requirements/test.txt dill==0.3.8 @@ -69,14 +66,22 @@ django-waffle==4.1.0 # via # -r requirements/test.txt # edx-django-utils +dnspython==2.6.1 + # via + # -r requirements/test.txt + # pymongo docutils==0.20.1 # via readme-renderer +edx-ccx-keys==1.3.0 + # via -r requirements/test.txt edx-django-utils==5.12.0 # via -r requirements/test.txt edx-lint==5.3.6 # via -r requirements/quality.in -edx-opaque-keys[django]==2.5.1 - # via -r requirements/test.txt +edx-opaque-keys[django]==2.9.0 + # via + # -r requirements/test.txt + # edx-ccx-keys exceptiongroup==1.2.1 # via # -r requirements/test.txt @@ -106,10 +111,6 @@ jaraco-context==5.3.0 # via keyring jaraco-functools==4.0.1 # via keyring -jeepney==0.8.0 - # via - # keyring - # secretstorage jinja2==3.1.3 # via # -r requirements/test.txt @@ -148,7 +149,7 @@ pbr==6.0.0 # stevedore pkginfo==1.10.0 # via twine -platformdirs==4.2.0 +platformdirs==4.2.1 # via pylint pluggy==1.5.0 # via @@ -184,7 +185,7 @@ pylint-plugin-utils==0.8.2 # via # pylint-celery # pylint-django -pymongo==3.13.0 +pymongo==4.4.0 # via # -r requirements/test.txt # edx-opaque-keys @@ -221,10 +222,11 @@ rfc3986==2.0.0 # via twine rich==13.7.1 # via twine -secretstorage==3.3.3 - # via keyring six==1.16.0 - # via edx-lint + # via + # -r requirements/test.txt + # edx-ccx-keys + # edx-lint snowballstemmer==2.2.0 # via pydocstyle sqlparse==0.5.0 diff --git a/requirements/test.txt b/requirements/test.txt index ff1da2fb..0dbee450 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -26,7 +26,7 @@ click==8.1.7 # edx-django-utils code-annotations==1.7.0 # via -r requirements/test.in -coverage[toml]==7.4.4 +coverage[toml]==7.5.0 # via pytest-cov ddt==1.7.2 # via -r requirements/test.in @@ -44,10 +44,18 @@ django-waffle==4.1.0 # via # -r requirements/base.txt # edx-django-utils -edx-django-utils==5.12.0 +dnspython==2.6.1 + # via + # -r requirements/base.txt + # pymongo +edx-ccx-keys==1.3.0 # via -r requirements/base.txt -edx-opaque-keys[django]==2.5.1 +edx-django-utils==5.12.0 # via -r requirements/base.txt +edx-opaque-keys[django]==2.9.0 + # via + # -r requirements/base.txt + # edx-ccx-keys exceptiongroup==1.2.1 # via pytest fastavro==1.9.4 @@ -78,7 +86,7 @@ pycparser==2.22 # via # -r requirements/base.txt # cffi -pymongo==3.13.0 +pymongo==4.4.0 # via # -r requirements/base.txt # edx-opaque-keys @@ -98,6 +106,10 @@ python-slugify==8.0.4 # via code-annotations pyyaml==6.0.1 # via code-annotations +six==1.16.0 + # via + # -r requirements/base.txt + # edx-ccx-keys sqlparse==0.5.0 # via # -r requirements/base.txt From 3dd4d3295da9f8d0b88895ae0541caa4f11bb417 Mon Sep 17 00:00:00 2001 From: andrii-hantkovskyi <131773947+andrii-hantkovskyi@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:53:15 +0300 Subject: [PATCH 20/27] test: [ACI-949] increase coverage & fix status field problem (#13) * test: [ACI-949] increase coverage & fix status field problem * refactor: [ACI-949] remove redundant comments --------- Co-authored-by: Andrii --- .../event_bus/avro/tests/test_avro.py | 2 +- .../avro/tests/test_custom_serializers.py | 21 +++++++++++++++++++ openedx_events/learning/data.py | 6 +----- 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 openedx_events/event_bus/avro/tests/test_custom_serializers.py diff --git a/openedx_events/event_bus/avro/tests/test_avro.py b/openedx_events/event_bus/avro/tests/test_avro.py index 2596192f..b42a39e8 100644 --- a/openedx_events/event_bus/avro/tests/test_avro.py +++ b/openedx_events/event_bus/avro/tests/test_avro.py @@ -98,7 +98,7 @@ def generate_test_event_data_for_data_type(data_type): # pragma: no cover defaults_per_type = { int: 1, bool: True, - str: "passing", + str: "default", float: 1.0, CourseKey: CourseKey.from_string("course-v1:edX+DemoX.1+2014"), UsageKey: UsageKey.from_string( diff --git a/openedx_events/event_bus/avro/tests/test_custom_serializers.py b/openedx_events/event_bus/avro/tests/test_custom_serializers.py new file mode 100644 index 00000000..e979a942 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/test_custom_serializers.py @@ -0,0 +1,21 @@ +from unittest import TestCase + +from ccx_keys.locator import CCXLocator + +from openedx_events.event_bus.avro.custom_serializers import ( + CcxCourseLocatorAvroSerializer, +) + + +class TestCCXLocatorSerailizer(TestCase): + def test_serialize(self): + obj1 = CCXLocator(org="edx", course="DemoX", run="Demo_course", ccx="1") + expected1 = "ccx-v1:edx+DemoX+Demo_course+ccx@1" + result1 = CcxCourseLocatorAvroSerializer.serialize(obj1) + self.assertEqual(result1, expected1) + + def test_deseialize(self): + data1 = "ccx-v1:edx+DemoX+Demo_course+ccx@1" + expected1 = CCXLocator(org="edx", course="DemoX", run="Demo_course", ccx="1") + result1 = CcxCourseLocatorAvroSerializer.deserialize(data1) + self.assertEqual(result1, expected1) diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 0de3877b..83a76a60 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -535,11 +535,7 @@ class CoursePassingStatusData: in which the grade was updated. """ - PASSING = 'passing' - FAILING = 'failing' - STATUSES = [PASSING, FAILING] - - status = attr.ib(type=str, validator=in_(STATUSES)) + status = attr.ib(type=str) course = attr.ib(type=CourseData) user = attr.ib(type=UserData) From f290a49db6fbd7f5ca77bd1fcc3eeb1433a1deb5 Mon Sep 17 00:00:00 2001 From: wowkalucky Date: Thu, 25 Apr 2024 17:55:42 +0300 Subject: [PATCH 21/27] chore: upgrade requirements --- requirements/base.txt | 6 ++++-- requirements/dev.txt | 8 ++++++-- requirements/doc.txt | 8 ++++++-- requirements/quality.txt | 8 ++++++-- requirements/test.txt | 8 ++++++-- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 8293f97e..622ce2c0 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -27,11 +27,13 @@ django-crum==0.7.9 # via edx-django-utils django-waffle==4.1.0 # via edx-django-utils +dnspython==2.6.1 + # via pymongo edx-ccx-keys==1.3.0 # via -r requirements/base.in edx-django-utils==5.12.0 # via -r requirements/base.in -edx-opaque-keys[django]==2.8.0 +edx-opaque-keys[django]==2.9.0 # via # -r requirements/base.in # edx-ccx-keys @@ -45,7 +47,7 @@ psutil==5.9.8 # via edx-django-utils pycparser==2.22 # via cffi -pymongo==3.13.0 +pymongo==4.4.0 # via edx-opaque-keys pynacl==1.5.0 # via edx-django-utils diff --git a/requirements/dev.txt b/requirements/dev.txt index 3938e0cf..f3391e72 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -102,6 +102,10 @@ django-waffle==4.1.0 # via # -r requirements/quality.txt # edx-django-utils +dnspython==2.6.1 + # via + # -r requirements/quality.txt + # pymongo docutils==0.20.1 # via # -r requirements/quality.txt @@ -112,7 +116,7 @@ edx-django-utils==5.12.0 # via -r requirements/quality.txt edx-lint==5.3.6 # via -r requirements/quality.txt -edx-opaque-keys[django]==2.8.0 +edx-opaque-keys[django]==2.9.0 # via # -r requirements/quality.txt # edx-ccx-keys @@ -276,7 +280,7 @@ pylint-plugin-utils==0.8.2 # -r requirements/quality.txt # pylint-celery # pylint-django -pymongo==3.13.0 +pymongo==4.4.0 # via # -r requirements/quality.txt # edx-opaque-keys diff --git a/requirements/doc.txt b/requirements/doc.txt index 506307dd..c4f9ba2d 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -67,6 +67,10 @@ django-waffle==4.1.0 # via # -r requirements/test.txt # edx-django-utils +dnspython==2.6.1 + # via + # -r requirements/test.txt + # pymongo doc8==1.1.1 # via -r requirements/doc.in docutils==0.19 @@ -80,7 +84,7 @@ edx-ccx-keys==1.3.0 # via -r requirements/test.txt edx-django-utils==5.12.0 # via -r requirements/test.txt -edx-opaque-keys[django]==2.8.0 +edx-opaque-keys[django]==2.9.0 # via # -r requirements/test.txt # edx-ccx-keys @@ -175,7 +179,7 @@ pygments==2.17.2 # readme-renderer # rich # sphinx -pymongo==3.13.0 +pymongo==4.4.0 # via # -r requirements/test.txt # edx-opaque-keys diff --git a/requirements/quality.txt b/requirements/quality.txt index 0c202401..47cd6e50 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -66,6 +66,10 @@ django-waffle==4.1.0 # via # -r requirements/test.txt # edx-django-utils +dnspython==2.6.1 + # via + # -r requirements/test.txt + # pymongo docutils==0.20.1 # via readme-renderer edx-ccx-keys==1.3.0 @@ -74,7 +78,7 @@ edx-django-utils==5.12.0 # via -r requirements/test.txt edx-lint==5.3.6 # via -r requirements/quality.in -edx-opaque-keys[django]==2.8.0 +edx-opaque-keys[django]==2.9.0 # via # -r requirements/test.txt # edx-ccx-keys @@ -181,7 +185,7 @@ pylint-plugin-utils==0.8.2 # via # pylint-celery # pylint-django -pymongo==3.13.0 +pymongo==4.4.0 # via # -r requirements/test.txt # edx-opaque-keys diff --git a/requirements/test.txt b/requirements/test.txt index 714d02bd..0dbee450 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -44,11 +44,15 @@ django-waffle==4.1.0 # via # -r requirements/base.txt # edx-django-utils +dnspython==2.6.1 + # via + # -r requirements/base.txt + # pymongo edx-ccx-keys==1.3.0 # via -r requirements/base.txt edx-django-utils==5.12.0 # via -r requirements/base.txt -edx-opaque-keys[django]==2.8.0 +edx-opaque-keys[django]==2.9.0 # via # -r requirements/base.txt # edx-ccx-keys @@ -82,7 +86,7 @@ pycparser==2.22 # via # -r requirements/base.txt # cffi -pymongo==3.13.0 +pymongo==4.4.0 # via # -r requirements/base.txt # edx-opaque-keys From 619289aad56329f27c7cdff9711239099fafaa96 Mon Sep 17 00:00:00 2001 From: andrii-hantkovskyi <131773947+andrii-hantkovskyi@users.noreply.github.com> Date: Thu, 25 Apr 2024 17:53:15 +0300 Subject: [PATCH 22/27] test: [ACI-949] increase coverage & fix status field problem (#13) * test: [ACI-949] increase coverage & fix status field problem * refactor: [ACI-949] remove redundant comments --------- Co-authored-by: Andrii --- .../event_bus/avro/tests/test_avro.py | 2 +- .../avro/tests/test_custom_serializers.py | 21 +++++++++++++++++++ openedx_events/learning/data.py | 6 +----- 3 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 openedx_events/event_bus/avro/tests/test_custom_serializers.py diff --git a/openedx_events/event_bus/avro/tests/test_avro.py b/openedx_events/event_bus/avro/tests/test_avro.py index 2596192f..b42a39e8 100644 --- a/openedx_events/event_bus/avro/tests/test_avro.py +++ b/openedx_events/event_bus/avro/tests/test_avro.py @@ -98,7 +98,7 @@ def generate_test_event_data_for_data_type(data_type): # pragma: no cover defaults_per_type = { int: 1, bool: True, - str: "passing", + str: "default", float: 1.0, CourseKey: CourseKey.from_string("course-v1:edX+DemoX.1+2014"), UsageKey: UsageKey.from_string( diff --git a/openedx_events/event_bus/avro/tests/test_custom_serializers.py b/openedx_events/event_bus/avro/tests/test_custom_serializers.py new file mode 100644 index 00000000..e979a942 --- /dev/null +++ b/openedx_events/event_bus/avro/tests/test_custom_serializers.py @@ -0,0 +1,21 @@ +from unittest import TestCase + +from ccx_keys.locator import CCXLocator + +from openedx_events.event_bus.avro.custom_serializers import ( + CcxCourseLocatorAvroSerializer, +) + + +class TestCCXLocatorSerailizer(TestCase): + def test_serialize(self): + obj1 = CCXLocator(org="edx", course="DemoX", run="Demo_course", ccx="1") + expected1 = "ccx-v1:edx+DemoX+Demo_course+ccx@1" + result1 = CcxCourseLocatorAvroSerializer.serialize(obj1) + self.assertEqual(result1, expected1) + + def test_deseialize(self): + data1 = "ccx-v1:edx+DemoX+Demo_course+ccx@1" + expected1 = CCXLocator(org="edx", course="DemoX", run="Demo_course", ccx="1") + result1 = CcxCourseLocatorAvroSerializer.deserialize(data1) + self.assertEqual(result1, expected1) diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 0de3877b..83a76a60 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -535,11 +535,7 @@ class CoursePassingStatusData: in which the grade was updated. """ - PASSING = 'passing' - FAILING = 'failing' - STATUSES = [PASSING, FAILING] - - status = attr.ib(type=str, validator=in_(STATUSES)) + status = attr.ib(type=str) course = attr.ib(type=CourseData) user = attr.ib(type=UserData) From dce606972b2f6303a47965721c1205bc5d176ee4 Mon Sep 17 00:00:00 2001 From: andrii-hantkovskyi <131773947+andrii-hantkovskyi@users.noreply.github.com> Date: Tue, 7 May 2024 20:17:08 +0300 Subject: [PATCH 23/27] refactor: [ACI-972] change course status to is_passing & add docs (#14) * chore: Updating Python Requirements (#343) * chore: Updating Python Requirements (#344) * refactor: [ACI-972] change course status to is_passing & add docs * chore: [ACI-972] requirements update * fix: remove local development index from requirements --------- Co-authored-by: edX requirements bot <49161187+edx-requirements-bot@users.noreply.github.com> Co-authored-by: Andrii Co-authored-by: wowkalucky --- ...urse+passing+status+updated+v1_schema.avsc | 4 ++-- ...urse+passing+status+updated+v1_schema.avsc | 4 ++-- .../avro/tests/test_custom_serializers.py | 10 +++++++++ openedx_events/learning/data.py | 5 ++--- requirements/base.txt | 2 +- requirements/ci.txt | 6 +++--- requirements/dev.txt | 21 +++++++++---------- requirements/doc.txt | 17 +++++++-------- requirements/pip-tools.txt | 3 +-- requirements/quality.txt | 12 +++++------ requirements/test.txt | 8 +++---- 11 files changed, 49 insertions(+), 43 deletions(-) diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc index 81bc1a2e..f538f2ef 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+ccx+course+passing+status+updated+v1_schema.avsc @@ -10,8 +10,8 @@ "type": "record", "fields": [ { - "name": "status", - "type": "string" + "name": "is_passing", + "type": "boolean" }, { "name": "user", diff --git a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc index a20b821f..89da6104 100644 --- a/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc +++ b/openedx_events/event_bus/avro/tests/schemas/org+openedx+learning+course+passing+status+updated+v1_schema.avsc @@ -10,8 +10,8 @@ "type": "record", "fields": [ { - "name": "status", - "type": "string" + "name": "is_passing", + "type": "boolean" }, { "name": "course", diff --git a/openedx_events/event_bus/avro/tests/test_custom_serializers.py b/openedx_events/event_bus/avro/tests/test_custom_serializers.py index e979a942..45be6cc2 100644 --- a/openedx_events/event_bus/avro/tests/test_custom_serializers.py +++ b/openedx_events/event_bus/avro/tests/test_custom_serializers.py @@ -8,13 +8,23 @@ class TestCCXLocatorSerailizer(TestCase): + """Test case for CCXLocator serializer.""" + def test_serialize(self): + """ + Test case for serializing CCXLocator object. + """ + obj1 = CCXLocator(org="edx", course="DemoX", run="Demo_course", ccx="1") expected1 = "ccx-v1:edx+DemoX+Demo_course+ccx@1" result1 = CcxCourseLocatorAvroSerializer.serialize(obj1) self.assertEqual(result1, expected1) def test_deseialize(self): + """ + Test case for deserializing CCXLocator object. + """ + data1 = "ccx-v1:edx+DemoX+Demo_course+ccx@1" expected1 = CCXLocator(org="edx", course="DemoX", run="Demo_course", ccx="1") result1 = CcxCourseLocatorAvroSerializer.deserialize(data1) diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 83a76a60..7f183102 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -528,14 +528,13 @@ class CoursePassingStatusData: Represents the event data when a user's grade is updated, indicates if current grade is enough for course passing. Attributes: - status (str): A string containing information about user's current course grade value - in comparison to the grading policy threshold. + is_passing (bool): Indicates whether the user's grade is enough to pass the course. user (UserData): An instance of UserData containing information about the user whose grade was updated. course (CourseData): An instance of CourseData containing details about the course in which the grade was updated. """ - status = attr.ib(type=str) + is_passing = attr.ib(type=bool) course = attr.ib(type=CourseData) user = attr.ib(type=UserData) diff --git a/requirements/base.txt b/requirements/base.txt index 622ce2c0..6f0e42db 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -31,7 +31,7 @@ dnspython==2.6.1 # via pymongo edx-ccx-keys==1.3.0 # via -r requirements/base.in -edx-django-utils==5.12.0 +edx-django-utils==5.13.0 # via -r requirements/base.in edx-opaque-keys[django]==2.9.0 # via diff --git a/requirements/ci.txt b/requirements/ci.txt index b88bd342..2877eac1 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -12,7 +12,7 @@ colorama==0.4.6 # via tox distlib==0.3.8 # via virtualenv -filelock==3.13.4 +filelock==3.14.0 # via # tox # virtualenv @@ -32,7 +32,7 @@ tomli==2.0.1 # via # pyproject-api # tox -tox==4.14.2 +tox==4.15.0 # via -r requirements/ci.in -virtualenv==20.26.0 +virtualenv==20.26.1 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index f3391e72..65580c7d 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -71,7 +71,7 @@ colorama==0.4.6 # via # -r requirements/ci.txt # tox -coverage[toml]==7.5.0 +coverage[toml]==7.5.1 # via # -r requirements/quality.txt # pytest-cov @@ -112,7 +112,7 @@ docutils==0.20.1 # readme-renderer edx-ccx-keys==1.3.0 # via -r requirements/quality.txt -edx-django-utils==5.12.0 +edx-django-utils==5.13.0 # via -r requirements/quality.txt edx-lint==5.3.6 # via -r requirements/quality.txt @@ -126,7 +126,7 @@ exceptiongroup==1.2.1 # pytest fastavro==1.9.4 # via -r requirements/quality.txt -filelock==3.13.4 +filelock==3.14.0 # via # -r requirements/ci.txt # tox @@ -167,12 +167,12 @@ jaraco-functools==4.0.1 # via # -r requirements/quality.txt # keyring -jinja2==3.1.3 +jinja2==3.1.4 # via # -r requirements/quality.txt # code-annotations # diff-cover -keyring==25.1.0 +keyring==25.2.0 # via # -r requirements/quality.txt # twine @@ -254,7 +254,7 @@ pycparser==2.22 # cffi pydocstyle==6.3.0 # via -r requirements/quality.txt -pygments==2.17.2 +pygments==2.18.0 # via # -r requirements/quality.txt # diff-cover @@ -292,12 +292,12 @@ pyproject-api==1.6.1 # via # -r requirements/ci.txt # tox -pyproject-hooks==1.0.0 +pyproject-hooks==1.1.0 # via # -r requirements/pip-tools.txt # build # pip-tools -pytest==8.1.1 +pytest==8.2.0 # via # -r requirements/quality.txt # pytest-cov @@ -368,14 +368,13 @@ tomli==2.0.1 # pip-tools # pylint # pyproject-api - # pyproject-hooks # pytest # tox tomlkit==0.12.4 # via # -r requirements/quality.txt # pylint -tox==4.14.2 +tox==4.15.0 # via -r requirements/ci.txt twine==5.0.0 # via -r requirements/quality.txt @@ -392,7 +391,7 @@ urllib3==2.2.1 # -r requirements/quality.txt # requests # twine -virtualenv==20.26.0 +virtualenv==20.26.1 # via # -r requirements/ci.txt # tox diff --git a/requirements/doc.txt b/requirements/doc.txt index c4f9ba2d..0ed2b5b4 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -14,7 +14,7 @@ asgiref==3.8.1 # django attrs==23.2.0 # via -r requirements/test.txt -babel==2.14.0 +babel==2.15.0 # via # pydata-sphinx-theme # sphinx @@ -46,7 +46,7 @@ code-annotations==1.7.0 # via -r requirements/test.txt colorama==0.4.6 # via sphinx-autobuild -coverage[toml]==7.5.0 +coverage[toml]==7.5.1 # via # -r requirements/test.txt # pytest-cov @@ -82,7 +82,7 @@ docutils==0.19 # sphinx edx-ccx-keys==1.3.0 # via -r requirements/test.txt -edx-django-utils==5.12.0 +edx-django-utils==5.13.0 # via -r requirements/test.txt edx-opaque-keys[django]==2.9.0 # via @@ -117,12 +117,12 @@ jaraco-context==5.3.0 # via keyring jaraco-functools==4.0.1 # via keyring -jinja2==3.1.3 +jinja2==3.1.4 # via # -r requirements/test.txt # code-annotations # sphinx -keyring==25.1.0 +keyring==25.2.0 # via twine livereload==2.6.3 # via sphinx-autobuild @@ -171,7 +171,7 @@ pycparser==2.22 # cffi pydata-sphinx-theme==0.14.4 # via sphinx-book-theme -pygments==2.17.2 +pygments==2.18.0 # via # accessible-pygments # doc8 @@ -187,9 +187,9 @@ pynacl==1.5.0 # via # -r requirements/test.txt # edx-django-utils -pyproject-hooks==1.0.0 +pyproject-hooks==1.1.0 # via build -pytest==8.1.1 +pytest==8.2.0 # via # -r requirements/test.txt # pytest-cov @@ -283,7 +283,6 @@ tomli==2.0.1 # build # coverage # doc8 - # pyproject-hooks # pytest tornado==6.4 # via livereload diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index 8ea29a86..adbe98b4 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -16,7 +16,7 @@ packaging==24.0 # via build pip-tools==7.4.1 # via -r requirements/pip-tools.in -pyproject-hooks==1.0.0 +pyproject-hooks==1.1.0 # via # build # pip-tools @@ -24,7 +24,6 @@ tomli==2.0.1 # via # build # pip-tools - # pyproject-hooks wheel==0.43.0 # via pip-tools zipp==3.18.1 diff --git a/requirements/quality.txt b/requirements/quality.txt index 47cd6e50..45431508 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -43,7 +43,7 @@ code-annotations==1.7.0 # via # -r requirements/test.txt # edx-lint -coverage[toml]==7.5.0 +coverage[toml]==7.5.1 # via # -r requirements/test.txt # pytest-cov @@ -74,7 +74,7 @@ docutils==0.20.1 # via readme-renderer edx-ccx-keys==1.3.0 # via -r requirements/test.txt -edx-django-utils==5.12.0 +edx-django-utils==5.13.0 # via -r requirements/test.txt edx-lint==5.3.6 # via -r requirements/quality.in @@ -111,11 +111,11 @@ jaraco-context==5.3.0 # via keyring jaraco-functools==4.0.1 # via keyring -jinja2==3.1.3 +jinja2==3.1.4 # via # -r requirements/test.txt # code-annotations -keyring==25.1.0 +keyring==25.2.0 # via twine lazy-object-proxy==1.10.0 # via astroid @@ -167,7 +167,7 @@ pycparser==2.22 # cffi pydocstyle==6.3.0 # via -r requirements/quality.in -pygments==2.17.2 +pygments==2.18.0 # via # readme-renderer # rich @@ -193,7 +193,7 @@ pynacl==1.5.0 # via # -r requirements/test.txt # edx-django-utils -pytest==8.1.1 +pytest==8.2.0 # via # -r requirements/test.txt # pytest-cov diff --git a/requirements/test.txt b/requirements/test.txt index 0dbee450..9b3eeee0 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -26,7 +26,7 @@ click==8.1.7 # edx-django-utils code-annotations==1.7.0 # via -r requirements/test.in -coverage[toml]==7.5.0 +coverage[toml]==7.5.1 # via pytest-cov ddt==1.7.2 # via -r requirements/test.in @@ -50,7 +50,7 @@ dnspython==2.6.1 # pymongo edx-ccx-keys==1.3.0 # via -r requirements/base.txt -edx-django-utils==5.12.0 +edx-django-utils==5.13.0 # via -r requirements/base.txt edx-opaque-keys[django]==2.9.0 # via @@ -62,7 +62,7 @@ fastavro==1.9.4 # via -r requirements/base.txt iniconfig==2.0.0 # via pytest -jinja2==3.1.3 +jinja2==3.1.4 # via code-annotations markupsafe==2.1.5 # via jinja2 @@ -94,7 +94,7 @@ pynacl==1.5.0 # via # -r requirements/base.txt # edx-django-utils -pytest==8.1.1 +pytest==8.2.0 # via # pytest-cov # pytest-django From 63f1dc95c302b102757b6acdcf87ed51ddceb612 Mon Sep 17 00:00:00 2001 From: wowkalucky Date: Tue, 7 May 2024 20:24:06 +0300 Subject: [PATCH 24/27] fix: remove obsolete changes --- openedx_events/learning/signals.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/openedx_events/learning/signals.py b/openedx_events/learning/signals.py index 279ce3ad..d3970066 100644 --- a/openedx_events/learning/signals.py +++ b/openedx_events/learning/signals.py @@ -355,20 +355,6 @@ ) -# .. event_type: org.openedx.learning.ora.submission.created.v1 -# .. event_name: ORA_SUBMISSION_CREATED -# .. event_description: Emitted when a new ORA submission is created -# .. event_data: ORASubmissionData -# Warning: This event is currently incompatible with the event bus, list/dict cannot be serialized yet -ORA_SUBMISSION_CREATED = OpenEdxPublicSignal( - event_type="org.openedx.learning.ora.submission.created.v1", - data={ - "submission": ORASubmissionData, - }, -) - - - # .. event_type: org.openedx.learning.course.passing.status.updated.v1 # .. event_name: COURSE_PASSING_STATUS_UPDATED # .. event_description: Emitted when course grade updates. From 02d715a7703c839fabc654e5a5aff6f88d6a176d Mon Sep 17 00:00:00 2001 From: wowkalucky Date: Tue, 7 May 2024 20:37:19 +0300 Subject: [PATCH 25/27] fix: merge upstream requirements --- requirements/base.txt | 6 +++--- requirements/dev.txt | 17 ++++++----------- requirements/doc.txt | 12 +++--------- requirements/quality.txt | 14 ++++++-------- requirements/test.txt | 4 ++-- 5 files changed, 20 insertions(+), 33 deletions(-) diff --git a/requirements/base.txt b/requirements/base.txt index 60841902..decac25d 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -16,7 +16,7 @@ cffi==1.16.0 # via pynacl click==8.1.7 # via edx-django-utils -django==4.2.11 +django==4.2.13 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/base.in @@ -29,9 +29,9 @@ django-waffle==4.1.0 # via edx-django-utils dnspython==2.6.1 # via pymongo -edx-django-utils==5.13.0 +edx-ccx-keys==1.3.0 # via -r requirements/base.in -edx-opaque-keys[django]==2.9.0 +edx-django-utils==5.13.0 # via -r requirements/base.in edx-opaque-keys[django]==2.9.0 # via diff --git a/requirements/dev.txt b/requirements/dev.txt index 53e46dd1..35095dde 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -75,10 +75,6 @@ coverage[toml]==7.5.1 # via # -r requirements/quality.txt # pytest-cov -cryptography==42.0.6 - # via - # -r requirements/quality.txt - # secretstorage ddt==1.7.2 # via -r requirements/quality.txt diff-cover==9.0.0 @@ -91,7 +87,7 @@ distlib==0.3.8 # via # -r requirements/ci.txt # virtualenv -django==4.2.11 +django==4.2.13 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/quality.txt @@ -114,12 +110,16 @@ docutils==0.20.1 # via # -r requirements/quality.txt # readme-renderer +edx-ccx-keys==1.3.0 + # via -r requirements/quality.txt edx-django-utils==5.13.0 # via -r requirements/quality.txt edx-lint==5.3.6 # via -r requirements/quality.txt edx-opaque-keys[django]==2.9.0 - # via -r requirements/quality.txt + # via + # -r requirements/quality.txt + # edx-ccx-keys exceptiongroup==1.2.1 # via # -r requirements/quality.txt @@ -167,11 +167,6 @@ jaraco-functools==4.0.1 # via # -r requirements/quality.txt # keyring -jeepney==0.8.0 - # via - # -r requirements/quality.txt - # keyring - # secretstorage jinja2==3.1.4 # via # -r requirements/quality.txt diff --git a/requirements/doc.txt b/requirements/doc.txt index 2dbb1825..405d3d03 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -50,11 +50,9 @@ coverage[toml]==7.5.1 # via # -r requirements/test.txt # pytest-cov -cryptography==42.0.6 - # via secretstorage ddt==1.7.2 # via -r requirements/test.txt -django==4.2.11 +django==4.2.13 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/test.txt @@ -82,9 +80,9 @@ docutils==0.19 # readme-renderer # restructuredtext-lint # sphinx -edx-django-utils==5.13.0 +edx-ccx-keys==1.3.0 # via -r requirements/test.txt -edx-opaque-keys[django]==2.9.0 +edx-django-utils==5.13.0 # via -r requirements/test.txt edx-opaque-keys[django]==2.9.0 # via @@ -119,10 +117,6 @@ jaraco-context==5.3.0 # via keyring jaraco-functools==4.0.1 # via keyring -jeepney==0.8.0 - # via - # keyring - # secretstorage jinja2==3.1.4 # via # -r requirements/test.txt diff --git a/requirements/quality.txt b/requirements/quality.txt index 29ebdcdd..7c841d18 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -47,13 +47,11 @@ coverage[toml]==7.5.1 # via # -r requirements/test.txt # pytest-cov -cryptography==42.0.6 - # via secretstorage ddt==1.7.2 # via -r requirements/test.txt dill==0.3.8 # via pylint -django==4.2.11 +django==4.2.13 # via # -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/test.txt @@ -74,12 +72,16 @@ dnspython==2.6.1 # pymongo docutils==0.20.1 # via readme-renderer +edx-ccx-keys==1.3.0 + # via -r requirements/test.txt edx-django-utils==5.13.0 # via -r requirements/test.txt edx-lint==5.3.6 # via -r requirements/quality.in edx-opaque-keys[django]==2.9.0 - # via -r requirements/test.txt + # via + # -r requirements/test.txt + # edx-ccx-keys exceptiongroup==1.2.1 # via # -r requirements/test.txt @@ -109,10 +111,6 @@ jaraco-context==5.3.0 # via keyring jaraco-functools==4.0.1 # via keyring -jeepney==0.8.0 - # via - # keyring - # secretstorage jinja2==3.1.4 # via # -r requirements/test.txt diff --git a/requirements/test.txt b/requirements/test.txt index c3e366ae..9b3eeee0 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -48,9 +48,9 @@ dnspython==2.6.1 # via # -r requirements/base.txt # pymongo -edx-django-utils==5.13.0 +edx-ccx-keys==1.3.0 # via -r requirements/base.txt -edx-opaque-keys[django]==2.9.0 +edx-django-utils==5.13.0 # via -r requirements/base.txt edx-opaque-keys[django]==2.9.0 # via From 1068d0ab822586d693a908b51d7e518bafd779d7 Mon Sep 17 00:00:00 2001 From: wowkalucky Date: Tue, 7 May 2024 20:45:04 +0300 Subject: [PATCH 26/27] style: quality checks --- .../event_bus/avro/tests/test_custom_serializers.py | 5 ++--- openedx_events/learning/data.py | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/openedx_events/event_bus/avro/tests/test_custom_serializers.py b/openedx_events/event_bus/avro/tests/test_custom_serializers.py index 45be6cc2..ab852fc0 100644 --- a/openedx_events/event_bus/avro/tests/test_custom_serializers.py +++ b/openedx_events/event_bus/avro/tests/test_custom_serializers.py @@ -1,10 +1,9 @@ +"""Test custom servializers""" from unittest import TestCase from ccx_keys.locator import CCXLocator -from openedx_events.event_bus.avro.custom_serializers import ( - CcxCourseLocatorAvroSerializer, -) +from openedx_events.event_bus.avro.custom_serializers import CcxCourseLocatorAvroSerializer class TestCCXLocatorSerailizer(TestCase): diff --git a/openedx_events/learning/data.py b/openedx_events/learning/data.py index 7f183102..ba22df9a 100644 --- a/openedx_events/learning/data.py +++ b/openedx_events/learning/data.py @@ -8,7 +8,6 @@ from typing import List, Optional import attr -from attr.validators import in_ from ccx_keys.locator import CCXLocator from opaque_keys.edx.keys import CourseKey, UsageKey From bc2c855b36d7f5617aea26792747d58d57418995 Mon Sep 17 00:00:00 2001 From: wowkalucky Date: Wed, 8 May 2024 12:00:07 +0300 Subject: [PATCH 27/27] style: add missing end of line --- requirements/base.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/base.in b/requirements/base.in index 3eb50114..5d6be5bc 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -6,4 +6,4 @@ django attrs fastavro edx-opaque-keys[django] -edx-ccx-keys \ No newline at end of file +edx-ccx-keys