From a993a2ff48e54b652ac2c107f877d28fa16d4705 Mon Sep 17 00:00:00 2001
From: JarbasAI <33701864+JarbasAl@users.noreply.github.com>
Date: Wed, 19 Oct 2022 03:46:12 +0100
Subject: [PATCH] move OCP to optional requirements, only needed for OCP skills
 that directly import the template (#28)

---
 ovos_workshop/decorators/__init__.py | 4 ++++
 requirements/ocp.txt                 | 1 +
 requirements/requirements.txt        | 1 -
 setup.py                             | 3 +++
 4 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 requirements/ocp.txt

diff --git a/ovos_workshop/decorators/__init__.py b/ovos_workshop/decorators/__init__.py
index aff36485..e182dd0e 100644
--- a/ovos_workshop/decorators/__init__.py
+++ b/ovos_workshop/decorators/__init__.py
@@ -4,6 +4,10 @@
     disables_layer, layer_intent, removes_layer, resets_layers, replaces_layer
 from ovos_workshop.decorators.converse import converse_handler
 from ovos_workshop.decorators.fallback_handler import fallback_handler
+try:
+    from ovos_workshop.decorators.ocp import ocp_next, ocp_play, ocp_pause, ocp_resume, ocp_search, ocp_previous, ocp_featured_media
+except ImportError:
+    pass  # these imports are only available if extra requirements are installed
 
 
 def resting_screen_handler(name):
diff --git a/requirements/ocp.txt b/requirements/ocp.txt
new file mode 100644
index 00000000..80aa0005
--- /dev/null
+++ b/requirements/ocp.txt
@@ -0,0 +1 @@
+ovos_plugin_common_play
\ No newline at end of file
diff --git a/requirements/requirements.txt b/requirements/requirements.txt
index 13ff3155..d4176174 100644
--- a/requirements/requirements.txt
+++ b/requirements/requirements.txt
@@ -1,6 +1,5 @@
 ovos_utils~=0.0, >=0.0.23
 ovos_config~=0.0,>=0.0.4
-ovos_plugin_common_play
 
 # optional but improves fuzzy matching and silences logs
 rapidfuzz
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 2778bcfa..36d374a8 100644
--- a/setup.py
+++ b/setup.py
@@ -58,6 +58,9 @@ def required(requirements_file):
               'ovos_workshop.decorators',
               'ovos_workshop.patches'],
     install_requires=required("requirements/requirements.txt"),
+    extras_require={
+            'ocp': required('requirements/ocp.txt')
+        },
     package_data={'': package_files('ovos_workshop')},
     url='https://github.com/OpenVoiceOS/OVOS-workshop',
     license='apache-2.0',