Skip to content

Conversation

starchou6
Copy link
Contributor

Description:
This PR fixes the issue where langchain-cli migrate command fails when run in pyenv virtual environments. The problem occurs because the .grit directory is placed under a git-managed pyenv virtualenv, and GritQL honors parent .gitignore files, causing the .grit directory to be ignored and pattern definitions to be inaccessible.

The fix moves the .grit directory to a user cache location (~/.cache/langchain-cli/.grit) to avoid Git management conflicts. The implementation includes:

  • Automatic creation of cache directory on first run
  • Copying of .grit files from package to cache location
  • Fallback mechanism to original behavior if source doesn't exist

Issue: Fixes #32779

Dependencies: None - uses only standard library modules (shutil, pathlib)

Copy link

vercel bot commented Sep 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
langchain Ignored Ignored Preview Sep 4, 2025 11:03pm

Copy link

codspeed-hq bot commented Sep 4, 2025

CodSpeed WallTime Performance Report

Merging #32815 will not alter performance

Comparing starchou6:fix/migrate-grit-dir-gitignore-conflict (2522232) with master (aa63de9)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched benchmarks

Copy link

codspeed-hq bot commented Sep 4, 2025

CodSpeed Instrumentation Performance Report

Merging #32815 will not alter performance

Comparing starchou6:fix/migrate-grit-dir-gitignore-conflict (2522232) with master (aa63de9)

Summary

✅ 14 untouched benchmarks

@mdrxy mdrxy added the cli Related to the package `langchain-cli` label Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the package `langchain-cli`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

langchain-cli migrate fails to find GritQL patterns when .grit places under a git-managed pyenv with virtualenv due to parent .gitignore
3 participants