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