Beispiel #1
0
    ('etc/jupyter/nbconfig/notebook.d', 'etc/jupyter/nbconfig/notebook.d',
     'bqplot.json'),
]

js_command = combine_commands(
    install_npm(js_dir,
                build_dir='share/jupyter/',
                source_dir='js/src',
                build_cmd='build'),
    ensure_targets(jstargets),
)

# Adding "map_data" as package_data manually, this should not be needed because it's already
# specified in MANIFEST and include_package_data=True. This might be a bug in jupyter-packaging?
cmdclass = create_cmdclass('jsdeps',
                           data_files_spec=data_files_spec,
                           package_data_spec={"bqplot": ["map_data/*.json"]})
is_repo = os.path.exists(os.path.join(here, '.git'))
if is_repo:
    cmdclass['jsdeps'] = js_command
else:
    cmdclass['jsdeps'] = skip_if_exists(jstargets, js_command)

setup_args = dict(
    name=name,
    version=version,
    description=
    'Interactive plotting for the Jupyter notebook, using d3.js and ipywidgets.',
    long_description=LONG_DESCRIPTION,
    license='Apache',
    author='The BQplot Development Team',
Beispiel #2
0
from jupyter_packaging import get_version, create_cmdclass
import setuptools

name = "swancontents"

# Get our version
version = get_version(os.path.join(name, "_version.py"))

package_data_spec = {name: ["*"]}

data_files_spec = [
    ("etc/jupyter/jupyter_notebook_config.d", "jupyter-config",
     "swancontents.json"),
]

cmdclass = create_cmdclass(package_data_spec=package_data_spec,
                           data_files_spec=data_files_spec)

with open("README.md", "r") as fh:
    long_description = fh.read()

setup_args = dict(
    name=name,
    version=version,
    url="https://github.com/swan-cern/jupyter-extensions",
    author="SWAN Admins",
    description="SWAN Contents Manager for Jupyter",
    long_description=long_description,
    long_description_content_type="text/markdown",
    cmdclass=cmdclass,
    packages=setuptools.find_packages(),
    install_requires=[
Beispiel #3
0
            msg = ('Missing file: %s, `build:prod` script did not complete '
                   'successfully' % t)
            raise ValueError(msg)

    if 'sdist' not in sys.argv and 'bdist_wheel' not in sys.argv:
        return

    target = pjoin(HERE, NAME, 'static', 'package.json')
    with open(target) as fid:
        version = json.load(fid)['jupyterlab']['version']

    if Version(version) != Version(VERSION):
        raise ValueError('Version mismatch, please run `build:update`')


cmdclass = create_cmdclass('jsdeps', data_files_spec=data_files_spec,
                           package_data_spec=package_data_spec, exclude=exclude)
cmdclass['jsdeps'] = combine_commands(
    install_npm(build_cmd='build:prod', path=staging, source_dir=staging,
                build_dir=pjoin(HERE, NAME, 'static'), npm=npm),
    command_for_func(check_assets)
)


class JupyterlabDevelop(develop):
    """A custom develop command that runs yarn"""

    def run(self):
        if not skip_npm:
            if not which('node'):
                error_message = """
Please install nodejs and npm before continuing installation.
Beispiel #4
0
    "Sphinx>=1.8.4",
    "sphinx-markdown-builder>=0.5.2",
]

data_spec = [
    # Lab extension installed by default:
    (
        "share/jupyter/labextensions/jupyterlab_commands",
        "jupyterlab_commands/labextension",
        "**",
    ),
    # Config to enable server extension by default:
    ("etc/jupyter/jupyter_server_config.d", "jupyter-config", "*.json"),
]

cmdclass = create_cmdclass("js", data_files_spec=data_spec)
cmdclass["js"] = combine_commands(
    install_npm(jshere, build_cmd="build:all"),
    ensure_targets([
        pjoin(jshere, "lib", "index.js"),
        pjoin(jshere, "style", "index.css"),
        pjoin(here, "jupyterlab_commands", "labextension", "package.json"),
    ]),
)

setup(
    name=name,
    version=version,
    description="Arbitrary python commands for notebooks in JupyterLab",
    long_description=long_description,
    long_description_content_type="text/markdown",
Beispiel #5
0
NAME = 'nbclassic'

about = {}
here = os.path.abspath(os.path.dirname(__file__))
project_slug = NAME.lower().replace("-", "_").replace(" ", "_")
with open(os.path.join(here, project_slug, '__version__.py')) as f:
    exec(f.read(), about)

with open("README.md", "r") as fh:
    long_description = fh.read()

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

# Handle datafiles
cmdclass = create_cmdclass(
    data_files_spec=[('etc/jupyter/jupyter_server_config.d',
                      'jupyter_server_config.d', '*.json')])

setup_args = dict(
    name=NAME,
    description='Jupyter Notebook as a Jupyter Server Extension.',
    long_description=long_description,
    long_description_content_type="text/markdown",
    version=about['__version__'],
    author='Jupyter Development Team',
    author_email='*****@*****.**',
    url='http://jupyter.org',
    license='BSD',
    platforms="Linux, Mac OS X, Windows",
    keywords=['ipython', 'jupyter'],
    classifiers=[
Beispiel #6
0
ensure_python(('2.7', '>=3.6'))

version = get_version(str(py_pkg / '_version.py'))

with open('README.md', encoding='utf-8') as f:
    long_description = f.read()

data_files_spec = [
    # lab extension installed by default:
    ('share/jupyter/lab/extensions', str(py_pkg / 'labdist'), '*.tgz'),
    # config to enable server extension by default:
    ('etc/jupyter', 'jupyter-config', '**/*.json'),
]

cmdclass = create_cmdclass('pack_labext', data_files_spec=data_files_spec)
cmdclass['pack_labext'] = combine_commands(
    install_npm(js_pkg, build_cmd='build:labdist', npm=['jlpm']),
    ensure_targets(
        [js_pkg / 'lib' / 'index.js', js_pkg / 'style' / 'index.css']),
)

cmdclass.pop('develop')

requires = [
    'fs>=2.4.11',
    'fs-s3fs>=1.1.1',
    'fs.smbfs>=0.6.3',
    'jupyterlab>=2.0.0',
    'notebook>=5.7.0',
]
Beispiel #7
0
# Get our version
version = get_version(path.join(name, '_version.py'))

HERE = path.dirname(path.abspath(__file__))
lab_path = path.join(HERE, name, 'labextension')
ext_path = path.join(HERE, 'js')
public_path = path.join(HERE, 'jupyter_ros_server', 'public')
zethus_path = path.join(lab_path, 'node_modules', 'zethus', 'build', '*')

cmdclass = create_cmdclass('js',
                           package_data_spec={
                               name: [
                                   'static/*', 'public/*', 'public/forklift/*',
                                   'public/image/viz/*', 'labextension/*'
                               ]
                           },
                           data_files_spec=[
                               ("share/jupyter/labextensions/" + ext_name,
                                lab_path, "**"),
                               ('etc/jupyter/jupyter_notebook_config.d', name,
                                'jupyter_ros_server.json')
                           ])

cmdclass['js'] = combine_commands(
    install_npm(path=ext_path,
                npm=["jlpm"],
                build_cmd="build:labextension",
                build_dir=path.join(ext_path, 'build'),
                source_dir=path.join(ext_path, 'src')),
    # Representative files that should exist after a successful build
    ensure_targets([
Beispiel #8
0
setup_args = dict(
    name='jupyter-packaging',
    version=__version__,
    py_modules=['jupyter_packaging'],
    description="Jupyter Packaging Utilities",
    long_description="""
    This package contains utilities for making Python packages with
    and without accompanying JavaScript packages.
    """,
    author='Jupyter Development Team',
    author_email='*****@*****.**',
    url='http://jupyter.org',
    license='BSD',
    platforms="Linux, Mac OS X, Windows",
    keywords=['Jupyter', 'Packaging'],
    cmdclass=create_cmdclass(),
    classifiers=[
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: BSD License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],
)

if __name__ == '__main__':
    setup(**setup_args)
Beispiel #9
0
        jupyter_server_config_path,
        "jupytext.json",
    ),
    ("etc/jupyter/jupyter_notebook_config.d", notebook_config_path,
     "jupytext.json"),
    ("etc/jupyter/nbconfig/notebook.d", nbconfig_path, "jupytext.json"),
]

# Representative files that should exist after a successful build
jstargets = [
    path.join(lab_path, "package.json"),
]

cmdclass = create_cmdclass(
    "jsdeps",
    package_data_spec={"jupytext": ["nbextension/**"]},
    data_files_spec=data_files_spec,
)

cmdclass["jsdeps"] = combine_commands(
    install_npm(
        path.join(this_directory, "packages", "labextension"),
        build_cmd="build:prod",
        npm=["jlpm"],
    ),
    ensure_targets(jstargets),
)

setup(
    name="jupytext",
    version=version,
Beispiel #10
0
    def add_data_files(path):
        for (dirpath, dirnames, filenames) in os.walk(path):
            if filenames:
                paths = [(dirpath, dirpath, filename)
                         for filename in filenames]
                data_files.extend(paths)

    # Add all static and templates folders.
    add_data_files("simple_ext1/static")
    add_data_files("simple_ext1/templates")
    add_data_files("simple_ext2/static")
    add_data_files("simple_ext2/templates")
    return data_files


cmdclass = create_cmdclass(data_files_spec=get_data_files())

setup_args = dict(
    name="jupyter_server_example",
    version=VERSION,
    description="Jupyter Server Example",
    long_description=open("README.md").read(),
    python_requires=">=3.7",
    install_requires=[
        "jupyter_server",
        "jinja2",
    ],
    extras_require={
        "test": ["pytest"],
    },
    include_package_data=True,
Beispiel #11
0
jstargets = [
    str(lab_path / "package.json"),
]

package_data_spec = {name: ["*"]}

labext_name = "@jupyterlab-ipython/KernelSpec-Manager"

data_files_spec = [
    ("share/jupyter/labextensions/%s" % labext_name, str(lab_path), "**"),
    ("share/jupyter/labextensions/%s" % labext_name, str(HERE),
     "install.json"),
]

cmdclass = jupyter_packaging.create_cmdclass(
    "jsdeps",
    package_data_spec=package_data_spec,
    data_files_spec=data_files_spec)

js_command = jupyter_packaging.combine_commands(
    jupyter_packaging.install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]),
    jupyter_packaging.ensure_targets(jstargets),
)

is_repo = (HERE / ".git").exists()
if is_repo:
    cmdclass["jsdeps"] = js_command
else:
    cmdclass["jsdeps"] = skip_if_exists(jstargets, js_command)

setup_args = dict(
    name='ksmm',
Beispiel #12
0
import os
from jupyter_packaging import (create_cmdclass, install_npm, ensure_targets,
                               combine_commands, skip_if_exists)
import setuptools

HERE = os.path.abspath(os.path.dirname(__file__))
LAB_PATH = os.path.join(HERE, "conda_store", "labextension")

cmdclass = create_cmdclass(
    "jsdeps",
    package_data_spec={"conda_store": ["*"]},
    data_files_spec=[
        ("share/jupyter/labextensions/%s" % "@Quansight/conda-store", LAB_PATH,
         "**"),
        ("share/jupyter/labextensions/%s" % "@Quansight/conda-store", HERE,
         "install.json"),
    ])

js_command = combine_commands(
    install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]),
    ensure_targets([
        os.path.join(LAB_PATH, "package.json"),
    ]),
)

if os.path.exists(os.path.join(HERE, ".git")):
    cmdclass["jsdeps"] = js_command
else:
    cmdclass["jsdeps"] = skip_if_exists([
        os.path.join(LAB_PATH, "package.json"),
    ], js_command)
Beispiel #13
0
#         s = ros3d.js_extract()
#         fo.write(s)
#     sys.path.pop()

# extract_defaults()

# Extensions' path
module_path = path.join(HERE, name)
nb_path = path.join(HERE, name, 'static')
lab_path = path.join(HERE, name, 'labextension')

cmdclass = create_cmdclass(
    'js',
    package_data_spec={name: ['static/*', 'labextension/*']},
    data_files_spec=[
        ('share/jupyter/nbextensions/' + nb_ext_name, nb_path, '**'),
        ('etc/jupyter/nbconfig/notebook.d', name, 'jupyter-ros.json'),
        ("share/jupyter/labextensions/" + ext_name, lab_path, "**"),
        ('etc/jupyter/jupyter_notebook_config.d', name,
         'jupyros_server_extension.json')
    ])

cmdclass['js'] = combine_commands(
    install_npm(path=ext_path,
                npm=["jlpm"],
                build_cmd="build:labextension",
                source_dir=path.join(ext_path, 'lib')),
    # Representative files that should exist after a successful build
    ensure_targets([
        path.join(nb_path, 'index.js'),
        path.join(lab_path, 'package.json'),
    ]),
Beispiel #14
0
js_dir = os.path.join(here, 'js')

# Representative files that should exist after a successful build
jstargets = [
    os.path.join('ipytree/nbextension', 'index.js'),
    os.path.join('ipytree/labextension', 'package.json'),
]

data_files_spec = [
    ('share/jupyter/nbextensions/ipytree', 'ipytree/nbextension', '**'),
    ('share/jupyter/labextensions/ipytree', 'ipytree/labextension', "**"),
    ('etc/jupyter/nbconfig/notebook.d', '.', 'ipytree.json'),
]

cmdclass = create_cmdclass('jsdeps', data_files_spec=data_files_spec)
js_command = combine_commands(
    install_npm(js_dir, npm=["yarn"], build_cmd='build'), ensure_targets(jstargets),
)

is_repo = os.path.exists(os.path.join(here, '.git'))
if is_repo:
    cmdclass['jsdeps'] = js_command
else:
    cmdclass['jsdeps'] = skip_if_exists(jstargets, js_command)

setup_args = {
    'name': name,
    'version': version,
    'license': 'MIT License',
    'description': 'A Tree Widget using jsTree',
Beispiel #15
0
package_data_spec = {pkg_name: ['*']}

data_files_spec = [
    ('share/jupyter/lab/extensions', lab_path, '*.tgz'),
    ('etc/jupyter/jupyter_notebook_config.d', 'jupyter-config',
     'mosaik_docker_jl.json'),
]

if (os.path.isfile(os.path.join(HERE, 'package.json'))):
    # Representative files that should exist after a successful build
    jstargets = [
        os.path.join(HERE, 'lib', 'mosaik-docker-jl.js'),
    ]

    cmdclass = create_cmdclass('jsdeps',
                               package_data_spec=package_data_spec,
                               data_files_spec=data_files_spec)

    cmdclass['jsdeps'] = combine_commands(
        install_npm(HERE, build_cmd='build:all', npm=['jlpm']),
        ensure_targets(jstargets),
    )
else:
    cmdclass = create_cmdclass(package_data_spec=package_data_spec,
                               data_files_spec=data_files_spec)

cmdclass.pop('develop')

# Read long description from file (reStructuredText syntax). Will be parsed and displayed as HTML online.
with open('description.rst') as description_file:
    long_description = description_file.read()
Beispiel #16
0
]

package_data_spec = {
    name: [
        "*"
    ]
}

data_files_spec = [
    ("share/jupyter/lab/extensions", lab_path, "*.tgz"),
    ("etc/jupyter/jupyter_notebook_config.d",
     "jupyter-config", "rucio_jupyterlab.json"),
]

cmdclass = create_cmdclass("jsdeps",
                           package_data_spec=package_data_spec,
                           data_files_spec=data_files_spec
                           )

cmdclass["jsdeps"] = combine_commands(
    install_npm(HERE, build_cmd="build:all", npm=["jlpm"]),
    ensure_targets(jstargets),
)

with open("README.md", "r") as fh:
    long_description = fh.read()

setup_args = dict(
    name=name,
    version=version,
    url="https://github.com/rucio/jupyterlab-extension",
    author="Muhammad Aditya Hilmy",
Beispiel #17
0
# Get our version
version = get_version(os.path.join(name, "_version.py"))

lab_path = os.path.join(HERE, name, "labextension")

# Representative files that should exist after a successful build
jstargets = [
    os.path.join(HERE, "lib", "CodeSnippetService.js"),
]

package_data_spec = {name: ["*"]}

data_files_spec = [("share/jupyter/metadata/code-snippets",
                    "share/jupyter/metadata/code-snippets", "*.json")]

cmdclass = create_cmdclass(data_files_spec=data_files_spec)

with open("README.md", "r") as fh:
    long_description = fh.read()

setup_args = dict(
    name=name,
    version=version,
    url="https://github.com/jupytercalpoly/project2.git",
    author="Jay Ahn, Kiran Pinnipati",
    description=
    "Save, reuse, and share code snippets using JupyterLab Code Snippets",
    long_description=long_description,
    long_description_content_type="text/markdown",
    cmdclass=cmdclass,
    install_requires=["jupyterlab~=2.0", "elyra==1.0.0b1"],