Exemplo n.º 1
0
def entry_point():
    """
    External entry point which calls main() and
    if Stop is raised, calls sys.exit()
    """
    try:
        main("scc", items=[
            (AlreadyMerged.NAME, AlreadyMerged),
            (CheckLabels.NAME, CheckLabels),
            (CheckMilestone.NAME, CheckMilestone),
            (CheckPRs.NAME, CheckPRs),
            (CheckStatus.NAME, CheckStatus),
            (Deploy.NAME, Deploy),
            (DeleteTags.NAME, DeleteTags),
            (Label.NAME, Label),
            (Merge.NAME, Merge),
            (MilestoneCommand.NAME, MilestoneCommand),
            (Rate.NAME, Rate),
            (Rebase.NAME, Rebase),
            (SetCommitStatus.NAME, SetCommitStatus),
            (Token.NAME, Token),
            (TagRelease.NAME, TagRelease),
            (TravisMerge.NAME, TravisMerge),
            (Version.NAME, Version),
            (UpdateSubmodules.NAME, UpdateSubmodules),
            ])
    except Stop, stop:
        print stop,
        sys.exit(stop.rc)
Exemplo n.º 2
0
def entry_point():
    """
    External entry point which calls main() and
    if Stop is raised, calls sys.exit()
    """
    try:
        main("scc", items=[
            (AlreadyMerged.NAME, AlreadyMerged),
            (CheckLabels.NAME, CheckLabels),
            (CheckMilestone.NAME, CheckMilestone),
            (CheckPRs.NAME, CheckPRs),
            (CheckStatus.NAME, CheckStatus),
            (Deploy.NAME, Deploy),
            (DeleteTags.NAME, DeleteTags),
            (Label.NAME, Label),
            (ExternalIssues.NAME, ExternalIssues),
            (Merge.NAME, Merge),
            (MilestoneCommand.NAME, MilestoneCommand),
            (Rate.NAME, Rate),
            (Rebase.NAME, Rebase),
            (SetCommitStatus.NAME, SetCommitStatus),
            (Token.NAME, Token),
            (TagRelease.NAME, TagRelease),
            (TravisMerge.NAME, TravisMerge),
            (Version.NAME, Version),
            (UnsubscribedRepos.NAME, UnsubscribedRepos),
            (UpdateSubmodules.NAME, UpdateSubmodules),
            ])
    except Stop, stop:
        print stop,
        sys.exit(stop.rc)
Exemplo n.º 3
0
 def testVersionOverwrite(self, capsys):
     with open(version_file, 'w') as f:
         f.write('test\n')
     assert self.read_version_file() == 'test'
     try:
         main("test", ["version"], items=[("version", Version)])
         out, err = capsys.readouterr()
         assert out.rstrip() == self.read_version_file()
     finally:
         os.remove(version_file)
Exemplo n.º 4
0
 def testVersionOverwrite(self, capsys):
     with open(version_file, 'w') as f:
         f.write('test\n')
     assert self.read_version_file() == 'test'
     try:
         main("test", ["version"], items=[("version", Version)])
         out, err = capsys.readouterr()
         assert out.rstrip() == self.read_version_file()
     finally:
         os.remove(version_file)
Exemplo n.º 5
0
 def testNonGitRepository(self, capsys):
     # Move to a non-git repository and ensure call_git_describe
     # returns None
     dir = os.getcwd()
     os.chdir('..')
     try:
         assert call_git_describe() is None
         main("test", ["version"], items=[("version", Version)])
         out, err = capsys.readouterr()
         assert out.rstrip() == self.read_version_file()
     except:
         os.chdir(dir)
Exemplo n.º 6
0
 def testNonGitRepository(self, capsys):
     # Move to a non-git repository and ensure call_git_describe
     # returns None
     dir = os.getcwd()
     os.chdir('..')
     try:
         assert call_git_describe() is None
         main("test", ["version"], items=[("version", Version)])
         out, err = capsys.readouterr()
         assert out.rstrip() == self.read_version_file()
     except:
         os.chdir(dir)
