Commits

lakin.wecker committed 2a9c8c2

initial version of the baste-example repository.

  • Participants

Comments (0)

Files changed (5)

+baste-dep
+.pyc
+Copyright (c) 2012 Structured Abstraction Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+import os.path
+
+from fabric.api import (
+        env,
+        get,
+        hosts,
+        lcd,
+        local,
+        prompt,
+        settings,
+        OrderedDict,
+    )
+from fabric import colors
+from fabric.contrib.console import confirm
+
+from baste import (
+        DiffCommand,
+        Mercurial,
+        python_dependency,
+        StatusCommand,
+    )
+
+PYTHON_VERSION = "python2.6"
+
+# Use this to track dependencies on internal libraries who's development
+# may occur in parallel to the main project and as such should be checked
+# out next to all the other code in an editable manner.
+python_repos = OrderedDict([(repo.name, repo) for repo in [
+    Mercurial("bastedep", "ssh://hg@bitbucket.org/lakin.wecker/baste-dep"),
+]])
+all_repos = python_repos.copy()
+all_repos['baste'] = Mercurial("env/src/baste", "ssh://hg@bitbucket.org/lakin.wecker/baste")
+all_repos['container'] = Mercurial(".", "ssh://hg@bitbucket.org/lakin.wecker/baste-example")
+
+def update():
+    """
+    Update the all of the dependencies to their latest states.
+    """
+    for repo in all_repos.values():
+        repo.update()
+
+    for repo in python_repos.values():
+        # If the __init__.py is directly in the directory we checked out
+        # use the main repo directory for the symlink
+        if os.path.exists(os.path.join(repo.name, "__init__.py")):
+            python_dependency(repo.name, PYTHON_VERSION)
+        # Otherwise see if the python package is a subdir of the main repo
+        # and use it.
+        elif os.path.exists(os.path.join(repo.name, repo.name, "__init__.py")):
+            python_dependency(repo.name, PYTHON_VERSION, os.path.join(repo.name, repo.name))
+up = update # defines up as the shortcut for update
+st = status = StatusCommand(all_repos)
+diff = DiffCommand(all_repos)
+fabric==1.3.4
+hg+ssh://hg@bitbucket.org/lakin.wecker/baste#egg=baste
+psycopg2==2.4.1
+cherrypy==3.2.2
+#!/bin/bash
+virtualenv env -p /usr/bin/python2.6 --no-site-packages --prompt="(baste-example):"
+source env/bin/activate
+pip install -r requirements.txt
+fab update
+