Exemplo n.º 1
0
    include_package_data=True,
    python_requires=">=3.6",
    platforms="Linux, Mac OS X, Windows",
    keywords=["Jupyter", "JupyterLab", "JupyterLab3"],
    classifiers=[
        "License :: OSI Approved :: BSD License",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.6",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Framework :: Jupyter",
    ],
)

try:
    from jupyter_packaging import (wrap_installers, npm_builder,
                                   get_data_files)
    post_develop = npm_builder(build_cmd="install:extension",
                               source_dir="src",
                               build_dir=lab_path)
    setup_args['cmdclass'] = wrap_installers(post_develop=post_develop,
                                             ensured_targets=ensured_targets)
    setup_args['data_files'] = get_data_files(data_files_spec)
except ImportError as e:
    pass

if __name__ == "__main__":
    setuptools.setup(**setup_args)
Exemplo n.º 2
0
        "Programming Language :: Python :: 3.9",
        "Framework :: Jupyter",
        "Framework :: Jupyter :: JupyterLab",
        "Framework :: Jupyter :: JupyterLab :: 3",
        "Framework :: Jupyter :: JupyterLab :: Extensions",
        "Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt",
    ],
)

try:
    if sys.version_info >= (3, 5):
        from jupyter_packaging import (
            wrap_installers,
            npm_builder,
            get_data_files
        )
        post_develop = npm_builder(
            build_cmd="install:extension", source_dir="src", build_dir=lab_path
        )
        setup_args["cmdclass"] = wrap_installers(post_develop=post_develop, ensured_targets=ensured_targets)
        setup_args["data_files"] = get_data_files(data_files_spec)
except ImportError as e:
    import logging
    logging.basicConfig(format="%(levelname)s: %(message)s")
    logging.warning("Build tool `jupyter-packaging` is missing. Install it with pip or conda.")
    if not ("--name" in sys.argv or "--version" in sys.argv):
        raise e

if __name__ == "__main__":
    setuptools.setup(**setup_args)
Exemplo n.º 3
0
LOCAL_APP_DIR = HERE / "quetz_frontend" / "app"
GLOBAL_APP_DIR = "share/quetz/frontend/app"

data_files_spec = [
    (GLOBAL_APP_DIR, str(LOCAL_APP_DIR), "static/**"),
    (GLOBAL_APP_DIR, str(LOCAL_APP_DIR), "themes/**"),
    (GLOBAL_APP_DIR, str(LOCAL_APP_DIR), "schemas/**")
]

# Representative files that should exist after a successful build
ensured_targets = [
    str(LOCAL_APP_DIR / "templates"),
    str(LOCAL_APP_DIR / "static"),
    str(LOCAL_APP_DIR / "themes"),
    str(LOCAL_APP_DIR / "static" / "package.json"),
    str(LOCAL_APP_DIR / "static" / "style.js"),
]

try:
    from jupyter_packaging import wrap_installers, npm_builder, get_data_files

    builder = npm_builder(build_cmd="build:prod", npm=["yarn"])
    cmdclass = wrap_installers(post_develop=builder, ensured_targets=ensured_targets)

    setup_args = {"cmdclass": cmdclass, "data_files": get_data_files(data_files_spec)}
except ImportError:
    setup_args = dict()

if __name__ == "__main__":
    setup(**setup_args)
Exemplo n.º 4
0
# Get the package info from package.json
pkg_json = json.loads((HERE / "package.json").read_bytes())

