hython-cli 0.1.0__py3-none-macosx_11_0_arm64.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.
|
Binary file
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hython-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
8
|
+
Classifier: Environment :: Console
|
|
9
|
+
Summary: Zero-Interruption Python Automation Engine
|
|
10
|
+
Author: Hython Labs
|
|
11
|
+
License: MIT
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
14
|
+
|
|
15
|
+
# Hython ⚡
|
|
16
|
+
### Zero-Interruption Python Automation
|
|
17
|
+
|
|
18
|
+
> **"Don't ask the developer to fix something that Hython can safely fix itself.
|
|
19
|
+
> And after fixing it: Tell the developer what happened, without making them participate in the process."**
|
|
20
|
+
|
|
21
|
+
Hython is an automation-first Python environment orchestrator written in **Rust**. It eliminates the friction of managing virtual environments, installing missing dependencies, matching Python versions, and typing routine answers to `[Y/n]` prompts.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## The Mental Model
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
Developer intent (`hython` or `hython run script.py`)
|
|
29
|
+
↓
|
|
30
|
+
Hython inspects project & requirements
|
|
31
|
+
↓
|
|
32
|
+
Hython resolves environment & runtimes
|
|
33
|
+
↓
|
|
34
|
+
Hython fixes safe problems automatically
|
|
35
|
+
↓
|
|
36
|
+
Hython runs the project
|
|
37
|
+
↓
|
|
38
|
+
Hython reports what happened (concise post-action summary)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The developer should think:
|
|
42
|
+
> *I have a Python project. I want to run it. `hython`. That's it.*
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Key Features
|
|
47
|
+
|
|
48
|
+
- 🚫 **No Routine Prompts:** Never stops execution for safe, deterministic actions like creating `.venv` or installing missing dependencies.
|
|
49
|
+
- 🩺 **Self-Healing Environments:** If `.venv` is missing, damaged, or out-of-sync, Hython recreates or synchronizes it seamlessly.
|
|
50
|
+
- 🧠 **Automatic IDE & Framework IntelliSense:** Instantly writes `.vscode/settings.json` and `pyrightconfig.json` so editors lock onto the environment. Automatically provisions framework type stubs (e.g. `django-stubs`, `django-stubs-ext`, `pandas-stubs`) so Django ORM autocompletion and hover documentation work out-of-the-box with zero configuration.
|
|
51
|
+
- 📦 **Dynamic Import Healing:** Intercepts `ModuleNotFoundError` during both pre-flight static analysis and runtime execution. It maps module names to PyPI packages (e.g. `yaml` → `PyYAML`, `dateutil` → `python-dateutil`, `PIL` → `Pillow`, `psycopg2` → `psycopg2-binary`) and installs them automatically.
|
|
52
|
+
- 🎯 **Intelligent Runtime Selection:** Parses `requires-python` (e.g. `>=3.12, <3.14`). If your default interpreter is Python 3.14, Hython discovers or auto-provisions Python 3.13 without manual setup.
|
|
53
|
+
- 🤫 **Quiet & Instant When Warm:** Once an environment is ready and synchronized, `hython` introduces near-zero overhead and runs completely silently.
|
|
54
|
+
- 📊 **Calm Post-Action Summary:** Reports what was detected, selected, installed, and executed only when actions took place.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Quick Start
|
|
59
|
+
|
|
60
|
+
### Installation
|
|
61
|
+
|
|
62
|
+
**Via pip (Recommended):**
|
|
63
|
+
```bash
|
|
64
|
+
pip install hython-cli
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Via Cargo:**
|
|
68
|
+
```bash
|
|
69
|
+
cargo install --path .
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Build from Source:**
|
|
73
|
+
```bash
|
|
74
|
+
cargo build --release
|
|
75
|
+
# Standalone binary located at target/release/hython
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Usage
|
|
81
|
+
|
|
82
|
+
### 1. Automatic Project Detection & Execution
|
|
83
|
+
In any project folder (Django, FastAPI, Flask, or script-based):
|
|
84
|
+
```bash
|
|
85
|
+
hython
|
|
86
|
+
```
|
|
87
|
+
- If Django is detected (`manage.py`): runs `manage.py runserver`.
|
|
88
|
+
- If FastAPI is detected (`main.py` with `FastAPI()`): ensures `uvicorn` and runs `uvicorn main:app --reload`.
|
|
89
|
+
- If standard entrypoint (`main.py`, `app.py`, `run.py`): executes with project environment.
|
|
90
|
+
|
|
91
|
+
### 2. Run Any Script with Self-Healing
|
|
92
|
+
```bash
|
|
93
|
+
hython app.py
|
|
94
|
+
```
|
|
95
|
+
If `app.py` imports a missing package, Hython resolves it, installs it, runs `app.py`, and displays a clean summary.
|
|
96
|
+
|
|
97
|
+
### 3. Run Environment Tools
|
|
98
|
+
```bash
|
|
99
|
+
hython pytest
|
|
100
|
+
hython manage.py migrate
|
|
101
|
+
hython -m pip list
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### 4. Add a Dependency Without Prompts
|
|
105
|
+
```bash
|
|
106
|
+
hython add requests
|
|
107
|
+
```
|
|
108
|
+
Updates `pyproject.toml` or `requirements.txt` and synchronizes the environment immediately.
|
|
109
|
+
|
|
110
|
+
### 5. Explicit Synchronization & Status
|
|
111
|
+
```bash
|
|
112
|
+
hython sync # Reconciles environment and dependencies
|
|
113
|
+
hython status # Inspects detected project root, manifest, and runtime
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## Architecture
|
|
119
|
+
|
|
120
|
+
| Module | Responsibility |
|
|
121
|
+
| :--- | :--- |
|
|
122
|
+
| [`src/main.rs`](file:///Volumes/harsha's%20SSD/Hython/src/main.rs) | CLI entrypoint, argument dispatch, zero-argument project auto-detection |
|
|
123
|
+
| [`src/manifest.rs`](file:///Volumes/harsha's%20SSD/Hython/src/manifest.rs) | Inspects `pyproject.toml`, `requirements.txt`, `.python-version`, entry points |
|
|
124
|
+
| [`src/runtime.rs`](file:///Volumes/harsha's%20SSD/Hython/src/runtime.rs) | SemVer constraint matching, local Python discovery, standalone runtime provisioning |
|
|
125
|
+
| [`src/env.rs`](file:///Volumes/harsha's%20SSD/Hython/src/env.rs) | `.venv` lifecycle, state hashing (`.venv/.hython-state.json`), dependency synchronization |
|
|
126
|
+
| [`src/scanner.rs`](file:///Volumes/harsha's%20SSD/Hython/src/scanner.rs) | Fast static AST/regex import scanning for pre-flight missing package detection |
|
|
127
|
+
| [`src/resolver.rs`](file:///Volumes/harsha's%20SSD/Hython/src/resolver.rs) | Standard library filter and module-to-PyPI package name mapping |
|
|
128
|
+
| [`src/runner.rs`](file:///Volumes/harsha's%20SSD/Hython/src/runner.rs) | Execution supervisor with dynamic runtime `ModuleNotFoundError` interception & self-healing |
|
|
129
|
+
| [`src/reporter.rs`](file:///Volumes/harsha's%20SSD/Hython/src/reporter.rs) | Transparent, non-intrusive post-action summary formatter |
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## License
|
|
134
|
+
|
|
135
|
+
MIT
|
|
136
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
hython_cli-0.1.0.data/scripts/hython,sha256=YfxrfspkW2xWu_trkr3rWmHLX1eATNpo1tqKCJMPpzA,2910320
|
|
2
|
+
hython_cli-0.1.0.dist-info/METADATA,sha256=_Mofm4gPNfJ0weoH9bar-6649q1-MUqpUIeKm21VAZs,5534
|
|
3
|
+
hython_cli-0.1.0.dist-info/WHEEL,sha256=U927pSLvWHh5eaqcN5v72CdMm-HUWF344fKLe8HhSOU,102
|
|
4
|
+
hython_cli-0.1.0.dist-info/sboms/hython.cyclonedx.json,sha256=2Exv2nwPlZFMOh5xk3Whf-RSIbtcW5oCEBYtmlWPItc,158278
|
|
5
|
+
hython_cli-0.1.0.dist-info/RECORD,,
|