Completed
Pull Request — master (#120)
by Michael
15:55 queued 05:55
created

stage()   B

Complexity

Conditions 4

Size

Total Lines 32

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 4
c 3
b 0
f 0
dl 0
loc 32
rs 8.5806
1
2
import bumpversion
0 ignored issues
show
Configuration introduced by
The import bumpversion could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
3
4
from changes.config import BumpVersion
5
from . import info, note, error
6
from .status import status
7
8
9
def stage(draft):
10
    repository, bumpversion_part, release_type, proposed_version = status()
11
12
    if not repository.changes_since_last_version:
13
        error("There aren't any changes to release!")
14
        return
15
16
    info('Staging [{}] release for version {}'.format(
17
        release_type,
18
        proposed_version
19
    ))
20
21
    bumpversion_arguments = (
22
        BumpVersion.DRAFT_OPTIONS if draft
23
        else BumpVersion.STAGE_OPTIONS
24
    )
25
    bumpversion_arguments += [bumpversion_part]
26
27
    info('Running: bumpversion {}'.format(
28
        ' '.join(bumpversion_arguments)
29
    ))
30
31
    try:
32
        bumpversion.main(bumpversion_arguments)
33
    except bumpversion.WorkingDirectoryIsDirtyException as err:
34
        error(err)
35
        raise
36
    staged_files = [
37
38
    ]
39
    staged_release = None
40
    return staged_release
41