Beispiel #1
0
def test_make_ipkernel_cmd():
    cmd = make_ipkernel_cmd()
    nt.assert_equal(cmd, [
        sys.executable,
        '-m',
        'dfkernel_launcher',
        '-f',
        '{connection_file}'
    ])
Beispiel #2
0
def assert_kernel_dict_with_profile(d):
    nt.assert_equal(d['argv'], make_ipkernel_cmd(
        extra_arguments=["--profile", "test"]))
    nt.assert_equal(d['display_name'], 'Python %i' % sys.version_info[0])
    nt.assert_equal(d['language'], 'python')
Beispiel #3
0
def assert_kernel_dict(d):
    nt.assert_equal(d['argv'], make_ipkernel_cmd())
    nt.assert_equal(d['display_name'], 'Python %i' % sys.version_info[0])
    nt.assert_equal(d['language'], 'python')
Beispiel #4
0
    ],
)

if 'develop' in sys.argv or any(a.startswith('bdist') for a in sys.argv):
    import setuptools

setuptools_args = {}
install_requires = setuptools_args['install_requires'] = [
    'ipython>=4.0.0', 'traitlets>=4.1.0', 'jupyter_client', 'tornado>=4.0',
    'ipykernel>=4.6', 'notebook>=5.0'
]

if any(a.startswith(('bdist', 'build', 'install')) for a in sys.argv):
    from dfkernel.kernelspec import write_kernel_spec, make_ipkernel_cmd, KERNEL_NAME

    argv = make_ipkernel_cmd(executable='python')
    dest = os.path.join(here, 'data_kernelspec')
    if os.path.exists(dest):
        shutil.rmtree(dest)
    write_kernel_spec(dest, overrides={'argv': argv})

    setup_args['data_files'] = [
        (pjoin('share', 'jupyter', 'kernels', KERNEL_NAME),
         [f for f in glob(pjoin(dest, '*')) if not os.path.isdir(f)]),
        (pjoin('share', 'jupyter', 'kernels', KERNEL_NAME,
               'df-notebook'), glob(pjoin(dest, 'df-notebook', '*'))),
    ]

extras_require = setuptools_args['extras_require'] = {
    'test': ['nose_warnings_filters', 'nose-timer'],
}