def test_should_return_revision_when_svn_from_count_succeeds(self): self.execute_command.side_effect = [ (1, "", ""), # not git (0, "", ""), # is svn (0, "451", "any-stderr") ] self.assertEqual("451", VCSRevision().count)
def set_properties_for_teamcity_builds(project): import os project.version = '%s.%s-%s' % (project.version, VCSRevision().get_git_revision_count(), os.environ.get('BUILD_NUMBER', 0)) project.default_task = ['install_build_dependencies', 'publish'] project.set_property('install_dependencies_index_url', os.environ.get('PYPIPROXY_URL')) project.set_property('install_dependencies_use_mirrors', False) project.set_property('teamcity_output', True)
def test_should_return_revision_without_sparse_partial_when_svnversion_succeeds( self): self.execute_command.return_value = 0, "451P", "any-stderr" self.assertEqual("451", VCSRevision().get_svn_revision_count())
def test_should_fail_when_svnversion_succeeds_but_moved_path(self): self.execute_command.return_value = 0, "Uncommitted local addition, copy or move", "any-stderr" self.assertRaises(PyBuilderException, VCSRevision().get_svn_revision_count)
def test_should_fail_when_svnversion_succeeds_but_unversioned_directory( self): self.execute_command.return_value = 0, "Unversioned directory", "any-stderr" self.assertRaises(PyBuilderException, VCSRevision().get_svn_revision_count)
import os from pybuilder.core import use_plugin, init, Author, task, depends from pybuilder.vcs import VCSRevision use_plugin("python.core") use_plugin("python.unittest") use_plugin("python.install_dependencies") use_plugin("python.flake8") use_plugin("python.coverage") use_plugin("python.distutils") use_plugin("python.cram") use_plugin("filter_resources") name = 'c-bastion' commit_count = VCSRevision().get_git_revision_count() version = '{0}.{1}'.format(commit_count, os.environ.get('TRAVIS_BUILD_NUMBER', 0)) summary = 'Cloud Bastion Host' authors = [ Author('Sebastian Spoerer', "*****@*****.**"), Author('Valentin Haenel', "*****@*****.**"), Author('Tobias Hoeynck', "*****@*****.**"), Author('Laszlo Karolyi', "*****@*****.**"), ] url = 'https://github.com/ImmobilienScout24/c-bastion' default_task = "analyze" docker_name = 'run-c-bastion-run'
def test_should_not_detect_svn_when_status_succeeds_but_mentions_unversioned( self): self.execute_command.return_value = 0, "", "svn: warning: W155007: '/some/path' is not a working copy" self.assertFalse(VCSRevision().is_a_svn_repo())
def test_should_detect_svn_when_status_succeeds(self): self.execute_command.return_value = 0, "", "" self.assertTrue(VCSRevision().is_a_svn_repo())
def test_should_raise_when_not_git_or_svn(self): self.execute_command.side_effect = [ (1, "", ""), # not git (1, "", "") ] # is svn self.assertRaises(PyBuilderException, getattr, VCSRevision(), "count")
def test_should_return_revision_when_git_from_count_succeeds(self): self.execute_command.side_effect = [ (0, "", ""), # is git (0, "1\n2\n3", "any-stderr") ] self.assertEqual("3", VCSRevision().count)
use_plugin("python.core") use_plugin("python.unittest") use_plugin("python.install_dependencies") use_plugin("python.flake8") use_plugin("python.coverage") use_plugin("python.distutils") use_plugin('pypi:pybuilder_aws_plugin') use_plugin('python.integrationtest') use_plugin('python.pytddmon') use_plugin("filter_resources") name = "rds_log_dog" url = 'https://github.com/ImmobilienScout24/rds-log-dog' description = open("README.md").read() license = 'MIT' version = '0.2.{}'.format(VCSRevision().get_git_revision_count()) default_task = ["analyze", "package"] @init def set_properties(project): project.build_depends_on('unittest2>=0.7') # needed until moto>=0.4.32 is released project.build_depends_on( 'git+https://github.com/spulec/moto.git@master#egg=moto') project.build_depends_on('mock') project.depends_on('boto3') project.set_property('bucket_prefix', 'dist/') project.version = '%s.%s' % (project.version,
use_plugin("python.core") use_plugin("python.unittest") use_plugin("python.install_dependencies") use_plugin("python.flake8") use_plugin("python.coverage") use_plugin("python.distutils") use_plugin("python.integrationtest") use_plugin('copy_resources') use_plugin('pypi:pybuilder_aws_plugin') bucket_name = os.environ.get('BUCKET_NAME_FOR_UPLOAD', 'spotnik-distribution') name = "spotnik" default_task = ['clean', 'analyze', 'package'] version = '%s.%s' % (VCSRevision().get_git_revision_count(), os.environ.get('BUILD_NUMBER', '0')) @init def set_properties(project): project.set_property('coverage_break_build', False) project.set_property('integrationtest_inherit_environment', True) project.set_property('integrationtest_always_verbose', True) project.set_property('integrationtest_parallel', True) project.set_property('bucket_name', bucket_name) project.depends_on('boto3') project.depends_on('pils') project.build_depends_on('unittest2')
def write_version_into_library(project: Project): version_file = Path( project.expand_path('$dir_dist', f'{project.name}/__version__.py')) version_file.write_text(version_file.read_text().replace( '%version%', project.version).replace('%hash%', VCSRevision().get_git_hash()))
def test_should_return_revision_without_trailing_emptiness_when_svnversion_succeeds( self): self.execute_command.return_value = 0, "451 \n", "any-stderr" self.assertEqual("451", VCSRevision().get_svn_revision_count())
def test_should_raise_when_revparse_fails_in_get_git_hash(self): self.execute_command.side_effect = [ (0, "", ""), # is git (1, "", "") ] self.assertRaises(PyBuilderException, VCSRevision().get_git_hash)
def test_should_return_revision_when_git_revlist_succeeds(self): self.execute_command.return_value = 0, "1\n2\n3", "any-stderr" self.assertEqual("3", VCSRevision().get_git_revision_count())
def test_should_raise_when_not_git_in_get_git_hash(self): self.execute_command.return_value = 1, "", "" # not git self.assertRaises(PyBuilderException, VCSRevision().get_git_hash)
def test_should_not_detect_svn_when_status_fails(self): self.execute_command.return_value = 1, "", "" self.assertFalse(VCSRevision().is_a_svn_repo())
def test_should_return_revision_when_get_git_hash_succeeds(self): self.execute_command.side_effect = [ (0, "", ""), # is git (0, "451", "any-stderr") ] self.assertEqual("451", VCSRevision().get_git_hash())
use_plugin('copy_resources') use_plugin("filter_resources") use_plugin('python.cram') name = 'afp-cli' summary = 'Command line client for AWS federation proxy api' authors = [Author('Stefan Neben', "*****@*****.**"), Author('Tobias Vollmer', "*****@*****.**"), Author( 'Stefan Nordhausen', "*****@*****.**"), Author('Enrico Heine', "*****@*****.**"), Author('Valentin Haenel', "*****@*****.**"), ] url = 'https://github.com/ImmobilienScout24/afp-cli' version = VCSRevision().get_git_revision_count() description = open("README.rst").read() license = 'Apache License 2.0' default_task = ["clean", "analyze", "publish"] @init def set_properties(project): project.build_depends_on("unittest2") project.build_depends_on("mock") project.build_depends_on("six") project.build_depends_on("bottle") project.build_depends_on("bottledaemon") if sys.version_info[0:2] < (2, 7): project.depends_on("ordereddict")
def test_should_raise_when_svnversion_fails(self): self.execute_command.return_value = 1, "any-stdout", "any-stderr" self.assertRaises(PyBuilderException, VCSRevision().get_svn_revision_count)
import os from pybuilder.core import use_plugin, init from pybuilder.vcs import VCSRevision use_plugin("python.core") use_plugin("python.unittest") use_plugin("python.install_dependencies") use_plugin("python.flake8") #use_plugin("python.coverage") use_plugin("python.distutils") use_plugin("python.cram") use_plugin("filter_resources") name = "yadoma" default_task = "publish" version = '{0}.{1}'.format(VCSRevision().count, os.environ.get('TRAVIS_BUILD_NUMBER', 0)) @init def set_properties(project): project.depends_on('docopt') project.depends_on('pyyaml') project.get_property('filter_resources_glob').extend( ['**/yadoma/__init__.py'])
import os from pybuilder.core import use_plugin, init from pybuilder.vcs import VCSRevision use_plugin('copy_resources') use_plugin('pypi:pybuilder_aws_plugin') use_plugin("python.core") use_plugin("python.coverage") use_plugin("python.distutils") use_plugin("python.flake8") use_plugin("python.install_dependencies") use_plugin('python.integrationtest') use_plugin("python.unittest") name = "rds_log_cat" version = '0.1.%s' % VCSRevision().get_git_revision_count() summary = 'lambda function to send (rds) logs to kinesis' description = open("README.md").read() license = 'MIT License' url = 'https://github.com/ImmobilienScout24/rds-log-cat' default_task = ['clean', 'analyze', 'package'] def get_distribution_bucket_name(): region_to_deploy = os.environ['AWS_DEFAULT_REGION'] return '{}-{}'.format(os.environ.get('DISTRIBUTION_BUCKET_PREFIX'), region_to_deploy) def check_env():