From 186e8d17b316f2e4974028fddf58af38ad82c8a3 Mon Sep 17 00:00:00 2001 From: Zach Sailer Date: Tue, 14 May 2024 15:16:09 -0700 Subject: [PATCH 1/4] Update yarn lock for proper checksum --- yarn.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2ba31eea..9ea11fec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11562,11 +11562,11 @@ __metadata: "typescript@patch:typescript@~5.0.2#~builtin": version: 5.0.4 - resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin::version=5.0.4&hash=b5f058" + resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin::version=5.0.4&hash=85af82" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: d26b6ba97b6d163c55dbdffd9bbb4c211667ebebc743accfeb2c8c0154aace7afd097b51165a72a5bad2cf65a4612259344ff60f8e642362aa1695c760d303ac + checksum: bb309d320c59a26565fb3793dba550576ab861018ff3fd1b7fccabbe46ae4a35546bc45f342c0a0b6f265c801ccdf64ffd68f548f117ceb7f0eac4b805cd52a9 languageName: node linkType: hard From a2a02b951bdf30f06dd525606ea4acbaf26232f3 Mon Sep 17 00:00:00 2001 From: Zach Sailer Date: Tue, 14 May 2024 15:38:54 -0700 Subject: [PATCH 2/4] Update broken link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d9744394..171be7cb 100644 --- a/README.md +++ b/README.md @@ -324,7 +324,7 @@ The Jupyter Git extension is part of [Project Jupyter](http://jupyter.org/) and Konstantin Taletskiy
Konstantin Taletskiy

💻 👀 - Kostya Farber
Kostya Farber

💻 + Kostya Farber
Kostya Farber

💻 Linda Ngoc Nguyen
Linda Ngoc Nguyen

💻 Major League Hacking
Major League Hacking

🤝 Max Klein
Max Klein

💻 👀 📆 🎨 🚇 From e934d0f13bbcfcf5054420a402773f12024e977d Mon Sep 17 00:00:00 2001 From: Zach Sailer Date: Tue, 14 May 2024 16:22:34 -0700 Subject: [PATCH 3/4] run black --- examples/demo.ipynb | 18 ++++++++++++------ jupyterlab_git/__init__.py | 3 ++- jupyterlab_git/git.py | 9 ++++++--- jupyterlab_git/handlers.py | 1 + ui-tests/jupyter_server_test_config.py | 1 + 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/examples/demo.ipynb b/examples/demo.ipynb index 763309ec..d9b12971 100644 --- a/examples/demo.ipynb +++ b/examples/demo.ipynb @@ -119,7 +119,9 @@ } ], "source": [ - "import sys; print('this is stderr', file=sys.stderr)" + "import sys\n", + "\n", + "print(\"this is stderr\", file=sys.stderr)" ] }, { @@ -253,12 +255,14 @@ } ], "source": [ - "md = Markdown(\"\"\"\n", + "md = Markdown(\n", + " \"\"\"\n", "### Subtitle\n", "\n", "This is some *markdown* text with math $F=ma$.\n", "\n", - "\"\"\")\n", + "\"\"\"\n", + ")\n", "md" ] }, @@ -362,13 +366,15 @@ } ], "source": [ - "maxwells = Latex(r\"\"\"\n", + "maxwells = Latex(\n", + " r\"\"\"\n", "\\begin{align}\n", "\\nabla \\times \\vec{\\mathbf{B}} -\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{E}}}{\\partial t} & = \\frac{4\\pi}{c}\\vec{\\mathbf{j}} \\\\ \\nabla \\cdot \\vec{\\mathbf{E}} & = 4 \\pi \\rho \\\\\n", "\\nabla \\times \\vec{\\mathbf{E}}\\, +\\, \\frac1c\\, \\frac{\\partial\\vec{\\mathbf{B}}}{\\partial t} & = \\vec{\\mathbf{0}} \\\\\n", "\\nabla \\cdot \\vec{\\mathbf{B}} & = 0\n", "\\end{align}\n", - "\"\"\")\n", + "\"\"\"\n", + ")\n", "maxwells" ] }, @@ -434,7 +440,7 @@ "img2 = Image(\n", " \"https://apod.nasa.gov/apod/image/1707/GreatWallMilkyWay_Yu_1686.jpg\",\n", " width=100,\n", - " height=200\n", + " height=200,\n", ")\n", "img2" ] diff --git a/jupyterlab_git/__init__.py b/jupyterlab_git/__init__.py index 7696aba8..5f424e92 100644 --- a/jupyterlab_git/__init__.py +++ b/jupyterlab_git/__init__.py @@ -1,5 +1,6 @@ """Initialize the backend server extension """ + from traitlets import CFloat, List, Dict, Unicode, default from traitlets.config import Configurable @@ -32,7 +33,7 @@ class JupyterLabGit(Configurable): config=True, value_trait=List( trait=Unicode(), help='List of commands to run. E.g. ["touch baz.py"]' - ) + ), # TODO Validate ) diff --git a/jupyterlab_git/git.py b/jupyterlab_git/git.py index 645a4312..f2e96682 100644 --- a/jupyterlab_git/git.py +++ b/jupyterlab_git/git.py @@ -1,6 +1,7 @@ """ Module for executing git commands, sending results back to the handlers """ + import base64 import datetime import os @@ -646,9 +647,11 @@ async def log(self, path, history_count=10, follow_path=None): "author": line_array[i + 1], "date": line_array[i + 2], "commit_msg": line_array[i + 3], - "pre_commits": line_array[i + 4].split(" ") - if i + 4 < len(line_array) and line_array[i + 4] - else [], + "pre_commits": ( + line_array[i + 4].split(" ") + if i + 4 < len(line_array) and line_array[i + 4] + else [] + ), } if is_single_file: diff --git a/jupyterlab_git/handlers.py b/jupyterlab_git/handlers.py index 6f878c47..1a109dad 100644 --- a/jupyterlab_git/handlers.py +++ b/jupyterlab_git/handlers.py @@ -1,6 +1,7 @@ """ Module with all the individual handlers, which execute git commands and return the results to the frontend. """ + import functools import json import os diff --git a/ui-tests/jupyter_server_test_config.py b/ui-tests/jupyter_server_test_config.py index c97b7405..d1e591e4 100644 --- a/ui-tests/jupyter_server_test_config.py +++ b/ui-tests/jupyter_server_test_config.py @@ -4,6 +4,7 @@ opens the server to the world and provide access to JupyterLab JavaScript objects through the global window variable. """ + import sys try: From 3aafbb72470255ac3575c5ce698f3f3ed087a242 Mon Sep 17 00:00:00 2001 From: Zach Sailer Date: Tue, 14 May 2024 16:26:13 -0700 Subject: [PATCH 4/4] run black --- .pre-commit-config.yaml | 2 +- jupyterlab_git/git.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3e5aceb..fb081861 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 23.1.0 # Replace by any tag/version: https://github.com/psf/black/tags + rev: 24.4.2 # Replace by any tag/version: https://github.com/psf/black/tags hooks: - id: black language_version: python3 # Should be a command that runs python3.6+ diff --git a/jupyterlab_git/git.py b/jupyterlab_git/git.py index f2e96682..77888b60 100644 --- a/jupyterlab_git/git.py +++ b/jupyterlab_git/git.py @@ -1241,9 +1241,9 @@ async def pull(self, path, auth=None, cancel_on_conflict=False): cwd=path, ) if code == 0: - response[ - "message" - ] = "Unable to pull latest changes as doing so would result in a merge conflict. In order to push your local changes, you may want to consider creating a new branch based on your current work and pushing the new branch. Provided your repository is hosted (e.g., on GitHub), once pushed, you can create a pull request against the original branch on the remote repository and manually resolve the conflicts during pull request review." + response["message"] = ( + "Unable to pull latest changes as doing so would result in a merge conflict. In order to push your local changes, you may want to consider creating a new branch based on your current work and pushing the new branch. Provided your repository is hosted (e.g., on GitHub), once pushed, you can create a pull request against the original branch on the remote repository and manually resolve the conflicts during pull request review." + ) else: response["message"] = error.strip() elif has_conflict: