Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

obsoleted by setuptools_scm

Project Description

Warning

this module is superseeded by setuptools_scm

This module is a simple drop-in to support setup.py in mercurial and git based projects.

Alternatively it can be a setup time requirement.

It extracts the last Tag as well as the distance to it in commits from the scm, and uses these to calculate a version number

By default, it will increment the last component of the Version by one and append .dev{distance} in case the last component is .dev, the version will be unchanged

Tis requires always using all components in tags (i.e. 2.0.0 instead of 2.0) to avoid misstakenly releasing higher version (i.e. 2.1.devX instead of 2.0.1.devX)

It uses 4 strategies to archive its task:

  1. try to directly ask hg for the tag/distance
  2. try to infer it from the .hg_archival.txt file
  3. try to read the exact version the cache file if it exists
  4. try to read the exact version from the ‘PKG-INFO’ file as generated by setup.py sdists (this is a nasty abuse)

The most simple usage is:

from setuptools import setup
from hgdistver import get_version
setup(
    ...,
    version=get_version(),
    ...,
)

get_version takes the optional argument cachefile, which causes it to store the version info in a python script instead of abusing PKG-INFO from a sdist.

The setup requirement usage is:

from setuptools import setup
setup(
    ...,
    get_version_from_hg=True,
    setup_requires=['hgdistver'],
    ...,
)

The requirement uses the setup argument cache_hg_version_to instead of cachefile.

Release History

Release History

This version
History Node

0.25

History Node

0.24

History Node

0.23

History Node

0.22

History Node

0.21

History Node

0.20

History Node

0.19

History Node

0.18

History Node

0.17

History Node

0.16

History Node

0.15

History Node

0.14

History Node

0.13

History Node

0.12

History Node

0.11

History Node

0.10

History Node

0.9

History Node

0.8

History Node

0.7

History Node

0.6

History Node

0.5

History Node

0.4

History Node

0.3

History Node

0.2

History Node

0.1

History Node

0.8.dev1-3c3e5fc8d549

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
hgdistver-0.25-py2.py3-none-any.whl (7.4 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Feb 14, 2015
hgdistver-0.25.tar.gz (9.9 kB) Copy SHA256 Checksum SHA256 Source Feb 14, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting