-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: plugin compatible with nutmeg (#216)
BREAKING CHANGE: drop django22 and added python 3.10 * feat: make it compatible with nutmeg * perf: update requirements * docs: update readme * feat: drop django22 and added python 3.10 * ci: add python publish workflow and drop circleci Co-authored-by: Maria Fernanda Magallanes Zubillaga <[email protected]> Co-authored-by: Juan David Buitrago <[email protected]>
- Loading branch information
1 parent
f3b8e6a
commit 22f60b5
Showing
17 changed files
with
412 additions
and
367 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Publish Python 🐍 distributions 📦 to PyPI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: | | ||
python -m build --sdist --wheel --outdir dist/ . | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
""" | ||
Test backend to get CourseEnrollment Model. | ||
""" | ||
|
||
from unittest.mock import Mock | ||
|
||
from django.contrib.auth.models import Permission | ||
|
||
USERNAME_MAX_LENGTH = 30 | ||
|
||
|
||
def get_edxapp_user(**kwargs): | ||
""" | ||
Return a fake user | ||
""" | ||
return Mock() | ||
|
||
|
||
def create_edxapp_user(*args, **kwargs): | ||
""" | ||
Return a fake user and a list of errors | ||
""" | ||
return Mock(), [] | ||
|
||
|
||
def get_user_read_only_serializer(): | ||
""" | ||
Return a fake user read only serializer | ||
""" | ||
try: | ||
from openedx.core.djangoapps.user_api.accounts.serializers import \ | ||
UserReadOnlySerializer # pylint: disable=import-outside-toplevel | ||
except ImportError: | ||
UserReadOnlySerializer = object | ||
return UserReadOnlySerializer | ||
|
||
|
||
def check_edxapp_account_conflicts(email, username): | ||
""" | ||
Get an executes the check_account_exists for tests | ||
""" | ||
try: | ||
from openedx.core.djangoapps.user_api.accounts.api import \ | ||
check_account_exists # pylint: disable=import-outside-toplevel | ||
except ImportError: | ||
def check_account_exists(email=None, username=None): | ||
""" | ||
Fake definition for check_account_exists edxapp function | ||
""" | ||
return email and username | ||
return check_account_exists(email=email, username=username) | ||
|
||
|
||
def get_course_enrollment(): | ||
""" | ||
Get Test CourseEnrollment model. | ||
We return any django model that already exists so that | ||
django-filters is happy and no migrations are created. | ||
""" | ||
return Permission | ||
|
||
|
||
def get_course_team_user(*args, **kwargs): | ||
""" | ||
Return a fake course team user | ||
""" | ||
return Mock() | ||
|
||
|
||
def get_user_signup_source(): | ||
""" | ||
Get test UserSignupSource model | ||
""" | ||
try: | ||
from common.djangoapps.student.models import UserSignupSource # pylint: disable=import-outside-toplevel | ||
except ImportError: | ||
UserSignupSource = object | ||
return UserSignupSource | ||
|
||
|
||
def get_user_profile(): | ||
""" Gets the UserProfile model """ | ||
try: | ||
from common.djangoapps.student.models import UserProfile # pylint: disable=import-outside-toplevel | ||
except ImportError: | ||
UserProfile = object | ||
return UserProfile | ||
|
||
|
||
def generate_password(*args, **kwargs): | ||
""" Generates a password """ | ||
return "ThisShouldBeARandomPassword" | ||
|
||
|
||
def get_user_attribute(): | ||
""" | ||
Get test UserAttribute model | ||
""" | ||
try: | ||
from common.djangoapps.student.models import UserAttribute # pylint: disable=import-outside-toplevel | ||
except ImportError: | ||
UserAttribute = object | ||
return UserAttribute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.