colabcode
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: colabcode | ||
| Version: 0.1.1 | ||
| Version: 0.1.2 | ||
| Summary: ColabCode - Run codeserver on Colab! | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/abhishekkrthakur/colabcode |
| pyngrok>=5.0.0 | ||
| nest_asyncio==1.4.3 | ||
| uvicorn==0.13.1 |
| README.md | ||
| setup.cfg | ||
| setup.py | ||
@@ -3,0 +4,0 @@ colabcode/__init__.py |
+26
-8
| import os | ||
| import subprocess | ||
| import nest_asyncio | ||
| import uvicorn | ||
| from pyngrok import ngrok | ||
| try: | ||
@@ -18,3 +22,5 @@ from google.colab import drive | ||
| class ColabCode: | ||
| def __init__(self, port=10000, password=None, authtoken=None, mount_drive=False): | ||
| def __init__( | ||
| self, port=10000, password=None, authtoken=None, mount_drive=False, code=True | ||
| ): | ||
| self.port = port | ||
@@ -24,8 +30,11 @@ self.password = password | ||
| self._mount = mount_drive | ||
| self._install_code() | ||
| self._install_extensions() | ||
| self._start_server() | ||
| self._run_code() | ||
| self._code = code | ||
| if self._code: | ||
| self._install_code() | ||
| self._install_extensions() | ||
| self._start_server() | ||
| self._run_code() | ||
| def _install_code(self): | ||
| @staticmethod | ||
| def _install_code(): | ||
| subprocess.run( | ||
@@ -39,3 +48,4 @@ ["wget", "https://code-server.dev/install.sh"], stdout=subprocess.PIPE | ||
| def _install_extensions(self): | ||
| @staticmethod | ||
| def _install_extensions(): | ||
| for ext in EXTENSIONS: | ||
@@ -52,3 +62,6 @@ subprocess.run(["code-server", "--install-extension", f"{ext}"]) | ||
| url = ngrok.connect(addr=self.port, options={"bind_tls": True}) | ||
| print(f"Code Server can be accessed on: {url}") | ||
| if self._code: | ||
| print(f"Code Server can be accessed on: {url}") | ||
| else: | ||
| print(f"Public URL: {url}") | ||
@@ -72,1 +85,6 @@ def _run_code(self): | ||
| print(line, end="") | ||
| def run_app(self, app, workers=1): | ||
| self._start_server() | ||
| nest_asyncio.apply() | ||
| uvicorn.run(app, host="127.0.0.1", port=self.port, workers=workers) |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: colabcode | ||
| Version: 0.1.1 | ||
| Version: 0.1.2 | ||
| Summary: ColabCode - Run codeserver on Colab! | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/abhishekkrthakur/colabcode |
+15
-0
@@ -0,1 +1,16 @@ | ||
| [isort] | ||
| multi_line_output = 3 | ||
| include_trailing_comma = True | ||
| force_grid_wrap = 0 | ||
| use_parentheses = True | ||
| ensure_newline_before_comments = True | ||
| line_length = 89 | ||
| lines_after_imports = 2 | ||
| [flake8] | ||
| ignore = E203, E501, W503 | ||
| max-line-length = 119 | ||
| per-file-ignores = | ||
| __init__.py: F401 | ||
| [egg_info] | ||
@@ -2,0 +17,0 @@ tag_build = |
+4
-4
@@ -1,4 +0,4 @@ | ||
| from setuptools import setup, Extension | ||
| from setuptools import find_packages | ||
| from setuptools import Extension, find_packages, setup | ||
| with open("README.md") as f: | ||
@@ -12,3 +12,3 @@ long_description = f.read() | ||
| scripts=["scripts/colabcode"], | ||
| version="0.1.1", | ||
| version="0.1.2", | ||
| description="ColabCode - Run codeserver on Colab!", | ||
@@ -23,5 +23,5 @@ long_description=long_description, | ||
| include_package_data=True, | ||
| install_requires=["pyngrok>=5.0.0"], | ||
| install_requires=["pyngrok>=5.0.0", "nest_asyncio==1.4.3", "uvicorn==0.13.1"], | ||
| platforms=["linux", "unix"], | ||
| python_requires=">3.5.2", | ||
| ) |
Sorry, the diff of this file is not supported yet
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
12494
6.47%94
17.5%