{ "info": { "author": "Lain Supe (lainproliant)", "author_email": "lainproliant@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Build Tools" ], "description": "# Bakery: A Python build system straight out of the oven\n\nBakery is a dependency driven build system atop the\n[Xeno](https://github.com/lainproliant/xeno) injection framework. Bakery\nallows you to define the structure and flow of your build process using plain\nPython code. Bakery mixes the expressiveness of Makefiles with the power and\nutility of the Python programming language.\n\n### Note\nBakery is still in early development. There may be some rough edges or major\nbugs. You are encouraged to try it out now and have fun, but keep in mind that\nthis is a living project and there's plenty more to come!\n\n# Installation\n\nInstallation is simple. With python3-pip, do the following:\n\n```\n$ sudo pip install -e .\n```\n\nOr, to install the latest version available on PyPI:\n\n```\n$ sudo pip install bakery-build\n```\n\nBakery is now available via the `bake` command:\n\n```\n$ bake\n```\n\n# Usage\nThe first step to using Bakery is to create a `Bakefile.py` in your project.\nThis is a Python script that is executed via the `bake` command and contains\nyour *build module* definition. This module establishes the setup methods,\ninputs, outputs, temporary resources and targets that are needed to build your\nproject.\n\nVia Xeno, dependencies are declared via the parameters provided to each target\nmethod. Each target, input, output, and temporary resource may be defined as a\nnormal function or a coroutine. When coroutines are used this way, bakery will\nschedule them in the current event loop. Using `asyncio` and the built-in\n`shell` coroutine, it becomes easy to define a build workflow that can run\nmultiple concurrent tasks, such as compiling source files, in parallel.\n\n## Example\n\nThis simple example defines a `Bakefile.py` for a simple C project containing\nnumber of source files which are linked into a resulting executable.\n\n```\nimport bakery.recipes.cxx as CXX\nimport bakery.recipes.file as File\nimport os\n\nCXX.CXX = 'clang++'\nCXX.CFLAGS = [\n '-g',\n '-rdynamic',\n '--std=c++14',\n '-DLAIN_ENABLE_STACKTRACE',\n '-DLAIN_STACKTRACE_IN_DESCRIPTION',\n '-I./toolbox/include',\n '-I./include'\n]\nCXX.LDFLAGS = ['-lSDL2', '-lSDL2_image']\n\n@build\nclass LostLevels:\n @provide\n def demo_sources(self):\n return File.glob('demo/*.cpp')\n \n @provide\n def build_dir(self):\n return File.directory('build')\n\n @target\n def demo_resources(self, build_dir, demo_sources):\n resource_paths = []\n for source in demo_sources:\n resource_dir = File.basename(File.drop_ext(source)) + '-rc'\n resource_paths.append(File.copy(\n File.join('demo', resource_dir),\n File.join(build_dir, resource_dir)))\n return resource_paths\n \n @provide\n def demo_objects(self, build_dir, demo_resources, demo_sources):\n objects = []\n for source in demo_sources:\n object_file = File.join(build_dir, File.basename(File.swap_ext(source, 'o')))\n objects.append(CXX.compile(source, object_file))\n return objects\n \n @default\n def demos(self, demo_objects):\n return [CXX.link(obj, File.drop_ext(obj)) for obj in demo_objects]\n\n```\n\nIn the above example, the following Bakery patterns are used:\n\n- `@build` wraps the module so that it is evaluated by Bakery as a build module.\n More than one module may be decorated with `@build`, but no more than one\n target may be marked as `@default` among them.\n\n- `@provide` is an annotation from\n [Xeno](https://github.com/lainproliant/python3-xeno), marking the given\n method as a named resource that can be injected into other resources (and\n build targets) via their parameter name.\n\n- `@target` is a Bakery annotation that marks a method as providing a target that\n can be specified with the `bake` command.\n\n- `@default` marks the method as a valid nameable target and the default target\n to be executed when no other targets are specified with the `bake` command.\n\nA few other useful Bakery patterns and tools to consider in your projects:\n\n- `@recipe` marks a given function as defining a recipe for creating files.\n The modification time of the input files is compared to the output if it\n exists to determine if the recipe needs to be executed. Recipes should\n generally return the name or names of the output files generated by the\n recipe. The decorator takes the following arguments:\n - `*args`: Names of parameters to the decorated function that represent\n the outputs generated by the recipe.\n - `check`: A string or list of strings indicating parameters containing\n filenames or list of filenames that represent inputs to the\n recipe. Bakery uses the modification time on these files\n to determine if the recipe should be run.\n - `temp`: Refers to parameters containing files that should be cleaned up\n once the recipe finishes running.\n Additionally, the decorated function may define annotated variables into which\n special values are injected as follows:\n - `log`: This parameter is provided with a logger specific to the recipe run.\n Note that recipes can be defined inside or outside of your build module, this\n choice is up to you.\n\n- `shell`: This is a coroutine wrapper to `asyncio.create_subprocess_exec` which\n captures and returns the output from the command as well as printing its\n output and error output to the bakery logger. Prefer this function for\n executing other programs such as compilers, unless the program requires a tty.\n\n### Note\nTo make the most out of Bakery, you should first read up on\n[Xeno](https://github.com/lainproliant/python3-xeno). *Build modules* in Bakery\nare Xeno modules as well, allowing you to require and use resources defined in\nother Xeno modules, such as the runtime parts of your Xeno-based project.\n\n## Change Log\n### Bakery v0.3.0 - May 4 2018\n- Added `@noclean` decorator for resources which should not be cleaned when\n `bake -c` is run.\n- Fixed bug which prevented usage of namespaced or aliased resources.\n- Due to the above bug fix, Bakery now depends on `xeno>=3.0.0`.\n\n### Bakery v0.2.0 - May 3 2018\n- First stable working version.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lainproliant/bakery", "keywords": "build make dependency", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "bakery-build", "package_url": "https://pypi.org/project/bakery-build/", "platform": "", "project_url": "https://pypi.org/project/bakery-build/", "project_urls": { "Homepage": "https://github.com/lainproliant/bakery" }, "release_url": "https://pypi.org/project/bakery-build/0.3.5/", "requires_dist": null, "requires_python": "", "summary": "A dependency-driven build manager based on xeno.", "version": "0.3.5" }, "last_serial": 4793625, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "1e809abf2963329d5c22f6700cfc102d", "sha256": "35ab86abc81f9515c7d811634938af5daba4b8a20721c0fed47ab3cc5fd84f51" }, "downloads": -1, "filename": "bakery-build-0.2.tar.gz", "has_sig": false, "md5_digest": "1e809abf2963329d5c22f6700cfc102d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6013, "upload_time": "2018-05-03T17:34:31", "url": "https://files.pythonhosted.org/packages/80/02/70af62f1e3621c18a07c6848d986019f8d7c4aa38ceebbef69ffeb4653fb/bakery-build-0.2.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "c3de5c0d3ab488b33dd31c129eb4733a", "sha256": "d92c1dcba4c89fc1bec27dd343c8fffa168f3d1120685d017938c4d36c713fd5" }, "downloads": -1, "filename": "bakery-build-0.2.1.tar.gz", "has_sig": false, "md5_digest": "c3de5c0d3ab488b33dd31c129eb4733a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12343, "upload_time": "2018-05-04T06:36:50", "url": "https://files.pythonhosted.org/packages/be/08/91c78c39dbd76775699957c8a3c358812bfd4a1c8ac5d226b05cd6236adc/bakery-build-0.2.1.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "11dfb47c9d4e3283d3f859adfe3f8d3b", "sha256": "32543faa444da29c90ce5c95cebff223abe41eb179ec3d0c3f9b076807c937fd" }, "downloads": -1, "filename": "bakery-build-0.3.0.tar.gz", "has_sig": false, "md5_digest": "11dfb47c9d4e3283d3f859adfe3f8d3b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12766, "upload_time": "2018-05-05T01:37:21", "url": "https://files.pythonhosted.org/packages/3f/c0/bacf01b7e3d2f2c68737978a952fb76fc06f167590be8574e9b4a984aac0/bakery-build-0.3.0.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "1526f063d21da6ba4f504a41c5f31cdd", "sha256": "575cdeea3e6d8e09b959772b6c6395e70a4b21be25b4531e7c9b355d4a430c94" }, "downloads": -1, "filename": "bakery-build-0.3.2.tar.gz", "has_sig": false, "md5_digest": "1526f063d21da6ba4f504a41c5f31cdd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12867, "upload_time": "2018-05-23T00:38:07", "url": "https://files.pythonhosted.org/packages/95/7a/759cb7aa8c46fa111e8f2c00ed34e96d87b34754d15646e44b46c2bbd071/bakery-build-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "bcf3c9834b3ee96d8c0fdb9d94be7822", "sha256": "34b8e3d76ac972ba5b616c37b245ba21eb623c2e03612189e1bc80c429a6a385" }, "downloads": -1, "filename": "bakery-build-0.3.3.tar.gz", "has_sig": false, "md5_digest": "bcf3c9834b3ee96d8c0fdb9d94be7822", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13665, "upload_time": "2018-10-26T17:42:32", "url": "https://files.pythonhosted.org/packages/db/b7/41b940e98eb377c2c9cbc6dc49f5a606c9f68b009fb03f9787b650282fee/bakery-build-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "3788014629efd4bf41690af3ef509573", "sha256": "a0c423bbe8735528f1b6e5fd8b6da5fb8f46a42bcbed10fe91b848f7bf5dbbaa" }, "downloads": -1, "filename": "bakery-build-0.3.4.tar.gz", "has_sig": false, "md5_digest": "3788014629efd4bf41690af3ef509573", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13762, "upload_time": "2019-02-08T00:14:59", "url": "https://files.pythonhosted.org/packages/78/e9/7c4f4fbfb88caac69ff56042811fe9bca1cf1d7c57960b4eda87b9e26bb8/bakery-build-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "23f3cd5050f8afb944c21a17fd26662d", "sha256": "e6d5a8540061bffe4648406170869d27ba10c62778d3822c8d420a5031c9fefb" }, "downloads": -1, "filename": "bakery-build-0.3.5.tar.gz", "has_sig": false, "md5_digest": "23f3cd5050f8afb944c21a17fd26662d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13759, "upload_time": "2019-02-08T00:17:19", "url": "https://files.pythonhosted.org/packages/ac/cf/d15e53b6c9f605b7c52ad3092b6e3b1e3e7a481eb4d8cd704f47b0d4dab1/bakery-build-0.3.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "23f3cd5050f8afb944c21a17fd26662d", "sha256": "e6d5a8540061bffe4648406170869d27ba10c62778d3822c8d420a5031c9fefb" }, "downloads": -1, "filename": "bakery-build-0.3.5.tar.gz", "has_sig": false, "md5_digest": "23f3cd5050f8afb944c21a17fd26662d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13759, "upload_time": "2019-02-08T00:17:19", "url": "https://files.pythonhosted.org/packages/ac/cf/d15e53b6c9f605b7c52ad3092b6e3b1e3e7a481eb4d8cd704f47b0d4dab1/bakery-build-0.3.5.tar.gz" } ] }