Add the lts plugin to the tutor binary

This commit is contained in:
Régis Behmo 2019-12-25 01:09:53 +01:00
parent 41c9bfc337
commit 9620447a4d
5 changed files with 19 additions and 6 deletions

View File

@ -72,16 +72,16 @@ ci-install-python-requirements: ## Install requirements
ci-install-plugins: ci-install-python-requirements ## Install alll supported plugins
pip3 install -r requirements/plugins.txt
ci-bundle: ## Create bundle and run basic tests
$(MAKE) bundle
mkdir -p releases/
ci-bundle: bundle ## Create bundle and run basic tests
./dist/tutor --version
./dist/tutor config printroot
yes "" | ./dist/tutor config save --interactive
./dist/tutor config save
./dist/tutor plugins enable discovery ecommerce minio notes xqueue
./dist/tutor plugins enable discovery ecommerce figures lts minio notes xqueue
./dist/tutor lts --help
./releases/github-release: ## Download github-release binary
mkdir -p releases/
cd releases/ \
&& curl -sSL -o ./github-release.tar.bz2 "https://github.com/aktau/github-release/releases/download/v0.7.2/$(shell uname -s | tr "[:upper:]" "[:lower:]")-amd64-github-release.tar.bz2" \
&& bzip2 -d -f ./github-release.tar.bz2 \

View File

@ -1,11 +1,10 @@
#!/usr/bin/env python3
import importlib
from tutor.commands.cli import main
from tutor.plugins import Plugins
# Manually install plugins (this is for creating the bundle)
for plugin in ["discovery", "ecommerce", "figures", "minio", "notes", "xqueue"]:
for plugin in ["discovery", "ecommerce", "figures", "lts", "minio", "notes", "xqueue"]:
try:
module = importlib.import_module("tutor{}.plugin".format(plugin))
except ImportError:
@ -13,4 +12,5 @@ for plugin in ["discovery", "ecommerce", "figures", "minio", "notes", "xqueue"]:
else:
Plugins.EXTRA_INSTALLED[plugin] = module
from tutor.commands.cli import main
main()

View File

@ -52,4 +52,6 @@ This work is licensed under the terms of the `GNU Affero General Public License
The AGPL license covers the Tutor code, including the Dockerfiles, but not the content of the Docker images which can be downloaded from https://hub.docker.com. Software other than Tutor provided with the docker images retain their original license.
The Tutor plugin system is licensed under the terms of the `Apache License, Version 2.0 <https://opensource.org/licenses/Apache-2.0>`__.
The :ref:`Tutor Web UI <webui>` depends on the `Gotty <https://github.com/yudai/gotty/>`_ binary, which is provided under the terms of the `MIT license <https://github.com/yudai/gotty/blob/master/LICENSE>`_.

View File

@ -1,6 +1,7 @@
tutor-discovery
tutor-ecommerce
tutor-figures
tutor-lts
tutor-minio
tutor-notes
tutor-xqueue

View File

@ -19,6 +19,16 @@ for entrypoint in pkg_resources.iter_entry_points("tutor.plugin.v0"):
path = os.path.join(plugin_root, folder)
if os.path.exists(path):
datas.append((path, os.path.join(plugin_root_module_name, folder)))
# Fix lts import: if we don't declare some modules, pyinstaller does not find them
hidden_imports.append("tutorlts.__about__")
hidden_imports.append("Crypto.Cipher.AES")
hidden_imports.append("Crypto.Cipher.PKCS1_OAEP")
hidden_imports.append("Crypto.Hash")
hidden_imports.append("Crypto.PublicKey.RSA")
hidden_imports.append("Crypto.Random")
hidden_imports.append("Crypto.Signature.PKCS1_v1_5")
hidden_imports.append("uuid")
# The following was initially generated with:
# pyinstaller --onefile --name=tutor --add-data=./tutor/templates:./tutor/templates ./bin/main.py