Package: natcap.versioner
This package provides a consistent versioning scheme for projects of the
Natural Capital Project (http://naturalcapitalproject.org).  The versioning
string currently provided is PEP440-compliant, and is supported for both git
and mercurial repositories.  Mercurial source archives (created by thehg archivecommand) are also supported.Versioning SchemeInstallationDependenciesUsage In Your ProjectUsage in setup.pyUsage in __init__.pySupportTestsDevelopment0.5.00.4.20.4.10.4.00.3.30.3.20.3.10.3.00.2.40.2.30.2.20.2.10.2.00.1.40.1.30.1.20.1.10.1.0Versioning SchemeHow a version string is formatted:If we are at a tag:
    version = {tag}
else:
    version = {tag}.post{N}+r{nodeid|short}

If there are no tags:
    {tag} = 'null'Examples:Version string=3.4.5Meaning: This version of this tool was built from the tag3.4.5.You can update to this revision by callinghg update-r3.4.5Version string =3.4.5.post35+r788a29c99234Meaning: This version of this tool was built from a revision where:The latest tag was3.4.5The latest commit on this branch is35commits beyond the latest tag.The latest commit has a shortened node ID of788a29c99234You can update to this revision by callinghg update-r788a29c99234InstallationVia pip:pip install natcap.versionerVia setup.py:python setup.py installNoteIf you installnatcap.versionervia pip or via setup.py, dependencies
should install automatically.DependenciesNote thatnatcap.versionerrequires setuptools andsix.Usage In Your ProjectTo use this project, you’ll need to edit two files within your own project:setup.pyand__init__.py.Usage in setup.pyAdding these lines to yoursetup.pyallows the DVCS information to be
fetched fromgitorhgand recorded in the package metadata.
Additionally, the version will be recorded to the file you indicate with
thenatcap_versionkeyword.from setuptools import setup

setup(
    name='example_project',
    ...
    natcap_version='example_project/version.py',
    setup_requires=['natcap.versioner>=0.4.2']
)Usage in __init__.pyAdding these lines to your package’s__init__.pyfile 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')SupportIf 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!You can also file an issue in ourissue tracker.TestsTo run the suite of tests:$ nosetests test/*.pyNote thathgandgitmust be available as executables on the command-line.DevelopmentThenatcap.versionersource tree is located athttps://bitbucket.org/jdouglass/versioner0.5.0Added python 3.x support.  Installation now requiressix.Added testing via bitbucket pipelines.0.4.2Correcting an issue when using thenatcap_versiondistutils keyword where
the distutils version attribute was being improperly set.0.4.1Removing the need to import natcap.versioner withinsetup.py.natcap.versionernow uses its own functionality to generate its version
string.Removingpyyamlfrom setup.py’sinstall_requires.  This will prevent
pyyaml from being installed, despite the fact thatpyyamlis no longer
used bynatcap.versioner.Git, Hg, and Hg archive repositories can now be referred to by a subdirectory
within the repo itself.0.4.0Removing dependency onpyyaml.Adding__version__attribute tonatcap.versioner.0.3.3Tests now have full coverage of the package.Git repositories without branches are now correctly handled.Errors encountered in calls tohgandgitcommand-line applications
will causesubprocess.CalledProcessErrorto be raised.0.3.2Setting setuptoolszip_safe=True.  After a review of the module, it
appears that no functionality withinnatcap.versionerrequires access to
resources within the package via the filesystem.0.3.1Restoring support for installation as egg (0.3.0 lacked this).Minor stylistic changes for PEP8 and PEP2570.3.0Adding support for git.Added tests for core versioning functionality.0.2.4Allowing get_version() to allow fallback to SCM only when allowed by user
input.  Defaults to only allowing fallback in non-frozen environments (e.g. a
source tree).natcap.versioner.VersionNotFoundwill be raised if the version
string cannot be loaded normally or SCM is disallowed.If a version string cannot be parsed by vcs_version(),natcap.versioner.VersionNotFoundwill optionally be raised.0.2.3Turning setuptools zip_safe flag to False.  When this and natcap.invest have their zip_safe
flags all as False, the packages happily install side-by-side as individual eggs.0.2.2Fixes an issue where a development version is returned when the user is at a tag.  The
version is now correctly reported as just the tag.0.2.1Version files are now properly imported.  This fixes an issue with users unable to fetch
version strings from within frozen environments that are outside of a source tree.0.2.0API Change: version is now parsed from setup.py usingnatcap.versioner.parse_version().Allowing the version to be correctly fetched from PKG-INFO from egg/distribution metadata even when the package has not already been built.0.1.4Attempting to get the utils module to import correctly.0.1.3Allowing version string to be written to a package file.0.1.2Default version scheme is dvcs-based post-release now. but can also do a pre-release.0.1.1Fixes installation issues where certain files needed for setup.py were missing from the source distribution.0.1.0Initial public release.