mojox 0.1.0__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.
- mojox-0.1.0/.gitignore +5 -0
- mojox-0.1.0/LICENSE +21 -0
- mojox-0.1.0/PKG-INFO +8 -0
- mojox-0.1.0/mojox/__init__.py +1 -0
- mojox-0.1.0/mojox/_cli.py +25 -0
- mojox-0.1.0/pyproject.toml +14 -0
mojox-0.1.0/.gitignore
ADDED
mojox-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Conobi
|
|
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.
|
mojox-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""mojox: CLI wrapper for Mojo with automatic package discovery."""
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Wrapper around mojo that auto-injects -I for installed Mojo packages."""
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
import sysconfig
|
|
5
|
+
|
|
6
|
+
# Mojo subcommands that accept -I for import paths
|
|
7
|
+
_SUBCOMMANDS = {"run", "build", "test", "repl", "doc", "package", "format", "debug"}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main():
|
|
11
|
+
pkg = sysconfig.get_path("platlib") + "/mojo_packages"
|
|
12
|
+
lib = pkg + "/lib"
|
|
13
|
+
|
|
14
|
+
# Set library paths (read by mojo's exec_mojo -> os.execve)
|
|
15
|
+
for var in ("LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"):
|
|
16
|
+
existing = os.environ.get(var, "")
|
|
17
|
+
os.environ[var] = f"{lib}:{existing}" if existing else lib
|
|
18
|
+
|
|
19
|
+
# Inject -I after the subcommand, only for subcommands that accept it
|
|
20
|
+
if len(sys.argv) > 1 and sys.argv[1] in _SUBCOMMANDS:
|
|
21
|
+
sys.argv.insert(2, f"-I{pkg}")
|
|
22
|
+
|
|
23
|
+
from mojo._entrypoints import exec_mojo
|
|
24
|
+
|
|
25
|
+
exec_mojo()
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "mojox"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "CLI wrapper for Mojo with automatic package discovery"
|
|
5
|
+
license = "MIT"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
dependencies = ["mojo-compiler"]
|
|
8
|
+
|
|
9
|
+
[project.scripts]
|
|
10
|
+
mojox = "mojox._cli:main"
|
|
11
|
+
|
|
12
|
+
[build-system]
|
|
13
|
+
requires = ["hatchling"]
|
|
14
|
+
build-backend = "hatchling.build"
|