Skip to content

Commit

Permalink
refactor: [ACI-972] change course status to is_passing & add docs (#14)
Browse files Browse the repository at this point in the history
* chore: Updating Python Requirements (openedx#343)

* chore: Updating Python Requirements (openedx#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 <[email protected]>
Co-authored-by: Andrii <[email protected]>
Co-authored-by: wowkalucky <[email protected]>
  • Loading branch information
4 people authored May 7, 2024
1 parent 619289a commit dce6069
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"type": "record",
"fields": [
{
"name": "status",
"type": "string"
"name": "is_passing",
"type": "boolean"
},
{
"name": "user",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"type": "record",
"fields": [
{
"name": "status",
"type": "string"
"name": "is_passing",
"type": "boolean"
},
{
"name": "course",
Expand Down
10 changes: 10 additions & 0 deletions openedx_events/event_bus/avro/tests/test_custom_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions openedx_events/learning/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
21 changes: 10 additions & 11 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
17 changes: 8 additions & 9 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -283,7 +283,6 @@ tomli==2.0.1
# build
# coverage
# doc8
# pyproject-hooks
# pytest
tornado==6.4
# via livereload
Expand Down
3 changes: 1 addition & 2 deletions requirements/pip-tools.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,14 @@ 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
tomli==2.0.1
# via
# build
# pip-tools
# pyproject-hooks
wheel==0.43.0
# via pip-tools
zipp==3.18.1
Expand Down
12 changes: 6 additions & 6 deletions requirements/quality.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dce6069

Please sign in to comment.