# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['dunamai']

package_data = \
{'': ['*']}

install_requires = \
['packaging>=20.9']

extras_require = \
{':python_version < "3.8"': ['importlib-metadata>=2.1.1']}

entry_points = \
{'console_scripts': ['dunamai = dunamai.__main__:main']}

setup_kwargs = {
    'name': 'dunamai',
    'version': '1.7.0',
    'description': 'Dynamic version generation',
    'long_description': '\n# Dunamai\n[![Version](https://img.shields.io/pypi/v/dunamai)](https://pypi.org/project/dunamai)\n[![License: MIT](https://img.shields.io/badge/license-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nDunamai is a Python 3.5+ library and command line tool for producing dynamic,\nstandards-compliant version strings, derived from tags in your version\ncontrol system. This facilitates uniquely identifying nightly or per-commit\nbuilds in continuous integration and releasing new versions of your software\nsimply by creating a tag.\n\nDunamai is also available as a [GitHub Action](https://github.com/marketplace/actions/run-dunamai).\n\n## Features\n* Version control system support:\n  * [Git](https://git-scm.com) (minimum version: 2.7.0)\n  * [Mercurial](https://www.mercurial-scm.org)\n  * [Darcs](http://darcs.net)\n  * [Subversion](https://subversion.apache.org)\n  * [Bazaar](https://bazaar.canonical.com/en)\n  * [Fossil](https://www.fossil-scm.org/home/doc/trunk/www/index.wiki)\n* Version styles:\n  * [PEP 440](https://www.python.org/dev/peps/pep-0440)\n  * [Semantic Versioning](https://semver.org)\n  * [Haskell Package Versioning Policy](https://pvp.haskell.org)\n  * Custom output formats\n* Can be used for projects written in any programming language.\n  For Python, this means you do not need a setup.py.\n\n## Usage\nInstall with `pip install dunamai`, and then use as either a CLI:\n\n```console\n# Suppose you are on commit g29045e8, 7 commits after the v0.2.0 tag.\n# Note that the "v" prefix on the tag is required, unless you specify\n# a different tag style using "--pattern".\n\n# Auto-detect the version control system and generate a version:\n$ dunamai from any\n0.2.0.post7.dev0+g29045e8\n\n# Or use an explicit VCS and style:\n$ dunamai from git --no-metadata --style semver\n0.2.0-post.7\n\n# Custom formats:\n$ dunamai from any --format "v{base}+{distance}.{commit}"\nv0.2.0+7.g29045e8\n\n# If you\'d prefer to frame the version in terms of progress toward the next\n# release rather than distance from the latest one, you can bump it:\n$ dunamai from any --bump\n0.2.1.dev7+g29045e8\n\n# Validation of custom formats:\n$ dunamai from any --format "v{base}" --style pep440\nVersion \'v0.2.0\' does not conform to the PEP 440 style\n\n# Validate your own freeform versions:\n$ dunamai check 0.01.0 --style semver\nVersion \'0.01.0\' does not conform to the Semantic Versioning style\n\n# More info:\n$ dunamai --help\n$ dunamai from --help\n$ dunamai from git --help\n```\n\nOr as a library:\n\n```python\nfrom dunamai import Version, Style\n\n# Let\'s say you\'re on commit g644252b, which is tagged as v0.1.0.\nversion = Version.from_git()\nassert version.serialize() == "0.1.0"\n\n# Let\'s say there was a v0.1.0rc5 tag 44 commits ago\n# and you have some uncommitted changes.\nversion = Version.from_any_vcs()\nassert version.serialize() == "0.1.0rc5.post44.dev0+g644252b"\nassert version.serialize(metadata=False) == "0.1.0rc5.post44.dev0"\nassert version.serialize(dirty=True) == "0.1.0rc5.post44.dev0+g644252b.dirty"\nassert version.serialize(style=Style.SemVer) == "0.1.0-rc.5.post.44+g644252b"\n```\n\nThe `serialize()` method gives you an opinionated, PEP 440-compliant default\nthat ensures that versions for untagged commits are compatible with Pip\'s\n`--pre` flag. The individual parts of the version are also available for you\nto use and inspect as you please:\n\n```python\nassert version.base == "0.1.0"\nassert version.stage == "rc"\nassert version.revision == 5\nassert version.distance == 44\nassert version.commit == "g644252b"\nassert version.dirty is True\n\n# Available if the latest tag includes metadata, like v0.1.0+linux:\nassert version.tagged_metadata == "linux"\n```\n\n## Comparison to Versioneer\n[Versioneer](https://github.com/warner/python-versioneer) is another great\nlibrary for dynamic versions, but there are some design decisions that\nprompted the creation of Dunamai as an alternative:\n\n* Versioneer requires a setup.py file to exist, or else `versioneer install`\n  will fail, rendering it incompatible with non-setuptools-based projects\n  such as those using Poetry or Flit. Dunamai can be used regardless of the\n  project\'s build system.\n* Versioneer has a CLI that generates Python code which needs to be committed\n  into your repository, whereas Dunamai is just a normal importable library\n  with an optional CLI to help statically include your version string.\n* Versioneer produces the version as an opaque string, whereas Dunamai provides\n  a Version class with discrete parts that can then be inspected and serialized\n  separately.\n* Versioneer provides customizability through a config file, whereas Dunamai\n  aims to offer customizability through its library API and CLI for both\n  scripting support and use in other libraries.\n\n## Integration\n* Setting a `__version__` statically:\n\n  ```console\n  $ echo "__version__ = \'$(dunamai from any)\'" > your_library/_version.py\n  ```\n  ```python\n  # your_library/__init__.py\n  from your_library._version import __version__\n  ```\n\n  Or dynamically (but Dunamai becomes a runtime dependency):\n\n  ```python\n  # your_library/__init__.py\n  import dunamai as _dunamai\n  __version__ = _dunamai.get_version("your-library", third_choice=_dunamai.Version.from_any_vcs).serialize()\n  ```\n\n* setup.py (no install-time dependency on Dunamai as long as you use wheels):\n\n  ```python\n  from setuptools import setup\n  from dunamai import Version\n\n  setup(\n      name="your-library",\n      version=Version.from_any_vcs().serialize(),\n  )\n  ```\n\n  Or you could use a static inclusion approach as in the prior example.\n\n* [Poetry](https://poetry.eustace.io):\n\n  ```console\n  $ poetry version $(dunamai from any)\n  ```\n\n  Or you can use the [poetry-dynamic-versioning](https://github.com/mtkennerly/poetry-dynamic-versioning) plugin.\n\n## Other notes\n* When using Git, the initial commit must **not** be both tagged and empty\n  (i.e., created with `--allow-empty`). This is related to a reporting issue\n  in Git. For more info, [click here](https://github.com/mtkennerly/dunamai/issues/14).\n\n## Development\nThis project is managed using [Poetry](https://poetry.eustace.io).\nDevelopment requires Python 3.6+ because of [Black](https://github.com/ambv/black).\n\n* If you want to take advantage of the default VSCode integration, then first\n  configure Poetry to make its virtual environment in the repository:\n  ```\n  poetry config settings.virtualenvs.in-project true\n  ```\n* After cloning the repository, activate the tooling:\n  ```\n  poetry install\n  poetry run pre-commit install\n  ```\n* Run unit tests:\n  ```\n  poetry run pytest --cov\n  poetry run tox\n  ```\n',
    'author': 'Matthew T. Kennerly',
    'author_email': 'mtkennerly@gmail.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/mtkennerly/dunamai',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'extras_require': extras_require,
    'entry_points': entry_points,
    'python_requires': '>=3.5,<4.0',
}


setup(**setup_kwargs)
