-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support alternate virtualenv directories #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! In general this looks good to me. Could you also update README.rst
(it states the folder names) and prepare an entry in CHANGES.md
?
@jgosmann, are you good for the code I made or do you think it would be better to add environment variable support like I suggested? |
I'm fine with either. I think the current version is already an improvement, having an environment variable would add some more flexibility on top. |
This introduces a new PYLINT_VENV_PATH environment variable to pass a list of paths that will be checked.
56e1ba3
to
f426644
Compare
@jgosmann, I updated it. I named the environment variable
|
# Check if a local ".venv" folder exists | ||
# Check if a virtualenv directory exists (.venv by default, or alternative | ||
# paths given by environment variable) | ||
venv_paths = os.getenv("PYLINT_VENV_PATH", ".venv").split(":") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This does not support any directories where the name itself contains a colon (:
). However, I think it is fine because the same is true for Bash's $PATH
variable and I hope no-one uses colons in the venv directory names (or any other directory names for that matter).
I was able to reproduce this and reported the issue upstream as pylint-dev/pylint#6888. |
Fix #10
EDIT: This could be replaced by a custom environment variable, such as: