@zils/cli 0.4.11 → 0.4.12

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/bootstrap.py CHANGED
@@ -83,6 +83,23 @@ def install(python, wheel):
83
83
  )
84
84
 
85
85
 
86
+ def create_runtime(environment):
87
+ """`python -m venv`. Debian and Ubuntu ship python3 without ensurepip, so this is the step
88
+ that fails on a fresh box; say which package fixes it instead of a bare exit status."""
89
+ try:
90
+ subprocess.run(
91
+ [sys.executable, "-I", "-m", "venv", str(environment)],
92
+ stdout=sys.stderr,
93
+ check=True,
94
+ )
95
+ except subprocess.CalledProcessError as error:
96
+ raise RuntimeError(
97
+ f"{sys.executable} cannot create a virtual environment (python3 -m venv failed). On"
98
+ " Debian or Ubuntu run: sudo apt install python3-venv (or python3.X-venv for your"
99
+ " Python), then retry"
100
+ ) from error
101
+
102
+
86
103
  def runtime():
87
104
  package = Path(__file__).resolve().parent
88
105
  version = json.loads((package / "package.json").read_text())["version"]
@@ -110,11 +127,7 @@ def runtime():
110
127
  ready.unlink(missing_ok=True)
111
128
  if environment.exists():
112
129
  shutil.rmtree(environment)
113
- subprocess.run(
114
- [sys.executable, "-I", "-m", "venv", str(environment)],
115
- stdout=sys.stderr,
116
- check=True,
117
- )
130
+ create_runtime(environment)
118
131
  install(python, wheel)
119
132
  ready.write_text(digest + "\n")
120
133
  return python
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zils/cli",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
4
4
  "description": "Sign in, train, and call Zils decision models from your terminal",
5
5
  "license": "MIT",
6
6
  "homepage": "https://zils.ai",
index 737622d..9ca98ec 100644
Binary file