Exemplo n.º 7
0
def entry_point():
    """
    External entry point which calls main() and
    if Stop is raised, calls sys.exit()
    """
    try:
        main("omego",
             items=[(InstallCommand.NAME, InstallCommand),
                    (UpgradeCommand.NAME, UpgradeCommand),
                    (ConvertCommand.NAME, ConvertCommand),
                    (DownloadCommand.NAME, DownloadCommand),
                    (DbCommand.NAME, DbCommand), (Version.NAME, Version)])
    except Stop, stop:
        if stop.rc != 0:
            print "ERROR:", stop
        else:
            print stop
        sys.exit(stop.rc)
Exemplo n.º 8
0
def entry_point():
    """
    External entry point which calls main() and
    if Stop is raised, calls sys.exit()
    """
    try:
        main("omego", items=[
            (InstallCommand.NAME, InstallCommand),
            (UpgradeCommand.NAME, UpgradeCommand),
            (ConvertCommand.NAME, ConvertCommand),
            (DownloadCommand.NAME, DownloadCommand),
            (DbCommand.NAME, DbCommand),
            (Version.NAME, OmegoVersion)])
    except Stop, stop:
        if stop.rc != 0:
            print "ERROR:", stop
        else:
            print stop
        sys.exit(stop.rc)
Exemplo n.º 9
0
 def testGitRepository(self, tmpdir):
     cwd = os.getcwd()
     from subprocess import Popen, PIPE
     sandbox_url = "https://github.com/openmicroscopy/snoopys-sandbox.git"
     path = str(tmpdir.mkdir("sandbox"))
     # Read the version for the current Git repository
     main("test", ["version"], items=[("version", Version)])
     version = self.read_version_file()
     try:
         # Clone snoopys-sanbox
         p = Popen(["git", "clone", sandbox_url, path],
                   stdout=PIPE, stderr=PIPE)
         assert p.wait() == 0
         os.chdir(path)
         # Check git describe returns a different version number
         assert call_git_describe() != version
         # Read the version again and check the file is unmodified
         main("test", ["version"], items=[("version", Version)])
         assert self.read_version_file() == version
     finally:
         os.chdir(cwd)
Exemplo n.º 10
0
 def testGitRepository(self, tmpdir):
     cwd = os.getcwd()
     from subprocess import Popen, PIPE
     sandbox_url = "https://github.com/openmicroscopy/snoopys-sandbox.git"
     path = str(tmpdir.mkdir("sandbox"))
     # Read the version for the current Git repository
     main("test", ["version"], items=[("version", Version)])
     version = self.read_version_file()
     try:
         # Clone snoopys-sanbox
         p = Popen(["git", "clone", sandbox_url, path],
                   stdout=PIPE,
                   stderr=PIPE)
         assert p.wait() == 0
         os.chdir(path)
         # Check git describe returns a different version number
         assert call_git_describe() != version
         # Read the version again and check the file is unmodified
         main("test", ["version"], items=[("version", Version)])
         assert self.read_version_file() == version
     finally:
         os.chdir(cwd)
Exemplo n.º 11
0
 def check_milestone(self, *args):
     args = ["check-milestone", "--no-ask"] + list(args)
     main("scc", args=args, items=[(CheckMilestone.NAME, CheckMilestone)])
Exemplo n.º 12
0
 def upgrade(self, *args):
     args = ["upgrade"] + list(args)
     main("omego", args=args, items=[("upgrade", UpgradeCommand)])
Exemplo n.º 13
0
 def update_submodules(self, *args):
     args = ["update-submodules", "--no-ask", self.branch] + list(args)
     main("scc",
          args=args,
          items=[(UpdateSubmodules.NAME, UpdateSubmodules)])
Exemplo n.º 14
0
 def check_milestone(self, *args):
     args = ["check-milestone", "--no-ask"] + list(args)
     main("scc", args=args, items=[(CheckMilestone.NAME, CheckMilestone)])
Exemplo n.º 15
0
 def download(self, *args):
     args = ["download", self.artifact] + list(args)
     main("omego", args=args, items=[("download", DownloadCommand)])
Exemplo n.º 16
0
 def testVersionOutput(self, capsys):
     main("test", ["version"], items=[("version", Version)])
     out, err = capsys.readouterr()
     assert out.rstrip() == get_git_version(module_file)
Exemplo n.º 17
0
 def unrebased_prs(self):
     self.sandbox.checkout_branch("origin/" + self.branch1)
     self.args += [self.branch1, self.branch2]
     main("scc", args=self.args, items=[(CheckPRs.NAME, CheckPRs)])
