{ "info": { "author": "Dave Shawley", "author_email": "daveshawley@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Setuptools Plugin", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "gitversion Setuptools Extension\n===============================\n\n|Version| |Downloads| |Status| |License| |Docs|\n\nWait... Why? What??\n-------------------\n`PEP440`_ codifies a version scheme for Python packages. This `setuptools`_\nextension will generate `Developmental Release`_ and `Local Version Label`_\nsegments that identify the revision that is being built. `PEP440`_ defines\nthe following format for Python package versions::\n\n version = [epoch \"!\"] public-version [\"+\" local-version]\n epoch = digit+\n public-version = release-segment [pre-segment] [post-segment] [dev-segment]\n local-version = (letter | digit)+ [\".\" (letter|digit)+]\n release-segment = digit+ (\".\" digit+)*\n pre-segment = \"a\" digit+ | \"b\" digit+ | \"rc\" digit+\n post-segment = \".post\" digit+\n dev-segment = \".dev\" digit+\n\nIt also recommends that package indecies only accept *final releases* which\nare defined as having a version that consists of only a release segment and\nan optional epoch. So why did I go through all of the trouble to create an\nextension for managing versions that should not be submitted to a package\nindex? If you develop Python packages that are used inside the walls of a\nbusiness, then you probably know exactly why -- using a local Python Package\nIndex that holds non-public packages is commonplace. It is also common to\nstage pre-release packages and builds from a CI server in an internal index.\nThis is where this extension comes into play. It provides a consistent way\nto manage package versions throughout all stages of development.\n\nLet's look at the state of this project as I am writing this document. The\ngit history looks like the following::\n\n * 3fdc192 - (HEAD, origin/initial-implementation, initial-implementation)\n ###### 9 more commits here\n * 7ca1fd2 - (origin/master, master)\n * 87d944e - Merge pull request #1 from dave-shawley/reorg (6 days ago)\n |\\\n | * 04d0cca - (origin/reorg, reorg)\n | ###### 9 more commits here\n |/\n * bd7ad3c - (tag: 0.0.0) SYN (4 months ago)\n\nWhen I run **setup.py git_version** it sets the version to ``0.0.0.post1.dev11``.\nThe ``0.0.0`` portion is the release segment that is passed to the ``setup``\nfunction in *setup.py*. The extension finds that tag in the history and\ncounts the number of merges that have occurred since that tag -- this value\nbecomes the *post* version segment. In this case there has only been a single\nmerge. Then it counts the number of commits since the last merge occurred --\nthis value becomes the *development* version segment.\n\nHow?\n----\nThe easiest way to use this extension is to install it into your build\nenvironment and then use it from the command line when you generate and upload\nyour distribution.\n\n1. ``pip install setupext-gitversion`` into your build environment\n2. Add the following lines to your *setup.cfg*:\n\n.. code-block:: ini\n\n [git_version]\n version-file = LOCAL-VERSION\n\n3. Add the following line to your *MANIFEST.in*::\n\n include LOCAL-VERSION\n\n4. Modify your *setup.py* to append the contents of *LOCAL-VERSION*\n to your ``version`` keyword:\n\n .. code-block:: python\n\n version_suffix = ''\n try:\n with open('LOCAL-VERSION') as f:\n version_suffix = f.readline().strip()\n except IOError:\n pass\n\n setup(\n # normal keywords\n version='1.2.3' + version_suffix,\n )\n\n Where ``1.2.3`` is the tag of the last release package.\n\n5. Add ``git_version`` to your *upload* or distribution generation\n command. You want to use something like the following::\n\n setup.py git_version sdist upload\n setup.py git_version bdist_egg upload\n\nAnd that's it. That will embed SCM information into your package when\nyour build a distribution. It is also smart enough to generate an empty\nsuffix for a build from a tagged commit.\n\nOk... Where?\n------------\n+---------------+--------------------------------------------------------------+\n| Source | https://github.com/dave-shawley/setupext-gitversion |\n+---------------+--------------------------------------------------------------+\n| Status | https://travis-ci.org/dave-shawley/setupext-gitversion |\n+---------------+--------------------------------------------------------------+\n| Download | https://pypi.python.org/pypi/setupext-gitversion |\n+---------------+--------------------------------------------------------------+\n| Documentation | http://setupext-gitversion.readthedocs.org/en/latest |\n+---------------+--------------------------------------------------------------+\n| Issues | https://github.com/dave-shawley/setupext-gitversion |\n+---------------+--------------------------------------------------------------+\n\n.. _setuptools: https://pythonhosted.org/setuptools/\n.. _PEP440: https://www.python.org/dev/peps/pep-0440\n.. _Developmental Release: https://www.python.org/dev/peps/pep-0440/#local-version-identifiers\n.. _Local Version Label: https://www.python.org/dev/peps/pep-0440/#local-version-identifiers\n.. _pkg_resources: https://pythonhosted.org/setuptools/pkg_resources.html#getting-or-creating-distributions\n\n.. |Version| image:: https://pypip.in/version/setupext-gitversion/badge.svg\n :target: https://pypi.python.org/pypi/setupext-gitversion\n.. |Downloads| image:: https://pypip.in/download/setupext-gitversion/badge.svg\n :target: https://pypi.python.org/pypi/setupext-gitversion\n.. |Status| image:: https://travis-ci.org/dave-shawley/setupext-gitversion.svg\n :target: https://travis-ci.org/dave-shawley/setupext-gitversion\n.. |License| image:: https://pypip.in/license/setupext-gitversion/badge.svg\n :target: http://opensource.org/licenses/BSD-3-Clause\n.. |Docs| image:: https://readthedocs.org/projects/setupext-gitversion/badge/?version=latest\n :target: https://setupext-gitversion.readthedocs.org/", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/dave-shawley/setupext-gitversion", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "setupext-gitversion", "package_url": "https://pypi.org/project/setupext-gitversion/", "platform": "any", "project_url": "https://pypi.org/project/setupext-gitversion/", "project_urls": { "Homepage": "http://github.com/dave-shawley/setupext-gitversion" }, "release_url": "https://pypi.org/project/setupext-gitversion/1.1.1/", "requires_dist": [ "packaging (>=14.5)" ], "requires_python": "", "summary": "PEP-440 compliant versioning helper", "version": "1.1.1" }, "last_serial": 2811287, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "dbaecec3e383b7a58dc2bcc07a4129f5", "sha256": "56733d7cf005ee17983dbbcd92d9cc733a6a1d26f1cdb9f3c89f441293d57b02" }, "downloads": -1, "filename": "setupext_gitversion-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dbaecec3e383b7a58dc2bcc07a4129f5", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9025, "upload_time": "2015-01-03T17:41:57", "url": "https://files.pythonhosted.org/packages/0d/66/c4cdcd8b71851ebd801db20f97cb6f164caf4a896e5f7796ac266dd8e905/setupext_gitversion-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48c4ccfa5b40386067fa63163a52a1aa", "sha256": "feb42a4535cc1706733f8ea337a123c2e77414365cd0594660c6f1cf5437a919" }, "downloads": -1, "filename": "setupext-gitversion-1.0.1.tar.gz", "has_sig": false, "md5_digest": "48c4ccfa5b40386067fa63163a52a1aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7934, "upload_time": "2015-01-03T17:41:54", "url": "https://files.pythonhosted.org/packages/9f/0b/70986e853fc534dbd10ff5cd3cf191e675b9aa378bf436e6b8a39d2418e4/setupext-gitversion-1.0.1.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "4b0e76de8380d55649d7f4d6f7946bd0", "sha256": "14cfcc9d0d4cd610569c7a0b1218527da0c1f583e60f480a81a3bbfebc236b51" }, "downloads": -1, "filename": "setupext_gitversion-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4b0e76de8380d55649d7f4d6f7946bd0", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9135, "upload_time": "2015-01-07T02:28:58", "url": "https://files.pythonhosted.org/packages/c2/6e/82e225aee2ed40e81b17771d411e2257cedd0fe43eca31d0c3fbf0dc4d08/setupext_gitversion-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3ef5e10d14a0df68a97fbac5cf7e9d9c", "sha256": "0fc86c60599fdaa8d7e9f7d19c3ecd75de8b46e4121c25b9298ca90c08ec8900" }, "downloads": -1, "filename": "setupext-gitversion-1.1.0.tar.gz", "has_sig": false, "md5_digest": "3ef5e10d14a0df68a97fbac5cf7e9d9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8077, "upload_time": "2015-01-07T02:28:56", "url": "https://files.pythonhosted.org/packages/0a/55/f8ecc04e617cee0e3d80d4753410f8bf078de74f5da428ee2b51e6c1645b/setupext-gitversion-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "046f5c52bbb9993b03e66a5318d61595", "sha256": "ae51ccabf6cbe6cf0b8104a195af128b574622a2e47dd2a9bd0ce3cca5ac101b" }, "downloads": -1, "filename": "setupext_gitversion-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "046f5c52bbb9993b03e66a5318d61595", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9132, "upload_time": "2017-04-18T14:25:30", "url": "https://files.pythonhosted.org/packages/25/98/19adf5657f12e61778b67e58445251bc856b5d3ba69bb4d3600590636381/setupext_gitversion-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "641d46350d3de890bc68a1257a127dae", "sha256": "f8b25e1fa6adc0cb4682fd32d734ba4df0ef660d7b49bd88a1587882e2b45aa8" }, "downloads": -1, "filename": "setupext-gitversion-1.1.1.tar.gz", "has_sig": false, "md5_digest": "641d46350d3de890bc68a1257a127dae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11747, "upload_time": "2017-04-18T14:25:32", "url": "https://files.pythonhosted.org/packages/bf/07/a39d68aca8740b277733f99c452c274e2bffd1bb0d2f648ff5d71be54fa4/setupext-gitversion-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "046f5c52bbb9993b03e66a5318d61595", "sha256": "ae51ccabf6cbe6cf0b8104a195af128b574622a2e47dd2a9bd0ce3cca5ac101b" }, "downloads": -1, "filename": "setupext_gitversion-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "046f5c52bbb9993b03e66a5318d61595", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9132, "upload_time": "2017-04-18T14:25:30", "url": "https://files.pythonhosted.org/packages/25/98/19adf5657f12e61778b67e58445251bc856b5d3ba69bb4d3600590636381/setupext_gitversion-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "641d46350d3de890bc68a1257a127dae", "sha256": "f8b25e1fa6adc0cb4682fd32d734ba4df0ef660d7b49bd88a1587882e2b45aa8" }, "downloads": -1, "filename": "setupext-gitversion-1.1.1.tar.gz", "has_sig": false, "md5_digest": "641d46350d3de890bc68a1257a127dae", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11747, "upload_time": "2017-04-18T14:25:32", "url": "https://files.pythonhosted.org/packages/bf/07/a39d68aca8740b277733f99c452c274e2bffd1bb0d2f648ff5d71be54fa4/setupext-gitversion-1.1.1.tar.gz" } ] }