Metadata-Version: 2.1
Name: bad-setuptools-git-version
Version: 1.0.9
Summary: Automatically set package version using git tags.
Home-page: https://github.com/st7105/bad-setuptools-git-version
Author: st7105
Author-email: st7105@gmail.com
License: MIT
Keywords: setuptools git version-control
Platform: UNKNOWN
Classifier: Framework :: Setuptools Plugin
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 3
Classifier: Development Status :: 5 - Production/Stable
Description-Content-Type: text/markdown
Requires-Dist: setuptools (>=8.0)

# bad-setuptools-git-version

[![PackageVersion][pypi-version]][pypi-home]
[![PythonVersion][python-version]][python-home]
[![Stable][pypi-status]][pypi-home]
[![Format][pypi-format]][pypi-home]
[![License][pypi-license]](LICENSE)

[pypi-version]: https://badge.fury.io/py/bad-setuptools-git-version.svg
[pypi-license]: https://img.shields.io/pypi/l/bad-setuptools-git-version.svg
[pypi-status]: https://img.shields.io/pypi/status/bad-setuptools-git-version.svg
[pypi-format]: https://img.shields.io/pypi/format/bad-setuptools-git-version.svg
[pypi-home]: https://badge.fury.io/py/bad-setuptools-git-version
[python-version]: https://img.shields.io/pypi/pyversions/bad-setuptools-git-version.svg
[python-home]: https://python.org

Automatically set package version from Git. This is a re-release of
[bad-setuptools-git-version][] with fixes and improvements, which is itself a re-release of [setuptools-git-version][]

[setuptools-git-version]: https://github.com/pyfidelity/setuptools-git-version


## Introduction

Instead of hard-coding the package version in ``setup.py`` like:

```python
setup(
    name='foobar',
    version='1.0.0',
    ...
)
```

this package allows to extract it from tags in the underlying Git repository:

```python
setup(
    name='foobar',
    version_config={
        "version_format": "{tag}.{cc}",
        "starting_version": "0.1.0"
    },
    setup_requires=['bad-setuptools-git-version'],
    ...
)
```

The tool uses the semantically-latest tag as the base version. If there are no annotated tags, the version specified by `starting_version` will be used. If `HEAD` is at the tag, the version will be the tag itself. If there are commits ahead of the tag, the first 8 characters of the sha of the `HEAD` commit will be included.


