Skip to content

Commit

Permalink
Prepare final release of hgtools.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jun 20, 2023
1 parent 419d285 commit ac3f08d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 68 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v10.1.0
=======

* Final release of ``hgtools`` redirecting users to
`jaraco.vcs <https://pypi.org/project/jaraco.vcs>`_.

v10.0.0
=======

Expand Down
69 changes: 1 addition & 68 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,68 +1 @@
.. image:: https://img.shields.io/pypi/v/hgtools.svg
:target: https://pypi.org/project/hgtools

.. image:: https://img.shields.io/pypi/pyversions/hgtools.svg

.. image:: https://github.com/jaraco/hgtools/workflows/tests/badge.svg
:target: https://github.com/jaraco/hgtools/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://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: Code style: Black

.. .. 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-2023-informational
:target: https://blog.jaraco.com/skeleton

Usage
=====

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

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

Auto Version Numbering
**********************

With the 0.4 release, hgtools adds support for automatically generating
project version numbers from the repository in which the
project is developed.

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 RepoManager.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 hgtools
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::

>>> from hgtools.managers import RepoManager
>>> RepoManager().get_first_valid_manager().get_current_version()
'9.0.1.dev0'
``hgtools`` is defunct, superseded by `jaraco.vcs <https://pypi.org/project/jaraco.vcs>`_.

0 comments on commit ac3f08d

Please sign in to comment.