def test_get_version(self): ver = version.get_version() self.ok(ver.startswith('2.1')) ver = version.get_version((2, 1, 1, 'alpha', 1)) self.eq(ver, '2.1.1a1') ver = version.get_version((2, 1, 2, 'beta', 2)) self.eq(ver, '2.1.2b2') ver = version.get_version((2, 1, 2, 'rc', 3)) self.eq(ver, '2.1.2c3')
def test_get_version(): ver = version.get_version() assert ver.startswith('3.0') ver = version.get_version((2, 1, 1, 'alpha', 1)) assert ver == '2.1.1a1' ver = version.get_version((2, 1, 2, 'beta', 2)) assert ver == '2.1.2b2' ver = version.get_version((2, 1, 2, 'rc', 3)) assert ver == '2.1.2c3' ver = version.get_version((2, 1, 3, 'final', 0)) assert ver == '2.1.3'
#!/usr/bin/env python import os import sys import re import tempfile from cement.core.foundation import CementApp from cement.core.controller import CementBaseController, expose from cement.utils.version import get_version from cement.utils import shell VERSION = get_version() class CementDevtoolsController(CementBaseController): class Meta: label = 'base' arguments = [ (['-y, --noprompt'], dict(help='answer yes to prompts.', action='store_true', dest='noprompt')), (['--ignore-errors'], dict(help="don't stop operations because of errors", action='store_true', dest='ignore_errors')), (['--loud'], dict(help='add more verbose output', action='store_true', dest='loud')), (['modifier1'], dict(help='command modifier positional argument', nargs='?')), ] def _do_error(self, msg):
import os import sys sys.path.insert(0, os.path.abspath('../cement/')) on_rtd = os.environ.get('READTHEDOCS', None) == 'True' if not on_rtd: # only import and set the theme if we're building docs locally import sphinx_rtd_theme html_theme = 'sphinx_rtd_theme' html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # If we dont' prep an app, then we'll get runtime errors from cement.utils import test, version app = test.TestApp() RELEASE = version.get_version() VERSION = '.'.join(RELEASE.split('.')[:2]) ### Hack for Read The Docs: class Mock(object): def __init__(self, *args, **kwargs): pass def __call__(self, *args, **kwargs): return Mock() @classmethod def __getattr__(cls, name): if name in ('__file__', '__path__'): return '/dev/null'
from setuptools import setup, find_packages import sys, os from cement.utils import version VERSION = version.get_version() LONG = """ Cement is an advanced CLI Application Framework for Python. Its goal is to introduce a standard, and feature-full platform for both simple and complex command line applications as well as support rapid development needs without sacrificing quality. More Information please visit the official site at: * http://builtoncement.com/ """ setup(name='cement', version=VERSION, description="CLI Application Framework for Python", long_description=LONG, classifiers=[], keywords='cli framework', author='BJ Dierkes', author_email='*****@*****.**', url='http://builtoncement.org', license='BSD',