Exemplo n.º 18
0
 def testVersionOutput(self, capsys):
     main("test", ["version"], items=[("version", Version)])
     out, err = capsys.readouterr()
     assert out.rstrip() == get_git_version(module_file)
Exemplo n.º 19
0
 def update_submodules(self, *args):
     args = ["update-submodules", "--no-ask", self.branch] + list(args)
     main("scc", args=args,
          items=[(UpdateSubmodules.NAME, UpdateSubmodules)])
Exemplo n.º 20
0
 def testVersionFile(self, capsys):
     main("test", ["version"], items=[("version", Version)])
     assert os.path.isfile(version_file)
     out, err = capsys.readouterr()
     assert out.rstrip() == self.read_version_file()
Exemplo n.º 21
0
 def travis_merge(self, *args):
     self.sandbox.checkout_branch(self.branch[0])
     args = ["travis-merge", "--no-ask"] + list(args)
     main("scc", args=args, items=[(TravisMerge.NAME, TravisMerge)])
Exemplo n.º 22
0
 def merge(self, *args):
     self.sandbox.checkout_branch(self.origin_remote + "/" + self.base)
     args = ["merge", "--no-ask", self.base] + list(args)
     main("scc", args=args, items=[(Merge.NAME, Merge)])
Exemplo n.º 23
0
 def travis_merge(self, *args):
     self.sandbox.checkout_branch(self.branch[0])
     args = ["travis-merge", "--no-ask"] + list(args)
     main("scc", args=args, items=[(TravisMerge.NAME, TravisMerge)])
Exemplo n.º 24
0
 def upgrade(self, *args):
     args = ["upgrade"] + list(args)
     main("omego", args=args, items=[("upgrade", UpgradeCommand)])
Exemplo n.º 25
0
 def rebase(self, *args):
     args = ["rebase", "--no-ask", str(self.pr.number),
             self.target_base] + list(args)
     main("scc", args=args, items=[(Rebase.NAME, Rebase)])
Exemplo n.º 26
0
 def testVersionFile(self, capsys):
     main("test", ["version"], items=[("version", Version)])
     assert os.path.isfile(version_file)
     out, err = capsys.readouterr()
     assert out.rstrip() == self.read_version_file()
Exemplo n.º 27
0
 def unrebased_prs(self):
     self.sandbox.checkout_branch("origin/" + self.branch1)
     self.args += [self.branch1, self.branch2]
     main("scc", args=self.args, items=[(CheckPRs.NAME, CheckPRs)])
Exemplo n.º 28
0
 def deploy(self, tmpdir):
     args = ["deploy", str(tmpdir.join('test'))]
     main("scc", args=args, items=[("deploy", Deploy)])
Exemplo n.º 29
0
 def label(self, *args):
     args = ["label", "--no-ask"] + list(args)
     main("scc", args=args, items=[(Label.NAME, Label)])
Exemplo n.º 30
0
 def tag_release(self, *args):
     args = ["tag-release", "--no-ask"] + list(args)
     main("scc", args=args, items=[("tag-release", TagRelease)])
Exemplo n.º 31
0
 def testCallback(self, capsys):
     main("test", ["cb"], items=[("cb", CallbackCommand)])
     out, err = capsys.readouterr()
     assert LISTENER.calls == set(["call", "cb"])
Exemplo n.º 32
0
 def download(self, *args):
     args = ["download", self.artifact] + list(args)
     main("omego", args=args, items=[("download", DownloadCommand)])
Exemplo n.º 33
0
 def label(self, *args):
     args = ["label", "--no-ask"] + list(args)
     main("scc", args=args, items=[(Label.NAME, Label)])
Exemplo n.º 34
0
 def merge(self, *args):
     self.sandbox.checkout_branch(self.origin_remote + "/" + self.base)
     args = ["merge", "--no-ask", self.base] + list(args)
     main("scc", args=args, items=[(Merge.NAME, Merge)])
Exemplo n.º 35
0
 def rebase(self, *args):
     args = ["rebase", "--no-ask",
             str(self.pr.number), self.target_base] + list(args)
     main("scc", args=args, items=[(Rebase.NAME, Rebase)])