示例#1
0
 def test_head_is_tagged_in_date_format(self):
     """Should return most recent tag"""
     silent_call('git', 'init')
     self._set_author()
     silent_call('git', 'commit', '--allow-empty', '-m', 'Initial Commit')
     silent_call('git', 'tag', 'r2018.01.04.0')
     self.assertEqual(versiontag.get_version(), 'r2018.01.04.0')
     self.assertEqual(versiontag.get_version(pypi=True), '2018.01.04.0')
 def test_head_is_tagged(self):
     """Should return most recent tag"""
     silent_call('git', 'init')
     self._set_author()
     silent_call('git', 'commit', '--allow-empty', '-m', 'Initial Commit')
     silent_call('git', 'tag', 'r1.2.3')
     self.assertEqual(versiontag.get_version(), 'r1.2.3')
     self.assertEqual(versiontag.get_version(pypi=True), '1.2.3')
    def test_head_is_post_release(self):
        """Subsequent commits show as post releases"""
        silent_call('git', 'init')
        self._set_author()
        silent_call('git', 'commit', '--allow-empty', '-m', 'Initial Commit')
        silent_call('git', 'tag', 'r1.2.3')
        silent_call('git', 'commit', '--allow-empty', '-m', 'another commit')
        self.assertTrue( versiontag.get_version().startswith('r1.2.3-1-') )
        self.assertEqual(versiontag.get_version(pypi=True), '1.2.3-1')

        silent_call('git', 'commit', '--allow-empty', '-m', 'another commit')
        self.assertTrue(versiontag.get_version().startswith('r1.2.3-2-'))
        self.assertEqual(versiontag.get_version(pypi=True), '1.2.3-2')

        silent_call('git', 'tag', 'r1.2.4')
        self.assertTrue( versiontag.get_version().startswith('r1.2.4') )
        self.assertEqual(versiontag.get_version(pypi=True), '1.2.4')
示例#4
0
    def test_head_is_post_release(self):
        """Subsequent commits show as post releases"""
        silent_call('git', 'init')
        self._set_author()
        silent_call('git', 'commit', '--allow-empty', '-m', 'Initial Commit')
        silent_call('git', 'tag', 'r1.2.3')
        silent_call('git', 'commit', '--allow-empty', '-m', 'another commit')
        self.assertTrue(versiontag.get_version().startswith('r1.2.3-1-'))
        self.assertEqual(versiontag.get_version(pypi=True), '1.2.3.post1')

        silent_call('git', 'commit', '--allow-empty', '-m', 'another commit')
        self.assertTrue(versiontag.get_version().startswith('r1.2.3-2-'))
        self.assertEqual(versiontag.get_version(pypi=True), '1.2.3.post2')

        silent_call('git', 'tag', 'r1.2.4')
        self.assertTrue(versiontag.get_version().startswith('r1.2.4'))
        self.assertEqual(versiontag.get_version(pypi=True), '1.2.4')
    def test_caching_with_removed_git_folder(self):
        """Caching continues to return release even if git repository disappears"""
        silent_call('git', 'init')
        self._set_author()
        silent_call('git', 'commit', '--allow-empty', '-m', 'Initial Commit')
        silent_call('git', 'tag', 'r1.2.3')

        versiontag.cache_git_tag()

        self.assertTrue( versiontag.get_version().startswith('r1.2.3') )
        self.assertEqual(versiontag.get_version(pypi=True), '1.2.3')

        silent_call('rm', '-rf', os.path.join(self.repo_dir.name, '.git'))

        self.assertTrue( versiontag.get_version().startswith('r1.2.3') )
        self.assertEqual(versiontag.get_version(pypi=True), '1.2.3')

        # Remove the version cache file and get_version goes back to return the default
        silent_call('rm', os.path.join(self.repo_dir.name, 'version.txt'))

        self.assertEqual(versiontag.get_version(), 'r0.0.0')
        self.assertEqual(versiontag.get_version(pypi=True), '0.0.0')
示例#6
0
    def test_caching_with_removed_git_folder(self):
        """Caching continues to return release even if git repository disappears"""
        silent_call('git', 'init')
        self._set_author()
        silent_call('git', 'commit', '--allow-empty', '-m', 'Initial Commit')
        silent_call('git', 'tag', 'r1.2.3')

        versiontag.cache_git_tag()

        self.assertTrue(versiontag.get_version().startswith('r1.2.3'))
        self.assertEqual(versiontag.get_version(pypi=True), '1.2.3')

        silent_call('rm', '-rf', os.path.join(self.repo_dir.name, '.git'))

        self.assertTrue(versiontag.get_version().startswith('r1.2.3'))
        self.assertEqual(versiontag.get_version(pypi=True), '1.2.3')

        # Remove the version cache file and get_version goes back to return the default
        silent_call('rm', os.path.join(self.repo_dir.name, 'version.txt'))

        self.assertEqual(versiontag.get_version(), 'r0.0.0')
        self.assertEqual(versiontag.get_version(pypi=True), '0.0.0')
