by-framework 0.1.2__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 (107) hide show
  1. by_framework-0.1.2/.github/workflows/workflow.yml +70 -0
  2. by_framework-0.1.2/.gitignore +68 -0
  3. by_framework-0.1.2/.pre-commit-config.yaml +55 -0
  4. by_framework-0.1.2/CLAUDE.md +96 -0
  5. by_framework-0.1.2/LICENSE +201 -0
  6. by_framework-0.1.2/Makefile +36 -0
  7. by_framework-0.1.2/PKG-INFO +798 -0
  8. by_framework-0.1.2/README.md +780 -0
  9. by_framework-0.1.2/autoformat.sh +67 -0
  10. by_framework-0.1.2/pylintrc +399 -0
  11. by_framework-0.1.2/pyproject.toml +44 -0
  12. by_framework-0.1.2/src/by_framework/__init__.py +117 -0
  13. by_framework-0.1.2/src/by_framework/__main__.py +82 -0
  14. by_framework-0.1.2/src/by_framework/client/__init__.py +10 -0
  15. by_framework-0.1.2/src/by_framework/client/byai_client.py +37 -0
  16. by_framework-0.1.2/src/by_framework/client/client.py +246 -0
  17. by_framework-0.1.2/src/by_framework/client/interceptors.py +101 -0
  18. by_framework-0.1.2/src/by_framework/common/__init__.py +62 -0
  19. by_framework-0.1.2/src/by_framework/common/config.py +107 -0
  20. by_framework-0.1.2/src/by_framework/common/constants.py +107 -0
  21. by_framework-0.1.2/src/by_framework/common/emitter.py +224 -0
  22. by_framework-0.1.2/src/by_framework/common/exceptions.py +161 -0
  23. by_framework-0.1.2/src/by_framework/common/logger.py +109 -0
  24. by_framework-0.1.2/src/by_framework/common/redis_client.py +71 -0
  25. by_framework-0.1.2/src/by_framework/core/__init__.py +70 -0
  26. by_framework-0.1.2/src/by_framework/core/extensions/__init__.py +20 -0
  27. by_framework-0.1.2/src/by_framework/core/extensions/agent_config.py +63 -0
  28. by_framework-0.1.2/src/by_framework/core/extensions/plugin.py +208 -0
  29. by_framework-0.1.2/src/by_framework/core/extensions/registry.py +407 -0
  30. by_framework-0.1.2/src/by_framework/core/protocol/__init__.py +103 -0
  31. by_framework-0.1.2/src/by_framework/core/protocol/action_type.py +29 -0
  32. by_framework-0.1.2/src/by_framework/core/protocol/agent_state.py +78 -0
  33. by_framework-0.1.2/src/by_framework/core/protocol/commands.py +249 -0
  34. by_framework-0.1.2/src/by_framework/core/protocol/content_type.py +37 -0
  35. by_framework-0.1.2/src/by_framework/core/protocol/data_message.py +44 -0
  36. by_framework-0.1.2/src/by_framework/core/protocol/data_shapes.py +82 -0
  37. by_framework-0.1.2/src/by_framework/core/protocol/event_type.py +32 -0
  38. by_framework-0.1.2/src/by_framework/core/protocol/events.py +67 -0
  39. by_framework-0.1.2/src/by_framework/core/protocol/message.py +98 -0
  40. by_framework-0.1.2/src/by_framework/core/protocol/message_header.py +63 -0
  41. by_framework-0.1.2/src/by_framework/core/protocol/responses.py +82 -0
  42. by_framework-0.1.2/src/by_framework/core/registry.py +296 -0
  43. by_framework-0.1.2/src/by_framework/core/runtime/__init__.py +21 -0
  44. by_framework-0.1.2/src/by_framework/core/runtime/agent_config_manager.py +281 -0
  45. by_framework-0.1.2/src/by_framework/core/runtime/agent_runtime_state.py +63 -0
  46. by_framework-0.1.2/src/by_framework/core/runtime/file_manager.py +156 -0
  47. by_framework-0.1.2/src/by_framework/core/runtime/filestore/__init__.py +18 -0
  48. by_framework-0.1.2/src/by_framework/core/runtime/filestore/base.py +36 -0
  49. by_framework-0.1.2/src/by_framework/core/runtime/filestore/local.py +159 -0
  50. by_framework-0.1.2/src/by_framework/core/runtime/filestore/minio.py +189 -0
  51. by_framework-0.1.2/src/by_framework/core/runtime/history/__init__.py +11 -0
  52. by_framework-0.1.2/src/by_framework/core/runtime/history/backends/__init__.py +0 -0
  53. by_framework-0.1.2/src/by_framework/core/runtime/history/backends/byclaw_history.py +27 -0
  54. by_framework-0.1.2/src/by_framework/core/runtime/history/backends/in_memory.py +41 -0
  55. by_framework-0.1.2/src/by_framework/core/runtime/history/backends/postgres.py +197 -0
  56. by_framework-0.1.2/src/by_framework/core/runtime/history/base.py +48 -0
  57. by_framework-0.1.2/src/by_framework/core/runtime/history/manager.py +49 -0
  58. by_framework-0.1.2/src/by_framework/core/runtime/session_manager.py +66 -0
  59. by_framework-0.1.2/src/by_framework/core/workspace.py +57 -0
  60. by_framework-0.1.2/src/by_framework/worker/__init__.py +15 -0
  61. by_framework-0.1.2/src/by_framework/worker/_control_handling.py +77 -0
  62. by_framework-0.1.2/src/by_framework/worker/_execution_tracking.py +68 -0
  63. by_framework-0.1.2/src/by_framework/worker/_message_processing.py +95 -0
  64. by_framework-0.1.2/src/by_framework/worker/app.py +197 -0
  65. by_framework-0.1.2/src/by_framework/worker/context.py +379 -0
  66. by_framework-0.1.2/src/by_framework/worker/heartbeat.py +63 -0
  67. by_framework-0.1.2/src/by_framework/worker/processor.py +138 -0
  68. by_framework-0.1.2/src/by_framework/worker/runner.py +413 -0
  69. by_framework-0.1.2/src/by_framework/worker/sandbox/__init__.py +0 -0
  70. by_framework-0.1.2/src/by_framework/worker/sandbox/hook_sandbox.py +68 -0
  71. by_framework-0.1.2/src/by_framework/worker/worker.py +389 -0
  72. by_framework-0.1.2/tests/client/__init__.py +0 -0
  73. by_framework-0.1.2/tests/client/test_client.py +102 -0
  74. by_framework-0.1.2/tests/common/__init__.py +0 -0
  75. by_framework-0.1.2/tests/common/test_config.py +256 -0
  76. by_framework-0.1.2/tests/common/test_exceptions.py +199 -0
  77. by_framework-0.1.2/tests/common/test_logger.py +84 -0
  78. by_framework-0.1.2/tests/common/test_redis_client.py +64 -0
  79. by_framework-0.1.2/tests/core/__init__.py +0 -0
  80. by_framework-0.1.2/tests/core/protocol/__init__.py +0 -0
  81. by_framework-0.1.2/tests/core/protocol/test_command_wire.py +21 -0
  82. by_framework-0.1.2/tests/core/protocol/test_protocol.py +244 -0
  83. by_framework-0.1.2/tests/core/runtime/history/__init__.py +0 -0
  84. by_framework-0.1.2/tests/core/runtime/history/test_history_persistence.py +177 -0
  85. by_framework-0.1.2/tests/core/runtime/history/test_postgres_history_storage.py +122 -0
  86. by_framework-0.1.2/tests/core/test_registry.py +160 -0
  87. by_framework-0.1.2/tests/integration/__init__.py +0 -0
  88. by_framework-0.1.2/tests/integration/test_ask_user_flow.py +100 -0
  89. by_framework-0.1.2/tests/integration/test_callback_flow.py +238 -0
  90. by_framework-0.1.2/tests/integration/test_logger_integration.py +141 -0
  91. by_framework-0.1.2/tests/integration/test_scatter_gather.py +67 -0
  92. by_framework-0.1.2/tests/plugin/__init__.py +0 -0
  93. by_framework-0.1.2/tests/plugin/test_plugin_discovery.py +65 -0
  94. by_framework-0.1.2/tests/plugin/test_plugin_improvements.py +323 -0
  95. by_framework-0.1.2/tests/plugin/test_plugin_registry.py +61 -0
  96. by_framework-0.1.2/tests/plugin/test_plugin_system.py +103 -0
  97. by_framework-0.1.2/tests/worker/__init__.py +0 -0
  98. by_framework-0.1.2/tests/worker/test_context.py +76 -0
  99. by_framework-0.1.2/tests/worker/test_control_handling.py +299 -0
  100. by_framework-0.1.2/tests/worker/test_gateway_worker.py +282 -0
  101. by_framework-0.1.2/tests/worker/test_heartbeat.py +191 -0
  102. by_framework-0.1.2/tests/worker/test_message_processing.py +197 -0
  103. by_framework-0.1.2/tests/worker/test_processor.py +75 -0
  104. by_framework-0.1.2/tests/worker/test_runner.py +399 -0
  105. by_framework-0.1.2/tests/worker/test_sandbox.py +42 -0
  106. by_framework-0.1.2/tests/worker/test_workspace.py +26 -0
  107. by_framework-0.1.2/uv.lock +375 -0
