1 darcsver - generate version numbers from darcs revision control history
2 =======================================================================
7 Create files containing version numbers, based upon the latest darcs
10 If your source tree is coming from darcs (i.e. it is in a darcs
11 repository), this tool will determine the most recent release tag,
12 count the patches that have been applied since then, and compute a
13 version number to be written into _version.py (and optionally other
14 version files). This version number will be available by doing:
16 from your_package_name import __version__
18 Source trees that do not come from darcs (e.g. release tarballs, nightly
19 tarballs) and are not within a darcs repository should instead, come with a
20 _version.py that was generated before the tarball was produced. In this case,
21 this tool will quietly exit without modifying the existing _version.py .
23 'release tags' are tags in the source repository that match the following
26 ^your_package_name-(\d+)(\.(\d+)(\.(\d+))?)?((a|b|c|rc)(\d+))?
36 Alternative manual installation:
38 tar -zxvf darcsver-X.Y.Z.tar.gz
40 python setup.py install
42 Where X.Y.Z is a version number.
44 Alternative to make a specific package use darcsver without installing
45 darcsver into the system:
47 Put "setup_requires=['darcsver']" in the call to setup() in the
48 package's setup.py file.
54 There are two ways to use this: the command-line tool and the
57 To use the command-line tool, execute it as:
59 darcsver $PACKAGE_NAME $PATH_TO_VERSION_PY
62 To use the setuptools plugin (which enables you to write "./setup.py
63 darcsver" and which cleverly figures out where the _version.py file
64 ought to go), you must first package your python module with
65 `setup.py` and use setuptools.
67 The former is well documented in the distutils manual:
69 http://docs.python.org/dist/dist.html
71 To use setuptools instead of distutils, just edit `setup.py` and
74 from distutils.core import setup
78 from setuptools import setup
84 How to distribute Python modules with Distutils:
86 http://docs.python.org/dist/dist.html
89 Setuptools complete manual:
91 http://peak.telecommunity.com/DevCenter/setuptools
94 Thanks to Yannick Gingras for providing the prototype for this