Metadata-Version: 2.2
Name: jaraco.vcs
Version: 2.4.0
Summary: Facilities for working with VCS repositories
Author-email: "Jason R. Coombs" <jaraco@jaraco.com>
Project-URL: Source, https://github.com/jaraco/jaraco.vcs
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Version Control
Requires-Python: >=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: packaging
Requires-Dist: jaraco.classes
Requires-Dist: more_itertools
Requires-Dist: jaraco.versioning
Requires-Dist: python-dateutil
Requires-Dist: tempora
Requires-Dist: jaraco.path
Provides-Extra: test
Requires-Dist: pytest!=8.1.1,>=6; extra == "test"
Requires-Dist: pytest-checkdocs>=2.4; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-mypy; extra == "test"
Requires-Dist: pytest-enabler>=2.2; extra == "test"
Requires-Dist: pytest-ruff>=0.2.1; sys_platform != "cygwin" and extra == "test"
Requires-Dist: pygments; extra == "test"
Requires-Dist: types-python-dateutil; extra == "test"
Requires-Dist: pytest-home; extra == "test"
Provides-Extra: doc
Requires-Dist: sphinx>=3.5; extra == "doc"
Requires-Dist: jaraco.packaging>=9.3; extra == "doc"
Requires-Dist: rst.linker>=1.9; extra == "doc"
Requires-Dist: furo; extra == "doc"
Requires-Dist: sphinx-lint; extra == "doc"

.. image:: https://img.shields.io/pypi/v/jaraco.vcs.svg
   :target: https://pypi.org/project/jaraco.vcs

.. image:: https://img.shields.io/pypi/pyversions/jaraco.vcs.svg

.. image:: https://github.com/jaraco/jaraco.vcs/actions/workflows/main.yml/badge.svg
   :target: https://github.com/jaraco/jaraco.vcs/actions?query=workflow%3A%22tests%22
   :alt: tests

.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
    :target: https://github.com/astral-sh/ruff
    :alt: Ruff

.. .. image:: https://readthedocs.org/projects/PROJECT_RTD/badge/?version=latest
..    :target: https://PROJECT_RTD.readthedocs.io/en/latest/?badge=latest

.. image:: https://img.shields.io/badge/skeleton-2024-informational
   :target: https://blog.jaraco.com/skeleton

Usage
=====

jaraco.vcs
provides classes for inspecting and working with repositories in the
Mercurial and Git version control systems (VCS).

The classes provided are designed to use subprocess invocation to
leverage the command-line interfaces of the VCS tools ``hg`` and ``git``. An
in-process Repo for Mercurial exists but has been disabled due to
issues that arise when run in certain environments (namely setuptools
sandboxing).

Auto Version Numbering
----------------------

This project adds support for automatically generating
project version numbers from a source code repository under
development.

To use this feature, the project must follow the following assumptions:

- Repo tags are used to indicate released versions.
- Tag names are specified as the version only (i.e. 0.1 or v0.1 and
  not release-0.1)
- Released versions currently must conform to the Version in
  `packaging <https://pypi.org/project/packaging>`_. Any tags
  that don't match this scheme will be ignored.

Thereafter, use the Repo.get_current_version to
determine the version of the local code. If the current revision is tagged
with a valid version, that version will be used. Otherwise, the tags in
the repo will be searched, the latest release will be found, and the
function will infer the upcoming release version.

For example, if the repo contains the tags 0.1, 0.2, and 0.3 and the
repo is not on any of those tags, get_current_version will return
'0.3.1dev' and get_current_version(increment='0.1') will return
'0.4dev'.

Example::

    >>> import jaraco.vcs
    >>> jaraco.vcs.repo().get_current_version()
    '9.0.1.dev0'
