PyEventEngine 0.6.2__cp315-cp315t-win_amd64.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.
Files changed (56) hide show
  1. event_engine/__infra__.pxd +2 -0
  2. event_engine/__init__.pxd +2 -0
  3. event_engine/__init__.py +62 -0
  4. event_engine/base/__infra__.pxd +9 -0
  5. event_engine/base/__init__.pxd +9 -0
  6. event_engine/base/__init__.py +31 -0
  7. event_engine/base/c_allocator_protocol.c +14310 -0
  8. event_engine/base/c_allocator_protocol.cp315t-win_amd64.pyd +0 -0
  9. event_engine/base/c_allocator_protocol.h +23 -0
  10. event_engine/base/c_allocator_protocol.pxd +31 -0
  11. event_engine/base/c_allocator_protocol.pyx +193 -0
  12. event_engine/capi/__infra__.pxd +189 -0
  13. event_engine/capi/__init__.pxd +189 -0
  14. event_engine/capi/__init__.py +84 -0
  15. event_engine/capi/c_engine.c +32542 -0
  16. event_engine/capi/c_engine.cp315t-win_amd64.pyd +0 -0
  17. event_engine/capi/c_engine.h +393 -0
  18. event_engine/capi/c_engine.pxd +84 -0
  19. event_engine/capi/c_engine.pyi +478 -0
  20. event_engine/capi/c_engine.pyx +673 -0
  21. event_engine/capi/c_event.c +22826 -0
  22. event_engine/capi/c_event.cp315t-win_amd64.pyd +0 -0
  23. event_engine/capi/c_event.h +342 -0
  24. event_engine/capi/c_event.pxd +159 -0
  25. event_engine/capi/c_event.pyi +265 -0
  26. event_engine/capi/c_event.pyx +444 -0
  27. event_engine/capi/c_topic.c +34545 -0
  28. event_engine/capi/c_topic.cp315t-win_amd64.pyd +0 -0
  29. event_engine/capi/c_topic.h +1007 -0
  30. event_engine/capi/c_topic.pxd +147 -0
  31. event_engine/capi/c_topic.pyi +644 -0
  32. event_engine/capi/c_topic.pyx +818 -0
  33. event_engine/capi/fallback_engine.py +707 -0
  34. event_engine/config_view.c +10271 -0
  35. event_engine/config_view.cp315t-win_amd64.pyd +0 -0
  36. event_engine/config_view.pyx +55 -0
  37. event_engine/includes/event_engine/base/c_allocator_protocol.c +14310 -0
  38. event_engine/includes/event_engine/base/c_allocator_protocol.h +23 -0
  39. event_engine/includes/event_engine/capi/c_engine.c +32542 -0
  40. event_engine/includes/event_engine/capi/c_engine.h +393 -0
  41. event_engine/includes/event_engine/capi/c_event.c +22826 -0
  42. event_engine/includes/event_engine/capi/c_event.h +342 -0
  43. event_engine/includes/event_engine/capi/c_topic.c +34545 -0
  44. event_engine/includes/event_engine/capi/c_topic.h +1007 -0
  45. event_engine/includes/event_engine/config_view.c +10271 -0
  46. event_engine/native/__init__.py +60 -0
  47. event_engine/native/_event.py +420 -0
  48. event_engine/native/_topic.py +171 -0
  49. event_engine/native/engine.py +793 -0
  50. event_engine/native/event.py +469 -0
  51. event_engine/native/topic.py +943 -0
  52. pyeventengine-0.6.2.dist-info/METADATA +189 -0
  53. pyeventengine-0.6.2.dist-info/RECORD +56 -0
  54. pyeventengine-0.6.2.dist-info/WHEEL +5 -0
  55. pyeventengine-0.6.2.dist-info/licenses/LICENSE +21 -0
  56. pyeventengine-0.6.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2 @@
