Skip to main content

UNKNOWN

Project description

travis pypi coverage

Incremental is a small library that versions your Python projects.

Quick Start

Add this to the top of your setup.py, assuming your code is called widgetbox:

my_project = 'widgetbox'

import os, importlib

def install_incremental():
    import importlib
    try:
        importlib.import_module('incremental')
    except ImportError:
        import pip
        pip.main(['install', 'incremental>=0.1.0'])
    finally:
        globals()['incremental'] = importlib.import_module('incremental')

install_incremental()

# PICK ONE OF:
# If you have a src/ dir
base_dir = os.path.dirname(__file__)
src_dir = os.path.join(base_dir, "src")
# If you do not
src_dir = os.path.dirname(__file__)

version = incremental.get_version_from_project(my_project, src_dir)

And in the setup call, add:

setup(
    name=my_project,
    version=version.base(),
    ...
}

Then in your project add a _version.py that contains:

from incremental import Version

__version__ = Version("widgetbox", 1, 2, 3)
__all__ = ["__version__"]

Then in your project’s __init__.py add:

from ._version import __version__

Subsequent installations of your project will use incremental for versioning.

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

incremental-15.0.0.tar.gz (9.5 kB view hashes)

Uploaded Source

Built Distribution

incremental-15.0.0-py2-none-any.whl (6.8 kB view hashes)

Uploaded Python 2

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