示例#7
0
def fpath(name):
    return os.path.join(os.path.dirname(__file__), name)


def read(fname):
    return codecs.open(fpath(fname), encoding='utf-8').read()


cache_git_tag()

setup(
    name='django-logpipe',
    description=
    "Move data around between Python services using Kafka and/or AWS Kinesis and Django Rest Framework serializers.",
    version=get_version(pypi=True),
    long_description=open('README.rst').read(),
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Console',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Framework :: Django :: 1.11',
        'Framework :: Django :: 2.0',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: ISC License (ISCL)',
        'Operating System :: Unix',
        'Operating System :: MacOS :: MacOS X',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
示例#8
0

def fpath(name):
    return os.path.join(os.path.dirname(__file__), name)


def read(fname):
    return codecs.open(fpath(fname), encoding='utf-8').read()


cache_git_tag()

setup(
    name='django-oscar-wfrs',
    description="An extension on-top of django-oscar-api-checkout to allow interfacing with Wells Fargo Retail Services.",
    version=get_version(pypi=True),
    long_description=open('README.rst').read(),
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Web Environment',
        'Framework :: Django',
        'Framework :: Django :: 1.11',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: ISC License (ISCL)',
        'Operating System :: Unix',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
    ],
示例#9
0
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'asymmetric-jwt-auth'
copyright = '2017, Craig Weber <*****@*****.**>'
author = 'Craig Weber <*****@*****.**>'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
from versiontag import get_version  # NOQA
version = get_version(pypi=True)
# The full version, including alpha/beta/rc tags.
release = get_version(pypi=True)

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
示例#10
0
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

STATIC_URL = '/static/'

RAVEN_CONFIG = {
    'dsn': '',
    'release': versiontag.get_version(),
}

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'verbose': {
            'format':
            '%(asctime)s django %(name)s: %(levelname)s %(process)d %(thread)d %(message)s',
            'datefmt': '%Y-%m-%dT%H:%M:%S',
        },
    },
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
示例#11
0
# -*- coding: utf-8 -*-
from setuptools import setup, Distribution
Distribution().fetch_build_eggs('versiontag')
from versiontag import get_version, cache_git_tag

cache_git_tag()

MY_VERSION = get_version(pypi=True)

setup(name='sshconf',
      version=MY_VERSION,
      description='Lightweight SSH config library',
      author='Søren A D',
      author_email='*****@*****.**',
      url='https://github.com/sorend/sshconf',
      download_url='https://github.com/sorend/sshconf/tarball/%s' % MY_VERSION,
      license='MIT',
      keywords=['ssh', 'config'],
      py_modules=['sshconf'],
      setup_requires=['pytest-runner'],
      tests_require=['pytest'],
      classifiers=(
          'License :: OSI Approved :: MIT License',
          'Programming Language :: Python :: 2',
          'Programming Language :: Python :: 3',
          'Topic :: Software Development :: Libraries :: Python Modules',
          'Topic :: Software Development :: Libraries',
      ))
 def test_no_commits(self):
     """No tags returns default version"""
     silent_call('git', 'init')
     self._set_author()
     self.assertEqual(versiontag.get_version(), 'r0.0.0')
     self.assertEqual(versiontag.get_version(pypi=True), '0.0.0')
 def test_no_repo(self):
     """No repo returns default version"""
     self.assertEqual(versiontag.get_version(), 'r0.0.0')
     self.assertEqual(versiontag.get_version(pypi=True), '0.0.0')
示例#14
0
 def test_no_commits(self):
     """No tags returns default version"""
     silent_call('git', 'init')
     self._set_author()
     self.assertEqual(versiontag.get_version(), 'r0.0.0')
     self.assertEqual(versiontag.get_version(pypi=True), '0.0.0')
示例#15
0
 def test_no_repo(self):
     """No repo returns default version"""
     self.assertEqual(versiontag.get_version(), 'r0.0.0')
     self.assertEqual(versiontag.get_version(pypi=True), '0.0.0')
示例#16
0
# The master toctree document.
master_doc = 'index'

# General information about the project.
project = u'django-oscar-wfrs'
copyright = u'2017, Craig Weber <*****@*****.**>'
author = u'Craig Weber <*****@*****.**>'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
from versiontag import get_version  # NOQA
version = get_version(pypi=True)
# The full version, including alpha/beta/rc tags.
release = get_version(pypi=True)

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']