|
12 | 12 | # The name of the project
|
13 | 13 | name = "jupyterlab_quickopen"
|
14 | 14 |
|
15 |
| -lab_path = (HERE / name.replace("-", "_") / "labextension") |
| 15 | +lab_path = HERE / name.replace("-", "_") / "labextension" |
16 | 16 |
|
17 | 17 | # Representative files that should exist after a successful build
|
18 |
| -ensured_targets = [ |
19 |
| - str(lab_path / "package.json"), |
20 |
| - str(lab_path / "static/style.js") |
21 |
| -] |
| 18 | +ensured_targets = [str(lab_path / "package.json"), str(lab_path / "static/style.js")] |
22 | 19 |
|
23 |
| -labext_name = "jupyterlab-quickopen" |
| 20 | +labext_name = "@parente/jupyterlab-quickopen" |
24 | 21 |
|
25 | 22 | data_files_spec = [
|
26 |
| - ("share/jupyter/labextensions/%s" % labext_name, str(lab_path.relative_to(HERE)), "**"), |
| 23 | + ( |
| 24 | + "share/jupyter/labextensions/%s" % labext_name, |
| 25 | + str(lab_path.relative_to(HERE)), |
| 26 | + "**", |
| 27 | + ), |
27 | 28 | ("share/jupyter/labextensions/%s" % labext_name, str("."), "install.json"),
|
28 |
| - ("etc/jupyter/jupyter_server_config.d", |
29 |
| - "jupyter-config/server-config", "jupyterlab_quickopen.json"), |
| 29 | + ( |
| 30 | + "etc/jupyter/jupyter_server_config.d", |
| 31 | + "jupyter-config/server-config", |
| 32 | + "jupyterlab_quickopen.json", |
| 33 | + ), |
30 | 34 | # For backward compatibility with notebook server
|
31 |
| - ("etc/jupyter/jupyter_notebook_config.d", |
32 |
| - "jupyter-config/nb-config", "jupyterlab_quickopen.json"), |
| 35 | + ( |
| 36 | + "etc/jupyter/jupyter_notebook_config.d", |
| 37 | + "jupyter-config/nb-config", |
| 38 | + "jupyterlab_quickopen.json", |
| 39 | + ), |
33 | 40 | ]
|
34 | 41 |
|
35 | 42 | long_description = (HERE / "README.md").read_text()
|
|
48 | 55 | long_description=long_description,
|
49 | 56 | long_description_content_type="text/markdown",
|
50 | 57 | packages=setuptools.find_packages(),
|
51 |
| - install_requires=[ |
52 |
| - "jupyter_server>=1.6,<2" |
53 |
| - ], |
| 58 | + install_requires=["jupyter_server>=1.6,<2"], |
54 | 59 | zip_safe=False,
|
55 | 60 | include_package_data=True,
|
56 | 61 | python_requires=">=3.6",
|
|
74 | 79 | )
|
75 | 80 |
|
76 | 81 | try:
|
77 |
| - from jupyter_packaging import ( |
78 |
| - wrap_installers, |
79 |
| - npm_builder, |
80 |
| - get_data_files |
81 |
| - ) |
| 82 | + from jupyter_packaging import wrap_installers, npm_builder, get_data_files |
| 83 | + |
82 | 84 | post_develop = npm_builder(
|
83 | 85 | build_cmd="install:extension", source_dir="src", build_dir=lab_path
|
84 | 86 | )
|
85 |
| - setup_args["cmdclass"] = wrap_installers(post_develop=post_develop, ensured_targets=ensured_targets) |
| 87 | + setup_args["cmdclass"] = wrap_installers( |
| 88 | + post_develop=post_develop, ensured_targets=ensured_targets |
| 89 | + ) |
86 | 90 | setup_args["data_files"] = get_data_files(data_files_spec)
|
87 | 91 | except ImportError as e:
|
88 | 92 | import logging
|
| 93 | + |
89 | 94 | logging.basicConfig(format="%(levelname)s: %(message)s")
|
90 |
| - logging.warning("Build tool `jupyter-packaging` is missing. Install it with pip or conda.") |
| 95 | + logging.warning( |
| 96 | + "Build tool `jupyter-packaging` is missing. Install it with pip or conda." |
| 97 | + ) |
91 | 98 | if not ("--name" in sys.argv or "--version" in sys.argv):
|
92 | 99 | raise e
|
93 | 100 |
|
|
0 commit comments