-
Notifications
You must be signed in to change notification settings - Fork 18
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
load_pkgs doesn't work on Windows #97
Comments
Thank you for this clear bug + fix for Windows users 🙌 would you want to open a PR with these changes? (If not, I am happy to implement it!) |
Will do! |
Sorry about closing and reopening. I needed to check the spacing for the newly added lines. All good now. Sorry again. |
No worries, I appreciate the PR :D |
I used an incorrect variable in my last PR. I have submitted a new one with the correct variable (in the compile command within the load_pkgs function |
Describe the bug
The load_pkgs method generates "permission denied" error when run on Windows 10 OS.
On Windows OS, the tempfile package that's used to create the temporary .in file doesn't allow the file to be written with a context manager because the NamedTemporaryFile function actually opens the file first. This prevents the open(tmp.name) and the pip-compile commands, which use this temporary file, from opening the file.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
This should create a temp file, write the list of requirements from the model/list, then compile the temp file into a requirements.txt file.
Screenshots
Desktop (please complete the following information):
Additional context
This can be solved by closing the temporary file after it's opened (requires using delete=False when creating the temp file), and then deleting it after the requirements.txt file has been compiled. (see below)
The text was updated successfully, but these errors were encountered: