Exemple #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)
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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #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)
Exemple #11
0
 def check_milestone(self, *args):
     args = ["check-milestone", "--no-ask"] + list(args)
     main("scc", args=args, items=[(CheckMilestone.NAME, CheckMilestone)])
Exemple #12
0
 def upgrade(self, *args):
     args = ["upgrade"] + list(args)
     main("omego", args=args, items=[("upgrade", UpgradeCommand)])
Exemple #13
0
 def update_submodules(self, *args):
     args = ["update-submodules", "--no-ask", self.branch] + list(args)
     main("scc",
          args=args,
          items=[(UpdateSubmodules.NAME, UpdateSubmodules)])
 def check_milestone(self, *args):
     args = ["check-milestone", "--no-ask"] + list(args)
     main("scc", args=args, items=[(CheckMilestone.NAME, CheckMilestone)])
Exemple #15
0
 def download(self, *args):
     args = ["download", self.artifact] + list(args)
     main("omego", args=args, items=[("download", DownloadCommand)])
Exemple #16
0
 def testVersionOutput(self, capsys):
     main("test", ["version"], items=[("version", Version)])
     out, err = capsys.readouterr()
     assert out.rstrip() == get_git_version(module_file)
Exemple #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)])
Exemple #18
0
 def testVersionOutput(self, capsys):
     main("test", ["version"], items=[("version", Version)])
     out, err = capsys.readouterr()
     assert out.rstrip() == get_git_version(module_file)
 def update_submodules(self, *args):
     args = ["update-submodules", "--no-ask", self.branch] + list(args)
     main("scc", args=args,
          items=[(UpdateSubmodules.NAME, UpdateSubmodules)])
Exemple #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()
Exemple #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)])
Exemple #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)])
 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)])
Exemple #24
0
 def upgrade(self, *args):
     args = ["upgrade"] + list(args)
     main("omego", args=args, items=[("upgrade", UpgradeCommand)])
Exemple #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)])
Exemple #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()
 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)])
Exemple #28
0
 def deploy(self, tmpdir):
     args = ["deploy", str(tmpdir.join('test'))]
     main("scc", args=args, items=[("deploy", Deploy)])
Exemple #29
0
 def label(self, *args):
     args = ["label", "--no-ask"] + list(args)
     main("scc", args=args, items=[(Label.NAME, Label)])
 def tag_release(self, *args):
     args = ["tag-release", "--no-ask"] + list(args)
     main("scc", args=args, items=[("tag-release", TagRelease)])
Exemple #31
0
 def testCallback(self, capsys):
     main("test", ["cb"], items=[("cb", CallbackCommand)])
     out, err = capsys.readouterr()
     assert LISTENER.calls == set(["call", "cb"])
Exemple #32
0
 def download(self, *args):
     args = ["download", self.artifact] + list(args)
     main("omego", args=args, items=[("download", DownloadCommand)])
Exemple #33
0
 def label(self, *args):
     args = ["label", "--no-ask"] + list(args)
     main("scc", args=args, items=[(Label.NAME, Label)])
Exemple #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)])
Exemple #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)])