@@ -0,0 +1,70 @@
1
+ # This workflow will upload a Python Package to PyPI when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
+
4
+ # This workflow uses actions that are not certified by GitHub.
5
+ # They are provided by a third-party and are governed by
6
+ # separate terms of service, privacy policy, and support
7
+ # documentation.
8
+
9
+ name: Upload Python Package
10
+
11
+ on:
12
+ release:
13
+ types: [published]
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ jobs:
19
+ release-build:
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.12"
28
+
29
+ - name: Build release distributions
30
+ run: |
31
+ # NOTE: put your own distribution build steps here.
32
+ python -m pip install build
33
+ python -m build
34
+
35
+ - name: Upload distributions
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: release-dists
39
+ path: dist/
40
+
41
+ pypi-publish:
42
+ runs-on: ubuntu-latest
43
+ needs:
44
+ - release-build
45
+ permissions:
46
+ # IMPORTANT: this permission is mandatory for trusted publishing
47
+ id-token: write
48
+
49
+ # Dedicated environments with protections for publishing are strongly recommended.
50
+ # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
51
+ environment:
52
+ name: pypi
53
+ # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status:
54
+ # url: https://pypi.org/p/YOURPROJECT
55
+ #
56
+ # ALTERNATIVE: if your GitHub Release name is the PyPI project version string
57
+ # ALTERNATIVE: exactly, uncomment the following line instead:
58
+ # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }}
59
+
60
+ steps:
61
+ - name: Retrieve release distributions
62
+ uses: actions/download-artifact@v4
63
+ with:
64
+ name: release-dists
65
+ path: dist/
66
+
67
+ - name: Publish release distributions to PyPI
68
+ uses: pypa/gh-action-pypi-publish@release/v1
69
+ with:
70
+ packages-dir: dist/
@@ -0,0 +1,68 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ share/python-wheels/
20
+ *.egg-info/
21
+ .installed.cfg
22
+ *.egg
23
+ MANIFEST
24
+
25
+ # Environment
26
+ .env
27
+ .venv
28
+ env/
29
+ venv/
30
+ ENV/
31
+ env.bak/
32
+ venv.bak/
33
+
34
+ # Node.js
35
+ node_modules/
36
+ npm-debug.log*
37
+ yarn-debug.log*
38
+ yarn-error.log*
39
+ .pnpm-debug.log*
40
+ dist/
41
+ .cache/
42
+ .next/
43
+ out/
44
+ .next-env.d.ts
45
+
46
+ # IDEs / Editors
47
+ .idea/
48
+ .vscode/
49
+ *.swp
50
+ *.swo
51
+ .DS_Store
52
+ .DS_Store?
53
+ ._*
54
+ .Spotlight-V100
55
+ .Trashes
56
+ ehthumbs.db
57
+ Thumbs.db
58
+
59
+ # Project Specific
60
+ .worktrees/
61
+ *.log
62
+ .gemini/
63
+ /brain/
64
+ .agents/
65
+ .agent/
66
+ *gateway-sdk.log*
67
+ .claude/settings.local.json
68
+ .claude/settings.json
@@ -0,0 +1,55 @@
1
+ repos:
2
+ # Python formatting and imports
3
+ - repo: https://github.com/pycqa/isort
4
+ rev: "5.13.2"
5
+ hooks:
6
+ - id: isort
7
+ name: isort (Python import sorting)
8
+
9
+ - repo: https://github.com/astral-sh/ruff-pre-commit
10
+ rev: "v0.9.4"
11
+ hooks:
12
+ - id: ruff
13
+ name: ruff (Python linter)
14
+ args: [--fix]
15
+ - id: ruff-format
16
+ name: ruff-format (Python formatter)
17
+
18
+ # Python syntax and semantic issues
19
+ - repo: https://github.com/pycqa/pylint
20
+ rev: "v3.3.1"
21
+ hooks:
22
+ - id: pylint
23
+ name: pylint (Python code analysis)
24
+ args: [--rcfile=pylintrc]
25
+ types: [python]
26
+ stages: [manual]
27
+
28
+ # Pyink (alternative formatter)
29
+ - repo: local
30
+ hooks:
31
+ - id: pyink
32
+ name: pyink (Python formatter)
33
+ entry: pyink
34
+ args: [--diff]
35
+ language: system
36
+ types: [python]
37
+
38
+ # General
39
+ - repo: https://github.com/pre-commit/pre-commit-hooks
40
+ rev: "v5.0.0"
41
+ hooks:
42
+ - id: trailing-whitespace
43
+ name: trailing whitespace
44
+ - id: end-of-file-fixer
45
+ name: end of file fixer
46
+ - id: check-yaml
47
+ name: check yaml
48
+ - id: check-toml
49
+ name: check toml
50
+ - id: check-added-large-files
51
+ name: check for added large files
52
+ args: [--maxkb=500]
53
+ - id: mixed-line-ending
54
+ name: mixed line ending
55
+ args: [--fix=no]
@@ -0,0 +1,96 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ `by-framework` is a distributed, high-performance Agent scheduling engine built on Redis Streams. It provides a framework for building AI agents with self-driven orchestration and sandbox isolation capabilities.
8
+
9
+ ## Build Commands
10
+
11
+ ```bash
12
+ # Install dependencies
13
+ make install
14
+
15
+ # Format code (isort + ruff + pyink)
16
+ make format
17
+
18
+ # Lint code (pylint + ruff)
19
+ make lint
20
+
21
+ # Run all tests
22
+ make test
23
+
24
+ # Run a single test file
25
+ uv run pytest tests/worker/test_gateway_worker.py
26
+
27
+ # Run tests matching a pattern
28
+ uv run pytest -k "test_name_pattern"
29
+ ```
30
+
31
+ ## Architecture
32
+
33
+ ### Core Data Flow
34
+
35
+ ```
36
+ Client → Redis Input MQ (queue:ctrl:{agent_type}) → GatewayWorker
37
+
38
+ Redis Data MQ (queue:data:stream)
39
+
40
+ WebSocket Backend
41
+ ```
42
+
43
+ ### Key Components
44
+
45
+ | Component | Location | Purpose |
46
+ |-----------|----------|---------|
47
+ | `GatewayWorker` | `src/by_framework/worker/worker.py` | Abstract base class for workers; implement `get_capabilities()` and `process_command()` |
48
+ | `AgentContext` | `src/by_framework/worker/context.py` | Runtime context for task execution; emits chunks, states, artifacts; calls other agents |
49
+ | `run_worker()` | `src/by_framework/worker/app.py` | Main entry point for starting a worker |
50
+ | `GatewayClient` | `src/by_framework/client/client.py` | Sends commands to Redis Streams |
51
+ | `ByaiGatewayClient` | `src/by_framework/client/byai_client.py` | GatewayClient with ByaiMessageInterceptor |
52
+ | `Plugin` | `src/by_framework/core/extensions/plugin.py` | Abstract base for extensible plugins with lifecycle hooks |
53
+ | `PluginRegistry` | `src/by_framework/core/extensions/registry.py` | Manages plugin registration and discovery |
54
+
55
+ ### Protocol System
56
+
57
+ Commands and events are defined in `src/by_framework/core/protocol/`:
58
+ - `commands.py` - `AskAgentCommand`, `CancelTaskCommand`, `ResumeCommand`
59
+ - `events.py` - `StreamChunkEvent`, `StateChangeEvent`, `ArtifactEvent`
60
+ - `message_header.py` - `MessageHeader` with session_id, trace_id, message_id
61
+
62
+ ### Plugin Lifecycle Hooks
63
+
64
+ Plugins can implement: `on_worker_startup`, `on_worker_shutdown`, `on_task_start`, `on_task_complete`, `on_task_error`, `on_task_cancel`
65
+
66
+ ### Redis Key Patterns
67
+
68
+ - `queue:ctrl:{agent_type}` - Control stream for agent commands
69
+ - `queue:data:stream` - Data stream for events/chunks
70
+ - `worker:active:{worker_id}` - Worker heartbeat registration
71
+
72
+ ## Test Structure
73
+
74
+ Tests are organized by module in `tests/`:
75
+ - `tests/common/` - Logger, redis client, config, exceptions
76
+ - `tests/core/` - Registry, protocol, history
77
+ - `tests/worker/` - Worker, context, processor, sandbox
78
+ - `tests/client/` - Client functionality
79
+ - `tests/plugin/` - Plugin system and discovery
80
+ - `tests/integration/` - Cross-component flows (scatter-gather, callbacks, ask_user)
81
+
82
+ ## Code Style
83
+
84
+ - **Import sorting**: isort
85
+ - **Formatting**: ruff-format + pyink
86
+ - **Linting**: pylint (with `pylintrc`) + ruff
87
+ - **Testing**: pytest with pytest-asyncio
88
+
89
+ Pre-commit hooks are configured in `.pre-commit-config.yaml` and run isort, ruff, pylint, pyink, and general checks.
90
+
91
+ ## Development Notes
92
+
93
+ - Package is at `src/by_framework/` (configured in `pyproject.toml`)
94
+ - `pythonpath = ["src"]` is set in pytest config
95
+ - Redis 7.0+ is required for Streams functionality
96
+ - Worker capabilities are declared via `get_capabilities()` and used for task routing
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,36 @@
1
+ # Makefile for by-framework-python
2
+
3
+ .PHONY: all install format lint test clean
4
+
5
+ # Default target
6
+ all: format lint test
7
+
8
+ # Install dependencies using uv
9
+ install:
10
+ uv sync --all-extras
11
+
12
+ # Format code using isort, ruff and pyink (matches autoformat.sh)
13
+ format:
14
+ @echo "Organizing imports and fixing common issues..."
15
+ uv run isort src/ tests/
16
+ uv run ruff check --fix src/ tests/
17
+ @echo "Auto-formatting code..."
18
+ uv run find -L src/ -not -path "*/.*" -type f -name "*.py" -exec pyink --config pyproject.toml {} +
19
+ uv run find -L tests/ -not -path "*/.*" -type f -name "*.py" -exec pyink --config pyproject.toml {} +
20
+
21
+ # Linting using pylint and ruff
22
+ lint:
23
+ uv run pylint src/ tests/
24
+ uv run ruff check src/ tests/
25
+
26
+ # Run tests
27
+ test:
28
+ uv run pytest
29
+
30
+ # Clean up temporary files
31
+ clean:
32
+ find . -type d -name "__pycache__" -exec rm -rf {} +
33
+ rm -rf .pytest_cache .ruff_cache .mypy_cache .coverage
34
+ rm -rf htmlcov
35
+ rm -rf dist build *.egg-info
36
+ rm -rf gateway-sdk.log