1
+ from .base cimport *
2
+ from .capi cimport *
@@ -0,0 +1,2 @@
1
+ from .base cimport *
2
+ from .capi cimport *
@@ -0,0 +1,62 @@
1
+ __version__ = '0.6.2'
2
+
3
+ import functools
4
+ import pathlib
5
+ from collections.abc import Mapping
6
+
7
+ from .config_view import CONFIG_VIEW
8
+ from .base import LOGGER
9
+
10
+ try:
11
+ from .capi import * # noqa: F401,F403
12
+ except Exception as e:
13
+ import warnings
14
+
15
+ warnings.warn(
16
+ f"Failed to import event_engine.capi ({e!r}); falling back to event_engine.native.",
17
+ ImportWarning,
18
+ stacklevel=2,
19
+ )
20
+ from .native import * # noqa: F401,F403
21
+
22
+
23
+ def _format_config_view(config: Mapping, indent: int = 0) -> str:
24
+ """Render a (possibly nested) config view as indented bullet lines."""
25
+ lines = []
26
+ for key, value in config.items():
27
+ if isinstance(value, Mapping):
28
+ lines.append(f"{' ' * indent}- {key}:")
29
+ lines.append(_format_config_view(value, indent + 1))
30
+ else:
31
+ lines.append(f"{' ' * indent}- {key}: {value}")
32
+ return "\n".join(lines)
33
+
34
+
35
+ @functools.cache
36
+ def get_include() -> list[str]:
37
+ import os
38
+
39
+ res_dir = pathlib.Path(__file__).parent
40
+ LOGGER.info(
41
+ f'Building with <PyEventEngine> version: "{__version__}", resource directory: "{res_dir}", '
42
+ f"config:\n{_format_config_view(CONFIG_VIEW)}"
43
+ )
44
+
45
+ scr_dir = [
46
+ os.path.realpath(res_dir),
47
+ os.path.realpath(res_dir / 'base'),
48
+ os.path.realpath(res_dir / 'capi'),
49
+ ]
50
+
51
+ include_root = os.path.realpath(res_dir / 'includes')
52
+ if os.path.isdir(include_root):
53
+ scr_dir.append(include_root)
54
+
55
+ return scr_dir
56
+
57
+
58
+ __all__ = [
59
+ 'CONFIG_VIEW',
60
+ 'get_include',
61
+ 'LOGGER',
62
+ ]
@@ -0,0 +1,9 @@
1
+ from .c_allocator_protocol cimport (
2
+ EE_LOCAL_ONLY,
3
+
4
+ EE_CFG_LOCKED, EE_CFG_SHARED, EE_CFG_FREELIST,
5
+ EEConfigContext,
6
+ EE_HEAP_ALLOCATOR_RAW, EE_SHM_ALLOCATOR_RAW,
7
+ EE_DEFAULT_ALLOCATOR, EE_SHM_ALLOCATOR, EE_HEAP_ALLOCATOR,
8
+ EE_SHARED, EE_LOCKED, EE_LOCKFREE, EE_FREELIST,
9
+ )
@@ -0,0 +1,9 @@
1
+ from .c_allocator_protocol cimport (
2
+ EE_LOCAL_ONLY,
3
+
4
+ EE_CFG_LOCKED, EE_CFG_SHARED, EE_CFG_FREELIST,
5
+ EEConfigContext,
6
+ EE_HEAP_ALLOCATOR_RAW, EE_SHM_ALLOCATOR_RAW,
7
+ EE_DEFAULT_ALLOCATOR, EE_SHM_ALLOCATOR, EE_HEAP_ALLOCATOR,
8
+ EE_SHARED, EE_LOCKED, EE_LOCKFREE, EE_FREELIST,
9
+ )
@@ -0,0 +1,31 @@
1
+ import logging
2
+
3
+ from cbase.backports.telemetrics import (
4
+ ColoredFormatter,
5
+ DuplicateWarningFilter,
6
+ LOG_LEVEL,
7
+ get_logger as _get_logger,
8
+ )
9
+
10
+ LOG_LEVEL_EVENT = LOG_LEVEL - 5
11
+
12
+
13
+ def get_logger(**kwargs) -> logging.Logger:
14
+ """Return the process-wide singleton EventEngine logger.
15
+
16
+ First call configures the logger via PyCyBase's telemetrics; subsequent
17
+ calls return the same cached instance.
18
+ """
19
+ return _get_logger(name='EventEngine', level=kwargs.get('level', LOG_LEVEL), **kwargs)
20
+
21
+
22
+ LOGGER = get_logger()
23
+
24
+ __all__ = [
25
+ 'ColoredFormatter',
26
+ 'DuplicateWarningFilter',
27
+ 'LOG_LEVEL',
28
+ 'LOG_LEVEL_EVENT',
29
+ 'LOGGER',
30
+ 'get_logger',
31
+ ]