hython-cli 0.1.1__tar.gz → 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 (39) hide show
  1. {hython_cli-0.1.1 → hython_cli-0.1.2}/.gitignore +1 -0
  2. {hython_cli-0.1.1 → hython_cli-0.1.2}/Cargo.lock +1 -1
  3. hython_cli-0.1.2/Cargo.toml +44 -0
  4. hython_cli-0.1.2/LICENSE +21 -0
  5. hython_cli-0.1.2/PKG-INFO +121 -0
  6. hython_cli-0.1.2/README.md +100 -0
  7. {hython_cli-0.1.1 → hython_cli-0.1.2}/pyproject.toml +7 -1
  8. hython_cli-0.1.2/src/dashboard.rs +28 -0
  9. hython_cli-0.1.2/src/django.rs +583 -0
  10. hython_cli-0.1.2/src/doctor.rs +82 -0
  11. hython_cli-0.1.2/src/dotenv.rs +35 -0
  12. hython_cli-0.1.2/src/intellisense.rs +206 -0
  13. hython_cli-0.1.2/src/main.rs +988 -0
  14. {hython_cli-0.1.1 → hython_cli-0.1.2}/src/manifest.rs +18 -0
  15. hython_cli-0.1.2/src/port.rs +100 -0
  16. hython_cli-0.1.2/src/resolver.rs +327 -0
  17. hython_cli-0.1.2/src/runner.rs +200 -0
  18. {hython_cli-0.1.1 → hython_cli-0.1.2}/src/runtime.rs +6 -0
  19. hython_cli-0.1.2/src/scaffold.rs +454 -0
  20. {hython_cli-0.1.1 → hython_cli-0.1.2}/src/scanner.rs +8 -4
  21. hython_cli-0.1.2/src/watcher.rs +253 -0
  22. {hython_cli-0.1.1 → hython_cli-0.1.2}/tests/integration_tests.rs +1 -1
  23. hython_cli-0.1.1/.github/workflows/release.yml +0 -61
  24. hython_cli-0.1.1/Cargo.toml +0 -23
  25. hython_cli-0.1.1/MONETIZATION.md +0 -104
  26. hython_cli-0.1.1/PHILOSOPHY.md +0 -71
  27. hython_cli-0.1.1/PKG-INFO +0 -115
  28. hython_cli-0.1.1/README.md +0 -100
  29. hython_cli-0.1.1/install.sh +0 -57
  30. hython_cli-0.1.1/src/intellisense.rs +0 -161
  31. hython_cli-0.1.1/src/main.rs +0 -382
  32. hython_cli-0.1.1/src/resolver.rs +0 -100
  33. hython_cli-0.1.1/src/runner.rs +0 -100
  34. {hython_cli-0.1.1 → hython_cli-0.1.2}/src/env.rs +0 -0
  35. {hython_cli-0.1.1 → hython_cli-0.1.2}/src/formatter.rs +0 -0
  36. {hython_cli-0.1.1 → hython_cli-0.1.2}/src/reporter.rs +0 -0
  37. {hython_cli-0.1.1 → hython_cli-0.1.2}/tests/live_pypi_sandbox_test.sh +0 -0
  38. {hython_cli-0.1.1 → hython_cli-0.1.2}/tests/sandbox_suite.sh +0 -0
  39. {hython_cli-0.1.1 → hython_cli-0.1.2}/tests/security_tests.sh +0 -0
@@ -5,3 +5,4 @@ __pycache__/
5
5
  .DS_Store
6
6
  .vscode/
7
7
  pyrightconfig.json
