Skip to main content

Git and hg versioning for natcap projects

Project description

Consistent versioning for NatCap Projects

This package provides a consistent versioning scheme for projects of the Natural Capital Project (http://naturalcapitalproject.org).

Versioning Scheme

How a version string is formatted:

If we are at a tag:
    version = {tag}
else:
    version = {tag}.post{N}+r{nodeid|short}

Examples:

  • Version string = 3.4.5

    • Meaning: This version of this tool was built from the tag 3.4.5.

    • You can update to this revision by calling hg update -r 3.4.5

  • Version string = 3.4.5.post35+r788a29c99234

    • Meaning: This version of this tool was built from a revision where:

      • The latest tag was 3.4.5

      • The latest commit on this branch is 35 commits beyond the latest tag.

      • The latest commit has a shortened node ID of 788a29c99234

    • You can update to this revision by calling hg update -r 788a29c99234

Installation

Via pip: pip install natcap.versioner

Via setup.py: python setup.py install

Dependencies

Both these can be installed via pip.

  • setuptools

  • yaml

To install dependencies:

pip install setuptools pyyaml

Usage In Your Project

To use this project, you’ll need to edit two files: setup.py and __init__.py.

In your ``setup.py``

Adding these lines to your setup.py allows the DVCS information to be fetched from git or hg and recorded in the package metadata.

from setuptools import setup
import natcap.versioner

setup(
    name='example_project',
    ...
    version=natcap.versioner.vcs_version()
    natcap_version='example_project/version.py',
)

In your package’s ``__init__.py``

Adding these lines to your package’s __init__.py file will allow the package version to be fetched from the package metadata.

# Let's assume your package name is still 'example_project'
import natcap.versioner
__version__ = natcap.versioner.get_version('example_project')

Support

If something doesn’t work, it’s probably broken! Please submit an issue via the issue tracker, send James an email or stop by if you’re in the office and I’ll try to fix it!

0.1.3

  • Allowing version string to be written to a package file.

0.1.2

  • Default version scheme is dvcs-based post-release now. but can also do a pre-release.

0.1.1

  • Fixes installation issues where certain files needed for setup.py were missing from the source distribution.

0.1.0

  • Initial public release.

Project details


Download files

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

Source Distribution

natcap.versioner-0.1.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

natcap.versioner-0.1.3-py2.7.egg (12.9 kB view details)

Uploaded Source

File details

Details for the file natcap.versioner-0.1.3.tar.gz.

File metadata

File hashes

Hashes for natcap.versioner-0.1.3.tar.gz
Algorithm Hash digest
SHA256 aa341930ce9be5ee6cf0b7022d4d7402698b65f1c93b58cd8508d16555ee3081
MD5 2e6112f6ed660a4edbe48af7d564c963
BLAKE2b-256 9f3d9fc7b39b1883efa96e212945d27550f12a3319aecae85d2e7fb15051f55e

See more details on using hashes here.

File details

Details for the file natcap.versioner-0.1.3-py2.7.egg.

File metadata

File hashes

Hashes for natcap.versioner-0.1.3-py2.7.egg
Algorithm Hash digest
SHA256 a79fe53aa4362e57e1ac9e21572074c98b4395d3f49b4dd38e6420064ab724fa
MD5 dc01ec2ebc06e2cba8769ebc9d3c13a9
BLAKE2b-256 7c1d1a7b792a489226b2c95a513e37147e9159ce927f5a5cc8dac8a9d844108a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page