From b1759c888271fc4bf8c0a91c316af0ca61e90643 Mon Sep 17 00:00:00 2001 From: Alejandro del Castillo Date: Wed, 14 Nov 2018 11:12:27 -0600 Subject: [PATCH] setup.py: add automatic script generation Use setuptools console_scripts functionality to create top level jupyter & jupyterhub-single user entry point scripts on *nix, and executables on Windows. Signed-off-by: Alejandro del Castillo --- scripts/jupyterhub | 4 ---- scripts/jupyterhub-singleuser | 6 ------ setup.py | 5 ++++- 3 files changed, 4 insertions(+), 11 deletions(-) delete mode 100755 scripts/jupyterhub delete mode 100755 scripts/jupyterhub-singleuser diff --git a/scripts/jupyterhub b/scripts/jupyterhub deleted file mode 100755 index 98d12891..00000000 --- a/scripts/jupyterhub +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env python3 - -from jupyterhub.app import main -main() diff --git a/scripts/jupyterhub-singleuser b/scripts/jupyterhub-singleuser deleted file mode 100755 index e207396d..00000000 --- a/scripts/jupyterhub-singleuser +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -from jupyterhub.singleuser import main - -if __name__ == '__main__': - main() diff --git a/setup.py b/setup.py index 5b14fc37..63e3b077 100755 --- a/setup.py +++ b/setup.py @@ -89,7 +89,6 @@ with open('README.md', encoding="utf8") as f: setup_args = dict( name = 'jupyterhub', - scripts = glob(pjoin('scripts', '*')), packages = packages, # dummy, so that install_data doesn't get skipped # this will be overridden when bower is run anyway @@ -121,6 +120,10 @@ setup_args = dict( 'localprocess = jupyterhub.spawner:LocalProcessSpawner', 'simple = jupyterhub.spawner:SimpleLocalProcessSpawner', ], + 'console_scripts': [ + 'jupyterhub = jupyterhub.app:main', + 'jupyterhub-singleuser = jupyterhub.singleuser:main', + ] }, classifiers = [ 'Intended Audience :: Developers',