{
"info": {
"author": "Giuseppe Ottaviano",
"author_email": "giuott@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License (GPL)",
"Operating System :: POSIX",
"Topic :: Software Development :: Build Tools"
],
"description": "==========================\n Boxed Package Tool (BPT)\n==========================\n\n* `Mercurial repository `_\n* `Issue tracker `_\n\nWhat is BPT\n===========\n\nBPT is a Python library (``bpt``) and a command line application\n(``box``) to create and manage isolated enviroments, or *boxes*. \n\n- Boxes are *relocatable*, which means that they can be moved to a\n different directory or even distributed to other machines (provided\n that the architecture is compatible).\n\n- Packages inside the box can be easily disabled, enabled and removed,\n so that different versions of the same software can be installed\n simultaneously, allowing to switch between them. \n\n- Boxes can be *nested*, in the sense that it is possible to activate\n a box environment while inside another box environment, so that all\n the packages installed in both boxes are available, and so on.\n\nBPT is similar in some ways to `virtualenv\n`_, but it is not restricted\nto Python packages, allowing to install virtually any Unix\nsoftware. It also takes some ideas from `jhbuild\n`_, but without the dependency\nresolution and automatic downloading machinery, and the ``bpt-rules``\nformat is inspired by `Gentoo `_'s ebuilds.\n\nA fork of PIP_ is included to make installation of python packages\neasier, and as an example of use of the BPT API.\n\nHow to use it\n=============\n\nA *box* is a directory whose structure resembles ``/usr/`` (as defined\nin the `Filesystem Hierarchy Standard\n`_), that\ncan contain one or more software *packages*. Each package is contained\nin a subdirectory of the ``pkgs`` directory in the box. A box contains\na script, ``env``, which sets up the environment, putting all the\nlibraries, executables, etc. in the path.\n\nThe command to create a box is::\n\n $ bpt/box create my_first_box\n\n(We assume that the source distribution of BPT is in the directory ``bpt``) \n\nThis creates the basic structure::\n\n $ find my_first_box\n my_first_box\n my_first_box/bin\n my_first_box/bpt_meta\n my_first_box/bpt_meta/box_info\n my_first_box/env\n my_first_box/include\n my_first_box/lib\n my_first_box/man\n my_first_box/pkgs\n my_first_box/share\n\nTo execute a command within the box environment, use the ``env`` script::\n\n $ my_first_box/env 'echo $PATH'\n /tmp/box_87a482cc-34fc-11de-865a-001ec21bf2c7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/bin\n\nEven if it may not seem obvious at first, the first path points to the\nbox's ``bin``. We'll talk about this later in the `How it works`_\nsection. Prefixing ``env`` to every command can be boring, so\n``box`` has a ``shell`` command that spawns a shell with the\nenvironment set up. The ``env`` script exports also an environment\nvariable, ``BPT_BOX_PATH``, that ``box`` uses to know the location of\nthe current box::\n\n $ bpt/box -b my_first_box/ shell\n (my_first_box) ot@brian ~ $ echo $BPT_BOX_PATH \n /Users/ot/my_first_box\n\nTo install packages into a box, ``box`` offers two different commands:\n``build`` and ``autobuild``. Alternatively, external programs can use\nthe BPT API to install packages. An example is given by ``pip-box``,\nincluded in the distribution.\n\n\n``build``\n---------\n\nThe ``build`` command works with *sourcedirs*: a *sourcedir* is a\ndirectory that contains a ``bpt-rules`` file, which contains the\ninstructions to build the software. A good practice is to install BPT\nitself into the box (the source distribution of BPT is a\n*sourcedir*)::\n\n (my_first_box) ot@brian ~ $ bpt/box build bpt\n INFO:BPT:Using current box \"my_first_box\"\n INFO:BPT:Building application bpt, in sourcedir work/experimental/bpt\n ...\n (my_first_box) ot@brian ~ $ which box\n /tmp/box_87a482cc-34fc-11de-865a-001ec21bf2c7/bin/box\n\nNow we can run the shell using the box's ``box``::\n\n $ my_first_box/env box shell\n INFO:BPT:Using current box \"my_first_box\"\n\n (my_first_box) ot@brian ~ $ \n\nAnother example of *sourcedir* is given by ``python30`` in the\n``examples`` directory, which installs python 3.0.1::\n\n (my_first_box) ot@brian ~ $ box build examples/python30/\n ...\n\n (my_first_box) ot@brian ~ $ python3.0 --version\n Python 3.0.1\n\n``autobuild``\n-------------\n\nThe ``autobuild`` command, when invoked with a vanilla source tarball\nor a source directory, tries to build and install it by guessing the\nbuild commands. It works when the software builds using the usual\n``configure``/``make`` or ``setup.py``::\n\n (my_first_box) ot@brian ~ $ box autobuild Downloads/ipython-0.9.1.tar.gz \n INFO:BPT:Using current box \"my_first_box\"\n INFO:BPT:Guessed application name \"ipython\", version \"0.9.1\". Unpacking the file...\n INFO:BPT:Building and installing as package ipython-0.9.1\n ...\n\n (my_first_box) ot@brian ~ $ which ipython\n /tmp/box_87a482cc-34fc-11de-865a-001ec21bf2c7/bin/ipython\n\n (my_first_box) ot@brian ~ $ box autobuild Downloads/sqlite-amalgamation-3.6.3.tar.gz \n INFO:BPT:Using current box \"my_first_box\"\n INFO:BPT:Guessed application name \"sqlite-amalgamation\", version \"3.6.3\". Unpacking the file...\n INFO:BPT:Building and installing as package sqlite-amalgamation-3.6.3\n ...\n\n (my_first_box) ot@brian ~ $ which sqlite3\n /tmp/box_87a482cc-34fc-11de-865a-001ec21bf2c7/bin/sqlite3\n\nTo guess name and version of the package, the tarball/directory name\nis used, so it has to be of the form ``-``.\n\n``pip-box``\n-----------\n\n``pip-box`` is a fork of PIP_ 0.3.1 where only\n``InstallRequirement.install{,_editable}`` have been replaced to\ninstall every package inside the current box::\n\n $ new_box/env pip-box install -qI sphinx\n INFO:BPT:Enabling package Jinja2-2.1.1\n INFO:BPT:Linking package Jinja2-2.1.1\n INFO:BPT:Created env script\n INFO:BPT:Enabling package Pygments-1.0\n INFO:BPT:Linking package Pygments-1.0\n INFO:BPT:Created env script\n INFO:BPT:Enabling package sphinx-0.6.1\n INFO:BPT:Linking package sphinx-0.6.1\n INFO:BPT:Created env script\n INFO:BPT:Enabling package docutils-0.5\n INFO:BPT:Linking package docutils-0.5\n INFO:BPT:Created env script\n\n $ new_box/env box status\n INFO:BPT:Using current box \"new_box\"\n\n PACKAGE | NAME | VERSION | STATUS |\n\n Jinja2-2.1.1 | Jinja2 | 2.1.1 | enabled |\n sphinx-0.6.1 | sphinx | 0.6.1 | enabled |\n docutils-0.5 | docutils | 0.5 | enabled |\n Pygments-1.0 | Pygments | 1.0 | enabled |\n\nSince only the install functions where changed, it is completely\ncommand-line-compatible with PIP_. (Interaction with virtualenv was\nnot tested and probably it won't work)\n\n``pip-box`` is just a working proof-of-concept of an external\napplication that uses the BPT API. If future versions of PIP_ allow to\noverride the install commands, probably the fork will be removed and\nthe PIP_ API will be used instead.\n\nNotice that to use ``pip-box``, ``setuptools`` is needed. It can be\ninstalled in the underlying system, or inside the box using\n``autobuild``::\n\n $ wget -q http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c9.tar.gz\n $ box -b my_box/ autobuild setuptools-0.6c9.tar.gz\n INFO:BPT:Unpacking the file...\n INFO:BPT:Guessed application name \"setuptools\", version \"0.6c9\"\n INFO:BPT:Building and installing as package setuptools-0.6c9\n ...\n \nOther commands\n--------------\n\nThe ``status`` command shows the installed packages::\n\n (my_first_box) ot@brian ~ $ box status\n INFO:BPT:Using current box \"my_first_box\"\n \n PACKAGE | NAME | VERSION | STATUS |\n \n bpt-0.1 | bpt | 0.1 | enabled |\n ipython-0.8.4 | ipython | 0.8.4 | disabled |\n ipython-0.9.1 | ipython | 0.9.1 | enabled |\n python30-3.0.1 | python30 | 3.0.1 | enabled |\n sqlite-amalgamation-3.6.3 | sqlite-amalgamation | 3.6.3 | enabled |\n\nPackages can be enabled/disabled with the ``enable``/``disable`` commands::\n\n (my_first_box) ot@brian ~ $ box disable python30-3.0.1\n\n (my_first_box) ot@brian ~ $ python3.0\n bash: python3.0: command not found\n\n (my_first_box) ot@brian ~ $ box enable python30-3.0.1\n\n (my_first_box) ot@brian ~ $ python3.0 --version\n Python 3.0.1\n\nExecuting ``disable`` with the ``--remove`` switch deletes permanently\nthe package files.\n\nUse cases\n=========\n\n- The main purpose of BPT is to create self-contained environments to\n be deployed in case it is not possible to install packages\n system-wide (for example because of non-friendly sysadmins or\n providers) or when different applications on the same machine need\n different versions of their dependencies. The box can be built on a\n development machine and then sent to deployment machines without\n having to take care of paths, thanks to relocatability of\n boxes. Several boxes with different versions of packages can be run\n on the same machine, as long as they have different ``box_id``\n (i.e. they have been created independently). \n\n- BPT is also a convenient alternative to cluttering ``/usr/local``\n when packages that are not packaged by the system distribution (or a\n different version is packaged) are needed. For example it is\n possible to add to ``.bashrc`` a line like::\n\n source ~/my_box/env \n\n so that we are always inside a common box where we can install new\n software with ``autobuild`` (or by writing the ``bpt-rules`` when\n needed). Notice that since boxes can be nested, this creates no\n problems with other boxes.\n\nHow it works\n============\n\nBPT is designed to work around two problems common to Unix\napplications and libraries:\n\n- Often the prefix (like ``/usr/local``) is hardcoded in the binary\n during compilation. This implies that once a software its compiled,\n its installation path cannot change. In other words, it is not\n *relocatable*.\n\n- Everything is installed in the same directories (``bin``, ``lib``,\n etc...). Hence is difficult or impossible to remove an installed\n software without using a packaging system, and is virtually\n impossible to keep different versions of the same software installed\n on the system. \n\nBoth problems are solved by BPT by using symlinks. When an application\nis compiled, the prefix passed to the compilation script has the form::\n \n /tmp/box_/pkgs/\n\nwhere ```` is a unique identifier of the box, and ````\nidentifies the (name, version) pair of the software. The ``env``\nscript ensures that ``/tmp/box_`` is a symlink to the box.\nThen, when a package is installed/enabled, all the contents of the\npackage are symlinked to the box root (where the ``PATH`` variables\npoint to).\n\n- If we relocate the box, the ``env`` script will fix the symlink.\n\n- Disabling a package is just matter of removing its symlinks, while\n if we remove its ``pkgs`` subdirectory, all the package files are\n removed.\n\nIf packages are manually removed by deleting their directories,\nsymlinks may be broken. The ``sync`` command can be used to restore\nthe consistency of the box by recreating all the symlinks and the\n``env`` script. \n\nWriting the ``bpt-rules`` file\n==============================\n\n*TODO* For now, see the ``examples/python30`` example, it is quite\nself-explanatory. Keep in mind that, for most software, ``autobuild``\njust works.\n\nAlso, the ``bpt-rules`` format may soon change (or, more probably, a\nnew syntax will be added alongside)\n\nTODO\n====\n\nSome features planned for next releases. Ideas and patches are very\nwelcome.\n\n* Dependencies. Would be very convenient to have automatic dependency\n resolution. I would like to achieve the following goals:\n\n * It should be very easy to install a package with a set of packages\n satisfying its dependencies.\n\n * Boxes are mainly meant for deploy, so it is needed a system to\n freeze a set of versions (instead of downloading the newest\n satisfying version, as easy_install and most packaging systems do,\n because it can break things)\n \n * It should be possible to specify mirrors for the packages so that\n a build bot has not to be connected to the Internet.\n\n * The system should not rely on a centralized repository. Maybe,\n specify via configuration a set of repositories, a-la\n apt/sources.list.\n\n * A PIP-like \"editable\" package mode should be available, for\n development (and so, also integration with VCSs)\n\n PIP_ gets most of these things right, so I could just copy or\n integrate its model. \n\n* Investigate Windows support (native, not cygwin, which should\n already work). This would need at least the following:\n\n * Generate a env.bat instead of env script using Windows batch files\n\n * Do not use ``bash`` as a syntax for bpt-rules (talk about this\n later)\n \n * See if the directories/symlinks/environment variables (PATHs) can\n be adapted to Windows. This requires a Windows guru, I do not know\n almost anything about it.\n\n* Get rid of ``bash`` as syntax for bpt-rules. Maybe a Python DSEL\n would be ideal: something like scons or waf, so that the\n declarations can be abstract enough to be cross-platform.\n \n* Buildout support? \n\n* The ``/tmp/box_...`` trick has some drawbacks: it is not possible to\n install two boxes with the same uuid in the same machine, because\n the symlink can point to only one of the two. Would be good to find\n a different solution (as portable as possible).\n\n* It has been suggested that ``box`` is too generic for the script\n name, and there could be collisions. If I receive enough feedback\n about this issue, I could rename the script to ``pbox`` or something\n similar.\n\nSupported operating systems\n===========================\n\nBPT should work with any POSIX operating system. It has been tested on\nMac OS X Leopard and several Ubuntu releases.\n\nLicense\n=======\n\nBPT is distributed under the terms of the GPL License. The full\nlicense is in the file COPYING, distributed as part of this software.\n\nCredits\n=======\n\n* Giuseppe Ottaviano \n\n.. _PIP: http://pypi.python.org/pypi/pip",
"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/bpt",
"keywords": null,
"license": "UNKNOWN",
"maintainer": null,
"maintainer_email": null,
"name": "bpt",
"package_url": "https://pypi.org/project/bpt/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/bpt/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "http://pypi.python.org/pypi/bpt"
},
"release_url": "https://pypi.org/project/bpt/0.5.2/",
"requires_dist": null,
"requires_python": null,
"summary": "Tool to create isolated environments",
"version": "0.5.2"
},
"last_serial": 787029,
"releases": {
"0.2a": [
{
"comment_text": "",
"digests": {
"md5": "45a822b2422fa4438e529e94034ced24",
"sha256": "6e2f3c6ee6637a165977a4e86244ff48f4e9ecf92f7c42a74e05c78d8e229173"
},
"downloads": -1,
"filename": "bpt-0.2a.tar.gz",
"has_sig": false,
"md5_digest": "45a822b2422fa4438e529e94034ced24",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 22982,
"upload_time": "2009-04-30T00:01:10",
"url": "https://files.pythonhosted.org/packages/9d/e4/380941687966fa83a81b5a8898e9100a1cd3cb6efb70651f3734b1421327/bpt-0.2a.tar.gz"
}
],
"0.3": [
{
"comment_text": "",
"digests": {
"md5": "31600e1a3e49240080dc54bc7d276a59",
"sha256": "48574b6ecc5761a63eb9312f101b26a84fbb026158f46f4034d74691647feb57"
},
"downloads": -1,
"filename": "bpt-0.3.tar.gz",
"has_sig": false,
"md5_digest": "31600e1a3e49240080dc54bc7d276a59",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 24923,
"upload_time": "2009-05-07T02:32:26",
"url": "https://files.pythonhosted.org/packages/98/c1/da5ad02ae0b339221c06b9b17273f07569edc2b1b774a42e5439c6f2b533/bpt-0.3.tar.gz"
}
],
"0.4a": [
{
"comment_text": "",
"digests": {
"md5": "7eeed804769c49a1bff57c31efaef275",
"sha256": "731fd50ccb5d64b4b0cab9ca1dfa9ecec98f44826a76e722c68dcf6e1a121c6b"
},
"downloads": -1,
"filename": "bpt-0.4a.tar.gz",
"has_sig": false,
"md5_digest": "7eeed804769c49a1bff57c31efaef275",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 61751,
"upload_time": "2009-05-14T18:41:14",
"url": "https://files.pythonhosted.org/packages/19/69/dc05d4ef7c23615bfab04f81a48ef77fb164d5285858b4e8fb6107e10aec/bpt-0.4a.tar.gz"
}
],
"0.5": [
{
"comment_text": "",
"digests": {
"md5": "c8ae9449fb713ff610d087af9778da74",
"sha256": "effca31fd60d57ab5c4ce0ee947b97d0d2de97802ff22e6f2f8cf22f77265132"
},
"downloads": -1,
"filename": "bpt-0.5.tar.gz",
"has_sig": false,
"md5_digest": "c8ae9449fb713ff610d087af9778da74",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 62013,
"upload_time": "2009-05-19T17:13:50",
"url": "https://files.pythonhosted.org/packages/2f/ac/cbd16af67cf7b830df80170201aef0c2475429379b73a055f66a54d24e3a/bpt-0.5.tar.gz"
}
],
"0.5.1": [
{
"comment_text": "",
"digests": {
"md5": "da7ee93b0762172493ce99dcdfa76857",
"sha256": "345c7a292e17244165729a5a89cb3be94d3dd4fec511c34bd9ffd9872a1835ee"
},
"downloads": -1,
"filename": "bpt-0.5.1.tar.gz",
"has_sig": false,
"md5_digest": "da7ee93b0762172493ce99dcdfa76857",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 62125,
"upload_time": "2009-05-29T11:24:30",
"url": "https://files.pythonhosted.org/packages/7b/20/bc735f6c38f2fc80b699a10a7a80838a43996820c422b8f044bde074d926/bpt-0.5.1.tar.gz"
}
],
"0.5.2": [
{
"comment_text": "",
"digests": {
"md5": "422780bcc12574b3c3651cb0ba6790e0",
"sha256": "dc76fbf29a2da1729d056f86304669829776f2875b3c60356dbf15f17cb5658d"
},
"downloads": -1,
"filename": "bpt-0.5.2.tar.gz",
"has_sig": false,
"md5_digest": "422780bcc12574b3c3651cb0ba6790e0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 62278,
"upload_time": "2009-10-03T17:46:41",
"url": "https://files.pythonhosted.org/packages/33/8d/9906c91dcd401f705e86b9c763acc6fd4370a6b0ffd81428884f29f80aef/bpt-0.5.2.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "422780bcc12574b3c3651cb0ba6790e0",
"sha256": "dc76fbf29a2da1729d056f86304669829776f2875b3c60356dbf15f17cb5658d"
},
"downloads": -1,
"filename": "bpt-0.5.2.tar.gz",
"has_sig": false,
"md5_digest": "422780bcc12574b3c3651cb0ba6790e0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 62278,
"upload_time": "2009-10-03T17:46:41",
"url": "https://files.pythonhosted.org/packages/33/8d/9906c91dcd401f705e86b9c763acc6fd4370a6b0ffd81428884f29f80aef/bpt-0.5.2.tar.gz"
}
]
}