{ "info": { "author": "Chris Musselle", "author_email": "chris.j.musselle@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6" ], "description": "\nMasonry\n=======\n\n|build status| |codecov|\n\n A command line tool for composable project templating.\n\nMasonry aims to reduce the need to write boiler plate code and setup\nfiles when starting or extending a project. It does so by allowing\n`cookiecutter `__ templates to\nbe combined in a series of layers to build up a projects file structure.\n\nApplying different combinations of these template building blocks then\nallow for a greater variety of project types to be more easily\nsupported, compared to defining each template permutation separately.\n\nMasonry also includes a cli application ``mason`` that makes applying\nand managing these template layers straight forward.\n\nInstallation\n============\n\n::\n\n pip install masonry\n\nKey Dependencies:\n-----------------\n\n- ``cookiecutter`` >= 1.6\n\nUsage\n=====\n\n1. Create a series of template layers to use for a particular project\n layout (see below and in the project-templates directory for\n examples).\n\n2. Initialise a new project with its default starting template\n\n ::\n\n mason init project/template/path\n\n3. Add an extra templating layer to the project\n\n ::\n\n mason add template_name\n\nCreating and Using Template Layers for a Custom Project\n=======================================================\n\nThe individual template layers are themselves cookiecutter templates. To\ncombine several of these into a project to use with masonry:\n\n- Each cookiecutter template should be in its own directory named after\n the templates purpose\n- All these are then held in a parent directory, which is named after\n the project type all these layers relate to.\n- Included in the project group directory is a metadata.json file that\n specifies the \"default\" template to use, as well as any dependencies\n between layers.\n\nFor example, imagine a situation that wished to combine the following\nthree layers into a project:\n\n1. One to create a base python package\n2. Another to define the unittest structure with pytest\n3. A third to add a build file for continuous integration.\n\nPlacing these all in the same directory called \"python-project\" would\ngive the following structure:\n\n::\n\n path/to/python-project/\n \u251c\u2500\u2500 ci-build\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 {{cookiecutter.project_name}}\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 cookiecutter.json\n \u2502\u00a0\n \u251c\u2500\u2500 package\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 {{cookiecutter.project_name}}\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 cookiecutter.json\n \u2502\u00a0\u00a0\n \u251c\u2500\u2500 pytest\n \u2502 \u251c\u2500\u2500 {{cookiecutter.project_name}}\n \u2502\u00a0\u00a0 \u2514\u2500\u2500 cookiecutter.json\n \u2502\n \u2514\u2500\u2500 metadata.json\n\nThe metadata.json file would then specify the *package* template as the\ndefault layer, with the *pytest* template layer depending on the\n*package* template, and the *ci-build* template layer depending on the\n*pytest* template. The structure of the resulting JSON file is shown\nbelow:\n\n.. code:: json\n\n {\n \"default\": \"package\", \n \"dependencies\": {\n \"pytest\": [\"package\"], \n \"ci-build\": [\"pytest\"]\n }\n }\n\nNow using ``mason`` we can create a new project following the *package*\ntemplate with:\n\n.. code:: bash\n\n mason init path/to/python-project/\n\nAnd at a later time, when we want to start adding tests and a build\nprocess to the project, we could run:\n\n.. code:: bash\n\n mason add ci-build\n\nNote that even though we only specified \"ci-build\" above, ``mason`` is\nable to work out all needed template layer dependencies from the\nmetadata.json and apply them in the right order. This means both the\n*pytest* and *ci-build* template layers will be applied in that order.\n\nProjects as a Collection of Components\n======================================\n\nSplitting out the templates above may not seem to have gained you very\nmuch. After all, you could have just defined all these files for package\n+ tests + CI in a single template structure. However, as you start to\nadd different components to your projects under different scenarios,\nthis modular approach becomes more beneficial.\n\nFor example, say you wanted to support different CI services such as\ncircle CI, travis, and GitLab Runners on different projects; and on some\nprojects you have a Makefile, and on others something more cross\nplatform compatible like an invoke tasks.py file.\n\nAccommodating all these options would either mean maintaining 6\ndifferent templates with a lot of repetition, or one large one with a\nlot of control flow logic in the jinja template.\n\nStomemason provides a middle ground of breaking up these components of\nthe project into separate layers.\n\nIt also has the major benefit of being able to apply any additional\nlayers **after** the initial project was created. So if you didn't see\nthe need to also create a conda package for your project till now? No\nproblem, just apply the conda-package layer to the current project\n(assuming you have defined one of course!).\n\nAdditional Features\n===================\n\n- Pre and post project creation hooks used by cookiecutter are\n supported.\n- Cookiecutter variables are remembered and reused between template\n layers, meaning you only need to specify values for new variables.\n- If project path is omitted, ``mason init`` allows you to\n interactively select one from a list of previously used projects.\n- If the template name is omitted, ``mason add``, allows you to\n interactively select one from a list of templates that can still be\n added to the project.\n- Colourful UI and easy multiple choice selection thanks to the\n `inquirer `__ library.\n\nOther Related Projects\n======================\n\n- `python boilerplate `__ A web\n application for interactively filling out a template for a new\n project.\n\n- `yeoman `__ A project scaffolding tool for web\n development written in javascript.\n\n- `mason `__ A project in R similar\n to cookiecutter but with a colourful UI, and one of the inspirations\n for this project.\n\n- `usethis `__ A project in the R\n community looking at similar ideas around project template\n composability, and being able to add them as needed on a project.\n\n.. |build status| image:: http://img.shields.io/travis/MrKriss/masonry/master.svg?style=flat\n :target: https://travis-ci.org/MrKriss/masonry\n.. |codecov| image:: https://codecov.io/gh/MrKriss/masonry/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/MrKriss/masonry\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MrKriss/masonry", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "masonry", "package_url": "https://pypi.org/project/masonry/", "platform": "", "project_url": "https://pypi.org/project/masonry/", "project_urls": { "Homepage": "https://github.com/MrKriss/masonry" }, "release_url": "https://pypi.org/project/masonry/0.1.2/", "requires_dist": [ "clint", "cookiecutter (>=1.6)", "docopt", "gitpython", "inquirer", "py", "ruamel.yaml (>=0.15)", "schema" ], "requires_python": "", "summary": "A command line tool for composable project templating.", "version": "0.1.2" }, "last_serial": 3279325, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "e92cc918580179a05f6a032724668b73", "sha256": "c0556c246d491ce8637e7e498761c61c86981fb251d42042a6bd0aa448b77ee1" }, "downloads": -1, "filename": "masonry-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e92cc918580179a05f6a032724668b73", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 48866, "upload_time": "2017-10-24T21:08:47", "url": "https://files.pythonhosted.org/packages/81/72/8e759deca06945cb3209508e4af840ef113ba1cd17dd2b6759793cbeb1ab/masonry-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b10cc508fde17b72a64af57dc26a25ad", "sha256": "151c4a0ce4d865b54ae3cfc4065928a159381b8a2fe0e4785b9c3422858a3a4c" }, "downloads": -1, "filename": "masonry-0.1.1.tar.gz", "has_sig": false, "md5_digest": "b10cc508fde17b72a64af57dc26a25ad", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 51452, "upload_time": "2017-10-24T21:08:48", "url": "https://files.pythonhosted.org/packages/ff/83/1ce27495fbe495728e529efed7abe809beadce5122c680e832bf0f274ee0/masonry-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "11f2d82f46c6f01cfd64999a6627d23e", "sha256": "296491fe24973fe6f6c02caf2b613987ccad4b7f6d218c660c2d7432afda1391" }, "downloads": -1, "filename": "masonry-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "11f2d82f46c6f01cfd64999a6627d23e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 48848, "upload_time": "2017-10-25T21:40:19", "url": "https://files.pythonhosted.org/packages/73/8b/0edb38be3c5398eebfb25e00d5a3b09e14fcfb9ab5d662323511a56f747e/masonry-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c34a72732235b87597da78fe53ff21cb", "sha256": "3a764987395936a715b207f5be950f75438e7d3daf85dd09d29daa006571faf0" }, "downloads": -1, "filename": "masonry-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c34a72732235b87597da78fe53ff21cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 52333, "upload_time": "2017-10-25T21:40:21", "url": "https://files.pythonhosted.org/packages/b5/e8/912a894ea40d76d034f0961945a63ee1abf284b50f4b127a9db70c72b823/masonry-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "11f2d82f46c6f01cfd64999a6627d23e", "sha256": "296491fe24973fe6f6c02caf2b613987ccad4b7f6d218c660c2d7432afda1391" }, "downloads": -1, "filename": "masonry-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "11f2d82f46c6f01cfd64999a6627d23e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 48848, "upload_time": "2017-10-25T21:40:19", "url": "https://files.pythonhosted.org/packages/73/8b/0edb38be3c5398eebfb25e00d5a3b09e14fcfb9ab5d662323511a56f747e/masonry-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c34a72732235b87597da78fe53ff21cb", "sha256": "3a764987395936a715b207f5be950f75438e7d3daf85dd09d29daa006571faf0" }, "downloads": -1, "filename": "masonry-0.1.2.tar.gz", "has_sig": false, "md5_digest": "c34a72732235b87597da78fe53ff21cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 52333, "upload_time": "2017-10-25T21:40:21", "url": "https://files.pythonhosted.org/packages/b5/e8/912a894ea40d76d034f0961945a63ee1abf284b50f4b127a9db70c72b823/masonry-0.1.2.tar.gz" } ] }