Skip to content

Commit 8bef0cc

Browse files
committed
Merge branch 'main' of https://github.com/Ghua8088/pytron
2 parents 8869c15 + c59199e commit 8bef0cc

119 files changed

Lines changed: 12185 additions & 2171 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
rust_native:
2929
- 'pytron/engines/native/**'
3030
- 'pytron/engines/native/Cargo.toml'
31+
- 'pytron/platforms/pytron_os/**'
3132
rust_loader:
3233
- 'pytron/pack/secure_loader/**'
3334
- 'pytron/pack/secure_loader/Cargo.toml'
@@ -75,6 +76,7 @@ jobs:
7576
workspaces: |
7677
pytron/engines/native
7778
pytron/pack/secure_loader
79+
pytron/platforms/pytron_os
7880
7981
- name: 🛡️ Build Rust Loader
8082
if: steps.filter.outputs.rust_loader == 'true' || github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v')
@@ -84,6 +86,10 @@ jobs:
8486
if: steps.filter.outputs.rust_native == 'true' || github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v')
8587
run: python pytron/engines/native/build.py
8688

89+
- name: 🦾 Build OS Platform Hook
90+
if: steps.filter.outputs.rust_native == 'true' || github.event_name == 'push' || startsWith(github.ref, 'refs/tags/v')
91+
run: python pytron/platforms/pytron_os/build.py
92+
8793
- name: 📦 Build Platform Wheel
8894
shell: bash
8995
run: |

.github/workflows/tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
rust_native:
2828
- 'pytron/engines/native/**'
2929
- 'pytron/engines/native/Cargo.toml'
30+
- 'pytron/platforms/pytron_os/**'
3031
rust_loader:
3132
- 'pytron/pack/secure_loader/**'
3233
- 'pytron/pack/secure_loader/Cargo.toml'
@@ -48,6 +49,7 @@ jobs:
4849
workspaces: |
4950
pytron/engines/native
5051
pytron/pack/secure_loader
52+
pytron/platforms/pytron_os
5153
5254
- name: Install Linux Dependencies
5355
if: matrix.os == 'ubuntu-latest'
@@ -81,6 +83,8 @@ jobs:
8183
run: |
8284
if [ "${{ steps.filter.outputs.rust_native }}" == "true" ]; then
8385
cd pytron/engines/native && cargo check
86+
cd ../../../pytron/platforms/pytron_os && cargo check
87+
cd ../../../
8488
fi
8589
if [ "${{ steps.filter.outputs.rust_loader }}" == "true" ]; then
8690
cd pytron/pack/secure_loader && cargo check
@@ -90,6 +94,10 @@ jobs:
9094
- name: 🦾 Build Native Engine
9195
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (steps.filter.outputs.rust_native == 'true') || startsWith(github.ref, 'refs/tags/v')
9296
run: python pytron/engines/native/build.py
97+
98+
- name: 🦾 Build OS Platform Hook
99+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (steps.filter.outputs.rust_native == 'true') || startsWith(github.ref, 'refs/tags/v')
100+
run: python pytron/platforms/pytron_os/build.py
93101

94102
- name: Run Tests
95103
run: |