setup_args = dict(
    name=name,
    version=pkg_json["version"],
    url=pkg_json["homepage"],
    author=pkg_json["author"]["name"],
    author_email=pkg_json["author"]["email"],
    description=pkg_json["description"],
    license=pkg_json["license"],
    long_description=long_description,
    long_description_content_type="text/markdown",
    cmdclass=cmdclass,
    data_files=get_data_files(data_files_spec),
    packages=setuptools.find_packages(),
    install_requires=[
        "jupyterlab~=3.0",
        "jupyter_packaging~=0.9,<2",
        "jupyterlab-tour>=3.0.1,<4"
    ],
    zip_safe=False,
    include_package_data=True,
    python_requires=">=3.6",
    platforms="Linux, Mac OS X, Windows",
    keywords=["Jupyter", "JupyterLab", "JupyterLab3"],
    classifiers=[
        "License :: OSI Approved :: BSD License",
        "Programming Language :: Python",
        "Programming Language :: Python :: 3",
Exemplo n.º 5
0
from os import path
from setuptools import setup

version = "3.0.2"
name = "test_no_hyphens"
module_name = "test_no_hyphens"
lab_ext_name = "test_no_hyphens"

HERE = path.abspath(path.dirname(__file__))
lab_path = path.join(HERE, module_name, "labextension")

data_files_spec = [("share/jupyter/labextensions/" + lab_ext_name, lab_path,
                    "**")]

setup_args = dict(name=name, version=version, packages=[module_name])

try:
    from jupyter_packaging import get_data_files, npm_builder, wrap_installers
    post_develop = npm_builder(build_cmd="build:labextension",
                               build_dir=lab_path,
                               npm=["jlpm"])
    cmdclass = wrap_installers(post_develop=post_develop)
    setup_args.update(
        dict(cmdclass=cmdclass, data_files=get_data_files(data_files_spec)))
except ImportError:
    pass

setup(**setup_args)
Exemplo n.º 6
0
long_desc = """
            Elyra is a set of AI centric extensions to JupyterLab. It aims to help data scientists,
            machine learning engineers and AI developer’s through the model development life cycle complexities.
            """

here = os.path.abspath(os.path.dirname(__file__))

setup_args = dict(
    name="{{package-name}}",
    version="{{version}}",
    url="https://github.com/elyra-ai/elyra",
    description="Elyra provides AI Centric extensions to JupyterLab",
    long_description=long_desc,
    author="Elyra Maintainers",
    license="Apache License Version 2.0",
    data_files=get_data_files([{{data - files}}]),
    packages=find_packages(),
    install_requires=[{{install - requires}}],
    include_package_data=True,
    classifiers=(
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: OS Independent",
        "Topic :: Scientific/Engineering",
        "Topic :: Scientific/Engineering :: Artificial Intelligence",
        "Topic :: Software Development",
        "Topic :: Software Development :: Libraries",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
Exemplo n.º 7
0
data_files_spec = [
    ("share/jupyter/labextensions/%s" % labext_name, str(lab_extension_dest), "**"),
    ("share/jupyter/labextensions/%s" % labext_name, str(HERE), "install.json"),
    ("share/jupyter/lab/schemas", f"{NAME}/schemas", "@jupyter-notebook/**/*"),
    (
        "etc/jupyter/jupyter_server_config.d",
        "jupyter-config/jupyter_server_config.d",
        "notebook.json",
    ),
    (
        "etc/jupyter/jupyter_notebook_config.d",
        "jupyter-config/jupyter_notebook_config.d",
        "notebook.json",
    ),
]

try:
    from jupyter_packaging import wrap_installers, npm_builder, get_data_files

    # In develop mode, just run yarn
    builder = npm_builder(build_cmd="build", npm="jlpm", force=True)
    cmdclass = wrap_installers(post_develop=builder, ensured_targets=ensured_targets)

    setup_args = dict(cmdclass=cmdclass, data_files=get_data_files(data_files_spec))
except ImportError:
    setup_args = dict()


if __name__ == "__main__":
    setuptools.setup(**setup_args)
Exemplo n.º 8
0
#!/usr/bin/env python
# coding: utf-8

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from jupyter_packaging import get_data_files
from setuptools import setup
import pathlib

# Add labextension target to data_files
HERE = pathlib.Path.cwd().absolute()
EXT_SOURCE_PATH = HERE / "jupyterlab_markup" / "labextension"
EXT_DEST_PATH = (pathlib.PurePath("share") / "jupyter" / "labextensions" /
                 "@agoose77" / "jupyterlab-markup")

setup(data_files=get_data_files([
    (EXT_DEST_PATH, EXT_SOURCE_PATH, "**"),
    (EXT_DEST_PATH, HERE, "install.json"),
]))
Exemplo n.º 9
0
cmdclass = jp.wrap_installers(
    pre_develop=builder,
    pre_dist=builder,
    ensured_targets=jstargets,
    skip_if_exists=jstargets,
)
setup_args = dict(
    name=namepy,
    description="A package for labeling image data quickly",
    version=jp.get_version(os.path.join(namepy, "version.py")),
    scripts=glob.glob(os.path.join("scripts", "*")),
    cmdclass=cmdclass,
    data_files=jp.get_data_files(
        data_specs=[
            ("share/jupyter/nbextensions/qslwidgets", "qsl/ui/nbextension", "**"),
            ("share/jupyter/labextensions/qslwidgets", "qsl/ui/labextension", "**"),
            ("share/jupyter/labextensions/qslwidgets", "qsl/ui/assets", "install.json"),
            ("etc/jupyter/nbconfig/notebook.d", "qsl/ui/assets", "qsl.json"),
        ]
    ),
    platforms="Linux, Mac OS X, Windows",
    keywords=["Jupyter", "Widgets", "IPython"],
    python_requires=">=3.6",
    entry_points="""
        [console_scripts]
        qsl=qsl.cli:cli
    """,
)


if __name__ == "__main__":
    setuptools.setup(**setup_args)