本文整理汇总了Python中bumpr.releaser.Releaser.release方法的典型用法代码示例。如果您正苦于以下问题:Python Releaser.release方法的具体用法?Python Releaser.release怎么用?Python Releaser.release使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bumpr.releaser.Releaser
的用法示例。
在下文中一共展示了Releaser.release方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import release [as 别名]
def main():
import sys
from bumpr import log
log.init()
from bumpr.config import Config, ValidationError
from bumpr.releaser import Releaser
from bumpr.helpers import BumprError
from logging import DEBUG, INFO, getLogger
config = Config.parse_args()
getLogger().setLevel(DEBUG if config.verbose else INFO)
logger = getLogger(__name__)
try:
config.validate()
except ValidationError as e:
msg = 'Invalid configuration: {0}'.format(e)
logger.error(msg)
sys.exit(1)
try:
releaser = Releaser(config)
releaser.release()
except BumprError as error:
logger.error(str(error))
sys.exit(1)
示例2: test_release_wihtout_vcs_or_commands
# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import release [as 别名]
def test_release_wihtout_vcs_or_commands(self):
with workspace('fake', '1.2.3.dev') as wksp:
config = Config({'file': 'fake.py', 'files': [wksp.readme]})
releaser = Releaser(config)
with patch('bumpr.releaser.execute') as execute:
with patch.object(releaser, 'commit') as commit:
releaser.release()
self.assertFalse(execute.called)
self.assertFalse(commit.called)
for filename in wksp.module, wksp.readme:
with open(filename) as f:
content = f.read()
self.assertIn('1.2.3', content)
self.assertNotIn('1.2.3.dev', content)
示例3: test_release_wihtout_vcs_or_commands
# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import release [as 别名]
def test_release_wihtout_vcs_or_commands(workspace, mocker):
config = Config({'file': 'fake.py', 'files': [str(workspace.readme)]})
releaser = Releaser(config)
execute = mocker.patch('bumpr.releaser.execute')
commit = mocker.patch.object(releaser, 'commit')
releaser.release()
assert not execute.called
assert not commit.called
for file in workspace.module, workspace.readme:
with file.open() as f:
content = f.read()
assert '1.2.3' in content
assert '1.2.3.dev' not in content
示例4: main
# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import release [as 别名]
def main():
import sys
from bumpr import log
log.init()
from bumpr.config import Config
from bumpr.releaser import Releaser
from bumpr.helpers import BumprError
from logging import DEBUG, INFO, getLogger
config = Config.parse_args()
getLogger().setLevel(DEBUG if config.verbose else INFO)
try:
releaser = Releaser(config)
releaser.release()
except BumprError as error:
getLogger(__name__).error(error.message)
sys.exit(1)
示例5: test_release_dryrun
# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import release [as 别名]
def test_release_dryrun(self):
with workspace('fake', '1.2.3.dev') as wksp:
config = Config({
'file': 'fake.py',
'files': [wksp.readme],
'vcs': 'fake',
'dryrun': True,
})
releaser = Releaser(config)
with patch('bumpr.releaser.execute') as execute:
with patch.object(releaser, 'vcs') as vcs:
releaser.release()
self.assertFalse(execute.called)
self.assertFalse(vcs.commit.called)
self.assertFalse(vcs.tag.called)
for filename in wksp.module, wksp.readme:
with open(filename) as f:
content = f.read()
self.assertIn('1.2.3.dev', content)
self.assertNotIn('1.2.4', content)
示例6: test_release_dryrun
# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import release [as 别名]
def test_release_dryrun(workspace, mocker):
config = Config({
'file': 'fake.py',
'files': [str(workspace.readme)],
'vcs': 'fake',
'dryrun': True,
'push': True,
})
releaser = Releaser(config)
execute = mocker.patch('bumpr.releaser.execute')
vcs = mocker.patch.object(releaser, 'vcs')
releaser.release()
assert not execute.called
assert not vcs.commit.called
assert not vcs.tag.called
assert not vcs.push.called
for file in workspace.module, workspace.readme:
with file.open() as f:
content = f.read()
assert '1.2.3.dev' in content
assert '1.2.4' not in content
示例7: test_release
# 需要导入模块: from bumpr.releaser import Releaser [as 别名]
# 或者: from bumpr.releaser.Releaser import release [as 别名]
def test_release(workspace, mocker):
config = Config({
'file': 'fake.py',
'files': [str(workspace.readme)],
'vcs': 'fake',
'push': True,
})
releaser = Releaser(config)
clean = mocker.patch.object(releaser, 'clean')
test = mocker.patch.object(releaser, 'test')
bump = mocker.patch.object(releaser, 'bump')
publish = mocker.patch.object(releaser, 'publish')
prepare = mocker.patch.object(releaser, 'prepare')
push = mocker.patch.object(releaser, 'push')
releaser.release()
assert clean.called
assert test.called
assert bump.called
assert publish.called
assert prepare.called
assert push.called