ARCHITECTURE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,21 @@ Pytron uses a curated stack of robust open-source technologies to power its feat
6060
- **[PyInstaller](https://pyinstaller.org/)**: The default choices for `pytron package` due to its excellent compatibility with complex scientific libraries (NumPy, Torch).
6161
- **[Nuitka](https://nuitka.net/)**: Available via `--nuitka`. We support this for developers needing compilation to machine code (C++) for performance-critical applications.
6262
- **Frontend Tooling**: Our CLI scaffolds projects using **[Vite](https://vitejs.dev/)**. We customized the Vite config to proxy requests to our Python backend, enabling a seamless "Hot Module Replacement" experience for dual-stack development.
63+
64+
## Build & Security Pipeline
65+
66+
Pytron introduces a sophisticated build pipeline designed to secure Python applications and ensure reliable dependency resolution.
67+
68+
### Crystal Audit
69+
Traditional Python packagers often struggle with hidden imports, dynamic loading, and complex dependency trees. **Crystal Audit** is Pytron's answer to this challenge.
70+
* **PEP 578 Surveillance**: Crystal Audit launches your application in a controlled environment and attaches a system audit hook (`sys.addaudithook`) to capture every import event as it happens in real-time.
71+
* **Defanged Execution**: To safely analyze side-effects without damaging your system, Crystal "defangs" destructive operations (like `os.remove`, `subprocess.run`, `socket`) by replacing them with aggressive mocks during the audit.
72+
* **Recursive Analysis**: It inspects exposed functions and classes, recursively traversing closures and bytecode to find hidden dependencies that static analysis misses.
73+
* **Precision Manifest**: The result is a `requirements.lock.json` that lists exactly which modules and files were accessed, ensuring a 100% accurate build with zero bloat.
74+
75+
### Secure Pipeline (Agentic Shield)
76+
For enterprise and commercial applications, protecting source code is paramount. The **Secure Pipeline** ensures that your Python logic is not exposed as easily decompilable bytecode.
77+
* **Binary Compilation**: The main entry point and critical modules are compiled to native machine code (`.pyd` / `.so`) using **Cython**. This prevents trivial decompilation (like `uncompyle6`) and requires reverse engineering tools to analyze.
78+
* **Native Bootloader**: A custom Rust-based bootloader ("Agentic Shield") initializes the environment and launches the compiled application, providing a secure native entry point.
79+
* **Library Fusion**: Functionality to bundle distributed Python modules into a single `app.bundle` structure, reducing file clutter and obscuring the standard `_internal` directory layout.
80+
* **Integrity Checks**: The pipeline ensures that the compiled components are correctly linked and loaded, preventing basic tampering.

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.3.14] - 2026-02-08
9+
10+
### Added
11+
- **Credits & Acknowledgments**: Added `CREDITS.md` to honor third-party dependencies (Wry, Tao, Electron, etc.).
12+
- **Support Documentation**: Added `SUPPORT.md` for better community guidance.
13+
- **Improved Manifest**: Updated `MANIFEST.in` to include all documentation and internal architecture files.
14+
15+
### Changed
16+
- **License Rollback**: Reverted to pure Apache 2.0 based on community feedback. We value our open-source roots!
17+
- Refined the packaging pipeline documentation to clarify "Safe" vs "Unsafe" methods in `SECURITY.md`.
18+
- Updated repository metadata in `pyproject.toml` to reflect the current license status.
19+
20+
## [0.3.x] - Earlier Releases
21+
22+
### Added
23+
- **Agentic Shield**: Introduced the new Rust-based secure bootloader.
24+
- **Crystal Audit**: Runtime-audited dependency mapping for 100% accurate builds.
25+
- **Dual Engine Support**: Optional transition between Native Webview (Wry) and Chrome Engine (Electron).
26+
- **Zero-Copy Bridge**: High-speed binary data streaming via `pytron://`.
27+
28+
---
29+
*Note: For older version details, please refer to the GitHub release tags.*

CREDITS.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Credits & Third-Party Acknowledgments
2+
3+
Pytron Kit is built on the shoulders of giants. We are grateful to the following open-source projects and their communities for providing the foundational technologies that make this framework possible.
4+
5+
## Core Rendering & Windowing
6+
* **[Wry](https://github.com/tauri-apps/wry)**: A cross-platform webview rendering library in Rust. Used for our high-performance Native Engine.
7+
* **[Tao](https://github.com/tauri-apps/tao)**: A cross-platform window creation library in Rust.
8+
* **[Electron](https://www.electronjs.org/)**: Used as our optional rendering engine for maximum compatibility and parity with Chromium.
9+
10+
## Internal Engineering
11+
* **[Rust](https://www.rust-lang.org/)**: Powers our secure bootloader and native extensions. Huge thanks for providing the memory safety and performance required for the Agentic Shield.
12+
* **[Zig](https://ziglang.org/)**: Utilized for cross-compilation and native toolchain orchestration. We are grateful for Zig's incredible "it just works" approach to C/C++ toolchains.
13+
* **[Cython](https://cython.org/)**: Used for compiling performance-critical modules and securing the "Agentic Shield" pipeline. Thanks for bridging the gap between Python and C so elegantly.
14+
* **[PyInstaller](https://pyinstaller.org/)**: The reliable workhorse for standard application packaging. Thank you for the years of work that make Python distribution possible.
15+
* **[Nuitka](https://nuitka.net/)**: A Python-to-C++ compiler used for our high-performance machine code builds.
16+
17+
## Python Ecosystem
18+
* **[PyPI](https://pypi.org/)**: The Python Package Index. Huge thanks for hosting the worldwide community of Python software. We'd be nothing without you.
19+
* **[Keyring](https://github.com/jaraco/keyring)**: For providing a secure way to handle secrets and credentials across different OS environments.
20+
* **[Requests](https://requests.readthedocs.io/)**: For making HTTP requests human-friendly and reliable.
21+
* **[Pytest](https://pytest.org/)**: For providing the backbone of our testing suite and ensuring Pytron stays stable.
22+
* **[Comtypes](https://github.com/enthought/comtypes)**: Essential for our deep Win32 COM integrations on Windows.
23+
24+
## Frontend Ecosystem
25+
* **[Vite](https://vitejs.dev/)**: The lightning-fast build tool used for our project scavenging and HMR.
26+
* **[React](https://reactjs.org/)**: The default frontend framework for Pytron project templates.
27+
28+
## Inspiration & Community
29+
* **[pywebview](https://github.com/r0x0r/pywebview)**: Our native engine implementation was heavily inspired by the pioneering work of the pywebview team in bringing web technologies to Python.
30+
* **[Tauri](https://tauri.app/)**: For setting the gold standard in secure, lightweight cross-platform development.
31+
32+
---
33+
34+
### License Note
35+
The use of these libraries is governed by their respective licenses (MIT, Apache 2.0, or BSD). Pytron Kit's use of a "Commons Clause" rider on its own license does not affect the licensing of these dependencies, nor does it claim ownership over their work. We strictly adhere to all attribution requirements for these upstream projects.

MANIFEST.in

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11

22
include README.md
3+
include LICENSE
4+
include CREDITS.md
5+
include ARCHITECTURE.md
6+
include CHANGELOG.md
7+
include SUPPORT.md
38
include pyproject.toml
49

510
# 1. Include the core package
6-
recursive-include pytron *.py *.png *.ico *.exe *.md *.dll *.so *.pyd *.dylib *.lib
11+
recursive-include pytron *.py *.png *.ico *.exe *.md *.dll *.so *.pyd *.dylib *.lib *.a
712
recursive-include pytron/dependencies *
13+
recursive-include pytron/pack/secure_loader/bin *
814

915
# 2. Android Shell - The "Allow List"
1016
# We match specifically to avoid dragging in temp files

0 commit comments

Comments
 (0)