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

Explain the logic in README.md #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

antoine-gallix
Copy link

I've had issues with this plugin sometimes not working, and I had to search in the code to see exactly what was intended. I'd find it useful to have the logic written down in the readme for a quick reference.

I've had issues with this plugin sometimes not working, and I had to search in the code to see exactly what was intended. I'd find it useful to have the logic written down in the readme for a quick reference.
@nakulj
Copy link
Owner

nakulj commented Feb 5, 2024

When did it not work?

Also, I think the description belongs in a comment in the script itself.

@nakulj nakulj assigned nakulj and antoine-gallix and unassigned nakulj Feb 5, 2024
@antoine-gallix
Copy link
Author

When using a plugin, I either expect it to work magically without reading anything, or to have the logic explained in human language. Expecting all plugin users to understand fluently fish script, or even going to the code in the first place would exclude a good share of users when they have a problem.

In my case it didn't work because we have a repo that gather code for multiple services of our system, and the python service I work on, along with the virtual environment, are in a subdir of the repo, not at the root of it. I understood the problem by reading the code of the plugin. I first looked at the readme some month ago, found no info, gave up, and just got back to it last week.

@antoine-gallix
Copy link
Author

I can also imagine something shorter like:

## Working logic
- the plugin function is activated at directory change
- environments are detected if they are named `env`, `.env`,`venv` or `.venv`
- the current directory is searched, or the root of the current git repo, if applicable

@nakulj
Copy link
Owner

nakulj commented Feb 15, 2024

Ah, I think I understand your issue. I saw your PR as well; but I think we can find a more general solution. What if we used a config file to map directories to virtual environments? This seems to be what a lot of IDEs and language servers do.
I'll try and implement something.

@antoine-gallix
Copy link
Author

you mean a config file (.autovenv, .venv_map,...) at the root of the repo that would have something like

python_module_a:.venv
js_module_b:.jsvenv
...

?

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.

None yet

2 participants