-
Notifications
You must be signed in to change notification settings - Fork 277
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
[Feature] Install necessary packages #2
base: master
Are you sure you want to change the base?
Conversation
colabcode/code.py
Outdated
|
||
def _install_packages(self): | ||
for package in self.packages: | ||
print(f'Installing {package}...') |
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.
use logger.info instead of print here please
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.
yes adding it
self._run_code() | ||
|
||
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.
some extra space? would be nice to get rid of this
colabcode/code.py
Outdated
@@ -1,16 +1,20 @@ | |||
import os | |||
import subprocess | |||
from pyngrok import ngrok | |||
|
|||
import subprocess |
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.
subprocess is already imported
Please let me know when this is ready. There is a conflict too now :) |
|
Is there anything else to change? |
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.
I love this.... Ship it
conflicts. update readme please. |
README.md conflicts resolved. |
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.
Perhaps run the code through flake8
and black
to iron out some pep8 violations.
@mmphego flake8 and black works good. |
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.
I guess that after installing the packages you need to restart the session...
if self.packages: | ||
self._install_packages() |
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.
if self.packages: | |
self._install_packages() | |
self._install_packages() |
@@ -58,3 +65,8 @@ def _run_code(self): | |||
) as proc: | |||
for line in proc.stdout: | |||
print(line, end="") | |||
|
|||
def _install_packages(self): | |||
for package in self.packages: |
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.
for package in self.packages: | |
if not self.packages: | |
return | |
for package in self.packages: |
Install necessary packages with
ColabCode(port=10000, packages=['torchaudio', 'pytorch_lightning'])