setuptools-git-versioning


Namesetuptools-git-versioning JSON
Version 2.0.0 PyPI version JSON
download
home_pagehttps://setuptools-git-versioning.readthedocs.io
SummaryUse git repo data for building a version number according PEP-440
upload_time2024-04-08 20:15:34
maintainerNone
docs_urlNone
authordolfinus
requires_python>=3.7
licenseMIT
keywords setuptools git versioning pep-440
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            *************************
setuptools-git-versioning
*************************

|status| |PyPI| |PyPI License| |PyPI Python Version|
|ReadTheDocs| |Build| |Coverage| |pre-commit.ci|

.. |status| image:: https://www.repostatus.org/badges/latest/active.svg
    :alt: Project Status: Active – The project has reached a stable, usable state and is being actively developed.
    :target: https://www.repostatus.org/#active
.. |PyPI| image:: https://badge.fury.io/py/setuptools-git-versioning.svg
    :target: https://badge.fury.io/py/setuptools-git-versioning
.. |PyPI License| image:: https://img.shields.io/pypi/l/setuptools-git-versioning.svg
    :target: https://github.com/dolfinus/setuptools-git-versioning/blob/master/LICENSE
.. |PyPI Python Version| image:: https://img.shields.io/pypi/pyversions/setuptools-git-versioning.svg
    :target: https://badge.fury.io/py/setuptools-git-versioning
.. |ReadTheDocs| image:: https://img.shields.io/readthedocs/setuptools-git-versioning.svg
    :target: https://setuptools-git-versioning.readthedocs.io
.. |Build| image:: https://github.com/dolfinus/setuptools-git-versioning/workflows/Tests/badge.svg
    :target: https://github.com/dolfinus/setuptools-git-versioning/actions
.. |Coverage| image:: https://codecov.io/gh/dolfinus/setuptools-git-versioning/branch/master/graph/badge.svg?token=GIMVHUTNW4
    :target: https://codecov.io/gh/dolfinus/setuptools-git-versioning
.. |pre-commit.ci| image:: https://results.pre-commit.ci/badge/github/dolfinus/setuptools-git-versioning/master.svg
    :target: https://results.pre-commit.ci/latest/github/dolfinus/setuptools-git-versioning/master

Use git repo data (latest tag, current commit hash, etc) for building a
version number according :pep:`440`.

**Features:**

- Can be installed & configured through both ``setup.py`` and :pep:`518`'s ``pyproject.toml``

- Does not require to change source code of the project

- Tag-, file-, and callback-based versioning schemas are supported

- Templates for *tag*, *dev* and *dirty* versions are separated

- Templates support a lot of substitutions including git and environment information

- Well-documented

See `comparison <https://setuptools-git-versioning.readthedocs.io/en/stable/comparison.html>`_
between ``setuptools-git-versioning`` and other tools.

**Limitations:**

- Currently the only supported VCS is *Git*

- Only Git v2 is supported

- Only Setuptools build backend is supported (no Poetry & others)

- Currently does not support automatic exporting of package version to a file for runtime use
  (but you can use ``setuptools-git-versioning > file`` redirect instead)

.. documentation

Documentation
--------------

See https://setuptools-git-versioning.readthedocs.io/en/stable/

.. contribution

Contribution Guide
------------------

See ./CONTRIBUTING.rst

.. installation

Install
------------

``pyproject.toml``
~~~~~~~~~~~~~~~~~~

Just add ``setuptools-git-versioning`` to ``build-sytem`` section of your ``pyproject.toml``,
add a section ``tool.setuptools-git-versioning`` with config options, and mark the project
``version`` as dynamic.

.. code:: toml

    [build-system]
    requires = [ "setuptools>=41", "wheel", "setuptools-git-versioning>=2.0,<3", ]
    build-backend = "setuptools.build_meta"

    [tool.setuptools-git-versioning]
    enabled = true

    [project]
    dynamic = ["version"]

And check the package version generated (see `command help <https://setuptools-git-versioning.readthedocs.io/en/stable/command.html>`_):

.. code:: bash

    $ python -m setuptools_git_versioning
    0.0.1

    # or

    $ setuptools-git-versioning
    0.0.1

``setup.py``
~~~~~~~~~~~~

Just add ``setuptools-git-versioning`` to ``setup_requires`` argument of ``setuptools.setup`` function call,
and then add new argument ``setuptools_git_versioning`` with config options:

