From caf35bcdf470c3c59fbde1d47126e06d74c3e10a Mon Sep 17 00:00:00 2001 From: Calum Lind Date: Fri, 4 Sep 2015 19:43:06 +0100 Subject: [PATCH] [Packaging] Include WebUI debug files for dev versions * Webui will try to use debug files if deluge version contains 'dev'. * Include webui debug files in sdist. * Use exclude_package_data to remove debug files in release versions. --- MANIFEST.in | 6 ++---- setup.py | 62 ++++++++++++++++++++++++++++++----------------------- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 7b9bb2dd7..ff277eb36 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -14,11 +14,9 @@ graft deluge/ui/gtkui/glade include deluge/ui/web/index.html include deluge/ui/web/css/*.css -exclude deluge/ui/web/css/*-debug.css -include deluge/ui/web/js/extjs/*.js -exclude deluge/ui/web/js/extjs/*-debug.js include deluge/ui/web/js/*.js -exclude deluge/ui/web/js/*-debug.js +graft deluge/ui/web/js/deluge-all +graft deluge/ui/web/js/extjs graft deluge/ui/web/themes graft deluge/ui/web/render graft deluge/ui/web/icons diff --git a/setup.py b/setup.py index ada3a9267..3fd115fb5 100755 --- a/setup.py +++ b/setup.py @@ -313,10 +313,42 @@ if windows_check(): 'deluge-web-debug = deluge.ui.web:start', 'deluged-debug = deluge.main:start_daemon']) +_package_data = {} +_package_data['deluge'] = [ + 'ui/data/pixmaps/*.png', + 'ui/data/pixmaps/*.svg', + 'ui/data/pixmaps/*.ico', + 'ui/data/pixmaps/*.gif', + 'ui/data/pixmaps/flags/*.png', + 'plugins/*.egg', + 'i18n/*/LC_MESSAGES/*.mo'] +_package_data['deluge.ui.web'] = [ + 'index.html', + 'css/*.css', + 'icons/*.png', + 'images/*.gif', + 'images/*.png', + 'js/*.js', + 'js/extjs/*.js', + 'render/*.html', + 'themes/css/*.css', + 'themes/images/*/*.gif', + 'themes/images/*/*.png', + 'themes/images/*/*/*.gif', + 'themes/images/*/*/*.png'] +_package_data['deluge.ui.gtkui'] = ['glade/*.ui'] + +_version = get_version(prefix='deluge-', suffix='.dev0') + +if 'dev' in _version: + _exclude_package_data = {} +else: + _exclude_package_data = {"deluge.ui.web": ["*-debug.js", '*-debug.css']} + # Main setup setup( name='deluge', - version=get_version(prefix='deluge-', suffix='.dev0'), + version=_version, fullname='Deluge Bittorrent Client', description='Bittorrent Client', author='Andrew Resch, Damien Churchill', @@ -331,32 +363,8 @@ setup( cmdclass=cmdclass, tests_require=['pytest'], data_files=_data_files, - package_data={'deluge': ['ui/gtkui/glade/*.ui', - 'ui/data/pixmaps/*.png', - 'ui/data/pixmaps/*.svg', - 'ui/data/pixmaps/*.ico', - 'ui/data/pixmaps/*.gif', - 'ui/data/pixmaps/flags/*.png', - 'plugins/*.egg', - 'i18n/*/LC_MESSAGES/*.mo', - 'ui/web/index.html', - 'ui/web/css/*.css', - 'ui/web/icons/*.png', - 'ui/web/images/*.gif', - 'ui/web/images/*.png', - 'ui/web/js/*.js', - 'ui/web/js/*/*.js', - 'ui/web/js/*/.order', - 'ui/web/js/*/*/*.js', - 'ui/web/js/*/*/.order', - 'ui/web/js/*/*/*/*.js', - 'ui/web/render/*.html', - 'ui/web/themes/css/*.css', - 'ui/web/themes/images/*/*.gif', - 'ui/web/themes/images/*/*.png', - 'ui/web/themes/images/*/*/*.gif', - 'ui/web/themes/images/*/*/*.png' - ]}, + package_data=_package_data, + exclude_package_data=_exclude_package_data, packages=find_packages(exclude=['plugins', 'docs', 'tests']), namespace_packages=['deluge', 'deluge.plugins'], entry_points=entry_points