Metadata-Version: 2.2
Name: pygitversion
Version: 1.0.1
Summary: A set of plugins for setuptools_scm to enable better version tracking
Home-page: https://github.com/RadioAstronomySoftwareGroup/pygitversion
Author: Radio Astronomy Software Group
Author-email: steven.g.murray@asu.edu
License: MIT
Project-URL: Documentation, https://pygitversion.readthedocs.io/
Project-URL: Changelog, https://pygitversion.readthedocs.io/en/latest/changelog.html
Project-URL: Issue Tracker, https://github.com/RadioAstronomySoftwareGroup/pygitversion/issues
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Utilities
Requires-Python: >=3.5
License-File: LICENSE
License-File: AUTHORS.rst
Requires-Dist: setuptools_scm
Provides-Extra: dev
Requires-Dist: pre-commit; extra == "dev"
Requires-Dist: tox; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: license
Dynamic: project-url
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

============
pygitversion
============

**A set of plugins for setuptools_scm to enable better version tracking**



Installation
============

::

    pip install pygitversion

Usage
=====
The usage is almost exactly the same as using `setuptools_scm <https://pypi.org/project/setuptools-scm/>`_,
so follow those guidelines. This package merely adds a couple of plugin functions to make the
versioning a bit better (eg. having the branch name in the version if applicable).

To summarise: create a ``pyproject.toml`` and include (at least) the following lines::

    # pyproject.toml
    [build-system]
    requires = ["setuptools>=30.3.0", "wheel", "setuptools_scm", "pygitversion"]

Then in your ``setup.py``, add the following to the call to ``setup()``::

    # setup.py
    from setuptools import setup
    from pygitversion import branch_scheme

    setup(
        ...
        use_scm_version={
            "local_scheme": branch_scheme
        },
    )

You can now print the version of the package simply by doing::

    $ python setup.py --version

To set the version of your code, make your ``__init__.py`` have the following::

    from pkg_resources import get_distribution, DistributionNotFound
    try:
        __version__ = get_distribution(__name__).version
    except DistributionNotFound:
        # package is not installed
        pass

And that's it!


Development
===========

To run the all tests run::

    tox



Changelog
=========

1.0.0
----------

* Move to setuptools_scm

0.1.0 (2019-09-04)
------------------

* First release on PyPI.