.. code:: python

    import setuptools

    setuptools.setup(
        ...,
        setuptools_git_versioning={
            "enabled": True,
        },
        setup_requires=["setuptools-git-versioning>=2.0,<3"],
    )

And check the package version generated (see `command help <https://setuptools-git-versioning.readthedocs.io/en/stable/command.html>`_):

.. code:: bash

    $ python setup.py --version
    0.0.1

    # or

    $ python -m setuptools_git_versioning
    0.0.1

    # or

    $ setuptools-git-versioning
    0.0.1

            

Raw data

            {
    "_id": null,
    "home_page": "https://setuptools-git-versioning.readthedocs.io",
    "name": "setuptools-git-versioning",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "setuptools, git, versioning, pep-440",
    "author": "dolfinus",
    "author_email": "martinov.m.s.8@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a7/8f/46209c8d318017b3ebd9099dd6e3b7f59e9d89b11a1ccf00cd18f98cf4d7/setuptools-git-versioning-2.0.0.tar.gz",
    "platform": null,
    "description": "*************************\nsetuptools-git-versioning\n*************************\n\n|status| |PyPI| |PyPI License| |PyPI Python Version|\n|ReadTheDocs| |Build| |Coverage| |pre-commit.ci|\n\n.. |status| image:: https://www.repostatus.org/badges/latest/active.svg\n    :alt: Project Status: Active \u2013 The project has reached a stable, usable state and is being actively developed.\n    :target: https://www.repostatus.org/#active\n.. |PyPI| image:: https://badge.fury.io/py/setuptools-git-versioning.svg\n    :target: https://badge.fury.io/py/setuptools-git-versioning\n.. |PyPI License| image:: https://img.shields.io/pypi/l/setuptools-git-versioning.svg\n    :target: https://github.com/dolfinus/setuptools-git-versioning/blob/master/LICENSE\n.. |PyPI Python Version| image:: https://img.shields.io/pypi/pyversions/setuptools-git-versioning.svg\n    :target: https://badge.fury.io/py/setuptools-git-versioning\n.. |ReadTheDocs| image:: https://img.shields.io/readthedocs/setuptools-git-versioning.svg\n    :target: https://setuptools-git-versioning.readthedocs.io\n.. |Build| image:: https://github.com/dolfinus/setuptools-git-versioning/workflows/Tests/badge.svg\n    :target: https://github.com/dolfinus/setuptools-git-versioning/actions\n.. |Coverage| image:: https://codecov.io/gh/dolfinus/setuptools-git-versioning/branch/master/graph/badge.svg?token=GIMVHUTNW4\n    :target: https://codecov.io/gh/dolfinus/setuptools-git-versioning\n.. |pre-commit.ci| image:: https://results.pre-commit.ci/badge/github/dolfinus/setuptools-git-versioning/master.svg\n    :target: https://results.pre-commit.ci/latest/github/dolfinus/setuptools-git-versioning/master\n\nUse git repo data (latest tag, current commit hash, etc) for building a\nversion number according :pep:`440`.\n\n**Features:**\n\n- Can be installed & configured through both ``setup.py`` and :pep:`518`'s ``pyproject.toml``\n\n- Does not require to change source code of the project\n\n- Tag-, file-, and callback-based versioning schemas are supported\n\n- Templates for *tag*, *dev* and *dirty* versions are separated\n\n- Templates support a lot of substitutions including git and environment information\n\n- Well-documented\n\nSee `comparison <https://setuptools-git-versioning.readthedocs.io/en/stable/comparison.html>`_\nbetween ``setuptools-git-versioning`` and other tools.\n\n**Limitations:**\n\n- Currently the only supported VCS is *Git*\n\n- Only Git v2 is supported\n\n- Only Setuptools build backend is supported (no Poetry & others)\n\n- Currently does not support automatic exporting of package version to a file for runtime use\n  (but you can use ``setuptools-git-versioning > file`` redirect instead)\n\n.. documentation\n\nDocumentation\n--------------\n\nSee https://setuptools-git-versioning.readthedocs.io/en/stable/\n\n.. contribution\n\nContribution Guide\n------------------\n\nSee ./CONTRIBUTING.rst\n\n.. installation\n\nInstall\n------------\n\n``pyproject.toml``\n~~~~~~~~~~~~~~~~~~\n\nJust add ``setuptools-git-versioning`` to ``build-sytem`` section of your ``pyproject.toml``,\nadd a section ``tool.setuptools-git-versioning`` with config options, and mark the project\n``version`` as dynamic.\n\n.. code:: toml\n\n    [build-system]\n    requires = [ \"setuptools>=41\", \"wheel\", \"setuptools-git-versioning>=2.0,<3\", ]\n    build-backend = \"setuptools.build_meta\"\n\n    [tool.setuptools-git-versioning]\n    enabled = true\n\n    [project]\n    dynamic = [\"version\"]\n\nAnd check the package version generated (see `command help <https://setuptools-git-versioning.readthedocs.io/en/stable/command.html>`_):\n\n.. code:: bash\n\n    $ python -m setuptools_git_versioning\n    0.0.1\n\n    # or\n\n    $ setuptools-git-versioning\n    0.0.1\n\n``setup.py``\n~~~~~~~~~~~~\n\nJust add ``setuptools-git-versioning`` to ``setup_requires`` argument of ``setuptools.setup`` function call,\nand then add new argument ``setuptools_git_versioning`` with config options:\n\n.. code:: python\n\n    import setuptools\n\n    setuptools.setup(\n        ...,\n        setuptools_git_versioning={\n            \"enabled\": True,\n        },\n        setup_requires=[\"setuptools-git-versioning>=2.0,<3\"],\n    )\n\nAnd check the package version generated (see `command help <https://setuptools-git-versioning.readthedocs.io/en/stable/command.html>`_):\n\n.. code:: bash\n\n    $ python setup.py --version\n    0.0.1\n\n    # or\n\n    $ python -m setuptools_git_versioning\n    0.0.1\n\n    # or\n\n    $ setuptools-git-versioning\n    0.0.1\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Use git repo data for building a version number according PEP-440",
    "version": "2.0.0",
    "project_urls": {
        "CI/CD": "https://github.com/dolfinus/setuptools-git-versioning/actions",
        "Coverage": "https://app.codecov.io/gh/dolfinus/setuptools-git-versioning",
        "Documentation": "https://setuptools-git-versioning.readthedocs.io",
        "Homepage": "https://setuptools-git-versioning.readthedocs.io",
        "Source": "https://github.com/dolfinus/setuptools-git-versioning",
        "Tracker": "https://github.com/dolfinus/setuptools-git-versioning/issues"
    },
    "split_keywords": [
        "setuptools",
        " git",
        " versioning",
        " pep-440"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2d1537202ca349df8056d67c29a7b4bf27daae22dcb5ce7d7e21f4db1f2b6f34",
                "md5": "bbf904e42f90fcea15315778bf4d6cd8",
                "sha256": "72d6e473fc4e86f8563ce411e6c9057766c99aa40b84c862276b48f387eb8e93"
            },
            "downloads": -1,
            "filename": "setuptools_git_versioning-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bbf904e42f90fcea15315778bf4d6cd8",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10627,
            "upload_time": "2024-04-08T20:15:18",
            "upload_time_iso_8601": "2024-04-08T20:15:18.650018Z",
            "url": "https://files.pythonhosted.org/packages/2d/15/37202ca349df8056d67c29a7b4bf27daae22dcb5ce7d7e21f4db1f2b6f34/setuptools_git_versioning-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a78f46209c8d318017b3ebd9099dd6e3b7f59e9d89b11a1ccf00cd18f98cf4d7",
                "md5": "9b8bbc38938f700595c2b00fae73637f",
                "sha256": "85b5fbe7bda8e9c24bbd9e587a9d4b91129417f4dd3e11e3c0d5f3f835fc4d4d"
            },
            "downloads": -1,
            "filename": "setuptools-git-versioning-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9b8bbc38938f700595c2b00fae73637f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10608,
            "upload_time": "2024-04-08T20:15:34",
            "upload_time_iso_8601": "2024-04-08T20:15:34.951577Z",
            "url": "https://files.pythonhosted.org/packages/a7/8f/46209c8d318017b3ebd9099dd6e3b7f59e9d89b11a1ccf00cd18f98cf4d7/setuptools-git-versioning-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-08 20:15:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dolfinus",
    "github_project": "setuptools-git-versioning",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "setuptools-git-versioning"
}
        
Elapsed time: 1.78834s