adelie-ai 0.2.9 → 0.2.11
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.
- package/adelie/__init__.py +1 -1
- package/adelie/commands/workspace.py +7 -1
- package/bin/adelie.js +4 -4
- package/package.json +1 -1
package/adelie/__init__.py
CHANGED
|
@@ -84,7 +84,13 @@ def cmd_init(args) -> None:
|
|
|
84
84
|
"""Initialize a new Adelie workspace."""
|
|
85
85
|
from adelie import registry
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
# Resolve relative to user's actual CWD (ADELIE_CWD), not the Python process
|
|
88
|
+
# cwd (which is set to PKG_ROOT so that 'from adelie import ...' works).
|
|
89
|
+
import os
|
|
90
|
+
user_cwd = Path(os.environ.get("ADELIE_CWD", os.getcwd())).resolve()
|
|
91
|
+
raw_dir = args.directory if args.directory != "." else str(user_cwd)
|
|
92
|
+
target = (user_cwd / raw_dir).resolve() if not Path(raw_dir).is_absolute() else Path(raw_dir).resolve()
|
|
93
|
+
|
|
88
94
|
adelie_dir = target / ".adelie"
|
|
89
95
|
|
|
90
96
|
if adelie_dir.exists() and not args.force:
|
package/bin/adelie.js
CHANGED
|
@@ -67,15 +67,15 @@ function ensureVenv() {
|
|
|
67
67
|
|
|
68
68
|
ensureVenv();
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
// Run adelie as a module so Python adds PKG_ROOT to sys.path automatically.
|
|
71
|
+
// ADELIE_CWD preserves the user's actual working directory for workspace detection.
|
|
72
|
+
const child = spawn(PYTHON_BIN, ["-m", "adelie.cli", ...process.argv.slice(2)], {
|
|
73
|
+
cwd: PKG_ROOT,
|
|
72
74
|
stdio: "inherit",
|
|
73
75
|
env: {
|
|
74
76
|
...process.env,
|
|
75
77
|
ADELIE_PKG_ROOT: PKG_ROOT,
|
|
76
78
|
ADELIE_CWD: process.cwd(),
|
|
77
|
-
// Ensure 'adelie' package is importable regardless of install method
|
|
78
|
-
PYTHONPATH: PKG_ROOT + (process.env.PYTHONPATH ? path.delimiter + process.env.PYTHONPATH : ""),
|
|
79
79
|
},
|
|
80
80
|
});
|
|
81
81
|
|