-
Notifications
You must be signed in to change notification settings - Fork 27
Exclude environment directories #198
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
Conversation
colearendt
left a comment
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.
LGTM! Very elegant!
|
Does this also take care of the case where the virtual environment is not in a subdirectory but in the app directory itself?, i.e. a situation like |
|
No, it only handles the subdirectory case, where it can exclude the entire directory. This implementation doesn't know what's in a virtualenv, other than |
|
One thought I had - do virtualenvs ever have |
|
Virtualenv creates |
|
Ok. Maybe you could add a warning if you find |
Test Case 1
Local directory structure: Results: previously we would have uploaded all files and directories. Test Case 2
Local directory structure: Results: Test Case 3
Local directory structure: Results: Test Case 4
Local directory structure: Results: Test Case 5
Results: |
|
The warning message only seems to display when Warning is shown: sub-directory (where the env folders are under No warning is produced. Additionally in the warning we only mention |
|
We don't warn when detecting an environment in a subdirectory because we can safely exclude the whole directory. When it's the root directory (like you're deploying from inside the virtual environment directory itself) we don't know what to exclude, so we do what we can and warn that it might not be complete. |
Description
This PR adds a check for virtualenvs when bundling, to prevent accidentally uploading a virtualenv.
It also adds
renvto the default exclusion list for R/reticulate users.Testing Notes / Validation Steps
Create a virtualenv in the project directory; make sure its name is not in the default exclusion list. It doesn't need to be active. Deploy and then download the bundle from Connect to verify its contents.