Skip to content
Snippets Groups Projects
Commit 5499d3a9 authored by Nathan Hertz's avatar Nathan Hertz
Browse files

Added simple recipe for building packages.

parent f4506a16
No related branches found
No related tags found
No related merge requests found
import subprocess
def get_pkgs():
"""
Run a couple shell commands to parse the metadata directory for its packages.
:return: List of packages in metadata directory
"""
find_proc = subprocess.Popen(["find", "metadata",
"-name", "meta.yaml"],
stdout=subprocess.PIPE)
return subprocess.check_output(["sed", "-e", "s:metadata/::",
"-e", "s:/meta.yaml::"],
stdin=find_proc.stdout).decode('utf-8').split('\n')
class Recipe:
def __init__(self, buildout, name, options):
self.options = options
self.pkgs = get_pkgs()
def install(self):
# self.options.created()
pkg = self.options['name']
if pkg == "all":
for p in self.pkgs:
subprocess.run(["conda", "build", "metadata/{}".format(p)])
else:
subprocess.run(["conda", "build", "metadata/{}".format(pkg)])
update = install
\ No newline at end of file
from setuptools import setup
setup(
name='build_packages',
version='0.1',
py_modules = ['build_packages'],
entry_points = {"zc.buildout": ["default=build_packages:Recipe"]},
)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment