pkg: do not drag pystuck (heavy depedency) if not explicitly asked
3 files changed, 11 insertions(+), 4 deletions(-)

M rework/cli.py
M rework/worker.py
M setup.py
M rework/cli.py +7 -0
@@ 71,6 71,13 @@ def register_operations(dburi, module, d
 @click.option('--debug-port', type=int, default=0)
 def new_worker(**config):
     " spawn a new worker -- this is a purely *internal* command "
+    if 'debug_port' in config:
+        try:
+            import pystuck
+        except ImportError:
+            print('--debug-port is unsupported without `pystuck` ')
+            print('try "pip install pystuck" to make it work')
+            return
     worker = Worker(**config)
     worker.run()
 

          
M rework/worker.py +1 -1
@@ 3,7 3,6 @@ import os
 from contextlib import contextmanager
 import traceback
 
-import pystuck
 from sqlalchemy import create_engine
 
 from sqlhelp import select, update

          
@@ 86,6 85,7 @@ class Worker:
 
     def run(self):
         if self.debugport:
+            import pystuck
             pystuck.run_server(port=self.debugport)
 
         try:

          
M setup.py +3 -3
@@ 21,7 21,6 @@ setup(name='rework',
           'sqlalchemy',
           'sqlhelp',
           'psycopg2-binary',
-          'pystuck',
           'click',
           'tzlocal',
           'inireader',

          
@@ 33,9 32,10 @@ setup(name='rework',
       package_data={'rework': [
           'schema.sql'
       ]},
-      extra_require=[
+      extras_require=[
           'pytest',
-          'pytest_sa_pg'
+          'pytest_sa_pg',
+          'pystuck'
       ],
       entry_points={
           'console_scripts': [