|
1 |
| -""" |
2 |
| -jupyterlab_lego_boost setup |
3 |
| -""" |
4 |
| -import json |
5 |
| -import sys |
6 |
| -from pathlib import Path |
7 |
| - |
8 |
| -import setuptools |
9 |
| - |
10 |
| -HERE = Path(__file__).parent.resolve() |
11 |
| - |
12 |
| -# Get the package info from package.json |
13 |
| -pkg_json = json.loads((HERE / "package.json").read_bytes()) |
14 |
| - |
15 |
| -# The name of the project |
16 |
| -name = "jupyterlab_lego_boost" |
17 |
| - |
18 |
| -lab_path = (HERE / pkg_json["jupyterlab"]["outputDir"]) |
19 |
| - |
20 |
| -# Representative files that should exist after a successful build |
21 |
| -ensured_targets = [ |
22 |
| - str(lab_path / "package.json"), |
23 |
| - str(lab_path / "static/style.js") |
24 |
| -] |
25 |
| - |
26 |
| -labext_name = pkg_json["name"] |
27 |
| - |
28 |
| -data_files_spec = [ |
29 |
| - ("share/jupyter/labextensions/%s" % labext_name, str(lab_path.relative_to(HERE)), "**"), |
30 |
| - ("share/jupyter/labextensions/%s" % labext_name, str("."), "install.json"), |
31 |
| -] |
32 |
| - |
33 |
| -long_description = (HERE / "README.md").read_text(encoding="utf8") |
34 |
| - |
35 |
| -version = ( |
36 |
| - pkg_json["version"] |
37 |
| - .replace("-alpha.", "a") |
38 |
| - .replace("-beta.", "b") |
39 |
| - .replace("-rc.", "rc") |
40 |
| -) |
41 |
| - |
42 |
| -setup_args = dict( |
43 |
| - name=name, |
44 |
| - version=version, |
45 |
| - url=pkg_json["homepage"], |
46 |
| - author=pkg_json["author"]["name"], |
47 |
| - author_email=pkg_json["author"]["email"], |
48 |
| - description=pkg_json["description"], |
49 |
| - license=pkg_json["license"], |
50 |
| - license_file="LICENSE", |
51 |
| - long_description=long_description, |
52 |
| - long_description_content_type="text/markdown", |
53 |
| - packages=setuptools.find_packages(), |
54 |
| - zip_safe=False, |
55 |
| - include_package_data=True, |
56 |
| - python_requires=">=3.7", |
57 |
| - install_requires=['jupyterlab-blockly>=0.2.1,<0.3'], |
58 |
| - extras_require={ |
59 |
| - 'env': ['bleak', 'pylgbst'] |
60 |
| - }, |
61 |
| - platforms="Linux, Mac OS X, Windows", |
62 |
| - keywords=["Jupyter", "JupyterLab", "JupyterLab3"], |
63 |
| - classifiers=[ |
64 |
| - "License :: OSI Approved :: BSD License", |
65 |
| - "Programming Language :: Python", |
66 |
| - "Programming Language :: Python :: 3", |
67 |
| - "Programming Language :: Python :: 3.7", |
68 |
| - "Programming Language :: Python :: 3.8", |
69 |
| - "Programming Language :: Python :: 3.9", |
70 |
| - "Programming Language :: Python :: 3.10", |
71 |
| - "Framework :: Jupyter", |
72 |
| - "Framework :: Jupyter :: JupyterLab", |
73 |
| - "Framework :: Jupyter :: JupyterLab :: 3", |
74 |
| - "Framework :: Jupyter :: JupyterLab :: Extensions", |
75 |
| - "Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt", |
76 |
| - ], |
77 |
| -) |
78 |
| - |
79 |
| -try: |
80 |
| - from jupyter_packaging import ( |
81 |
| - wrap_installers, |
82 |
| - npm_builder, |
83 |
| - get_data_files |
84 |
| - ) |
85 |
| - post_develop = npm_builder( |
86 |
| - build_cmd="install:extension", source_dir="src", build_dir=lab_path, force=True |
87 |
| - ) |
88 |
| - setup_args["cmdclass"] = wrap_installers(post_develop=post_develop, ensured_targets=ensured_targets) |
89 |
| - setup_args["data_files"] = get_data_files(data_files_spec) |
90 |
| -except ImportError as e: |
91 |
| - import logging |
92 |
| - logging.basicConfig(format="%(levelname)s: %(message)s") |
93 |
| - logging.warning("Build tool `jupyter-packaging` is missing. Install it with pip or conda.") |
94 |
| - if not ("--name" in sys.argv or "--version" in sys.argv): |
95 |
| - raise e |
96 |
| - |
97 |
| -if __name__ == "__main__": |
98 |
| - setuptools.setup(**setup_args) |
| 1 | +# setup.py shim for use with applications that require it. |
| 2 | +__import__("setuptools").setup() |
0 commit comments