ErrorAI 1.1.0__tar.gz → 1.2.0__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.
Files changed (25) hide show
  1. {errorai-1.1.0 → errorai-1.2.0}/ErrorAI.egg-info/PKG-INFO +1 -1
  2. {errorai-1.1.0 → errorai-1.2.0}/PKG-INFO +1 -1
  3. {errorai-1.1.0 → errorai-1.2.0}/errorai/__init__.py +3 -4
  4. {errorai-1.1.0 → errorai-1.2.0}/errorai/compat.py +18 -0
  5. {errorai-1.1.0 → errorai-1.2.0}/pyproject.toml +1 -1
  6. {errorai-1.1.0 → errorai-1.2.0}/ErrorAI.egg-info/SOURCES.txt +0 -0
  7. {errorai-1.1.0 → errorai-1.2.0}/ErrorAI.egg-info/dependency_links.txt +0 -0
  8. {errorai-1.1.0 → errorai-1.2.0}/ErrorAI.egg-info/entry_points.txt +0 -0
  9. {errorai-1.1.0 → errorai-1.2.0}/ErrorAI.egg-info/requires.txt +0 -0
  10. {errorai-1.1.0 → errorai-1.2.0}/ErrorAI.egg-info/top_level.txt +0 -0
  11. {errorai-1.1.0 → errorai-1.2.0}/README.md +0 -0
  12. {errorai-1.1.0 → errorai-1.2.0}/errorai/__main__.py +0 -0
  13. {errorai-1.1.0 → errorai-1.2.0}/errorai/bootstrap.py +0 -0
  14. {errorai-1.1.0 → errorai-1.2.0}/errorai/cli.py +0 -0
  15. {errorai-1.1.0 → errorai-1.2.0}/errorai/config.py +0 -0
  16. {errorai-1.1.0 → errorai-1.2.0}/errorai/environment.py +0 -0
  17. {errorai-1.1.0 → errorai-1.2.0}/errorai/pipeline.py +0 -0
  18. {errorai-1.1.0 → errorai-1.2.0}/errorai/providers.py +0 -0
  19. {errorai-1.1.0 → errorai-1.2.0}/errorai/runtime.py +0 -0
  20. {errorai-1.1.0 → errorai-1.2.0}/errorai/universal.py +0 -0
  21. {errorai-1.1.0 → errorai-1.2.0}/setup.cfg +0 -0
  22. {errorai-1.1.0 → errorai-1.2.0}/tests/test_bootstrap.py +0 -0
  23. {errorai-1.1.0 → errorai-1.2.0}/tests/test_config.py +0 -0
  24. {errorai-1.1.0 → errorai-1.2.0}/tests/test_runtime.py +0 -0
  25. {errorai-1.1.0 → errorai-1.2.0}/tests/test_safety.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ErrorAI
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Python-only autonomous runtime that watches/analyzes errors with safe local auto-fix fallbacks.
5
5
  Author: Aswanth R
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ErrorAI
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Python-only autonomous runtime that watches/analyzes errors with safe local auto-fix fallbacks.
5
5
  Author: Aswanth R
6
6
  License: MIT
@@ -1,9 +1,8 @@
1
1
  from .compat import catch_errors, global_activate, watch
2
2
  from .runtime import configure, get_runtime
3
3
 
4
- __version__ = "2.0.0"
4
+ __version__ = "2.1.0"
5
5
  __all__ = ["get_runtime", "configure", "watch", "catch_errors", "global_activate"]
6
6
 
7
- # Import-time auto-start for zero-decorator usage.
8
- runtime = get_runtime()
9
- runtime.initialize()
7
+ # Auto-start runtime on import
8
+ get_runtime().initialize()
@@ -20,6 +20,9 @@ def watch(func):
20
20
 
21
21
 
22
22
  class catch_errors:
23
+ def __init__(self, func=None):
24
+ self.func = func
25
+
23
26
  def __enter__(self):
24
27
  return self
25
28
 
@@ -29,8 +32,23 @@ class catch_errors:
29
32
  get_runtime().process_exception(exc_type, exc_value, exc_tb)
30
33
  return True
31
34
 
35
+ def __call__(self, *args, **kwargs):
36
+ if callable(self.func):
37
+ @functools.wraps(self.func)
38
+ def inner(*wargs, **wkwargs):
39
+ try:
40
+ return self.func(*wargs, **wkwargs)
41
+ except Exception as e:
42
+ get_runtime().process_exception(type(e), e, e.__traceback__)
43
+ raise
44
+ return inner(*args, **kwargs)
45
+
32
46
 
33
47
  def global_activate():
34
48
  runtime = get_runtime()
35
49
  runtime.initialize()
36
50
  return runtime
51
+
52
+
53
+ # Automatically trigger global activation on import so zero-config works!
54
+ global_activate()
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ErrorAI"
7
- version = "1.1.0"
7
+ version = "1.2.0"
8
8
  description = "Python-only autonomous runtime that watches/analyzes errors with safe local auto-fix fallbacks."
9
9
  readme = "README.md"
10
10
  authors = [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes