diff --git a/.agents/setup b/.agents/setup new file mode 100755 index 0000000..e238c02 --- /dev/null +++ b/.agents/setup @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -euo pipefail + +if ! command -v uv >/dev/null 2>&1; then + python -m pip install --user uv + export PATH="$HOME/.local/bin:$PATH" +fi + +uv sync --all-packages --frozen + +mkdir -p \ + "$HOME/.jupyter/jupyter_server_config.d" \ + "$HOME/.jupyter/lab/user-settings/@jupyterlab/completer-extension" + +cat > "$HOME/.jupyter/jupyter_server_config.d/ty-language-server.json" <<'EOF' +{ + "LanguageServerManager": { + "language_servers": { + "ty": { + "version": 2, + "argv": ["ty", "server"], + "languages": ["python"], + "mime_types": ["text/python", "text/x-python", "text/x-ipython"], + "display_name": "ty" + } + } + } +} +EOF + +cat > "$HOME/.jupyter/lab/user-settings/@jupyterlab/completer-extension/manager.jupyterlab-settings" <<'EOF' +{ + "autoCompletion": true +} +EOF diff --git a/.amp/services.yaml b/.amp/services.yaml new file mode 100644 index 0000000..77736c8 --- /dev/null +++ b/.amp/services.yaml @@ -0,0 +1,20 @@ +services: + jupyter: + command: >- + uv run + --with jupyterlab + --with jupyterlab-lsp + --with ipywidgets + --with jupyter-collaboration + jupyter lab + --ip=0.0.0.0 + --port=$PORT + --no-browser + --IdentityProvider.token= + --ServerApp.password= + --ServerApp.allow_remote_access=True + --ServerApp.allow_origin_pat=^https://[A-Za-z0-9-]+[.]onamp[.]dev$ + --ServerApp.root_dir=. + portal: + title: JupyterLab + description: JupyterLab with ty language-server completion for the Tilebox workspace. diff --git a/.gitignore b/.gitignore index e134a5c..749190d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ __pycache__/ .ipynb_checkpoints/ +.virtual_documents/ .idea/ @@ -18,4 +19,5 @@ test-report.xml *.egg-info/ -.amp/ +.amp/* +!.amp/services.yaml