# HG changeset patch # User Denis Laxalde # Date 1516790412 -3600 # Node ID 2060ee44ea9ae6c0ef83de9352bec5c7a235c2aa # Parent 9165f4b7426b55d43b71a936da8638d96e47ddf5 [pkg] Replace custom "scripts" handling by a setuptools entry points http://setuptools.readthedocs.io/en/latest/setuptools.html#automatic-script-creation diff -r 9165f4b7426b -r 2060ee44ea9a cubicweb/__pkginfo__.py --- a/cubicweb/__pkginfo__.py Wed Jan 24 13:30:50 2018 +0100 +++ b/cubicweb/__pkginfo__.py Wed Jan 24 11:40:12 2018 +0100 @@ -43,10 +43,6 @@ 'Programming Language :: JavaScript', ] -scripts = [s for s in glob.glob(join('bin', 'cubicweb-*')) - if not s.endswith('.bat')] - - _server_migration_dir = join(modname, 'misc', 'migration') _data_dir = join(modname, 'web', 'data') _wdoc_dir = join(modname, 'web', 'wdoc') diff -r 9165f4b7426b -r 2060ee44ea9a setup.py --- a/setup.py Wed Jan 24 13:30:50 2018 +0100 +++ b/setup.py Wed Jan 24 11:40:12 2018 +0100 @@ -49,24 +49,10 @@ # import optional features distname = __pkginfo__['distname'] -scripts = __pkginfo__['scripts'] data_files = __pkginfo__['data_files'] package_data = __pkginfo__['package_data'] -def ensure_scripts(linux_scripts): - """ - Creates the proper script names required for each platform - (taken from 4Suite) - """ - from distutils import util - if util.get_platform()[:3] == 'win': - scripts_ = [script + '.bat' for script in linux_scripts] - else: - scripts_ = linux_scripts - return scripts_ - - def get_packages(directory, prefix): """return a list of subpackages for the given directory """ @@ -123,7 +109,6 @@ author_email=author_email, packages=[modname] + get_packages(join(here, modname), modname), package_data=package_data, - scripts=ensure_scripts(scripts), data_files=data_files, include_package_data=True, install_requires=[ @@ -140,6 +125,9 @@ 'unittest2 >= 0.7.0', ], entry_points={ + 'console_scripts': [ + 'cubicweb-ctl = cubicweb.cwctl:run', + ], 'paste.app_factory': [ 'pyramid_main=cubicweb.pyramid:pyramid_app', ],