Skip to content

Commit

Permalink
Update to 2.1692-vsc1.39.2 (betatim#5)
Browse files Browse the repository at this point in the history
Update to 2.1692-vsc1.39.2
  • Loading branch information
betatim authored Nov 18, 2019
2 parents ddb9a36 + 01bb481 commit 0f04c64
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 25 deletions.
40 changes: 25 additions & 15 deletions jupyter_vscode_proxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,41 @@

def setup_vscode():
def _get_vscode_cmd(port):
executable = 'code-server'
executable = "code-server"
if not shutil.which(executable):
raise FileNotFoundError('Can not find code-server in PATH')
raise FileNotFoundError("Can not find code-server in PATH")

working_dir = os.getenv("CODE_WORKINGDIR", None)
if working_dir is None:
working_dir = os.getenv("REPO_DIR", ".")

extensions_dir = os.getenv("CODE_EXTENSIONSDIR", None)
extra_extensions_dir = os.getenv("CODE_EXTRA_EXTENSIONSDIR", None)

cmd = [
executable,
'--no-auth',
'--disable-telemetry',
'--allow-http',
'--port=' + str(port),
working_dir
"--auth",
"none",
"--disable-telemetry",
"--port=" + str(port),
]

if extensions_dir:
cmd += ["--extensions-dir", extensions_dir]

if extra_extensions_dir:
cmd += ["--extra-extensions-dir", extra_extensions_dir]

cmd.append(working_dir)
return cmd

return {
'command': _get_vscode_cmd,
'timeout': 20,
'launcher_entry': {
'title': 'VS Code',
'icon_path': os.path.join(os.path.dirname(os.path.abspath(__file__)),
'icons',
'vscode.svg')
}
"command": _get_vscode_cmd,
"timeout": 20,
"launcher_entry": {
"title": "VS Code",
"icon_path": os.path.join(
os.path.dirname(os.path.abspath(__file__)), "icons", "vscode.svg"
),
},
}
4 changes: 3 additions & 1 deletion postBuild
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/bin/bash

CODE_SERVER_VERSION="2.1692-vsc1.39.2"

# Enable the proxy extension in notebook and lab
jupyter serverextension enable --py jupyter_server_proxy
jupyter labextension install jupyterlab-server-proxy
jupyter lab build

# Download and install VS Code server
wget -q -O code-server.tar.gz https://github.com/cdr/code-server/releases/download/2.1523-vsc1.38.1/code-server2.1523-vsc1.38.1-linux-x86_64.tar.gz
wget -q -O code-server.tar.gz https://github.com/cdr/code-server/releases/download/${CODE_SERVER_VERSION}/code-server${CODE_SERVER_VERSION}-linux-x86_64.tar.gz
mkdir -p ~/.local/bin
tar -xvf code-server.tar.gz -C ~/.local/bin --strip-components=1
rm -rf code-server.tar.gz
Expand Down
14 changes: 5 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@

setuptools.setup(
name="jupyter-vscode-proxy",
version='0.1',
version="0.1",
url="https://github.com/betatim/vscode-binder",
author="Tim Head",
description="Jupyter extension to proxy VS Code",
packages=setuptools.find_packages(),
keywords=['Jupyter'],
classifiers=['Framework :: Jupyter'],
keywords=["Jupyter"],
classifiers=["Framework :: Jupyter"],
install_requires=[
#'jupyter-server-proxy'
],
entry_points={
'jupyter_serverproxy_servers': [
'vscode = jupyter_vscode_proxy:setup_vscode',
]
},
package_data={
'jupyter_vscode_proxy': ['icons/*'],
"jupyter_serverproxy_servers": ["vscode = jupyter_vscode_proxy:setup_vscode",]
},
package_data={"jupyter_vscode_proxy": ["icons/*"],},
)

0 comments on commit 0f04c64

Please sign in to comment.