Skip to content

Commit 1b0e257

Browse files
authored
Apply Autoformats (#257)
1 parent 920f0a5 commit 1b0e257

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1185
-1198
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Tests
22

33
on:
44
push:
5-
branches: ['main']
5+
branches: ["main"]
66
pull_request:
77
schedule:
88
- cron: "0 8 * * *"

.pre-commit-config.yaml

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,32 @@ repos:
1616
- id: debug-statements
1717
- id: forbid-new-submodules
1818
- id: check-builtin-literals
19-
# - id: trailing-whitespace
19+
- id: trailing-whitespace
2020

21-
# - repo: https://github.com/psf/black
22-
# rev: 22.3.0
23-
# hooks:
24-
# - id: black
25-
# args: ["--line-length", "100"]
21+
- repo: https://github.com/psf/black
22+
rev: 22.3.0
23+
hooks:
24+
- id: black
25+
args: ["--line-length", "100"]
2626

27-
# - repo: https://github.com/PyCQA/isort
28-
# rev: 5.10.1
29-
# hooks:
30-
# - id: isort
31-
# files: \.py$
32-
# args: [--profile=black]
27+
- repo: https://github.com/PyCQA/isort
28+
rev: 5.10.1
29+
hooks:
30+
- id: isort
31+
files: \.py$
32+
args: [--profile=black]
3333

34-
# - repo: https://github.com/pre-commit/mirrors-prettier
35-
# rev: v2.6.1
36-
# hooks:
37-
# - id: prettier
34+
- repo: https://github.com/pre-commit/mirrors-prettier
35+
rev: v2.6.1
36+
hooks:
37+
- id: prettier
38+
exclude: "jupyterlab_server/templates/.*.html"
3839

39-
# - repo: https://github.com/asottile/pyupgrade
40-
# rev: v2.31.1
41-
# hooks:
42-
# - id: pyupgrade
43-
# args: [--py37-plus]
40+
- repo: https://github.com/asottile/pyupgrade
41+
rev: v2.31.1
42+
hooks:
43+
- id: pyupgrade
44+
args: [--py37-plus]
4445

4546
- repo: https://github.com/PyCQA/doc8
4647
rev: 0.11.0

CHANGELOG.md

Lines changed: 116 additions & 116 deletions
Large diffs are not rendered by default.

CONTRIBUTING.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Contributing
22

33
If you're reading this section, you're probably interested in contributing to
4-
Jupyter. Welcome and thanks for your interest in contributing!
4+
Jupyter. Welcome and thanks for your interest in contributing!
55

66
Please take a look at the Contributor documentation, familiarize yourself with
77
using the Jupyter Server, and introduce yourself on the mailing list and
@@ -12,7 +12,7 @@ For general documentation about contributing to Jupyter projects, see the
1212

1313
## Development Install
1414

15-
``` shell
15+
```shell
1616
git clone https://github.com/jupyterlab/jupyterlab_server.git
1717
cd jupyterlab_server
1818
pip install -e .
@@ -32,6 +32,7 @@ pytest --pyargs jupyterlab_server
3232
```
3333

3434
## Code Styling
35+
3536
`jupyterlab_server` has adopted automatic code formatting so you shouldn't
3637
need to worry too much about your code style.
3738
As long as your code is valid,
@@ -50,7 +51,7 @@ You can invoke the pre-commit hook by hand at any time with:
5051

5152
```shell
5253
pre-commit run
53-
````
54+
```
5455

5556
which should run any autoformatting on your code
5657
and tell you about any errors it couldn't fix automatically.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
## Motivation
88

99
JupyterLab Server sits between JupyterLab and Jupyter Server, and provides a
10-
set of REST API handlers and utilities that are used by JupyterLab. It is a separate project in order to
10+
set of REST API handlers and utilities that are used by JupyterLab. It is a separate project in order to
1111
accommodate creating JupyterLab-like applications from a more limited scope.
1212

1313
## Install

RELEASE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,30 @@ The recommended way to make a release is to use [`jupyter_releaser`](https://git
77
## Manual Release
88

99
### Set up
10+
1011
```
1112
pip install tbump twine build
1213
git pull origin $(git branch --show-current)
1314
git clean -dffx
1415
```
1516

1617
### Update the version and apply the tag
18+
1719
```
1820
echo "Enter new version"
1921
read script_version
2022
tbump ${script_version}
2123
```
2224

2325
### Build the artifacts
26+
2427
```
2528
rm -rf dist
2629
python -m build .
2730
```
2831

2932
### Publish the artifacts to pypi
33+
3034
```
3135
twine check dist/*
3236
twine upload dist/*

docs/autogen_config.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python
22

33
import os
4+
45
from jupyterlab_server import LabServerApp
56

67
header = """\
@@ -37,11 +38,11 @@
3738
"""
3839
# Handle local and RTD locations
3940
cwd = os.getcwd()
40-
if os.path.basename(cwd) == 'source':
41-
destination = os.path.join(cwd, 'api/app-config.rst')
41+
if os.path.basename(cwd) == "source":
42+
destination = os.path.join(cwd, "api/app-config.rst")
4243
else:
43-
destination = os.path.join(cwd, 'source/api/app-config.rst')
44+
destination = os.path.join(cwd, "source/api/app-config.rst")
4445

45-
with open(destination, 'w') as f:
46+
with open(destination, "w") as f:
4647
f.write(header)
4748
f.write(LabServerApp().document_config_options())

docs/environment.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
21
name: jupyterlab_server_documentation
32
channels:
43
- conda-forge
54
dependencies:
6-
- python=3.9
7-
- sphinx<4.0
8-
- sphinx-copybutton
9-
- pip
10-
- myst-parser
11-
- mistune<1
12-
- jinja2<3.1.0
13-
- pip:
14-
- autodoc-traits
15-
- pydata_sphinx_theme
16-
- sphinxcontrib-openapi
17-
- numpydoc
18-
- ..
5+
- python=3.9
6+
- sphinx<4.0
7+
- sphinx-copybutton
8+
- pip
9+
- myst-parser
10+
- mistune<1
11+
- jinja2<3.1.0
12+
- pip:
13+
- autodoc-traits
14+
- pydata_sphinx_theme
15+
- sphinxcontrib-openapi
16+
- numpydoc
17+
- ..

docs/source/conf.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,43 +20,43 @@
2020

2121
# -- Project information -----------------------------------------------------
2222

23-
project = 'JupyterLab Server'
24-
copyright = '2021, Project Jupyter'
25-
author = 'Project Jupyter'
23+
project = "JupyterLab Server"
24+
copyright = "2021, Project Jupyter"
25+
author = "Project Jupyter"
2626

2727
# The full version, including alpha/beta/rc tags
28-
_version_py = osp.join(HERE, '..', '..', 'jupyterlab_server', '_version.py')
28+
_version_py = osp.join(HERE, "..", "..", "jupyterlab_server", "_version.py")
2929
version_ns = {}
3030

31-
with open(_version_py, mode='r') as version_file:
31+
with open(_version_py) as version_file:
3232
exec(version_file.read(), version_ns)
3333

3434
# The short X.Y version.
35-
version = '%i.%i' % version_ns['version_info'][:2]
35+
version = "%i.%i" % version_ns["version_info"][:2]
3636
# The full version, including alpha/beta/rc tags.
37-
release = version_ns['__version__']
37+
release = version_ns["__version__"]
3838

3939
# -- General configuration ---------------------------------------------------
4040

4141
# Add any Sphinx extension module names here, as strings. They can be
4242
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
4343
# ones.
4444
extensions = [
45-
'myst_parser',
46-
'numpydoc',
47-
'autodoc_traits',
48-
'sphinx.ext.autodoc',
49-
'sphinx.ext.intersphinx',
50-
'sphinxcontrib.openapi',
51-
'sphinx.ext.napoleon',
52-
'sphinx.ext.mathjax',
53-
'sphinx_copybutton'
45+
"myst_parser",
46+
"numpydoc",
47+
"autodoc_traits",
48+
"sphinx.ext.autodoc",
49+
"sphinx.ext.intersphinx",
50+
"sphinxcontrib.openapi",
51+
"sphinx.ext.napoleon",
52+
"sphinx.ext.mathjax",
53+
"sphinx_copybutton",
5454
]
5555

5656
myst_enable_extensions = ["html_image"]
5757

5858
# Add any paths that contain templates here, relative to this directory.
59-
templates_path = ['_templates']
59+
templates_path = ["_templates"]
6060

6161
# List of patterns, relative to source directory, that match files and
6262
# directories to ignore when looking for source files.
@@ -89,8 +89,9 @@
8989
# so disable
9090
numpydoc_show_class_members = False
9191

92+
9293
def setup(app):
93-
dest = osp.join(HERE, 'changelog.md')
94-
shutil.copy(osp.join(HERE, '..', '..', 'CHANGELOG.md'), dest)
95-
with open(osp.join(HERE, '../autogen_config.py')) as f:
96-
exec(compile(f.read(), '../autogen_config.py', 'exec'), {})
94+
dest = osp.join(HERE, "changelog.md")
95+
shutil.copy(osp.join(HERE, "..", "..", "CHANGELOG.md"), dest)
96+
with open(osp.join(HERE, "../autogen_config.py")) as f:
97+
exec(compile(f.read(), "../autogen_config.py", "exec"), {})

jupyterlab_server/__init__.py

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

4+
from ._version import __version__
45
from .app import LabServerApp
6+
from .handlers import LabConfig, LabHandler, add_handlers
57
from .licenses_app import LicensesApp
6-
from .handlers import add_handlers, LabHandler, LabConfig
78
from .spec import get_openapi_spec, get_openapi_spec_dict
89
from .translation_utils import translator
910
from .workspaces_app import WorkspaceExportApp, WorkspaceImportApp, WorkspaceListApp
10-
from .workspaces_handler import slugify, WORKSPACE_EXTENSION
11-
from ._version import __version__
11+
from .workspaces_handler import WORKSPACE_EXTENSION, slugify
1212

1313
__all__ = [
14-
'__version__',
15-
'add_handlers',
16-
'LabConfig',
17-
'LabHandler',
18-
'LabServerApp',
19-
'LicensesApp',
20-
'SETTINGS_EXTENSION',
21-
'slugify',
22-
'translator',
23-
'WORKSPACE_EXTENSION',
24-
'WorkspaceExportApp',
25-
'WorkspaceImportApp',
26-
'WorkspaceListApp'
14+
"__version__",
15+
"add_handlers",
16+
"LabConfig",
17+
"LabHandler",
18+
"LabServerApp",
19+
"LicensesApp",
20+
"SETTINGS_EXTENSION",
21+
"slugify",
22+
"translator",
23+
"WORKSPACE_EXTENSION",
24+
"WorkspaceExportApp",
25+
"WorkspaceImportApp",
26+
"WorkspaceListApp",
2727
]
2828

29+
2930
def _jupyter_server_extension_points():
30-
return [
31-
{
32-
'module': 'jupyterlab_server',
33-
'app': LabServerApp
34-
}
35-
]
31+
return [{"module": "jupyterlab_server", "app": LabServerApp}]

0 commit comments

Comments
 (0)