-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from pkgw/jupyter-config
Add drop-in configuration files to activate the server extension
- Loading branch information
Showing
7 changed files
with
102 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"NotebookApp": { | ||
"nbserver_extensions": { | ||
"wwt_kernel_data_relay": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"ServerApp": { | ||
"jpserver_extensions": { | ||
"wwt_kernel_data_relay": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,83 +2,111 @@ | |
# Copyright 2019-2021 the .NET Foundation | ||
# Licensed under the MIT License | ||
|
||
import os | ||
from setuptools import setup, Extension | ||
import sys | ||
from setuptools import setup | ||
|
||
|
||
def get_long_desc(): | ||
in_preamble = True | ||
lines = [] | ||
|
||
with open('README.md', 'rt', encoding='utf8') as f: | ||
with open("README.md", "rt", encoding="utf8") as f: | ||
for line in f: | ||
if in_preamble: | ||
if line.startswith('<!--pypi-begin-->'): | ||
if line.startswith("<!--pypi-begin-->"): | ||
in_preamble = False | ||
else: | ||
if line.startswith('<!--pypi-end-->'): | ||
if line.startswith("<!--pypi-end-->"): | ||
break | ||
else: | ||
lines.append(line) | ||
|
||
lines.append(''' | ||
lines.append( | ||
""" | ||
For more information, including installation instructions, please visit [the | ||
project homepage]. | ||
[the project homepage]: https://github.com/WorldWideTelescope/wwt_kernel_data_relay/ | ||
''') | ||
return ''.join(lines) | ||
""" | ||
) | ||
return "".join(lines) | ||
|
||
|
||
data_files_spec = [ | ||
( | ||
"etc/jupyter/jupyter_server_config.d", | ||
"jupyter-config/server-config", | ||
"wwt_kernel_data_relay.json", | ||
), | ||
# For backward compatibility with notebook server: | ||
( | ||
"etc/jupyter/jupyter_notebook_config.d", | ||
"jupyter-config/nb-config", | ||
"wwt_kernel_data_relay.json", | ||
), | ||
] | ||
|
||
|
||
setup_args = dict( | ||
name = 'wwt_kernel_data_relay', # cranko project-name | ||
version = '0.dev0', # cranko project-version | ||
description = 'Jupyter server extension to allow kernels to make data web-accessible', | ||
long_description = get_long_desc(), | ||
long_description_content_type = 'text/markdown', | ||
url = 'https://github.com/WorldWideTelescope/wwt_kernel_data_relay/', | ||
license = 'MIT', | ||
platforms = 'Linux, Mac OS X, Windows', | ||
|
||
author = 'AAS WorldWide Telescope Team', | ||
author_email = '[email protected]', | ||
|
||
classifiers = [ | ||
'Intended Audience :: Science/Research', | ||
'License :: OSI Approved :: MIT License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Topic :: Scientific/Engineering :: Astronomy', | ||
'Topic :: Scientific/Engineering :: Visualization', | ||
name="wwt_kernel_data_relay", # cranko project-name | ||
version="0.dev0", # cranko project-version | ||
description="Jupyter server extension to allow kernels to make data web-accessible", | ||
long_description=get_long_desc(), | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/WorldWideTelescope/wwt_kernel_data_relay/", | ||
license="MIT", | ||
platforms="Linux, Mac OS X, Windows", | ||
author="AAS WorldWide Telescope Team", | ||
author_email="[email protected]", | ||
classifiers=[ | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Topic :: Scientific/Engineering :: Astronomy", | ||
"Topic :: Scientific/Engineering :: Visualization", | ||
], | ||
|
||
packages = [ | ||
'wwt_kernel_data_relay', | ||
packages=[ | ||
"wwt_kernel_data_relay", | ||
#'wwt_kernel_data_relay.tests', | ||
], | ||
include_package_data = True, | ||
|
||
install_requires = [ | ||
'jupyter-client>=7', | ||
'notebook>=6', | ||
'tornado>=6', | ||
'traitlets>=5', | ||
include_package_data=True, | ||
install_requires=[ | ||
"jupyter-client>=7", | ||
"notebook>=6", | ||
"tornado>=6", | ||
"traitlets>=5", | ||
], | ||
|
||
extras_require = { | ||
'test': [ | ||
'pytest-cov', | ||
extras_require={ | ||
"test": [ | ||
"pytest-cov", | ||
], | ||
'docs': [ | ||
'astropy-sphinx-theme', | ||
'numpydoc', | ||
'sphinx', | ||
'sphinx-automodapi', | ||
"docs": [ | ||
"astropy-sphinx-theme", | ||
"numpydoc", | ||
"sphinx", | ||
"sphinx-automodapi", | ||
], | ||
}, | ||
) | ||
|
||
if __name__ == '__main__': | ||
try: | ||
from jupyter_packaging import get_data_files | ||
|
||
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__": | ||
setup(**setup_args) |