cycls 0.0.2.88__tar.gz → 0.0.2.89__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cycls
3
- Version: 0.0.2.88
3
+ Version: 0.0.2.89
4
4
  Summary: Distribute Intelligence
5
5
  Author-email: "Mohammed J. AlRujayi" <mj@cycls.com>
6
6
  Requires-Python: >=3.9
@@ -51,6 +51,7 @@ class App(Function):
51
51
 
52
52
  def _prepare_func(self, prod):
53
53
  self.config.set_prod(prod)
54
+ self.config.debug = not prod # debug=True in local mode
54
55
  self.config.public_path = f"cycls/themes/{self.theme}"
55
56
  user_func, config, name = self.user_func, self.config, self.name
56
57
  self.func = lambda port: __import__("cycls").web.serve(user_func, config, name, port)
@@ -60,6 +61,7 @@ class App(Function):
60
61
  print(f"Starting local server at localhost:{port}")
61
62
  self.config.public_path = str(CYCLS_PATH.joinpath(f"themes/{self.theme}"))
62
63
  self.config.set_prod(False)
64
+ self.config.debug = True
63
65
  uvicorn.run(web(self.user_func, self.config), host="0.0.0.0", port=port)
64
66
 
65
67
  def local(self, port=8080, watch=True):
@@ -12,14 +12,17 @@ import tarfile
12
12
 
13
13
  os.environ["DOCKER_BUILDKIT"] = "1"
14
14
 
15
- ENTRYPOINT_PY = '''import cloudpickle
15
+ ENTRYPOINT_PY = '''import sys
16
+ sys.path.insert(0, '/app')
17
+ import cloudpickle
16
18
  with open("/app/function.pkl", "rb") as f:
17
19
  func, args, kwargs = cloudpickle.load(f)
18
20
  func(*args, **kwargs)
19
21
  '''
20
22
 
21
- RUNNER_PY = '''import cloudpickle
22
- import sys
23
+ RUNNER_PY = '''import sys
24
+ sys.path.insert(0, '/app')
25
+ import cloudpickle
23
26
  import traceback
24
27
  from pathlib import Path
25
28