aboutsummaryrefslogtreecommitdiff
path: root/rambo
diff options
context:
space:
mode:
authorMatt Rendina <mrendina@stsci.edu>2017-05-24 14:42:13 -0400
committerMatt Rendina <mrendina@stsci.edu>2017-05-24 14:42:13 -0400
commit2a4958e9e8389edc2b8e117e1d45635706bbec1b (patch)
treebf8f1615a258ac63fe6dc2727002c0747b48e52a /rambo
parent74c2df4ffc24688e74ce90eb4f41e1db8ef272c4 (diff)
downloadrambo-2a4958e9e8389edc2b8e117e1d45635706bbec1b.tar.gz
Bludgenoning into shape for desired package behavior
Diffstat (limited to 'rambo')
-rw-r--r--rambo/__init__.py6
-rw-r--r--rambo/__main__.py97
-rw-r--r--rambo/_version.py1
3 files changed, 104 insertions, 0 deletions
diff --git a/rambo/__init__.py b/rambo/__init__.py
new file mode 100644
index 0000000..3a180c1
--- /dev/null
+++ b/rambo/__init__.py
@@ -0,0 +1,6 @@
+__all__ = ["rambo"]
+
+from .rambo import __version__
+from .rambo import Meta
+from .rambo import MetaSet
+
diff --git a/rambo/__main__.py b/rambo/__main__.py
new file mode 100644
index 0000000..e7173be
--- /dev/null
+++ b/rambo/__main__.py
@@ -0,0 +1,97 @@
+#!/usr/bin/env python
+
+'''
+RAMBO - Recipe Analyzer and Multi-package Build Optimizer
+'''
+
+import os
+import sys
+import argparse
+from . import rambo
+#from ._version import __version__
+#from .rambo import *
+
+def main(argv=None):
+
+ if argv is None:
+ argv = sys.argv
+
+ parser = argparse.ArgumentParser(prog='rambo')
+ parser.add_argument('-p', '--platform', type=str)
+ parser.add_argument(
+ '--python',
+ type=str,
+ help='Python version to pass to conda machinery when rendering '
+ 'recipes. "#.#" format. If not specified, the version of python'
+ ' hosting conda_build.api is used.')
+ parser.add_argument(
+ '-m',
+ '--manifest',
+ type=str,
+ help='Use this file to filter the list of recipes to process.')
+ parser.add_argument(
+ '-f',
+ '--file',
+ type=str,
+ help='Send package list output to this file instead of stdout.')
+ parser.add_argument(
+ '-c',
+ '--culled',
+ action='store_true',
+ help='Print the ordered list of package names reduced to the set'
+ ' of packages that do not already exist in the channel specified'
+ ' in the supplied manifest file.')
+ parser.add_argument(
+ '-d',
+ '--details',
+ action='store_true',
+ help='Display details used in determining build order and/or '
+ 'package culling.')
+ parser.add_argument(
+ '--dirty',
+ action='store_true',
+ help='Use the most recent pre-existing conda work directory for '
+ 'each recipe instead of creating a new one. If a work directory '
+ 'does not already exist, the recipe is processed in the normal '
+ 'fashion. Used mostly for testing purposes.')
+ parser.add_argument(
+ '-v',
+ '--version',
+ action='version',
+ version='%(prog)s ' + rambo.__version__,
+ help='Display version information.')
+ parser.add_argument('recipes_dir', type=str)
+ args = parser.parse_args()
+
+ recipes_dir = os.path.normpath(args.recipes_dir)
+
+ fh = None
+ if args.file:
+ fh = open(args.file, 'w')
+
+ versions = {'python': '', 'numpy': ''}
+ if args.python:
+ versions['python'] = args.python
+
+ versions['numpy'] = rambo.DEFAULT_MINIMUM_NUMPY_VERSION
+
+ mset = rambo.MetaSet(
+ recipes_dir,
+ platform=args.platform,
+ versions=versions,
+ dirty=args.dirty,
+ manfile=args.manifest)
+
+ mset.multipass_optimize()
+
+ if args.details:
+ mset.print_details(fh)
+ if mset.channel:
+ mset.print_status_in_channel(fh)
+ elif args.culled:
+ mset.print_culled(fh)
+ else:
+ mset.print(fh)
+
+if __name__ == "__main__":
+ main()
diff --git a/rambo/_version.py b/rambo/_version.py
new file mode 100644
index 0000000..a655b17
--- /dev/null
+++ b/rambo/_version.py
@@ -0,0 +1 @@
+__version__ = '1.0.0b1'