Skip to content

Commit

Permalink
Merge pull request #2 from eduNEXT/cag/bootstrap-plugin
Browse files Browse the repository at this point in the history
chore: bootstrap plugin
  • Loading branch information
Ian2012 authored Oct 4, 2023
2 parents 54afa32 + f8cf9d0 commit 35d62a0
Show file tree
Hide file tree
Showing 19 changed files with 917 additions and 55 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
TOXENV: ${{ matrix.toxenv }}
run: tox

- name: Run coverage
if: matrix.python-version == '3.8' && matrix.toxenv == 'django32'
uses: codecov/codecov-action@v3
with:
flags: unittests
fail_ci_if_error: true
#- name: Run coverage
# if: matrix.python-version == '3.8' && matrix.toxenv == 'django32'
# uses: codecov/codecov-action@v3
# with:
# flags: unittests
# fail_ci_if_error: true
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
# For opening files in a browser. Use like: $(BROWSER)relative/path/to/file.html
BROWSER := python -m webbrowser file://$(CURDIR)/

PACKAGE=platform_plugin_turnitin
SOURCES=./setup.py ./$(PACKAGE)
BLACK_OPTS = --exclude templates ${SOURCES}

help: ## display this help message
@echo "Please use \`make <target>' where <target> is one of"
@awk -F ':.*?## ' '/^[a-zA-Z]/ && NF==2 {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
Expand Down Expand Up @@ -66,6 +70,10 @@ requirements: piptools ## install development environment requirements
test: clean ## run tests in the current virtualenv
pytest

format: ## Format code automatically
isort $(SOURCES)
black $(BLACK_OPTS)

diff_cover: test ## find diff lines that need test coverage
diff-cover coverage.xml

Expand Down
2 changes: 1 addition & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# issue is really that Django is missing to avoid masking other
# exceptions on Python 2.
try:
import django # pylint: disable=unused-import, wrong-import-position
import django # pylint: disable=unused-import
except ImportError as import_error:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
Expand Down
2 changes: 1 addition & 1 deletion platform_plugin_turnitin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Open edX Django plugin for Turnitin integrations using Open edX Filters.
"""

__version__ = '0.1.0'
__version__ = "0.1.0"
17 changes: 16 additions & 1 deletion platform_plugin_turnitin/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,19 @@ class PlatformPluginTurnitinConfig(AppConfig):
Configuration for the platform_plugin_turnitin Django application.
"""

name = 'platform_plugin_turnitin'
name = "platform_plugin_turnitin"

plugin_app = {
"settings_config": {
"lms.djangoapp": {
"common": {"relative_path": "settings.common"},
"test": {"relative_path": "settings.test"},
"production": {"relative_path": "settings.production"},
},
"cms.djangoapp": {
"common": {"relative_path": "settings.common"},
"test": {"relative_path": "settings.test"},
"production": {"relative_path": "settings.production"},
},
},
}
5 changes: 5 additions & 0 deletions platform_plugin_turnitin/settings/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""
Open edX Django plugin for Turnitin integrations using Open edX Filters.
"""

__version__ = "0.1.0"
37 changes: 37 additions & 0 deletions platform_plugin_turnitin/settings/common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""
Common Django settings for the platform_plugin_turnitin project.
For more information on this file, see
https://docs.djangoproject.com/en/2.22/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.22/ref/settings/
"""

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.22/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "secret-key"


# Application definition

INSTALLED_APPS = [
"platform_plugin_turnitin",
]


# Internationalization
# https://docs.djangoproject.com/en/2.22/topics/i18n/

LANGUAGE_CODE = "en-us"

TIME_ZONE = "UTC"

USE_TZ = True


def plugin_settings(settings): # pylint: disable=unused-argument
"""
Set of plugin settings used by the Open Edx platform.
More info: https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/plugins/README.rst
"""
10 changes: 10 additions & 0 deletions platform_plugin_turnitin/settings/production.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
Production Django settings for platform_plugin_turnitin project.
"""


def plugin_settings(settings): # pylint: disable=unused-argument
"""
Set of plugin settings used by the Open Edx platform.
More info: https://github.com/edx/edx-platform/blob/master/openedx/core/djangoapps/plugins/README.rst
"""
18 changes: 18 additions & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
asgiref==3.7.2
# via django
django==3.2.22
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/base.in
pytz==2023.3.post1
# via django
sqlparse==0.4.4
# via django
typing-extensions==4.8.0
# via asgiref
33 changes: 33 additions & 0 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# make upgrade
#
distlib==0.3.7
# via virtualenv
filelock==3.12.4
# via
# tox
# virtualenv
packaging==23.2
# via tox
platformdirs==3.11.0
# via virtualenv
pluggy==1.3.0
# via tox
py==1.11.0
# via tox
six==1.16.0
# via tox
tomli==2.0.1
# via tox
tox==3.28.0
# via
# -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt
# -r requirements/ci.in
# tox-battery
tox-battery==0.6.2
# via -r requirements/ci.in
virtualenv==20.24.5
# via tox
1 change: 1 addition & 0 deletions requirements/dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@

diff-cover # Changeset diff test coverage
edx-i18n-tools # For i18n_tool dummy
black
Loading

0 comments on commit 35d62a0

Please sign in to comment.