Skip to content

[Feature] Install necessary packages#2

Open
shangeth wants to merge 8 commits into
abhishekkrthakur:masterfrom
shangeth:master
Open

[Feature] Install necessary packages#2
shangeth wants to merge 8 commits into
abhishekkrthakur:masterfrom
shangeth:master

Conversation

@shangeth

@shangeth shangeth commented Sep 9, 2020

Copy link
Copy Markdown

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

Comment thread colabcode/code.py Outdated

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

Copy link
Copy Markdown
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
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes adding it

Comment thread colabcode/code.py
self._install_packages()
self._run_code()

Copy link
Copy Markdown
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

Comment thread colabcode/code.py Outdated
import subprocess
from pyngrok import ngrok

import subprocess

Copy link
Copy Markdown
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
Copy Markdown
Owner

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

@shangeth

shangeth commented Sep 9, 2020

Copy link
Copy Markdown
Author
  • conflict is resolved
  • added logger
  • removed unwanted import(repeated subprocess)

@shangeth

Copy link
Copy Markdown
Author

Is there anything else to change?

@mmphego mmphego left a comment

Copy link
Copy Markdown

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
Copy Markdown
Owner

conflicts. update readme please.

@shangeth

Copy link
Copy Markdown
Author

README.md conflicts resolved.

@mmphego mmphego left a comment

Copy link
Copy Markdown

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
Copy Markdown
Author

@mmphego flake8 and black works good.

@Borda Borda left a comment

Copy link
Copy Markdown

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 thread colabcode/code.py
Comment on lines +28 to +29
if self.packages:
self._install_packages()

Copy link
Copy Markdown

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

Comment thread colabcode/code.py
print(line, end="")

def _install_packages(self):
for package in self.packages:

Copy link
Copy Markdown

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