Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search both current directory and repo root #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

antoine-gallix
Copy link

This cover the use case where the current directory is inside a repo, the virtual environment being in the current directory, but not at the root of the repository. This is a common case in companies following monorepo pattern, where all modules of a system are in the same repo, and where dev would work in one of those module directories, and create virtual environment there.

antoine-gallix and others added 2 commits February 7, 2024 16:31
This cover the use case where the current directory is inside a repo, the virtual environment being in the current directory, but not at the root of the repository.
Copy link
Owner

@nakulj nakulj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what order will this search the target directories? I think we'd want to search the working directory first, then the repository directory.

@antoine-gallix
Copy link
Author

Experimenting with multiple list expansion in fish:

set A a1 a2;set B b1 b2
for cat in $A/$B
    echo $cat
end

a1/b1
a2/b1
a1/b2
a2/b2

Not what I expected, but it confirms that the final loop is more like:

for envdir in env .env venv .venv
    for dir in current repo_root
        try repo_root/envdir

@everyx
Copy link

everyx commented Sep 25, 2024

@nakulj Can we merge this PR now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants