{ "info": { "author": "Mike Miller", "author_email": "mixmastamyk@bitbucket.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Topic :: Software Development :: Build Tools" ], "description": "**tl;dr**\n\n A simple build tool for small projects, usable by mortals.\n\nBuildIt\n==========\n\nWhat?\n------\n\nBuildIt is a simple build tool and ``make`` replacement,\nmeaning it builds files based on other files,\ngiven your instructions.\nWhen original source files are modified,\n``bld`` will recreate the final products dependent on them.\nConversely, if nothing has been changed, nothing is done.\nThis type of utility is important to avoid unnecesary work\n(and the resulting wasted time)\nthat would occur had one used a \"dumb\" script or batch file to\nautomate a lengthy operation with intermediate steps.\n\nExamples of this sort of thing would be the well-known *compile* \u25b8 *link* steps of\nprograms,\nor the *lint* \u25b8 *minify* \u25b8 *compress* deployment steps of Javascript and CSS files.\nBuildIt is focused on these simple use cases.\n\nWho?\n------\n\nBuildIt attempts to be usable for humans, i.e., newcomers, IT folk, and\ndesigners, while still useful enough for developers creating small\nprojects.\nNot only today, but obvious nine months from now.\n\n\nWhy?\n------\n\n\u2026not use make?\nWell, good question.\nI've used it over the years,\nbut `like many `_\nnever `cared for it `_\nmuch due to its strange ways.\nIt feels arcane when you haven't `used it recently\n`_.\nIt's tedious to have to consult the manual every time you use a tool,\nbecause things aren't obvious.\n``make`` gives off a faint whiff of masochism and '80's resource constraints.\n;)\n\nLikewise I looked into ``scons`` and ``cmake``,\nbut they are complex for simple use cases\nand require reading a book to get started\n(if you want to understand rather than cut & paste).\nAlso tried Eckel's\n`builder.py `_\nand found it nifty.\nPython though, while great for logic and string manipulation,\nis clumsy at running commands...\nwhich is most of what I need for small projects.\nInteractive shells like bash are optimized for this kind of thing however.\n\nEven though these programs are quite robust,\nthey unfortunately tend to make the easy things difficult.\nPreferably, I've been looking for something like the following.\n\n\nDesign Goals\n~~~~~~~~~~~~~\n\n- Easy to use & *remember later*, with\n\n - A simple file format already known, and\n - A choice of scripting languages, already known,\n - That works like ``make`` when it makes sense.\n\n- Where a few complex operations are possible,\n but defers early to more sophisticated tools.\n Doesn't need to solve every problem.\n- With few-to-no dependencies.\n- With good feedback as to what decisions were made during the build.\n\nTo detect changes BuildIt currently compares timestamps of files,\nwhich is sufficient on filesystems used in a local context.\nThis includes remote logins via ssh.\n\n\nInstall\n---------\n\nIf necessary, first install pip::\n\n sudo apt-get install python-pip # s/apt-get/yum/\n\nthen::\n\n sudo pip install buildit\n\nIf using a Python version below 2.7, this will install ``ordereddict`` as well.\nUnder 3.0, it will install ``ushlex``.\n(This packagage does not currently support Python 3.)\n\nLinux-only for now.\nIt should work on Windows/OSX in theory,\nthough I have not yet tried it.\n\n\nUse\n------\n\nFile format\n~~~~~~~~~~~~~\n\nBuildIt uses the ini file format, encoded in UTF-8.\nDespite its limitations,\nini is a perfect fit for describing items with attributes\nthat need to be read and written by humans.\nThe format is an extended version\n(as implemented by Python's\n`ConfigParser `_)\nwhich adds variables.\nOne **notable change** is that it has been modified to use simpler\n``%name`` (or ``pre%{name}post``) shell-style variable expansion\nrather than the more cumbersome ``%(printf)s`` style.\n\nAs seen below,\na generic ``.ini`` file is a list of section names in square brackets,\neach of which has a mapping of names to values (aka attributes) following.\nComments start with a ``#`` or ``;`` character at the beginning of a line::\n\n # Below, a section with two attributes,\n # the second using variable expansion:\n\n [Section1]\n attribute_one = 1\n attribute_two = attribute_one is equal to %attribute_one\n attribute_three = To continue to additional lines,\n --> make sure to indent them like this.\n\nNote ``attribute_two`` above.\nThe text ``%attribute_one`` will be replaced with its value at load-time.\nThese values are substituted first before anything else happens, and\nunknown variables will raise an Error.\n\n\nBuildfiles\n~~~~~~~~~~~~~~~\n\nTherefore, an ini-file with build rules suitable for BuildIt\nmay be called a buildfile or build script.\nA simple one to concatenate and compress javascript might look like the next\nexample.\nEach section name is a \"target file\" that we want to build and underneath it\nthe various attributes that together make up the *rule* to create it.\n\nAn exception is the optional ``[vars]`` section which holds global variables\nthat are available to all rules.\nIt must be the first section::\n\n [vars] \u2502 Comments:\n basejs = foo.js \u2502 Global variable(s).\n \u2502\n [foo.js.gz] \u2502 Target: this file needs to be built,\n deps = %basejs foo2.js \u2502 Deps: using these input files,\n exec = gzip -c %deps > %me \u2502 Exec: in this manner.\n \u2502\n [clean] \u2502 A dummy target.\n exec = rm -f foo.js.gz \u2502\n\nNote the \"dummy\" target at the bottom, named clean.\nIt has no \"deps,\" aka dependencies,\nand always runs when passed as an argument at the command-line,\njust like make.\n\n\nAttributes\n~~~~~~~~~~~~\n\nSeveral attribute names are reserved:\n\n* ``me`` - Not set by the user.\n The output file, otherwise known as the target-file and section name.\n Is available for use in attributes such as exec.\n* ``deps`` - The list of files the target is dependent on,\n separated by whitespace.\n Names with spaces must therefore be quoted.\n* ``extends`` - Inherits the attributes from another target,\n similar to a base-class, AKA\n `Don't Repeat Yourself `_.\n If you find yourself cutting and pasting,\n stop and use ``extends\u00a0=\u00a0TARGET`` instead.\n* ``workdir`` - Selects a different working directory for the current target.\n\n\nExecution\n___________\n\nThere must be at least one (``exec`` or ``deps``) attribute in every rule.\nThe following attribute names are also reserved:\n\n* ``preexec`` - Setup script\n* ``exec`` - Main script\n* ``postexec`` - Exit stage left\n\nThe execution attributes of the rule are special since they can take a suffix\ncontaining the name of the desired shell,\n(which by default is ``sh``).\nTo choose a different shell (for example bash),\none would set the following attribute instead::\n\n exec.bash = line1...\n line2... etc.\n\nThese may be whatever shell you'd like, just add its name to the end.\nThere are shortcuts for a few languages (py, pl, rb, js(node)), for example::\n\n exec.py = print \"hello world!\"\n\nIf BuildIt decides a target needs to be built,\nits execution attributes will be run.\n\n\nNotes\n___________\n\n* Use of ``%deps`` and ``%me`` variables are very important since they make it\n more difficult to author rules with missing, untracked, or obsolete\n dependencies.\n* Use of ``%me`` also helps prevent errors from corrupting a previously\n successful target file.\n When using ``%me``, output files will be written with a ``.tmp`` extension first,\n and not moved over to the final filename until the script has completed without\n error (returned an exit-status code of ``0``).\n* To prevent the file parser from attempting to expand variables meant to be\n passed to the shell,\n double any percent characters to escape them::\n\n exec.bash = stat -c %%y foo.txt\n\n The percent expansion was chosen on purpose,\n as it will rarely conflict with shell code.\n\nGeneric Rules\n~~~~~~~~~~~~~~~\n\nIf you have many files, creating a rule for every one gets tedious quickly.\nThis is when generic rules come in handy.\nThe following demonstrates how to build every dependency with a filename\nending in ``.o`` without specifying them individually::\n\n [*.o]\n deps = *.c\n exec = %CC %CFLAGS %deps -o %me\n\nSee below for full examples.\n\n\nRunning It\n-----------\n\n::\n\n $ bld -h\n $ bld [target]\n $ bld\n\nHelp (``-h``) prints usage information, options, as well as available targets.\nRunning ``bld`` with no arguments will run the first target section in the\nfile ``./buildit.ini`` like make.\nTherefore it's a good place to put an \"all\" target.\n\nExample Run\n~~~~~~~~~~~~~\n\n::\n\n $ bld\n \u2023 foo.js.gz\n \u2757 foo.js\n \u2757 foo2.js\n \u2699 exec:\n + gzip -c foo.js foo2.js\n \u2714 exit: 0\n\nGood. Once more for good measure::\n\n $ bld\n \u2714 foo.js.gz\n \u2714 foo.js\n \u2714 foo2.js\n\n\nReturn Codes\n~~~~~~~~~~~~~\n\n* ``0`` - All clear\n* ``N`` - Command execution errors\n* ``NN`` - Error codes from BuildIt, see ``cat /usr/include/sysexits.h``\n\nLicense\n-----------\n\nBuildIt is licensed under the\n`GPL, version 3+ `_.\n\n\nNext...\n-----------\n\n* Full examples can be found under the\n `examples folder `_.\n\n* BuildIt is designed to be complementary to the deployment and\n configuration management tool `pave `_.", "description_content_type": null, "docs_url": null, "download_url": "https://bitbucket.org/mixmastamyk/buildit/get/default.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/mixmastamyk/buildit", "keywords": null, "license": "GPLv3+", "maintainer": null, "maintainer_email": null, "name": "buildit", "package_url": "https://pypi.org/project/buildit/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/buildit/", "project_urls": { "Download": "https://bitbucket.org/mixmastamyk/buildit/get/default.tar.gz", "Homepage": "https://bitbucket.org/mixmastamyk/buildit" }, "release_url": "https://pypi.org/project/buildit/0.90/", "requires_dist": null, "requires_python": null, "summary": "A simple build tool for small projects.", "version": "0.90" }, "last_serial": 1983457, "releases": { "0.81": [ { "comment_text": "", "digests": { "md5": "d6115cc94f2fac27b6cce58e954c9e3a", "sha256": "a42c5d0b25978e1b805bc31746f732809845e18bd13811ebd87123c4d965e591" }, "downloads": -1, "filename": "buildit-0.81.tar.gz", "has_sig": false, "md5_digest": "d6115cc94f2fac27b6cce58e954c9e3a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 195899, "upload_time": "2013-11-17T00:36:37", "url": "https://files.pythonhosted.org/packages/18/d1/220af30c64608a9e9b5c239cce9b8c3d6c23e36c6715c7b587bc4eb4b332/buildit-0.81.tar.gz" } ], "0.90": [ { "comment_text": "", "digests": { "md5": "b6044688f13ba5393a944a0ad79b227d", "sha256": "9ab92a5c06f825c105983fcac4961cf53ef6b97ac00765768c27b363bed10e25" }, "downloads": -1, "filename": "buildit-0.90.tar.gz", "has_sig": false, "md5_digest": "b6044688f13ba5393a944a0ad79b227d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 196363, "upload_time": "2016-03-01T08:21:56", "url": "https://files.pythonhosted.org/packages/80/c9/3aa8ed3e930a7670de25451942438267e76a6e4b4ab67ef3d5c640b2a025/buildit-0.90.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b6044688f13ba5393a944a0ad79b227d", "sha256": "9ab92a5c06f825c105983fcac4961cf53ef6b97ac00765768c27b363bed10e25" }, "downloads": -1, "filename": "buildit-0.90.tar.gz", "has_sig": false, "md5_digest": "b6044688f13ba5393a944a0ad79b227d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 196363, "upload_time": "2016-03-01T08:21:56", "url": "https://files.pythonhosted.org/packages/80/c9/3aa8ed3e930a7670de25451942438267e76a6e4b4ab67ef3d5c640b2a025/buildit-0.90.tar.gz" } ] }