onestep 0.4.0__py3-none-any.whl → 0.4.1__py3-none-any.whl

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.

Potentially problematic release.


This version of onestep might be problematic. Click here for more details.

onestep/cli.py CHANGED
@@ -22,8 +22,9 @@ def parse_args():
22
22
  parser = argparse.ArgumentParser(
23
23
  description='run onestep'
24
24
  )
25
- parser.add_argument(
26
- "step",
25
+ group = parser.add_mutually_exclusive_group(required=True)
26
+ group.add_argument(
27
+ "step", nargs='?',
27
28
  help="the run step",
28
29
  )
29
30
  parser.add_argument(
@@ -39,6 +40,11 @@ def parse_args():
39
40
  "--path", "-P", default=".", nargs="*", type=str,
40
41
  help="the step import path (default: current running directory)"
41
42
  )
43
+ group.add_argument(
44
+ "--cron",
45
+ help="the cron expression to test",
46
+ type=str
47
+ )
42
48
  return parser.parse_args()
43
49
 
44
50
 
@@ -46,10 +52,20 @@ def main():
46
52
  args = parse_args()
47
53
  for path in args.path:
48
54
  sys.path.insert(0, path)
55
+ if args.cron:
56
+ from croniter import croniter
57
+ from datetime import datetime
58
+ cron = croniter(args.cron, datetime.now())
59
+ for _ in range(10):
60
+ print(cron.get_next(datetime))
61
+ return
62
+
49
63
  logger.info(f"OneStep {__version__} is start up.")
50
64
  try:
51
65
  importlib.import_module(args.step)
52
66
  step.start(group=args.group, block=True, print_jobs=args.print)
67
+ except ModuleNotFoundError:
68
+ logger.error(f"Module `{args.step}` not found.")
53
69
  except KeyboardInterrupt:
54
70
  step.shutdown()
55
71
 
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: onestep
3
- Version: 0.4.0
4
- Summary:
3
+ Version: 0.4.1
4
+ Summary: 仅需一步,轻松实现分布式异步任务。
5
5
  Author: miclon
6
6
  Author-email: jcnd@163.com
7
7
  Requires-Python: >=3.8,<4.0
@@ -15,7 +15,7 @@ Provides-Extra: redis
15
15
  Requires-Dist: asgiref (>=3.6.0,<4.0.0)
16
16
  Requires-Dist: blinker (>=1.5,<2.0)
17
17
  Requires-Dist: croniter (>=1.3.8,<2.0.0)
18
- Requires-Dist: use-rabbitmq (>=0.1.6,<0.2.0)
18
+ Requires-Dist: use-rabbitmq (>=0.2.1,<0.3.0)
19
19
  Requires-Dist: use-redis (>=0.1.6,<0.2.0) ; extra == "redis"
20
20
  Description-Content-Type: text/markdown
21
21
 
@@ -9,7 +9,7 @@ onestep/broker/redis/__init__.py,sha256=lqjvBKpMGf6I34nyJTEAq7XU2a8aQemhMGCbb5aB
9
9
  onestep/broker/redis/pubsub.py,sha256=_p2bKqXu0gYjKz2DsS8UdpkN5dCy94xf_xYx5NFuKpY,2674
10
10
  onestep/broker/redis/stream.py,sha256=uQJncD93Fz8pdP_NdgyQ1UAXwIouh7AFA9_naXaeiJM,3470
11
11
  onestep/broker/webhook.py,sha256=Zg22QxKPqJzdxjBsglUcL7P1RcM8FltcHpHXJiJPYgM,2392
12
- onestep/cli.py,sha256=KfJFpccpfNrhULJmDymrW5bFBGXapdL57ESZdgaFbG8,1399
12
+ onestep/cli.py,sha256=JU3xQCy0Zc8Ou6AH4j37_bqw5GQ7C2wll9MWQZFo5jY,1902
13
13
  onestep/exception.py,sha256=T-tqfRrJZT9Y85qe-1l-1PcHZzV2jxv-61HAhOc4AKE,753
14
14
  onestep/message.py,sha256=W37HKnIDxpd5UmtDbPTw2DTb3lfxu9Vs2KYIiCr5b2s,4057
15
15
  onestep/middleware/__init__.py,sha256=MP_45lqr4pecmbzQBnn2-AODQ0N_Fss8nl2SA7Zzljo,347
@@ -21,7 +21,7 @@ onestep/retry.py,sha256=fPO139hQrcMjXZuQ4QfFaQR57VEqv_EKS2WSz92Ayvc,3706
21
21
  onestep/signal.py,sha256=tz9bGzTFZeBviG_iaGLfy4OyFKlWat6szEI6kWEGfTA,337
22
22
  onestep/state.py,sha256=UVG91CXCabU64X6qgcO0S7RzbBP8ut0ID7aTMww94us,618
23
23
  onestep/worker.py,sha256=8Bmbie-KrZxnHbne1RvNL3v8j1PObfd12Yp9jmzAFYg,6855
24
- onestep-0.4.0.dist-info/METADATA,sha256=KMQt0aJiyk2J0K-sz0Vbo_2jAE6gyppvVq-P4Y14zp4,2522
25
- onestep-0.4.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
26
- onestep-0.4.0.dist-info/entry_points.txt,sha256=ZfWnNQqiGujz2PPLjSlKPocOFRryL7Ot0vQ41TU1xw0,44
27
- onestep-0.4.0.dist-info/RECORD,,
24
+ onestep-0.4.1.dist-info/METADATA,sha256=WoZmHjd1LmL9MvamCVyUsEakOTmReNSg2FSBHBCqd2w,2573
25
+ onestep-0.4.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
26
+ onestep-0.4.1.dist-info/entry_points.txt,sha256=ZfWnNQqiGujz2PPLjSlKPocOFRryL7Ot0vQ41TU1xw0,44
27
+ onestep-0.4.1.dist-info/RECORD,,