{ "info": { "author": "Martin Lundwall", "author_email": "martin@betahaus.net", "bugtrack_url": null, "classifiers": [ "Framework :: Buildout", "Intended Audience :: Developers", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "buildout.eggnest\r\n=================\r\n\r\nThis product is no longer supported.\r\n\r\nThe problem\r\n------------\r\nIt is very convenient to install functionality to a buildout with just\r\na couple of lines, but for those used to Zope 2, one might miss\r\nthe way of adding a piece of functionality by just dropping something\r\n(i.e. a product) into a folder. This could be good for people who want to try\r\nout things without worrying about editing a configuration file with\r\nlots of directives in it.\r\nWhen wanting to install a new egg using buildout you currently have to\r\nedit the buildout configuration file(s) and add a couple of lines in \r\nthe right places. What if you could just drop a file in a folder instead?\r\n\r\nSolution\r\n--------\r\nMake a buildout extension so that the only thing you need to do in order to\r\ninstall an egg\r\nis to take a simple text file, and drop it in a certain directory. When you\r\nrerun buildout the\r\ncontents of that file is parsed, the specified egg is downloaded and added to\r\nthe instance.\r\n\r\nWhen ``buildout.eggnest`` is run it::\r\n\r\n 1. If ``eggnest-src-directory`` is not given the default directory ``src``\r\n is scanned. \r\n \r\n 2. Adds the egg to the ``eggs`` and ``zcml`` option to a set of given buildout\r\nparts.\r\n\r\nThis steps are done on the fly when running buildout. So I can add/delete/rename\r\nan egg and it will be picked up.\r\n\r\nNOTE: The extension does not write to the buildout's configuration file.\r\n\r\nbuildout.eggnest options\r\n-------------------------\r\n\r\neggnest-src-directory:\r\n Specified to the directory that your egg install files should be placed.\r\n Defaults to src. An idea could be\r\n to have a dedicated directory called \"eggnest\".\r\n\t\t\t\t\r\neggnest-parts:\r\n What part of your buildout config that the eggs should be added to. *required*\t\r\n\r\neggnest-verbose:\r\n Set this to ``true`` to get more information. \r\n Not really that much right now but a little bit more at least.\r\n\r\n\r\nHow to use it\r\n-------------\r\n\r\nTo use ``buildout.eggnest`` you need to add the following to your buildout.cfg::\r\n\r\n [buildout]\r\n extensions = \r\n buildout.eggnest\r\n\r\n eggnest-parts = \r\n instance\r\n\r\nIn ``eggnest-parts`` you need to specify what buildout part that the eggs should\r\nbe added to. \r\nBy default the ``src`` directory is scanned for egg specification files. \r\n\r\n\r\neggs specification files for eggnest\r\n------------------------------------\r\n\r\nThe egg install specification files should have this structure. This is the same\r\nas the normal buildout config format.::\r\n\r\n [eggnest]\r\n egg = \r\n plone.introspector\r\n \r\n zcml = \r\n plone.introspector\r\n\t\r\n``zcml`` can be multiple lines if additional slugs need to be specified.\r\n\r\nIf the egg is in the ``Products`` namespace the zcml is not needed in the\r\nspecification file.::\r\n\r\n [eggnest]\r\n egg = \r\n Products.DocFinderTab\r\n\r\n\r\n\r\nbuildout.eggnest was created by Martin Lundwall after an \r\ninitial idea by Jorgen Modin \r\n\r\nChange history\r\n================\r\n\r\n0.2 (unreleased)\r\n----------------\r\n\r\n - Compatibility update for zc.buildout 1.4.0 (mlundwall)\r\n\r\n0.1 (2008-11-22)\r\n----------------\r\n\r\n - Initial release (mlundwall)\r\nDetailed Documentation\r\n======================\r\n\r\nTests for buildout.eggnest buildout extension\r\n-------------------------------------------------\r\n\r\nLet's create a buildout configuration file::\r\n\r\n >>> data = \"\"\"\r\n ... [buildout]\r\n ... parts = zope2 instance1 instance2 instance3\r\n ... extensions = \r\n ... eggs =\r\n ... develop = %s\r\n ... eggnest-parts = instance1 instance2\r\n ... [instance1]\r\n ... recipe = plone.recipe.zope2instance\r\n ... zope2-location = ${zope2:location}\r\n ... user = admin:admin\r\n ... [instance2]\r\n ... recipe = plone.recipe.zope2instance\r\n ... zope2-location = ${zope2:location}\r\n ... user = admin:admin\r\n ... [instance3]\r\n ... recipe = plone.recipe.zope2instance\r\n ... zope2-location = ${zope2:location}\r\n ... user = admin:admin\r\n ... [zope2]\r\n ... recipe = plone.recipe.zope2install\r\n ... url = http://www.zope.org/Products/Zope/2.9.8/Zope-2.9.8-final.tgz\r\n ... \"\"\" % egg_dir\r\n >>> rmdir(tempdir, 'buildout.test')\r\n >>> cd(tempdir)\r\n >>> sh('mkdir buildout.test')\r\n mkdir buildout.test\r\n \r\n >>> cd('buildout.test')\r\n >>> touch('buildout.cfg', data=data)\r\n >>> ls('.')\r\n buildout.cfg\r\n\r\nrun the buildout first time so we get our zope instances::\r\n\r\n >>> sh('svn export\r\nsvn://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap/bootstrap.py')\r\n svn export\r\nsvn://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap/bootstrap.py\r\n A bootstrap.py\r\n Export complete.\r\n \r\n >>> sh('python2.4 bootstrap.py')\r\n python2.4 bootstrap.py\r\n ... \r\n Creating directory '/private/tmp/buildout.test/bin'.\r\n Creating directory '/private/tmp/buildout.test/parts'.\r\n Creating directory '/private/tmp/buildout.test/develop-eggs'.\r\n Generated script '/private/tmp/buildout.test/bin/buildout'.\r\n \r\n \r\n >>> sh('./bin/buildout')\r\n ./bin/buildout\r\n ...\r\n Installing instance1.\r\n ...\r\n Installing instance2.\r\n ...\r\n Installing instance3.\r\n ...\r\n \r\n \r\n \r\nNow let's create a test products specification file and add the buildout.eggnest\r\nas an extension::\r\n\t\r\n >>> sh('mkdir src')\r\n mkdir src\r\n \r\n >>> product = \"\"\"\r\n ... [eggnest]\r\n ... egg = \r\n ... plone.portlet.static\r\n ... zcml = \r\n ... plone.portlet.static\r\n ... \"\"\" \r\n >>> touch('src/product.txt', data=product)\r\n >>> ls('src')\r\n product.txt\r\n >>> data = data.replace('extensions =', 'extensions = buildout.eggnest')\r\n >>> touch('buildout.cfg', data=data)\r\n \r\n\r\nOk, so now that we have an egg, lets run the buildout in offline mode. We \r\nshould get a zcml slugs in parts/instance1/etc/package-includes and\r\nparts/instance2/etc/package-includes\r\nbut not in parts/instance3/etc/package-includes,\r\nand a line with the path to our egg in the bin/instance1 and bin/instance2\r\nbut not in bin/instance3 files. \r\n\r\nFirst we check that there is nothing of the previous mentioned things::\r\n\r\n >>> ls('develop-eggs')\r\n buildout.eggnest.egg-link\r\n >>> ls('parts/instance1/etc/package-includes') \r\n No directory named parts/instance1/etc/package-includes\r\n\r\n >>> ls('parts/instance2/etc/package-includes') \r\n No directory named parts/instance2/etc/package-includes\r\n \r\n >>> ls('parts/instance3/etc/package-includes') \r\n No directory named parts/instance3/etc/package-includes\r\n\r\n >>> sh('grep plone.portlet.static bin/instance1')\r\n grep plone.portlet.static bin/instance1\r\n \r\n \r\n >>> sh('grep plone.portlet.static bin/instance2')\r\n grep plone.portlet.static bin/instance2\r\n \r\n\r\n >>> sh('grep plone.portlet.static bin/instance3')\r\n grep plone.portlet.static bin/instance3\r\n \r\n\r\nOK, now run the buildout in offline mode::\r\n \r\n >>> sh('./bin/buildout')\r\n ./bin/buildout\r\n ...\r\n\r\nCheck that we have a correct created buildout. \r\n\r\nCheck that we have our zcml slugs in the package-includes::\r\n\r\n >>> ls('parts', 'instance1', 'etc', 'package-includes')\r\n 001-plone.portlet.static-configure.zcml\r\n \r\n >>> ls('parts', 'instance2', 'etc', 'package-includes')\r\n 001-plone.portlet.static-configure.zcml\r\n\r\n >>> ls('parts', 'instance3', 'etc', 'package-includes')\r\n No directory named parts/instance3/etc/package-includes\r\n \r\n\r\nand in the end check that there is a line in bin/instance1 and bin/instance1\r\nthat includes our egg in the path::\r\n\r\n >>> code = cat('bin', 'instance1', returndata=True)\r\n >>> code.find('plone.portlet.static') == -1\r\n False\r\n\r\n >>> code = cat('bin', 'instance2', returndata=True)\r\n >>> code.find('plone.portlet.static') == -1\r\n False\r\n \r\n >>> code = cat('bin', 'instance3', returndata=True)\r\n >>> code.find('plone.portlet.static') == -1\r\n True\r\n \r\nLet's now try the ``eggnest-src-directory`` option. We create a new buildout.cfg\r\nfile\r\nwith an empty ``eggnest-src-directory``::\r\n\r\n >>> data = data.replace('eggs =', 'eggnest-src-directory = \\neggs = ')\r\n >>> touch('buildout.cfg', data=data)\r\n >>> sh('./bin/buildout')\r\n ./bin/buildout\r\n ...\r\n\r\n\r\nNo zcml slug in the instance 1,2 or 3:: \r\n\r\n >>> ls('parts', 'instance1', 'etc', 'package-includes')\r\n No directory named parts/instance1/etc/package-includes\r\n\r\n >>> ls('parts', 'instance2', 'etc', 'package-includes')\r\n No directory named parts/instance2/etc/package-includes\r\n\r\n >>> ls('parts', 'instance3', 'etc', 'package-includes')\r\n No directory named parts/instance3/etc/package-includes\r\n\r\nNor a line in bin/instance1, bin/instance2 or bin/instance3 with our egg path::\r\n\r\n >>> code = cat('bin', 'instance1', returndata=True)\r\n >>> code.find('plone.portlet.static') == -1\r\n True\r\n\r\n >>> code = cat('bin', 'instance2', returndata=True)\r\n >>> code.find('plone.portlet.static') == -1\r\n True\r\n\r\n >>> code = cat('bin', 'instance3', returndata=True)\r\n >>> code.find('plone.portlet.static') == -1\r\n True\r\n\r\nBut if the ``eggnest-src-directory`` option is not empty::\r\n\r\n >>> data = data.replace('eggnest-src-directory =', 'eggnest-src-directory =\r\nauto')\r\n >>> touch('buildout.cfg', data=data)\r\n >>> sh('rm src/product.txt')\r\n rm src/product.txt\r\n >>> sh('mkdir auto')\r\n mkdir auto\r\n >>> touch('auto/product.txt', data=product)\r\n >>> ls('auto')\r\n product.txt\r\n >>> sh('./bin/buildout -o')\r\n ./bin/buildout -o\r\n ...\r\n\r\nand we get a zcml slug only in the specified target::\r\n\r\n >>> ls('parts', 'instance1', 'etc', 'package-includes')\r\n 001-plone.portlet.static-configure.zcml\r\n \r\n >>> ls('parts', 'instance2', 'etc', 'package-includes')\r\n 001-plone.portlet.static-configure.zcml\r\n\r\n >>> ls('parts', 'instance3', 'etc', 'package-includes')\r\n No directory named parts/instance3/etc/package-includes\r\n \r\nand only the specified target's control script is updated::\r\n\r\n >>> code = cat('bin', 'instance1', returndata=True)\r\n >>> code.find('plone.portlet.static') == -1\r\n False\r\n\r\n >>> code = cat('bin', 'instance2', returndata=True)\r\n >>> code.find('plone.portlet.static') == -1\r\n False\r\n \r\n >>> code = cat('bin', 'instance3', returndata=True)\r\n >>> code.find('plone.portlet.static') == -1\r\n True", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/buildout.eggnest", "keywords": "buildout extension auto load", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "buildout.eggnest", "package_url": "https://pypi.org/project/buildout.eggnest/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/buildout.eggnest/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/buildout.eggnest" }, "release_url": "https://pypi.org/project/buildout.eggnest/0.2/", "requires_dist": null, "requires_python": null, "summary": "buildout extension to auto load eggs", "version": "0.2" }, "last_serial": 787105, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "fb6b3df584b0de71c4e85f937044f596", "sha256": "b6bce88db7c405e9e6fb6a19aaa0618e64863467e82984636d083d21ce118ed2" }, "downloads": -1, "filename": "buildout.eggnest-0.1.tar.gz", "has_sig": false, "md5_digest": "fb6b3df584b0de71c4e85f937044f596", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7348, "upload_time": "2008-11-22T17:47:10", "url": "https://files.pythonhosted.org/packages/7b/3d/909b84b3d8fb4e94b7c77ef54792d02cbf38667fd075758354b64d965aee/buildout.eggnest-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "c84e878b7c7fbf599c389ab9346b4749", "sha256": "06f4a24aee569da47e2ee544d6816a4a65f854604fbbcf0ee6d7cd63bd09bd65" }, "downloads": -1, "filename": "buildout.eggnest-0.2.tar.gz", "has_sig": false, "md5_digest": "c84e878b7c7fbf599c389ab9346b4749", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7488, "upload_time": "2009-08-28T15:52:10", "url": "https://files.pythonhosted.org/packages/47/53/76398fd10126259350b6c81ef19fbdf0b21f495cb76ed2a4cb5e8e468322/buildout.eggnest-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c84e878b7c7fbf599c389ab9346b4749", "sha256": "06f4a24aee569da47e2ee544d6816a4a65f854604fbbcf0ee6d7cd63bd09bd65" }, "downloads": -1, "filename": "buildout.eggnest-0.2.tar.gz", "has_sig": false, "md5_digest": "c84e878b7c7fbf599c389ab9346b4749", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7488, "upload_time": "2009-08-28T15:52:10", "url": "https://files.pythonhosted.org/packages/47/53/76398fd10126259350b6c81ef19fbdf0b21f495cb76ed2a4cb5e8e468322/buildout.eggnest-0.2.tar.gz" } ] }