Skip to content

Commit a4d5970

Browse files
authored
Merge pull request #763 from ianhi/format
Format code using black
2 parents d632dee + ca40ee4 commit a4d5970

24 files changed

+697
-466
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# migrate code to black
2+
f922e2e1e60e3a964dbd07597e7c44c068b7ba1d

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: ['3.5', '3.6', '3.7', '3.8']
15+
python-version: ['3.6', '3.7', '3.8', '3.9.0-rc.1']
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v2
@@ -58,7 +58,7 @@ jobs:
5858
- name: Install dependencies
5959
run: |
6060
pip install wheel
61-
pip install --upgrade --upgrade-strategy=eager pytest pytest-asyncio "jupyterlab~=2.0"
61+
pip install --upgrade --upgrade-strategy=eager "jupyterlab~=2.0"
6262
6363
- name: Test the extension
6464
run: |
@@ -71,6 +71,9 @@ jobs:
7171
pip install jupyterlab_git[test] --pre --no-index --find-links=dist --no-deps --no-cache-dir -v
7272
# Install the extension dependencies based on the current setup.py
7373
pip install jupyterlab_git[test]
74+
75+
# Python formatting checks
76+
black . --check
7477
7578
# Run the Python tests
7679
pytest jupyterlab_git -r ap

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 20.8b1 # Replace by any tag/version: https://github.com/psf/black/tags
4+
hooks:
5+
- id: black
6+
language_version: python3 # Should be a command that runs python3.6+

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ cd jupyterlab-git
123123
124124
# Install the server extension in development mode and enable it
125125
pip install -e .[test]
126+
pre-commit install
126127
jupyter serverextension enable --py jupyterlab_git --sys-prefix
127128
128129
# Build and install your development version of the extension

jupyterlab_git/__init__.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from jupyterlab_git.handlers import setup_handlers
99
from jupyterlab_git.git import Git
1010

11+
1112
class JupyterLabGit(Configurable):
1213
"""
1314
Config options for jupyterlab_git
@@ -16,26 +17,24 @@ class JupyterLabGit(Configurable):
1617
"""
1718

1819
actions = Dict(
19-
help='Actions to be taken after a git command. Each action takes a list of commands to execute (strings). Supported actions: post_init',
20+
help="Actions to be taken after a git command. Each action takes a list of commands to execute (strings). Supported actions: post_init",
2021
config=True,
2122
trait=List(
22-
trait=Unicode(),
23-
help='List of commands to run. E.g. ["touch baz.py"]'
23+
trait=Unicode(), help='List of commands to run. E.g. ["touch baz.py"]'
2424
)
2525
# TODO Validate
2626
)
2727

28+
2829
def _jupyter_server_extension_paths():
29-
"""Declare the Jupyter server extension paths.
30-
"""
30+
"""Declare the Jupyter server extension paths."""
3131
return [{"module": "jupyterlab_git"}]
3232

3333

3434
def load_jupyter_server_extension(nbapp):
35-
"""Load the Jupyter server extension.
36-
"""
35+
"""Load the Jupyter server extension."""
3736

3837
config = JupyterLabGit(config=nbapp.config)
39-
git = Git(nbapp.web_app.settings['contents_manager'], config)
38+
git = Git(nbapp.web_app.settings["contents_manager"], config)
4039
nbapp.web_app.settings["git"] = git
4140
setup_handlers(nbapp.web_app)

jupyterlab_git/_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) Project Jupyter.
22
# Distributed under the terms of the Modified BSD License.
33

4-
version_info = (0, 21, 1)
5-
flag = ''
4+
version_info = (0, 22, 0)
5+
flag = "a0"
66

77
__version__ = ".".join(map(str, version_info)) + flag

0 commit comments

Comments
 (0)