8
+ site-backup-contour/
@@ -348,7 +348,7 @@ dependencies = [
348
348
 
349
349
  [[package]]
350
350
  name = "hython"
351
- version = "0.1.1"
351
+ version = "0.1.2"
352
352
  dependencies = [
353
353
  "clap",
354
354
  "colored",
@@ -0,0 +1,44 @@
1
+ [package]
2
+ name = "hython"
3
+ version = "0.1.2"
4
+ edition = "2021"
5
+ description = "Zero-Interruption Python Automation Engine"
6
+ license = "MIT"
7
+ readme = "README.md"
8
+ homepage = "https://hython.dev"
9
+ repository = "https://github.com/hython-labs/hython"
10
+ documentation = "https://hython.dev/docs/"
11
+ exclude = [
12
+ "site",
13
+ "site/**/*",
14
+ "site-backup-contour",
15
+ "site-backup-contour/**/*",
16
+ ".github",
17
+ ".github/**/*",
18
+ ".vscode",
19
+ ".vscode/**/*",
20
+ ".venv",
21
+ ".venv/**/*",
22
+ "DOCUMENTATION.md",
23
+ "MONETIZATION.md",
24
+ "PHILOSOPHY.md",
25
+ "install.sh",
26
+ ]
27
+
28
+ [[bin]]
29
+ name = "hython"
30
+ path = "src/main.rs"
31
+
32
+ [dependencies]
33
+ clap = { version = "4.5", features = ["derive"] }
34
+ serde = { version = "1.0", features = ["derive"] }
35
+ serde_json = "1.0"
36
+ toml = "0.8"
37
+ colored = "2.1"
38
+ regex = "1.10"
39
+ sha2 = "0.10"
40
+ which = "6.0"
41
+ walkdir = "2.5"
42
+ ureq = { version = "2.10", features = ["json", "native-tls"], default-features = false }
43
+ tar = "0.4"
44
+ flate2 = "1.0"
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hython Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,121 @@
1
+ Metadata-Version: 2.4
2
+ Name: hython-cli
3
+ Version: 0.1.2
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
+ License-File: LICENSE
10
+ Summary: Zero-Interruption Python Automation Engine
11
+ Home-Page: https://hython.dev
12
+ Author: Hython Labs
13
+ License: MIT
14
+ Requires-Python: >=3.8
15
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
16
+ Project-URL: Changelog, https://hython.dev/changelog/
17
+ Project-URL: Documentation, https://hython.dev/docs/
18
+ Project-URL: Homepage, https://hython.dev
19
+ Project-URL: Repository, https://github.com/hython-labs/hython
20
+
21
+ # Hython ⚡
22
+ ### Zero-Interruption Python Automation
23
+
24
+ > **"Don't ask the developer to fix something that Hython can safely fix itself.
25
+ > And after fixing it: Tell the developer what happened, without making them participate in the process."**
26
+
27
+ Hython is an automation-first Python environment orchestrator and developer workflow engine. It completely eliminates the friction of managing virtual environments, installing missing dependencies, matching Python versions, configuring IDE settings, and answering routine `[Y/n]` prompts.
28
+
29
+ 📖 **For detailed step-by-step guides with real-world project walkthroughs, see [Official Documentation](https://hython.dev/docs/).**
30
+
31
+ ---
32
+
33
+ ## The Mental Model
34
+
35
+ ```text
36
+ Developer intent (`hython` or `hython app.py`)
37
+ ↓
38
+ Hython inspects project & requirements
39
+ ↓
40
+ Hython resolves environment & runtimes
41
+ ↓
42
+ Hython fixes safe problems automatically (auto-installs, auto-migrates, auto-imports)
43
+ ↓
44
+ Hython runs the project & reports concisely
45
+ ```
46
+
47
+ The developer should think:
48
+ > *I have a Python project. I want to build and run it. `hython`. That's it.*
49
+
50
+ ---
51
+
52
+ ## Key Features
53
+
54
+ - 🚫 **No Routine Prompts:** Never stops execution for safe, deterministic actions like creating `.venv` or installing missing dependencies.
55
+ - ⚡ **Live Auto-Import Watcher (`hython watch`):** Monitors your code in real-time. Whenever you save a file in VS Code or Cursor, Hython detects unbound symbols (e.g. `JsonResponse`, `requests`, `models`), auto-installs any missing packages, and inserts the import statements into your code automatically.
56
+ - 🛠️ **Zero-Boilerplate Project Scaffolding (`hython new`):** Create production-ready Django, FastAPI, Flask, or script projects in 1 command with pre-warmed virtualenvs, `.env`, `.gitignore`, and IDE configs.
57
+ - 🩺 **Self-Healing Environments:** If `.venv` is missing, corrupted, or out-of-sync, Hython recreates or synchronizes it seamlessly.
58
+ - 📦 **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.
59
+ - 🧠 **Automatic IDE & Framework IntelliSense:** Instantly writes `.vscode/settings.json`, `.vscode/extensions.json`, and `pyrightconfig.json` with Pylance depth 5 package indexing and type stubs (`django-stubs`, `django-stubs-ext`). Autocomplete and auto-import proposals work lively as you type.
60
+ - 🗄️ **Pre-Flight Django Auto-Migrations:** Detects unmade model changes via dry-run check, automatically generates migrations, and applies them before server or test launch.
61
+ - 🔌 **Auto-Wiring Django Apps:** When you run `hython manage.py startapp <app>`, Hython automatically registers the new app in `INSTALLED_APPS` inside `settings.py`.
62
+ - 🌐 **Instant Free-Port Routing:** Automatically checks if ports (8000, 5000, 8888) are busy (e.g. macOS AirPlay Receiver on port 5000) and smoothly shifts to a free port without crashing.
63
+ - 🛡️ **One-Command CORS (`hython cors`):** Configures CORS middleware for Django, FastAPI, or Flask in one command.
64
+ - 👤 **Instant Dev Superuser (`hython superuser`):** Provisions `admin`/`admin` development credentials with zero prompts.
65
+ - 🧪 **Universal Test Runner (`hython test`):** Routes Django to `manage.py test` and non-Django to `pytest` (auto-installs if missing).
66
+ - 🐳 **Production Docker Generator (`hython docker`):** Generates optimized, security-hardened `Dockerfile` and `.dockerignore`.
67
+ - 🎨 **Automated Code Formatting (`hython fmt`):** Cleans, formats, and sorts imports according to PEP 8 and framework rules using ultra-fast Ruff.
68
+
69
+ ---
70
+
71
+ ## Quick Command Reference
72
+
73
+ ```bash
74
+ # Project Creation & Initialization
75
+ hython new django my_store # Scaffolds Django with .venv, .env, and VS Code configs
76
+ hython new fastapi my_api # Scaffolds FastAPI with Uvicorn and Pydantic
77
+ hython new flask my_web # Scaffolds Flask microservice
78
+ hython init # Initializes project in current directory
79
+
80
+ # Live Auto-Importing & IDE Assistance
81
+ hython watch # Real-time watcher: injects missing imports on save
82
+ hython fix # One-command project-wide auto-import healing
83
+
84
+ # Running & Self-Healing Execution
85
+ hython # Auto-detects framework and runs dev server
86
+ hython script.py # Runs script with automatic dependency resolution
87
+ hython test # Runs test suite (manage.py test or pytest)
88
+
89
+ # Developer Tools
90
+ hython add <package> # Adds dependency to manifest and installs
91
+ hython remove <package> # Removes dependency and uninstalls cleanly
92
+ hython cors # Enables CORS for frontend integration
93
+ hython superuser # Creates dev superuser (admin/admin)
94
+ hython rollback <app> # Reverts latest migration and deletes file
95
+ hython export # Exports dependencies to requirements.txt
96
+ hython docker # Generates production Dockerfile & .dockerignore
97
+ hython doctor # Runs full project & environment health audit
98
+ hython fmt # Formats code to PEP 8 standards
99
+ hython sync # Synchronizes virtual environment with manifest
100
+ hython status # Shows detected project and runtime status
101
+ ```
102
+
103
+ ---
104
+
105
+ ## Complete Documentation & Walkthroughs
106
+
107
+ For in-depth guides with real-world examples:
108
+ - [Django with Hython Workflow](DOCUMENTATION.md#3-workflow-1-django-with-hython)
109
+ - [FastAPI with Hython Workflow](DOCUMENTATION.md#4-workflow-2-fastapi-with-hython)
110
+ - [Flask with Hython Workflow](DOCUMENTATION.md#5-workflow-3-flask-with-hython)
111
+ - [Python Scripts Workflow](DOCUMENTATION.md#6-workflow-4-pure-python-scripts-with-hython)
112
+ - [IDE IntelliSense & Live Auto-Import Engine](DOCUMENTATION.md#7-the-live-ide-intellisense--auto-import-engine)
113
+ - [Production & Tooling](DOCUMENTATION.md#8-production--tooling-workflows)
114
+ - [Traditional Python vs. Hython Comparison Matrix](DOCUMENTATION.md#9-developer-comparison-traditional-python-vs-hython)
115
+
116
+ ---
117
+
118
+ ## License
119
+
120
+ MIT License — Hython Labs
121
+
@@ -0,0 +1,100 @@
1
+ # Hython ⚡
2
+ ### Zero-Interruption Python Automation
3
+
4
+ > **"Don't ask the developer to fix something that Hython can safely fix itself.
5
+ > And after fixing it: Tell the developer what happened, without making them participate in the process."**
6
+
7
+ Hython is an automation-first Python environment orchestrator and developer workflow engine. It completely eliminates the friction of managing virtual environments, installing missing dependencies, matching Python versions, configuring IDE settings, and answering routine `[Y/n]` prompts.
8
+
9
+ 📖 **For detailed step-by-step guides with real-world project walkthroughs, see [Official Documentation](https://hython.dev/docs/).**
10
+
11
+ ---
12
+
13
+ ## The Mental Model
14
+
15
+ ```text
16
+ Developer intent (`hython` or `hython app.py`)
17
+ ↓
18
+ Hython inspects project & requirements
19
+ ↓
20
+ Hython resolves environment & runtimes
21
+ ↓
22
+ Hython fixes safe problems automatically (auto-installs, auto-migrates, auto-imports)
23
+ ↓
24
+ Hython runs the project & reports concisely
25
+ ```
26
+
27
+ The developer should think:
28
+ > *I have a Python project. I want to build and run it. `hython`. That's it.*
29
+
30
+ ---
31
+
32
+ ## Key Features
33
+
34
+ - 🚫 **No Routine Prompts:** Never stops execution for safe, deterministic actions like creating `.venv` or installing missing dependencies.
35
+ - ⚡ **Live Auto-Import Watcher (`hython watch`):** Monitors your code in real-time. Whenever you save a file in VS Code or Cursor, Hython detects unbound symbols (e.g. `JsonResponse`, `requests`, `models`), auto-installs any missing packages, and inserts the import statements into your code automatically.
36
+ - 🛠️ **Zero-Boilerplate Project Scaffolding (`hython new`):** Create production-ready Django, FastAPI, Flask, or script projects in 1 command with pre-warmed virtualenvs, `.env`, `.gitignore`, and IDE configs.
37
+ - 🩺 **Self-Healing Environments:** If `.venv` is missing, corrupted, or out-of-sync, Hython recreates or synchronizes it seamlessly.
38
+ - 📦 **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.
39
+ - 🧠 **Automatic IDE & Framework IntelliSense:** Instantly writes `.vscode/settings.json`, `.vscode/extensions.json`, and `pyrightconfig.json` with Pylance depth 5 package indexing and type stubs (`django-stubs`, `django-stubs-ext`). Autocomplete and auto-import proposals work lively as you type.
40
+ - 🗄️ **Pre-Flight Django Auto-Migrations:** Detects unmade model changes via dry-run check, automatically generates migrations, and applies them before server or test launch.
41
+ - 🔌 **Auto-Wiring Django Apps:** When you run `hython manage.py startapp <app>`, Hython automatically registers the new app in `INSTALLED_APPS` inside `settings.py`.
42
+ - 🌐 **Instant Free-Port Routing:** Automatically checks if ports (8000, 5000, 8888) are busy (e.g. macOS AirPlay Receiver on port 5000) and smoothly shifts to a free port without crashing.
43
+ - 🛡️ **One-Command CORS (`hython cors`):** Configures CORS middleware for Django, FastAPI, or Flask in one command.
44
+ - 👤 **Instant Dev Superuser (`hython superuser`):** Provisions `admin`/`admin` development credentials with zero prompts.
45
+ - 🧪 **Universal Test Runner (`hython test`):** Routes Django to `manage.py test` and non-Django to `pytest` (auto-installs if missing).
46
+ - 🐳 **Production Docker Generator (`hython docker`):** Generates optimized, security-hardened `Dockerfile` and `.dockerignore`.
47
+ - 🎨 **Automated Code Formatting (`hython fmt`):** Cleans, formats, and sorts imports according to PEP 8 and framework rules using ultra-fast Ruff.
48
+
49
+ ---
50
+
51
+ ## Quick Command Reference
52
+
53
+ ```bash
54
+ # Project Creation & Initialization
55
+ hython new django my_store # Scaffolds Django with .venv, .env, and VS Code configs
56
+ hython new fastapi my_api # Scaffolds FastAPI with Uvicorn and Pydantic
57
+ hython new flask my_web # Scaffolds Flask microservice
58
+ hython init # Initializes project in current directory
59
+
60
+ # Live Auto-Importing & IDE Assistance
61
+ hython watch # Real-time watcher: injects missing imports on save
62
+ hython fix # One-command project-wide auto-import healing
63
+
64
+ # Running & Self-Healing Execution
65
+ hython # Auto-detects framework and runs dev server
66
+ hython script.py # Runs script with automatic dependency resolution
67
+ hython test # Runs test suite (manage.py test or pytest)
68
+
69
+ # Developer Tools
70
+ hython add <package> # Adds dependency to manifest and installs
71
+ hython remove <package> # Removes dependency and uninstalls cleanly
72
+ hython cors # Enables CORS for frontend integration
73
+ hython superuser # Creates dev superuser (admin/admin)
74
+ hython rollback <app> # Reverts latest migration and deletes file
75
+ hython export # Exports dependencies to requirements.txt
76
+ hython docker # Generates production Dockerfile & .dockerignore
77
+ hython doctor # Runs full project & environment health audit
78
+ hython fmt # Formats code to PEP 8 standards
79
+ hython sync # Synchronizes virtual environment with manifest
80
+ hython status # Shows detected project and runtime status
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Complete Documentation & Walkthroughs
86
+
87
+ For in-depth guides with real-world examples:
88
+ - [Django with Hython Workflow](DOCUMENTATION.md#3-workflow-1-django-with-hython)
89
+ - [FastAPI with Hython Workflow](DOCUMENTATION.md#4-workflow-2-fastapi-with-hython)
90
+ - [Flask with Hython Workflow](DOCUMENTATION.md#5-workflow-3-flask-with-hython)
91
+ - [Python Scripts Workflow](DOCUMENTATION.md#6-workflow-4-pure-python-scripts-with-hython)
92
+ - [IDE IntelliSense & Live Auto-Import Engine](DOCUMENTATION.md#7-the-live-ide-intellisense--auto-import-engine)
93
+ - [Production & Tooling](DOCUMENTATION.md#8-production--tooling-workflows)
94
+ - [Traditional Python vs. Hython Comparison Matrix](DOCUMENTATION.md#9-developer-comparison-traditional-python-vs-hython)
95
+
96
+ ---
97
+
98
+ ## License
99
+
100
+ MIT License — Hython Labs
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "hython-cli"
7
- version = "0.1.1"
7
+ version = "0.1.2"
8
8
  description = "Zero-Interruption Python Automation Engine"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -18,6 +18,12 @@ classifiers = [
18
18
  "Environment :: Console",
19
19
  ]
20
20
 
21
+ [project.urls]
22
+ Homepage = "https://hython.dev"
23
+ Documentation = "https://hython.dev/docs/"
24
+ Repository = "https://github.com/hython-labs/hython"
25
+ Changelog = "https://hython.dev/changelog/"
26
+
21
27
  [tool.maturin]
22
28
  bindings = "bin"
23
29
  strip = true
@@ -0,0 +1,28 @@
1
+ use colored::Colorize;
2
+ use crate::manifest::ProjectInfo;
3
+ use crate::runtime::PythonInterpreter;
4
+
5
+ pub fn print_server_dashboard(project: &ProjectInfo, runtime: &PythonInterpreter, port: u16, framework_name: &str) {
6
+ let proj_name = project.root_dir.file_name().unwrap_or_default().to_string_lossy();
7
+ println!();
8
+ println!(
9
+ "{} {} ── {} ({})",
10
+ "⚡ Hython".cyan().bold(),
11
+ format!("v{}", env!("CARGO_PKG_VERSION")).dimmed(),
12
+ proj_name.bold(),
13
+ framework_name.green()
14
+ );
15
+ println!("{}", "────────────────────────────────────────────────────────────".dimmed());
16
+ println!(" 🌍 App URL: {}", format!("http://127.0.0.1:{}/", port).cyan().bold());
17
+ if framework_name == "Django" {
18
+ println!(" 🛡️ Admin Panel: {}", format!("http://127.0.0.1:{}/admin", port).cyan());
19
+ } else if framework_name == "FastAPI" {
20
+ println!(" 📚 Swagger Docs: {}", format!("http://127.0.0.1:{}/docs", port).cyan());
21
+ println!(" ⚡ ReDoc: {}", format!("http://127.0.0.1:{}/redoc", port).cyan());
22
+ }
23
+ println!(" 📦 Runtime: Python {} in .venv", runtime.version);
24
+ println!(" ✨ IntelliSense: Active (VS Code / Pyright / Cursor)");
25
+ println!("{}", "────────────────────────────────────────────────────────────".dimmed());
26
+ println!("{}", "Watching for changes... (Press Ctrl+C to stop)".dimmed());
27
+ println!();
28
+ }