Skip to content

Commit 0ed4599

Browse files
revert unrelated changes
1 parent bca40c6 commit 0ed4599

6 files changed

Lines changed: 6 additions & 286 deletions

File tree

codeflash/cli_cmds/init_javascript.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -181,41 +181,6 @@ def find_node_modules_with_package(project_root: Path, package_name: str) -> Pat
181181
return None
182182

183183

184-
def _is_pnpm_workspace(project_root: Path) -> bool:
185-
"""Check if project is a pnpm workspace root.
186-
187-
Args:
188-
project_root: The project root directory.
189-
190-
Returns:
191-
True if pnpm-workspace.yaml exists.
192-
193-
"""
194-
return (project_root / "pnpm-workspace.yaml").exists()
195-
196-
197-
def _get_local_codeflash_package_path() -> Path | None:
198-
"""Get path to local codeflash package in dev environment.
199-
200-
Returns:
201-
Path to local codeflash package if in dev mode, None otherwise.
202-
203-
"""
204-
try:
205-
import codeflash as cf
206-
207-
codeflash_python_path = Path(cf.__file__).parent
208-
# Check if running from /opt/codeflash/ (dev environment)
209-
if "/opt/codeflash" in str(codeflash_python_path):
210-
# Local package is at /opt/codeflash/packages/codeflash
211-
local_pkg = codeflash_python_path.parent / "packages" / "codeflash"
212-
if local_pkg.exists() and (local_pkg / "package.json").exists():
213-
return local_pkg
214-
except Exception:
215-
pass
216-
return None
217-
218-
219184
def get_package_install_command(project_root: Path, package: str, dev: bool = True) -> list[str]:
220185
"""Get the correct install command for the project's package manager.
221186
@@ -230,19 +195,10 @@ def get_package_install_command(project_root: Path, package: str, dev: bool = Tr
230195
"""
231196
pkg_manager = determine_js_package_manager(project_root)
232197

233-
# For codeflash package in dev environment, use local path
234-
if package == "codeflash":
235-
local_pkg = _get_local_codeflash_package_path()
236-
if local_pkg:
237-
package = str(local_pkg)
238-
239198
if pkg_manager == JsPackageManager.PNPM:
240199
cmd = ["pnpm", "add", package]
241200
if dev:
242201
cmd.append("--save-dev")
243-
# Add workspace flag if installing to workspace root
244-
if _is_pnpm_workspace(project_root):
245-
cmd.append("-w")
246202
return cmd
247203
if pkg_manager == JsPackageManager.YARN:
248204
cmd = ["yarn", "add", package]

codeflash/cli_cmds/test_init_javascript_workspace.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

codeflash/languages/javascript/mocha_runner.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ def _ensure_runtime_files(project_root: Path) -> None:
8787
if result.returncode == 0:
8888
logger.debug(f"Installed codeflash using {install_cmd[0]}")
8989
return
90-
# Log stderr at ERROR level so it's visible to users
91-
logger.error(f"Failed to install codeflash (exit code {result.returncode}):\n{result.stderr.strip()}")
90+
logger.warning(f"Failed to install codeflash: {result.stderr}")
9291
except Exception as e:
93-
logger.error(f"Error installing codeflash: {e}")
92+
logger.warning(f"Error installing codeflash: {e}")
9493

9594
logger.error(f"Could not install codeflash. Please install it manually: {' '.join(install_cmd)}")
9695

codeflash/languages/javascript/test_runner.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -732,10 +732,9 @@ def _ensure_runtime_files(project_root: Path) -> None:
732732
if result.returncode == 0:
733733
logger.debug(f"Installed codeflash using {install_cmd[0]}")
734734
return
735-
# Log stderr at ERROR level so it's visible to users
736-
logger.error(f"Failed to install codeflash (exit code {result.returncode}):\n{result.stderr.strip()}")
735+
logger.warning(f"Failed to install codeflash: {result.stderr}")
737736
except Exception as e:
738-
logger.error(f"Error installing codeflash: {e}")
737+
logger.warning(f"Error installing codeflash: {e}")
739738

740739
logger.error(f"Could not install codeflash. Please install it manually: {' '.join(install_cmd)}")
741740

codeflash/languages/javascript/vitest_runner.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,9 @@ def _ensure_runtime_files(project_root: Path) -> None:
118118
if result.returncode == 0:
119119
logger.debug(f"Installed codeflash using {install_cmd[0]}")
120120
return
121-
# Log stderr at ERROR level so it's visible to users
122-
logger.error(f"Failed to install codeflash (exit code {result.returncode}):\n{result.stderr.strip()}")
121+
logger.warning(f"Failed to install codeflash: {result.stderr}")
123122
except Exception as e:
124-
logger.error(f"Error installing codeflash: {e}")
123+
logger.warning(f"Error installing codeflash: {e}")
125124

126125
logger.error(f"Could not install codeflash. Please install it manually: {' '.join(install_cmd)}")
127126

tests/languages/javascript/test_vitest_coverage_thresholds.py

Lines changed: 0 additions & 178 deletions
This file was deleted.

0 commit comments

Comments
 (0)