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

[Feature] Install necessary packages #2

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

shangeth
Copy link

@shangeth shangeth commented Sep 9, 2020

Install necessary packages with ColabCode(port=10000, packages=['torchaudio', 'pytorch_lightning'])


def _install_packages(self):
for package in self.packages:
print(f'Installing {package}...')
Copy link
Owner

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

Copy link
Author

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()

Copy link
Owner

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

@@ -1,16 +1,20 @@
import os
import subprocess
from pyngrok import ngrok

import subprocess
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

subprocess is already imported

@abhishekkrthakur
Copy link
Owner

Please let me know when this is ready. There is a conflict too now :)

@shangeth
Copy link
Author

shangeth commented Sep 9, 2020

  • conflict is resolved
  • added logger
  • removed unwanted import(repeated subprocess)

@shangeth
Copy link
Author

Is there anything else to change?

Copy link

@mmphego mmphego left a 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

@abhishekkrthakur
Copy link
Owner

conflicts. update readme please.

@shangeth
Copy link
Author

README.md conflicts resolved.

Copy link

@mmphego mmphego left a 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.

@shangeth
Copy link
Author

@mmphego flake8 and black works good.

Copy link

@Borda Borda left a 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...

Comment on lines +28 to +29
if self.packages:
self._install_packages()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for package in self.packages:
if not self.packages:
return
for package in self.packages:

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.

4 participants