{ "info": { "author": "Jim Carroll", "author_email": "jim@carroll.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Topic :: Software Development :: Build Tools", "Topic :: System :: Software Distribution" ], "description": "Pyjig - Quickly create python projects from templates\n#########################################################\n\n:Author: Jim Carroll \n:Description: Quickly create python projects from templates\n\nPyjig quickly creates new python projects using pre-created templates. Projects\ncan be simple scripts, distutils packages or full blown applications. Pyjig\ncan even add python source modules and c extensions to existing projects.\n\nPyjig is a wrapper around `Cookiecutter `_,\nwhich is a command-line utility that creates projects from ``cookiecutters``\n(project templates). Templates are downloaded from public repos (such as\ngithub.com and bitbucket.org). Templates are written in `Jinja\n`_.\n\nPyjig uses four public repos hosted with github:\n\n+---------------------------------------------------+----------------------------------+\n| Repo | Description |\n+===================================================+==================================+\n| https://github.com/jamercee/cookiecutter-pyapp | Python application type projects |\n+---------------------------------------------------+----------------------------------+\n| https://github.com/jamercee/cookiecutter-pypkg | Python package type projects |\n+---------------------------------------------------+----------------------------------+\n| https://github.com/jamercee/cookiecutter-pysource | Create python source |\n+---------------------------------------------------+----------------------------------+\n| https://github.com/jamercee/cookiecutter-pyext | Create python extension |\n+---------------------------------------------------+----------------------------------+\n\n****************\nPyjig Background\n****************\n\nProject Motivation\n==================\n\nUsing python requires developers to employ a full ecosystem of tools. At\nCarroll-Net, all projects require the following tools; `pylint\n`_ and `flake8 `_\nfor static code analysis, `sphinx `_ for project\ndocuments and `git `_ for revision control. And this\nrequires setting up directories, config files, a unittest infrastructure and a\ncomprehensive Makefile for automating the daily build, test and install tasks.\n\nWith all these steps, it's easy to miss one, or to make a typo when copying\nfrom another project which then causes developers to spend time debugging.\nWhat was needed was a way to ensure uniform deployment and configuration of our\npython architecture and toolchain.\n\nPyjig Name\n==========\n\nPyjig borrows it's name from the concept of a jig which is a tool used in metal\nand woodworking. A jig is a template that allows one to make duplicates of\npieces. The simplest example is a key duplication machine, which uses one key\nas the guide to make copies.\n\n****************\nProjects Details\n****************\n\nCreated Project Layout\n======================\n\nEach new project will create the following directories and files::\n\n myproj <-- Project root\n | .gitignore\n | id.txt\n | Makefile\n | pylint.rc\n | setup.cfg\n | setup.py\n |\n +---.git <-- Git repository\n | ...\n |\n +---docs <-- Sphinx documentation\n | conf.py\n | index.rst\n | make.bat\n | Makefile\n |\n +---src <-- Project source code\n | __init__.py\n |\n \\---tests <-- Unittest infrastructure\n __init__.py\n\nEach project root folder includes a copy of ``id.txt``. This file is a copy of\nthe cookiecutter settings that were in effect when the project was created. It\nacts as sentinel for project root identification and should not be removed or\nrenamed.\n\n\nMakefile generation\n===================\n\nEach project will have a cutomized ``Makefile`` installed in the project's\nroot directory. It's syntax is written to support `GNU Make\n`_. It comes with the following pre-built recipes\n\n+-------------+-----------------------------------------------------------------------+\n| Recipe | Description |\n+=============+=======================================================================+\n| comp | Perform static analysis (default target) |\n+-------------+-----------------------------------------------------------------------+\n| tests | Run unittests after in-lace build |\n+-------------+-----------------------------------------------------------------------+\n| docs | Generate html documentation |\n+-------------+-----------------------------------------------------------------------+\n| dist | Build python software distributions |\n+-------------+-----------------------------------------------------------------------+\n| build | Build everything needed to install |\n+-------------+-----------------------------------------------------------------------+\n| install | Perform static analysis, run unittests and install to site-packages |\n+-------------+-----------------------------------------------------------------------+\n| viewdocs | Rebuild html docs & launch browser |\n+-------------+-----------------------------------------------------------------------+\n| clean | Meta-recipe to invoke ``clean-build``, ``clean-pyc``, ``clean-docs`` |\n+-------------+-----------------------------------------------------------------------+\n| clean-build | Remove all built outputs |\n+-------------+-----------------------------------------------------------------------+\n| clean-pyc | Remove python built elements (\\*.pyc, \\*.pyo, etc...) |\n+-------------+-----------------------------------------------------------------------+\n| debug | Generate Makefile diagnostic output |\n+-------------+-----------------------------------------------------------------------+\n| help | Display Makefile help |\n+-------------+-----------------------------------------------------------------------+\n\nStatic Analysis\n===============\n\nPython's flexible syntax means that coding errors are difficult to detect until\nruntime. Static analysis tries to solve this by scanning code for coding\nerrors, bugs and bad style. It is an invaluable technique that has saved us\nuntold hours in debugging.\n\nWe first started using `pylint `_. Then later on we\nadded a second static analysis tool `flake8\n`_. Each tool has it's strengths and we've\nfound the combination of both has provided material reduction in time spent\ndebugging.\n\nEach of these two tools requires some tweaking before they will generate useful\nadvice. Pyjig will handle configuring sane defaults for new projects to get\nthem up to speed quickly.\n\nTo perform static analysis of code, from within the project's root folder run\n``make comp``.\n\n.. note::\n\n The ``Makefile`` recipe detects changes in ``*.py`` with reference to ``*.pyc``.\n If the ``*.pyc`` is missing or older than it's ``*.py``, a static analysis\n pass will be done, and if the pass does not generate errors or warnings, the\n ``*.pyc`` will be re-built.\n\nCode Documentation\n==================\n\nCarroll-Net has adopted `Sphinx `_ as our documentation\ngenerator for python projects. Sphinx converts `reStructuredText\n`_ into HTML websites. Sphinx\ncan extract documentation from source modules and automatically generate\nbrowesable websites.\n\nThere are two Makefile recipes related to documentation; ``make docs`` which\nwill rebuild documentation and ``make viewdocs`` which will rebuild docs and\nlaunch a webbrowser to read the rebuilt docs.\n\nTwo good references for authoring reST documents are\n\n * https://docs.python.org/devguide/documenting.html\n * https://pythonhosted.org/an_example_pypi_project/sphinx.html\n\nVersion Control\n===============\n\nCarroll-Net has adopted Git as our version control system for software. Git is\na fast, reliable distributed revision control system. Originally developed for\nLinux kernel development it is now the most widely used source code management\ntool.\n\nPyjig will initialize a git repository for each new project it creates using\nyour local sytem defaults (see `git config ...\n`_.). And each\ntime you use Pyjig to add to an existing project, pyjig will add the source to\nthe repo.\n\nPyjig will not create the repo if invoked with ``--excludegit`` or if the\ndirctory is a subdirectory of an existing git repository. It detects\nrepository membership by invoking `git status\n`_.\n\n***********\nPyjig Usage\n***********\n\nInstallation\n============\n\nPyjig is hosted on git hub at https://github.com/jamercee/pyjig\n\nInstallation using git::\n\n git clone https://github.com/jamercee/pyjig\n cd pyjig\n python setup.py install\n\nPyjig can also be installed with pip::\n\n pip install pyjig\n\nCommand line options\n====================\n\n*usage:* ``pyjig [-?] [-d] [--pkg PKG] [--app APP] [--ext EXT [EXT ...]] [-x] [source [source ..]]``\n\nPositional arguments\n--------------------\n\nsource\n\n Add one or more source file(s) to project. If the current directry is not part of an\n existing project, the source file will be created, but no project related activities\n will be taken (no unittest generation, no sphix-docs generation, not added to git...)\n\nOptional argument:\n------------------\n\n-?, -h, --help Display help and exit.\n\n-d, --debug Generate diagnotic output.\n\n--pkg PKG Create a distutils package project.\n\n--app APP Create an application type project.\n\n--ext EXT [EXT ...] Add an extension module(s) to the existing project.\n\n-x, --exludegit Do not initialize git repo and do not add new source to git repo.\n\n\nExample Usage\n=============\n\nIn the examples that follow, the ``--quiet`` flag is used to accept the default\ncookiecutter answers (and to keep our example brief). Some of the default\nanswers may not be appropriate for your project until you configure\ncookiecutter. An example of how todo this is also provided.\n\nNew package project with python source files\n--------------------------------------------\n\nTypically, the workflow is to create a new project and then to add source files\nto it. For example, to create a new package called ``mypkg`` and to the then\nadd three source files, you would do the following::\n\n $ pyjig --quiet --pkg mypkg\n $ cd mypkg\n $ pyjig --quiet s1 s2 s3\n\n $ git status --short\n A docs/s1.rst\n A docs/s2.rst\n A docs/s3.rst\n A src/s1.py\n A src/s2.py\n A src/s3.py\n A tests/tests1.py\n A tests/tests2.py\n A tests/tests3.py\n\nNew application project with python source\n------------------------------------------\n\nApplication projects are similar to package projects with the main difference\nbeing how the ``setup.py`` is created. Application projects use the setuptools\n``entry_points`` attribute to cause the install to create a python command\nscript::\n\n $ pyjig --quiet --app myapp\n $ cd myapp\n $ pyjig --quiet mycmd\n\n $ git status --short\n A docs/mycmd.rst\n A src/mycmd.py\n A tests/testmycmd.py\n\nCreate a single python source file\n----------------------------------\n\nIf you only need to create a python source file without the application or\npackage ecosystem, you can just use the source command. A simple example::\n\n $ pyjig -q source\n\nThis will create a single ``source.py`` in your current directory.\n\n\nNew project with C++ extension\n------------------------------\n\nC++ Extensions enable developers to extend the Python interpreter with new\nmodules. Pyjig comes with support for creating new projects with these\nextensions. To create a new C++ Extension you would typically do::\n\n $ pyjig --quiet --pkg mymod\n $ cd mymod\n $ pyjig --quiet --ext e1\n\n $ git status --short\n A docs/e1.rst\n A src/e1_module.cpp\n A tests/teste1.py\n\nPyjig will not add the new module to the ``setup.py`` file. This is an\nimportant step that needs to be done by the developer to cause the\nmodule to be rebuilt. The instructions for how todo this are included as a\ncomment at the top of the newly created module file::\n\n $ head -n 15 src/e1_module.cpp\n /*\n This module needs to be manually added to your setup.py. Consider\n adding the following lines:\n\n from setuptools import Extension\n\n module = Extension('mymod.e1',\n sources = ['src/e1_module.cpp'],\n )\n\n setup(...\n ext_modules = [ module ],\n )\n */\n\nDefining New Types with C++ Extension\n-------------------------------------\n\nExtensions can be used to create new types that can be manipulated from Python\ncode, much like strings and lists in core Python. The pyjig C++ Extension\nsystem has specialized sections that can be included to create these types. You\ncannot create these modules using ``--quiet`` as it requies the developer to\nspecify the name of the new type during the cookicutter build step. Here's an\nexample::\n\n $ pyjig --quiet --pkg mytype\n $ cd mytype\n $ pyjig --ext mytype\n >>> Option: Add extension module 'mytype'.\n You've cloned C:\\cygwin64\\home\\jimc\\.cookiecutters\\cookiecutter-pyext before.\n Is it okay to delete and re-clone it? [yes]:\n Cloning into 'cookiecutter-pyext'...\n remote: Counting objects: 29, done.\n remote: Compressing objects: 100% (21/21), done.\n remote: Total 29 (delta 13), reused 24 (delta 8), pack-reused 0\n Unpacking objects: 100% (29/29), done.\n Checking connectivity... done.\n module [mytype]:\n module_short_description [short module description]:\n project [mytype]:\n new_type []: Mytype <--- Give your new type a name here\n version [1.0]:\n release [1.0.1]:\n python [python2.7]:\n author [Jim Carroll]:\n email [jim@carroll.net]:\n year [2015]:\n copyright [Copyright(c) 2015, Carroll-Net, Inc., All Rights Reserved]:\n\nIn the example above, the fifth question allows the developer to give their new\ntype a name. Any non-default answer will cause additional code to be included\nin the project to create new custom types.\n\n.. note::\n Remember to add the new module to ``setup.py``\n\n\nOverride cookiecutter defaults\n------------------------------\n\nCookiecutter projects are bundled with a collection of key/value pairs delivered\nin a JSON file. You can override the defaults by creating your own\n``~/.cookiecutterrc`` file.\n\n.. note::\n To see where you should create your ``.cookiecutterrc`` file, execue the command\n ``python -c \"import os; print os.path.expanduser('~/.cookiecutterrc')\"``\n\nEach pyjig project has a collection of common key/value settings. Add these\nsettings to your ``.cookiecutterrc`` file to create overrides::\n\n default_context:\n author: \"Bob Jones\"\n email: \"bob@jones.com\"\n copyright: \"Copyright(c) {{cookiecutter.year}}, Jones, Inc., All Rights Reserved\"\n\n..\n Copyright(c), 2015, Carroll-Net, Inc., All Rights Reserved.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/jamercee/pyjig", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jamercee/pyjig", "keywords": null, "license": "Pyjig is licensed under the 3-clause BSD License", "maintainer": null, "maintainer_email": null, "name": "pyjig", "package_url": "https://pypi.org/project/pyjig/", "platform": "any", "project_url": "https://pypi.org/project/pyjig/", "project_urls": { "Download": "https://github.com/jamercee/pyjig", "Homepage": "https://github.com/jamercee/pyjig" }, "release_url": "https://pypi.org/project/pyjig/1.0.14/", "requires_dist": null, "requires_python": null, "summary": "Quickly create python projects from templates.", "version": "1.0.14" }, "last_serial": 1879034, "releases": { "1.0.10": [ { "comment_text": "", "digests": { "md5": "b524bd3d6dafd453aacf4f929393c777", "sha256": "673794aba39935a81896d1e46b64fa923831691ae8a6647821ca3dc96525136a" }, "downloads": -1, "filename": "pyjig-1.0.10.zip", "has_sig": false, "md5_digest": "b524bd3d6dafd453aacf4f929393c777", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16241, "upload_time": "2015-11-18T10:25:36", "url": "https://files.pythonhosted.org/packages/da/fe/8b47bdc83193958ff8e8f2afd02d5ed053448bcb51039cadf05fb543d6a9/pyjig-1.0.10.zip" } ], "1.0.11": [ { "comment_text": "", "digests": { "md5": "294abe53ba27b85c6a73a644cfd59c50", "sha256": "5839c2b19ec89f524d33282d29bfeea0ad5b9c47994725e36609aaf7e82de838" }, "downloads": -1, "filename": "pyjig-1.0.11.zip", "has_sig": false, "md5_digest": "294abe53ba27b85c6a73a644cfd59c50", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16256, "upload_time": "2015-11-18T10:30:03", "url": "https://files.pythonhosted.org/packages/5d/69/4cec13dd4f83c397de47b834e26fe91eb62fc2b094a532b70f1c274db9e2/pyjig-1.0.11.zip" } ], "1.0.12": [ { "comment_text": "", "digests": { "md5": "2062b6149e74db3e4f1facbeb9263795", "sha256": "2b2090e29237b3214a5111b46bec7c9ebc17886c0f87205d4353cd9ffbe9898c" }, "downloads": -1, "filename": "pyjig-1.0.12.zip", "has_sig": false, "md5_digest": "2062b6149e74db3e4f1facbeb9263795", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16114, "upload_time": "2015-11-18T13:13:08", "url": "https://files.pythonhosted.org/packages/8b/71/87ca28c3c19b3e8c0f9eeca242891c7b537d1ae1c12d98032d9e2ff1d4da/pyjig-1.0.12.zip" } ], "1.0.13": [ { "comment_text": "", "digests": { "md5": "dddff8dc0131540a7059720796f543da", "sha256": "a6631be8f53115d5ac7ad03b67ba072576fba9c539b7b1d241364ebd99c5485a" }, "downloads": -1, "filename": "pyjig-1.0.13.zip", "has_sig": false, "md5_digest": "dddff8dc0131540a7059720796f543da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19648, "upload_time": "2015-11-18T13:29:23", "url": "https://files.pythonhosted.org/packages/88/86/bb76510ec7a3128b48c3f552092ca52f9a953844f6121a8f9b95d84db356/pyjig-1.0.13.zip" } ], "1.0.14": [ { "comment_text": "", "digests": { "md5": "853876b0a2cca392769044d0c12bf1a1", "sha256": "a61b674f3313fcacdc7f4b040a5c5b5e56b629a39c1c4f6e0bd2ad70acc90e3d" }, "downloads": -1, "filename": "pyjig-1.0.14.zip", "has_sig": false, "md5_digest": "853876b0a2cca392769044d0c12bf1a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28266, "upload_time": "2015-12-27T19:11:33", "url": "https://files.pythonhosted.org/packages/ed/02/9aa77e9bd087ac0f6855debdd9b0b8b350ee230330d4df7643a5382d915e/pyjig-1.0.14.zip" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "4e665e274afc2e6242c7d6a1395c82a0", "sha256": "24a15a524735125fca51d2ec0c2e50186d5ab601aceb949ad23084dbf8279e94" }, "downloads": -1, "filename": "pyjig-1.0.8.zip", "has_sig": false, "md5_digest": "4e665e274afc2e6242c7d6a1395c82a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10043, "upload_time": "2015-11-17T23:12:46", "url": "https://files.pythonhosted.org/packages/f8/e4/9969afff8cab349d14000acacee8c83d18b8ac79c217aa110212b0d85090/pyjig-1.0.8.zip" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "68a053eae11e9c1e0513c6954830b217", "sha256": "26aadd294eb33ec5a4c9d4979e599996f35e8140e6a8aec31daf0eee1c86e069" }, "downloads": -1, "filename": "pyjig-1.0.9.zip", "has_sig": false, "md5_digest": "68a053eae11e9c1e0513c6954830b217", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16232, "upload_time": "2015-11-18T10:20:24", "url": "https://files.pythonhosted.org/packages/d1/04/9d53ce01d1b2f8680df11b68efdff6b5888d48d22e32f8bc3d470767e613/pyjig-1.0.9.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "853876b0a2cca392769044d0c12bf1a1", "sha256": "a61b674f3313fcacdc7f4b040a5c5b5e56b629a39c1c4f6e0bd2ad70acc90e3d" }, "downloads": -1, "filename": "pyjig-1.0.14.zip", "has_sig": false, "md5_digest": "853876b0a2cca392769044d0c12bf1a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 28266, "upload_time": "2015-12-27T19:11:33", "url": "https://files.pythonhosted.org/packages/ed/02/9aa77e9bd087ac0f6855debdd9b0b8b350ee230330d4df7643a5382d915e/pyjig-1.0.14.zip" } ] }