diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3e5aceb5..fb081861c 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/README.md b/README.md index d97443949..171be7cbf 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

💻 👀 📆 🎨 🚇 diff --git a/examples/demo.ipynb b/examples/demo.ipynb index 763309ec6..d9b129710 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 7696aba8f..5f424e92f 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 645a43128..77888b60f 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: @@ -1238,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: diff --git a/jupyterlab_git/handlers.py b/jupyterlab_git/handlers.py index 6f878c473..1a109dadc 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 c97b74055..d1e591e40 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: diff --git a/yarn.lock b/yarn.lock index 2ba31eea7..9ea11feca 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