[1.26 1/1] setup.py update for 1.26 release
From: Alexandru DAMIAN <[email protected]>
This patch updates setup.py and MANIFEST.in so it correctly packages bitbake in standard python package format.
Use "python manage.py sdist" to generate installation package.
Minor updates to toaster scripts so they work correctly from a package installation.
--- MANIFEST.in | 207 ++++++++++++++++++++++++++++++++++-- bin/toaster | 31 ++++-- lib/toaster/toastermain/settings.py | 4 - lib/toaster/toastermain/urls.py | 3 - setup.py | 16 +-- 5 files changed, 232 insertions(+), 29 deletions(-)
MANIFEST.in +200 -7
@@ -1,11 +1,204 @@ -include COPYING -include ChangeLog include AUTHORS +include bin/bitbake-worker +include bin/bitdoc +include bin/image-writer +include bin/toaster +include bin/toaster-eventreplay +include build/scripts-2.7/bitbake +include build/scripts-2.7/bitbake-diffsigs +include build/scripts-2.7/bitbake-dumpsig +include build/scripts-2.7/bitbake-layers +include build/scripts-2.7/bitbake-prserv +include build/scripts-2.7/bitbake-selftest +include build/scripts-2.7/bitbake-worker +include build/scripts-2.7/bitdoc +include build/scripts-2.7/image-writer +include build/scripts-2.7/toaster +include build/scripts-2.7/toaster-eventreplay +include ChangeLog +include classes/* +include classes/base.bbclass +include conf/* +include conf/bitbake.conf include contrib/* +include contrib/bbdev.sh +include contrib/README include contrib/vim/*/* -include conf/* -include classes/* -include doc/* -include doc/manual/* -include ez_setup.py +include contrib/vim/ftdetect/bitbake.vim +include contrib/vim/ftplugin/bitbake.vim +include contrib/vim/plugin/newbb.vim +include contrib/vim/syntax/bitbake.vim +include COPYING +recursive-include doc * include HEADER + +include lib/bb/ui/crumbs/puccho.glade +include lib/bb/ui/icons/images/images_display.png +include lib/bb/ui/icons/images/images_hover.png +include lib/bb/ui/icons/indicators/add-hover.png +include lib/bb/ui/icons/indicators/add.png +include lib/bb/ui/icons/indicators/alert.png +include lib/bb/ui/icons/indicators/confirmation.png +include lib/bb/ui/icons/indicators/denied.png +include lib/bb/ui/icons/indicators/error.png +include lib/bb/ui/icons/indicators/info.png +include lib/bb/ui/icons/indicators/issues.png +include lib/bb/ui/icons/indicators/refresh.png +include lib/bb/ui/icons/indicators/remove-hover.png +include lib/bb/ui/icons/indicators/remove.png +include lib/bb/ui/icons/indicators/tick.png +include lib/bb/ui/icons/info/info_display.png +include lib/bb/ui/icons/info/info_hover.png +include lib/bb/ui/icons/layers/layers_display.png +include lib/bb/ui/icons/layers/layers_hover.png +include lib/bb/ui/icons/packages/packages_display.png +include lib/bb/ui/icons/packages/packages_hover.png +include lib/bb/ui/icons/recipe/recipe_display.png +include lib/bb/ui/icons/recipe/recipe_hover.png +include lib/bb/ui/icons/settings/settings_display.png +include lib/bb/ui/icons/settings/settings_hover.png +include lib/bb/ui/icons/templates/templates_display.png +include lib/bb/ui/icons/templates/templates_hover.png +include lib/bs4/AUTHORS.txt +include lib/bs4/COPYING.txt +include lib/bs4/NEWS.txt +include lib/toaster/bldviewer/static/css/bootstrap.css +include lib/toaster/bldviewer/static/js/bootstrap.js +include lib/toaster/bldviewer/static/js/jquery-2.0.3.js +include lib/toaster/bldviewer/templates/simple_basebuildpage.html +include lib/toaster/bldviewer/templates/simple_base.html +include lib/toaster/bldviewer/templates/simple_basetable.html +include lib/toaster/bldviewer/templates/simple_bfile.html +include lib/toaster/bldviewer/templates/simple_bpackage.html +include lib/toaster/bldviewer/templates/simple_build.html +include lib/toaster/bldviewer/templates/simple_configuration.html +include lib/toaster/bldviewer/templates/simple_layer.html +include lib/toaster/bldviewer/templates/simple_package.html +include lib/toaster/bldviewer/templates/simple_recipe.html +include lib/toaster/bldviewer/templates/simple_task.html +include lib/toaster/toastergui/static/css/bootstrap.min.css +include lib/toaster/toastergui/static/css/bootstrap-responsive.min.css +include lib/toaster/toastergui/static/css/default.css +include lib/toaster/toastergui/static/css/font-awesome.min.css +include lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png +include lib/toaster/toastergui/static/css/images/ui-bg_diagonals-thick_20_666666_40x40.png +include lib/toaster/toastergui/static/css/images/ui-bg_flat_10_000000_40x100.png +include lib/toaster/toastergui/static/css/images/ui-bg_glass_100_f6f6f6_1x400.png +include lib/toaster/toastergui/static/css/images/ui-bg_glass_100_fdf5ce_1x400.png +include lib/toaster/toastergui/static/css/images/ui-bg_glass_65_ffffff_1x400.png +include lib/toaster/toastergui/static/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png +include lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +include lib/toaster/toastergui/static/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +include lib/toaster/toastergui/static/css/images/ui-icons_222222_256x240.png +include lib/toaster/toastergui/static/css/images/ui-icons_228ef1_256x240.png +include lib/toaster/toastergui/static/css/images/ui-icons_ef8c08_256x240.png +include lib/toaster/toastergui/static/css/images/ui-icons_ffd27a_256x240.png +include lib/toaster/toastergui/static/css/images/ui-icons_ffffff_256x240.png +include lib/toaster/toastergui/static/css/jquery.treetable.css +include lib/toaster/toastergui/static/css/jquery.treetable.theme.default.css +include lib/toaster/toastergui/static/css/jquery.treetable.theme.toaster.css +include lib/toaster/toastergui/static/css/jquery-ui.min.css +include lib/toaster/toastergui/static/css/jquery-ui.structure.min.css +include lib/toaster/toastergui/static/css/jquery-ui.theme.min.css +include lib/toaster/toastergui/static/css/prettify.css +include lib/toaster/toastergui/static/css/screen.css +include lib/toaster/toastergui/static/fonts/FontAwesome.otf +include lib/toaster/toastergui/static/fonts/fontawesome-webfont.eot +include lib/toaster/toastergui/static/fonts/fontawesome-webfont.svg +include lib/toaster/toastergui/static/fonts/fontawesome-webfont.ttf +include lib/toaster/toastergui/static/fonts/fontawesome-webfont.woff +include lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.eot +include lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.svg +include lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.ttf +include lib/toaster/toastergui/static/fonts/glyphicons-halflings-regular.woff +include lib/toaster/toastergui/static/img/logo.png +include lib/toaster/toastergui/static/img/toaster_1.7.png +include lib/toaster/toastergui/static/img/toaster.png +include lib/toaster/toastergui/static/jquery-treetable-license/GPL-LICENSE.txt +include lib/toaster/toastergui/static/jquery-treetable-license/MIT-LICENSE.txt +include lib/toaster/toastergui/static/jquery-treetable-license/README.md +include lib/toaster/toastergui/static/jquery.treetable.theme.toaster.css +include lib/toaster/toastergui/static/js/angular-animate.min.js +include lib/toaster/toastergui/static/js/angular-cookies.min.js +include lib/toaster/toastergui/static/js/angular.min.js +include lib/toaster/toastergui/static/js/angular.min.js.map +include lib/toaster/toastergui/static/js/angular-route.min.js +include lib/toaster/toastergui/static/js/angular-sanitize.min.js +include lib/toaster/toastergui/static/js/base.js +include lib/toaster/toastergui/static/js/bootstrap.min.js +include lib/toaster/toastergui/static/js/filtersnippet.js +include lib/toaster/toastergui/static/js/importlayer.js +include lib/toaster/toastergui/static/js/jquery-2.0.3.min.js +include lib/toaster/toastergui/static/js/jquery-2.0.3.min.map +include lib/toaster/toastergui/static/js/jquery.cookie.js +include lib/toaster/toastergui/static/js/jquery.treetable.js +include lib/toaster/toastergui/static/js/jquery-ui.min.js +include lib/toaster/toastergui/static/js/.jshintrc +include lib/toaster/toastergui/static/js/layerdetails.js +include lib/toaster/toastergui/static/js/libtoaster.js +include lib/toaster/toastergui/static/js/machines.js +include lib/toaster/toastergui/static/js/prettify.js +include lib/toaster/toastergui/static/js/projectapp.js +include lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.js +include lib/toaster/toastergui/static/js/ui-bootstrap-tpls-0.11.0.min.js +include lib/toaster/toastergui/templates/basebuilddetailpage.html +include lib/toaster/toastergui/templates/basebuildpage.html +include lib/toaster/toastergui/templates/base.html +include lib/toaster/toastergui/templates/baseprojectpage.html +include lib/toaster/toastergui/templates/basetable_bottom.html +include lib/toaster/toastergui/templates/basetable_top_buildprojects.html +include lib/toaster/toastergui/templates/basetable_top.html +include lib/toaster/toastergui/templates/basetable_top_layers.html +include lib/toaster/toastergui/templates/basetable_top_projectbuilds.html +include lib/toaster/toastergui/templates/bfile.html +include lib/toaster/toastergui/templates/bpackage.html +include lib/toaster/toastergui/templates/builddashboard.html +include lib/toaster/toastergui/templates/build.html +include lib/toaster/toastergui/templates/buildrequestdetails.html +include lib/toaster/toastergui/templates/buildtime.html +include lib/toaster/toastergui/templates/configuration.html +include lib/toaster/toastergui/templates/configvars.html +include lib/toaster/toastergui/templates/cpuusage.html +include lib/toaster/toastergui/templates/detail_pagination_bottom.html +include lib/toaster/toastergui/templates/detail_search_header.html +include lib/toaster/toastergui/templates/detail_sorted_header.html +include lib/toaster/toastergui/templates/dirinfo.html +include lib/toaster/toastergui/templates/diskio.html +include lib/toaster/toastergui/templates/filtersnippet.html +include lib/toaster/toastergui/templates/importlayer.html +include lib/toaster/toastergui/templates/landing.html +include lib/toaster/toastergui/templates/landing_not_managed.html +include lib/toaster/toastergui/templates/layerdetails.html +include lib/toaster/toastergui/templates/layer.html +include lib/toaster/toastergui/templates/layers_dep_modal.html +include lib/toaster/toastergui/templates/layers.html +include lib/toaster/toastergui/templates/machines.html +include lib/toaster/toastergui/templates/managed_builds.html +include lib/toaster/toastergui/templates/managed_mrb_section.html +include lib/toaster/toastergui/templates/mrb_section.html +include lib/toaster/toastergui/templates/newproject.html +include lib/toaster/toastergui/templates/package_built_dependencies.html +include lib/toaster/toastergui/templates/package_built_detail.html +include lib/toaster/toastergui/templates/package_detail_base.html +include lib/toaster/toastergui/templates/package.html +include lib/toaster/toastergui/templates/package_included_dependencies.html +include lib/toaster/toastergui/templates/package_included_detail.html +include lib/toaster/toastergui/templates/package_included_reverse_dependencies.html +include lib/toaster/toastergui/templates/package_included_tabs.html +include lib/toaster/toastergui/templates/projectbuilds.html +include lib/toaster/toastergui/templates/projectconf.html +include lib/toaster/toastergui/templates/project.html +include lib/toaster/toastergui/templates/projects.html +include lib/toaster/toastergui/templates/recipe.html +include lib/toaster/toastergui/templates/recipe_packages.html +include lib/toaster/toastergui/templates/recipes.html +include lib/toaster/toastergui/templates/tablesort.html +include lib/toaster/toastergui/templates/target.html +include lib/toaster/toastergui/templates/targets.html +include lib/toaster/toastergui/templates/task.html +include lib/toaster/toastergui/templates/tasks.html +include lib/toaster/toastergui/templates/unavailable_artifact.html +include LICENSE +include MANIFEST.in +include toaster-requirements.txt +include TODO
bin/toaster +23 -8
@@ -53,23 +53,23 @@ function webserverStartAll() fi retval=0 - python $BBBASEDIR/lib/toaster/manage.py syncdb || retval=1 - python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=2 + python $MANAGEPY syncdb || retval=1 + python $MANAGEPY migrate orm || retval=2 if [ $retval -eq 1 ]; then echo "Failed db sync, stopping system start" 1>&2 elif [ $retval -eq 2 ]; then echo -e "\nError on migration, trying to recover... \n" - python $BBBASEDIR/lib/toaster/manage.py migrate orm 0001_initial --fake + python $MANAGEPY migrate orm 0001_initial --fake retval=0 - python $BBBASEDIR/lib/toaster/manage.py migrate orm || retval=1 + python $MANAGEPY migrate orm || retval=1 fi if [ "x$TOASTER_MANAGED" == "x1" ]; then - python $BBBASEDIR/lib/toaster/manage.py migrate bldcontrol || retval=1 - python $BBBASEDIR/lib/toaster/manage.py checksettings --traceback || retval=1 + python $MANAGEPY migrate bldcontrol || retval=1 + python $MANAGEPY checksettings --traceback || retval=1 fi if [ $retval -eq 0 ]; then echo "Starting webserver..." - python $BBBASEDIR/lib/toaster/manage.py runserver "0.0.0.0:$WEB_PORT" </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 & echo $! >${BUILDDIR}/.toastermain.pid + python $MANAGEPY runserver "0.0.0.0:$WEB_PORT" </dev/null >>${BUILDDIR}/toaster_web.log 2>&1 & echo $! >${BUILDDIR}/.toastermain.pid sleep 1 if ! cat "${BUILDDIR}/.toastermain.pid" | xargs -I{} kill -0 {} ; then retval=1
@@ -145,6 +145,21 @@ function verify_prereq() { # read command line parameters BBBASEDIR=`dirname ${BASH_SOURCE}`/.. + +MANAGEPY=$BBBASEDIR/lib/toaster/manage.py + +if [ ! -f "$MANAGEPY" ]; then + echo "Could not find $MANAGEPY, trying autodetection" + MANAGEPY=`echo -e "from toaster import manage\nprint manage.__file__" | python` + echo "MANAGEPY is $MANAGEPY" +fi + +if [ ! -f $MANAGEPY ]; then + echo "Could not find toaster's manage.py; this is a serious error and I don't know what to do" + exit +fi + + RUNNING=0 NOTOASTERUI=0
@@ -235,7 +250,7 @@ if [ -z "$ZSH_NAME" ] && [ `basename \"$0\"` = `basename \"$BASH_SOURCE\"` ]; th trap trap_ctrlc SIGINT echo "Toaster is now running. You can stop it with Ctrl-C" while [ $RUNNING -gt 0 ]; do - python $BBBASEDIR/lib/toaster/manage.py runbuilds 2>&1 | tee -a "$BUILDDIR/toaster.log" + python $MANAGEPY runbuilds 2>&1 | tee -a "$BUILDDIR/toaster.log" sleep 1 done cleanup
lib/toaster/toastermain/settings.py +0 -4
@@ -324,10 +324,6 @@ import os currentdir = os.path.dirname(__file__) for t in os.walk(os.path.dirname(currentdir)): modulename = os.path.basename(t[0]) - #if we have a virtualenv skip it to avoid incorrect imports - if os.environ.has_key('VIRTUAL_ENV') and os.environ['VIRTUAL_ENV'] in t[0]: - continue - if ("views.py" in t[2] or "models.py" in t[2]) and not modulename in INSTALLED_APPS: INSTALLED_APPS = INSTALLED_APPS + (modulename,)
lib/toaster/toastermain/urls.py +0 -3
@@ -69,9 +69,6 @@ if toastermain.settings.MANAGED: import os currentdir = os.path.dirname(__file__) for t in os.walk(os.path.dirname(currentdir)): - #if we have a virtualenv skip it to avoid incorrect imports - if os.environ.has_key('VIRTUAL_ENV') and os.environ['VIRTUAL_ENV'] in t[0]: - continue if "urls.py" in t[2] and t[0] != currentdir: modulename = os.path.basename(t[0])
setup.py +9 -7
@@ -51,14 +51,14 @@ class Build(build): setup(name='bitbake', version = __version__, - requires = ["ply", "progressbar"], - package_dir = {"": "lib"}, - packages = ["bb.server", "bb.parse.parse_py", "bb.parse", - "bb.fetch2", "bb.ui.crumbs", "bb.ui", "bb.pysh", "bb", "prserv", "bb.tests"], - py_modules = ["codegen"], - scripts = ["bin/bitbake", "bin/bitbake-layers", "bin/bitbake-diffsigs", "bin/bitbake-prserv", "bin/bitbake-selftest", "bin/image-writer"], + requires = ["gobject", "html5lib", "lxml", "django", "south", "argparse", "wsgiref", "pyinotify"], + package_dir = {"": "lib", "toaster": "lib/toaster" }, + packages = ['ply', 'prserv', 'bs4', 'bs4.builder', 'bs4.tests', 'bb', 'bb.tests', 'bb.fetch2', 'bb.pysh', 'bb.ui', 'bb.ui.crumbs', 'bb.ui.crumbs.hig', 'bb.server', 'bb.parse', 'bb.parse.parse_py', 'toaster', 'toaster.bldviewer', 'toaster.bldviewer.templatetags', 'toaster.toastergui', 'toaster.toastergui.templatetags', 'toaster.orm', 'toaster.orm.management', 'toaster.orm.management.commands', 'toaster.orm.migrations', 'toaster.bldcontrol', 'toaster.bldcontrol.management', 'toaster.bldcontrol.management.commands', 'toaster.bldcontrol.migrations', 'toaster.toastermain', 'toaster.toastermain.management', 'toaster.toastermain.management.commands'], + py_modules = ["codegen", "progressbar", "pyinotify"], + scripts = [ "bin/bitbake-layers", "bin/bitbake-worker", "bin/toaster-eventreplay", "bin/toaster", "bin/bitbake-diffsigs", "bin/bitbake-dumpsig", "bin/bitdoc", "bin/image-writer", "bin/bitbake", "bin/bitbake-selftest", "bin/bitbake-prserv" ], data_files = [("share/bitbake", glob("conf/*") + glob("classes/*")), ("share/doc/bitbake-%s/bitbake-user-manual" % __version__, glob("doc/bitbake-user-manual/html/*"))], + include_package_data=True, cmdclass = { "build": Build, "clean": Clean,
@@ -69,5 +69,7 @@ setup(name='bitbake', description = 'BitBake build tool', long_description = 'BitBake is a simple tool for the execution of tasks. It is derived from Portage, which is the package management system used by the Gentoo Linux distribution. It is most commonly used to build packages, as it can easily use its rudimentary inheritance to abstract common operations, such as fetching sources, unpacking them, patching them, compiling them, and so on. It is the basis of the OpenEmbedded project, which is being used for OpenZaurus, Familiar, and a number of other Linux distributions.', author = 'BitBake Development Team', - author_email = '[email protected]', + author_email = '[email protected]', + maintainer = "Alexandru Damian", + maintainer_email = "[email protected]", )
Signature · 1 line
1.9.1
Quoted 10 lines · Alex DAMIAN
From: Alexandru DAMIAN <[email protected]>
This patch updates
setup.pyand MANIFEST.in so it correctly packages bitbake in standard python package format.Use "python
manage.pysdist" to generate installation package.Minor updates to toaster scripts so they work correctly from a package installation.
Quoted 8 lines
Signed-off-by Alexandru DAMIAN <[email protected]>--- MANIFEST.in | 207 ++++++++++++++++++++++++++++++++++-- bin/toaster | 31 ++++-- lib/toaster/toastermain/settings.py | 4 - lib/toaster/toastermain/urls.py | 3 - setup.py | 16 +-- 5 files changed, 232 insertions(+), 29 deletions(-)
We've been nervous about encouraging distros to ship packaged versions of bitbake for some time. Things usually work better with the version for the metadata you're using, not some random distro provided version. We have been bitten by this a lot in the past. That said, we do have the setup.py file and people do use it :/.
My other concern is the dependencies and the structure of this packaging. I don't think bundling bitbake and toaster together is the best move, I'd be much happier to see them packaged separately since bitbake can happily be used without django, gobject and its other dependencies.
I also noticed that ply and progressbar were dropped as requirements. Whilst we ship copies of these with bitbake for simplicity, it was previously a conscious decision not to package them and rely on the upstream packaged version of them for the packaged version of bitbake.
Cheers,
Richard