Ejemplo n.º 1
0
"""Logs
"""
import re
from typing import Optional

import ndebug

from ..errors import UnknownCommitMessageStyleError
from ..settings import config, current_commit_parser
from ..vcs_helpers import get_commit_log

debug = ndebug.create(__name__)

LEVELS = {
    1: 'patch',
    2: 'minor',
    3: 'major',
}

CHANGELOG_SECTIONS = ['feature', 'fix', 'breaking', 'documentation']

re_breaking = re.compile('BREAKING CHANGE: (.*)')


def evaluate_version_bump(current_version: str, force: str = None) -> Optional[str]:
    """
    Reads git log since last release to find out if should be a major, minor or patch release.

    :param current_version: A string with the current version number.
    :param force: A string with the bump level that should be forced.
    :return: A string with either major, minor or patch if there should be a release. If no release
Ejemplo n.º 2
0
"""HVCS
"""
import mimetypes
import os
from typing import Optional

import gitlab
import ndebug
import requests

from .errors import ImproperConfigurationError
from .settings import config

debug = ndebug.create(__name__)
debug_gh = ndebug.create(__name__ + ':github')
debug_gl = ndebug.create(__name__ + ':gitlab')

# Add a mime type for wheels
mimetypes.add_type('application/octet-stream', '.whl')


class Base(object):
    @staticmethod
    def domain() -> str:
        raise NotImplementedError

    @staticmethod
    def token() -> Optional[str]:
        raise NotImplementedError

    @staticmethod
Ejemplo n.º 3
0
import time
import ndebug

debug = ndebug.create('examples:test2')


def hi_there():
    debug("hi there2")


def slow():
    time.sleep(0.1)
    debug('should be milliseconds now')

    time.sleep(1)
    debug('should be seconds now')
Ejemplo n.º 4
0
"""Main of the 'examples' module
run with ``python3 -m examples``
"""
import ndebug
from . import test1, test2, test3

debug = ndebug.create('examples:main')

print('tada')
debug('start processing')
test1.hi_there()
test2.hi_there()
test3.hi_there()

print(1, 2, 3, 4)
debug(1, 2, 3, 4)

test1.awesome()

test2.slow()

debug(dir([]), repr([]), str([]))

print('Done!')