Skip to content

Commit

Permalink
fix: support to Sumac
Browse files Browse the repository at this point in the history
- Add missing test requirements
- Fix unit tests
- Add backends to import from the Open edX platform
- Upgrade requirements
- Fix configuration
  • Loading branch information
magajh committed Jan 19, 2025
1 parent f1cbe8e commit 3b3dbac
Show file tree
Hide file tree
Showing 40 changed files with 1,118 additions and 421 deletions.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,12 @@ symlink_translations:
if [ ! -d "$(TRANSLATIONS_DIR)" ]; then ln -s locale/ $(TRANSLATIONS_DIR); fi

test-python: clean ## Run test suite.
$(TOX) pip install -r requirements/test.txt --exists-action w
$(TOX) coverage run --source="." -m pytest ./webhook_xblock --ignore-glob='**/integration/*'
$(TOX) coverage report -m --fail-under=71
$(TOX) pip install -r requirements/dev.txt --exists-action w
$(TOX) coverage run --source="." -m pytest ./webhook_xblock

quality: clean ## Run quality test.
$(TOX) pycodestyle ./webhook_xblock
$(TOX) pylint ./webhook_xblock --rcfile=./setup.cfg
$(TOX) isort --check-only --diff ./webhook_xblock --skip ./webhook_xblock/migrations

run-tests: test-python quality
run-tests: test-python quality
28 changes: 22 additions & 6 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
#!/usr/bin/env python
"""
Django administration utility.
"""

import os
import sys

from django.core.management import execute_from_command_line
PWD = os.path.abspath(os.path.dirname(__file__))

if __name__ == "__main__":
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE",
"webhook_xblock.settings.test"
)

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webhook_xblock.settings.test")
sys.path.append(PWD)
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django # pylint: disable=unused-import
except ImportError as import_error:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from import_error
raise
execute_from_command_line(sys.argv)
1 change: 0 additions & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@

XBlock
xblock-utils

14 changes: 8 additions & 6 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ appdirs==1.4.4
# via fs
asgiref==3.8.1
# via django
boto3==1.35.89
boto3==1.36.2
# via fs-s3fs
botocore==1.35.89
botocore==1.36.2
# via
# boto3
# s3transfer
django==4.2.17
django==4.2.18
# via
# -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt
# openedx-django-pyfs
Expand Down Expand Up @@ -51,7 +51,7 @@ pytz==2024.2
# via xblock
pyyaml==6.0.2
# via xblock
s3transfer==0.10.4
s3transfer==0.11.1
# via boto3
simplejson==3.19.3
# via
Expand All @@ -64,8 +64,10 @@ six==1.17.0
# python-dateutil
sqlparse==0.5.3
# via django
urllib3==2.3.0
# via botocore
urllib3==2.2.3
# via
# -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt
# botocore
web-fragments==2.2.0
# via
# xblock
Expand Down
8 changes: 5 additions & 3 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ requests==2.32.3
# via codecov
tox==4.23.2
# via -r requirements/ci.in
urllib3==2.3.0
# via requests
virtualenv==20.28.0
urllib3==2.2.3
# via
# -c https://raw.githubusercontent.com/openedx/edx-lint/master/edx_lint/files/common_constraints.txt
# requests
virtualenv==20.29.1
# via tox
2 changes: 1 addition & 1 deletion requirements/dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
-r pip-tools.txt # pip-tools and its dependencies, for managing requirements files
-r quality.txt # Core and quality check dependencies
-r ci.txt # dependencies needed to setup testing environment on CI
-r test.txt # Core dependencies for this package

diff-cover # Changeset diff test coverage
tox-battery # Makes tox aware of requirements file changes
django-statici18n
edx-i18n-tools
Mako
transifex-client

Loading

0 comments on commit 3b3dbac

Please sign in to comment.