feat: upgrade to nutmeg
This commit is contained in:
parent
5f24df5177
commit
47c90a8409
@ -2,7 +2,7 @@ variables:
|
|||||||
TUTOR_PLUGIN: notes
|
TUTOR_PLUGIN: notes
|
||||||
TUTOR_IMAGES: notes
|
TUTOR_IMAGES: notes
|
||||||
TUTOR_PYPI_PACKAGE: tutor-notes
|
TUTOR_PYPI_PACKAGE: tutor-notes
|
||||||
OPENEDX_RELEASE: maple
|
OPENEDX_RELEASE: nutmeg
|
||||||
GITHUB_REPO: overhangio/tutor-notes
|
GITHUB_REPO: overhangio/tutor-notes
|
||||||
|
|
||||||
include:
|
include:
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
Students notes plugin for `Tutor <https://docs.tutor.overhang.io>`_
|
Students notes plugin for `Tutor <https://docs.tutor.overhang.io>`_
|
||||||
===================================================================
|
===================================================================
|
||||||
|
|
||||||
This is a plugin for `Tutor <https://docs.tutor.overhang.io>`_ to easily add the `Open edX note-taking app <https://github.com/edx/edx-notes-api>`_ to an Open edX platform. This app allows students to annotate portions of the courseware (see `the official documentation <https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-maple.master/exercises_tools/notes.html>`_).
|
This is a plugin for `Tutor <https://docs.tutor.overhang.io>`_ to easily add the `Open edX note-taking app <https://github.com/edx/edx-notes-api>`_ to an Open edX platform. This app allows students to annotate portions of the courseware (see `the official documentation <https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-nutmeg.master/exercises_tools/notes.html>`_).
|
||||||
|
|
||||||
.. image:: https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-maple.master/_images/SFD_SN_bodyexample.png
|
.. image:: https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-nutmeg.master/_images/SFD_SN_bodyexample.png
|
||||||
:alt: Notes in action
|
:alt: Notes in action
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
|
|||||||
7
setup.py
7
setup.py
@ -30,16 +30,15 @@ setup(
|
|||||||
long_description=readme,
|
long_description=readme,
|
||||||
packages=find_packages(exclude=["tests*"]),
|
packages=find_packages(exclude=["tests*"]),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
python_requires=">=3.5",
|
python_requires=">=3.7",
|
||||||
install_requires=["tutor>=13.0.0,<14.0.0"],
|
install_requires=["tutor>=14.0.0,<15.0.0"],
|
||||||
entry_points={"tutor.plugin.v0": ["notes = tutornotes.plugin"]},
|
entry_points={"tutor.plugin.v1": ["notes = tutornotes.plugin"]},
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Development Status :: 5 - Production/Stable",
|
"Development Status :: 5 - Production/Stable",
|
||||||
"Intended Audience :: Developers",
|
"Intended Audience :: Developers",
|
||||||
"License :: OSI Approved :: GNU Affero General Public License v3",
|
"License :: OSI Approved :: GNU Affero General Public License v3",
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
"Programming Language :: Python",
|
"Programming Language :: Python",
|
||||||
"Programming Language :: Python :: 3.6",
|
|
||||||
"Programming Language :: Python :: 3.7",
|
"Programming Language :: Python :: 3.7",
|
||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
__version__ = "13.0.1"
|
__version__ = "14.0.0"
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
"ENABLE_EDXNOTES": true
|
|
||||||
2
tutornotes/patches/openedx-common-settings
Normal file
2
tutornotes/patches/openedx-common-settings
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Student notes
|
||||||
|
FEATURES["ENABLE_EDXNOTES"] = True
|
||||||
@ -3,11 +3,13 @@ import os
|
|||||||
|
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
|
||||||
|
from tutor import hooks as tutor_hooks
|
||||||
|
|
||||||
from .__about__ import __version__
|
from .__about__ import __version__
|
||||||
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"add": {
|
"unique": {
|
||||||
"MYSQL_PASSWORD": "{{ 8|random_string }}",
|
"MYSQL_PASSWORD": "{{ 8|random_string }}",
|
||||||
"SECRET_KEY": "{{ 24|random_string }}",
|
"SECRET_KEY": "{{ 24|random_string }}",
|
||||||
"OAUTH2_SECRET": "{{ 24|random_string }}",
|
"OAUTH2_SECRET": "{{ 24|random_string }}",
|
||||||
@ -21,21 +23,68 @@ config = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
templates = pkg_resources.resource_filename("tutornotes", "templates")
|
# Initialization hooks
|
||||||
hooks = {
|
tutor_hooks.Filters.COMMANDS_INIT.add_item((
|
||||||
"init": ["mysql", "lms", "notes"],
|
"mysql",
|
||||||
"build-image": {"notes": "{{ NOTES_DOCKER_IMAGE }}"},
|
("notes", "tasks", "mysql", "init"),
|
||||||
"remote-image": {"notes": "{{ NOTES_DOCKER_IMAGE }}"},
|
))
|
||||||
}
|
tutor_hooks.Filters.COMMANDS_INIT.add_item((
|
||||||
|
"lms",
|
||||||
|
("notes", "tasks", "lms", "init"),
|
||||||
|
))
|
||||||
|
tutor_hooks.Filters.COMMANDS_INIT.add_item((
|
||||||
|
"notes",
|
||||||
|
("notes", "tasks", "notes", "init"),
|
||||||
|
))
|
||||||
|
|
||||||
|
# Image management
|
||||||
|
tutor_hooks.Filters.IMAGES_BUILD.add_item((
|
||||||
|
"notes",
|
||||||
|
("plugins", "notes", "build", "notes"),
|
||||||
|
"{{ NOTES_DOCKER_IMAGE }}",
|
||||||
|
(),
|
||||||
|
))
|
||||||
|
tutor_hooks.Filters.IMAGES_PULL.add_item((
|
||||||
|
"notes",
|
||||||
|
"{{ NOTES_DOCKER_IMAGE }}",
|
||||||
|
))
|
||||||
|
tutor_hooks.Filters.IMAGES_PUSH.add_item((
|
||||||
|
"notes",
|
||||||
|
"{{ NOTES_DOCKER_IMAGE }}",
|
||||||
|
))
|
||||||
|
|
||||||
def patches():
|
####### Boilerplate code
|
||||||
all_patches = {}
|
# Add the "templates" folder as a template root
|
||||||
for path in glob(
|
tutor_hooks.Filters.ENV_TEMPLATE_ROOTS.add_item(
|
||||||
os.path.join(pkg_resources.resource_filename("tutornotes", "patches"), "*")
|
pkg_resources.resource_filename("tutornotes", "templates")
|
||||||
):
|
)
|
||||||
with open(path) as patch_file:
|
# Render the "build" and "apps" folders
|
||||||
name = os.path.basename(path)
|
tutor_hooks.Filters.ENV_TEMPLATE_TARGETS.add_items(
|
||||||
content = patch_file.read()
|
[
|
||||||
all_patches[name] = content
|
("notes/build", "plugins"),
|
||||||
return all_patches
|
("notes/apps", "plugins"),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
# Load patches from files
|
||||||
|
for path in glob(
|
||||||
|
os.path.join(
|
||||||
|
pkg_resources.resource_filename("tutornotes", "patches"),
|
||||||
|
"*",
|
||||||
|
)
|
||||||
|
):
|
||||||
|
with open(path, encoding="utf-8") as patch_file:
|
||||||
|
tutor_hooks.Filters.ENV_PATCHES.add_item((os.path.basename(path), patch_file.read()))
|
||||||
|
# Add configuration entries
|
||||||
|
tutor_hooks.Filters.CONFIG_DEFAULTS.add_items(
|
||||||
|
[
|
||||||
|
(f"NOTES_{key}", value)
|
||||||
|
for key, value in config.get("defaults", {}).items()
|
||||||
|
]
|
||||||
|
)
|
||||||
|
tutor_hooks.Filters.CONFIG_UNIQUE.add_items(
|
||||||
|
[
|
||||||
|
(f"NOTES_{key}", value)
|
||||||
|
for key, value in config.get("unique", {}).items()
|
||||||
|
]
|
||||||
|
)
|
||||||
|
tutor_hooks.Filters.CONFIG_OVERRIDES.add_items(list(config.get("overrides", {}).items()))
|
||||||
|
|||||||
@ -16,7 +16,10 @@ WORKDIR /app/edx-notes-api
|
|||||||
|
|
||||||
RUN python -m venv /app/venv
|
RUN python -m venv /app/venv
|
||||||
ENV PATH /app/venv/bin:${PATH}
|
ENV PATH /app/venv/bin:${PATH}
|
||||||
RUN pip install setuptools==44.1.0 pip==20.3.4 wheel==0.37.0
|
# https://pypi.org/project/setuptools/
|
||||||
|
# https://pypi.org/project/pip/
|
||||||
|
# https://pypi.org/project/wheel/
|
||||||
|
RUN pip install setuptools==62.1.0 pip==22.0.4 wheel==0.37.1
|
||||||
RUN pip3 install -r requirements/base.txt
|
RUN pip3 install -r requirements/base.txt
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user