Skip to content

first cut at getting cdp-based packages #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/cdp_manage
38 changes: 38 additions & 0 deletions scripts/cdp_manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env python

import argparse
import subprocess
import shlex
import sys

P = argparse.ArgumentParser(
description='CDP-based conda packages manager',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)

P.add_argument(
"-l",
"--list",
action="store_true",
default=False,
help="List all cdp-based packages")
P.add_argument(
"-c",
"--channel",
nargs="+",
default=[
"pcmdi",
"conda-forge",
"acme"],
help="Channel where to look")
args = P.parse_args()

if args.list:
cmd = "conda search -c %s --names-only --reverse-dependency cdp" % " -c ".join(
args.channel)
p = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE)
out = []
while p.poll() is None:
a = p.stdout.readline()
if len(a) > 0:
out.append(a)
sys.stdout.write(a)
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
author_email="[email protected]",
description="Framework for creating scientific diagnostics.",
packages=find_packages(exclude=["*.test", "*.test.*", "test.*", "test"]),
include_package_data=True
include_package_data=True,
scripts = ["scripts/cdp_manage"]
)