rapidkit 0.14.0 → 0.14.1

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/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rapidkit",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
4
4
  "type": "module",
5
5
  "description": "Create RapidKit projects with a single command - The official CLI for RapidKit framework",
6
6
  "keywords": [
@@ -77,7 +77,7 @@
77
77
  "vitest": "^4.0.15"
78
78
  },
79
79
  "engines": {
80
- "node": ">=18.0.0"
80
+ "node": ">=20.19.6"
81
81
  },
82
82
  "lint-staged": {
83
83
  "*.ts": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rapidkit",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "type": "module",
5
5
  "description": "Create RapidKit projects with a single command - The official CLI for RapidKit framework",
6
6
  "keywords": [
@@ -56,6 +56,24 @@ def _python_code_targets(root: Path) -> list[str]:
56
56
  return targets or ["src"]
57
57
 
58
58
 
59
+ def _get_poetry_venv() -> Path | None:
60
+ """Get Poetry virtualenv path if it exists"""
61
+ try:
62
+ result = subprocess.run(
63
+ ["poetry", "env", "info", "--path"],
64
+ capture_output=True,
65
+ text=True,
66
+ check=False
67
+ )
68
+ if result.returncode == 0 and result.stdout.strip():
69
+ venv_path = Path(result.stdout.strip())
70
+ if venv_path.exists():
71
+ return venv_path
72
+ except Exception:
73
+ pass
74
+ return None
75
+
76
+
59
77
  def _venv_has_uvicorn(venv_path: Path) -> bool:
60
78
  if (venv_path / "bin" / "uvicorn").exists():
61
79
  return True
@@ -77,9 +95,16 @@ def dev(port: int = 8000, host: str = "0.0.0.0", allow_global_runtime: bool = Fa
77
95
  _print_banner("📁", f"Working directory: {root}")
78
96
  _print_banner("🌐", f"Server will be available at: http://{host}:{port}")
79
97
 
98
+ # Check for .venv or Poetry virtualenv
99
+ if not venv_dir.exists():
100
+ poetry_venv = _get_poetry_venv()
101
+ if poetry_venv:
102
+ venv_dir = poetry_venv
103
+ _print_banner("🐍", f"Using Poetry virtualenv: {venv_dir}")
104
+
80
105
  if venv_dir.exists():
81
106
  if not _venv_has_uvicorn(venv_dir):
82
- print("❌ Project .venv was found but uvicorn/fastapi doesn't appear installed.")
107
+ print("❌ Project virtualenv was found but uvicorn/fastapi doesn't appear installed.")
83
108
  print("💡 Run 'rapidkit init' to install dependencies.")
84
109
  sys.exit(1)
85
110
  else:
@@ -141,9 +166,16 @@ def start(port: int = 8000, host: str = "0.0.0.0", allow_global_runtime: bool =
141
166
 
142
167
  if ptype == "python":
143
168
  venv_dir = root / ".venv"
169
+
170
+ # Check for .venv or Poetry virtualenv
171
+ if not venv_dir.exists():
172
+ poetry_venv = _get_poetry_venv()
173
+ if poetry_venv:
174
+ venv_dir = poetry_venv
175
+
144
176
  if venv_dir.exists():
145
177
  if not _venv_has_uvicorn(venv_dir):
146
- print("❌ Project .venv was found but uvicorn/fastapi doesn't appear installed.")
178
+ print("❌ Project virtualenv was found but uvicorn/fastapi doesn't appear installed.")
147
179
  print("💡 Run 'poetry install' to install dependencies.")
148
180
  sys.exit(1)
149
181
  else:
@@ -48,6 +48,15 @@ fi
48
48
  VENV_PY="${ROOT_DIR}/.venv/bin/python"
49
49
  VENV_POETRY="${ROOT_DIR}/.venv/bin/poetry"
50
50
 
51
+ # Try to detect Poetry virtualenv path
52
+ if [ ! -d "${ROOT_DIR}/.venv" ] && command -v poetry >/dev/null 2>&1; then
53
+ POETRY_VENV_PATH=$(cd "$ROOT_DIR" && poetry env info --path 2>/dev/null || true)
54
+ if [ -n "$POETRY_VENV_PATH" ] && [ -d "$POETRY_VENV_PATH" ]; then
55
+ VENV_PY="${POETRY_VENV_PATH}/bin/python"
56
+ VENV_POETRY="${POETRY_VENV_PATH}/bin/poetry"
57
+ fi
58
+ fi
59
+
51
60
  case "$PKG_TYPE" in
52
61
  python)
53
62
  # prefer project-local poetry