From 4fd86f9c8b7b3b79e03a3f38f93aefb03468bd28 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 26 Jun 2017 23:01:39 -0400 Subject: Serializable, I guess --- src/org/stsci/Conda.groovy | 2 +- src/org/stsci/CondaInstaller.groovy | 2 +- src/org/stsci/OSInfo.groovy | 2 +- testing.groovy | 27 +++++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 testing.groovy diff --git a/src/org/stsci/Conda.groovy b/src/org/stsci/Conda.groovy index da488bc..d406cc9 100644 --- a/src/org/stsci/Conda.groovy +++ b/src/org/stsci/Conda.groovy @@ -1,6 +1,6 @@ package org.stsci -class Conda { +class Conda implements Serializable { public String prefix public boolean prefix_exists public Map shell_environment diff --git a/src/org/stsci/CondaInstaller.groovy b/src/org/stsci/CondaInstaller.groovy index e1cef45..50f7f50 100644 --- a/src/org/stsci/CondaInstaller.groovy +++ b/src/org/stsci/CondaInstaller.groovy @@ -1,7 +1,7 @@ package org.stsci import org.stsci.OSInfo -class CondaInstaller { +class CondaInstaller implements Serializable { OSInfo os String prefix String dist_version diff --git a/src/org/stsci/OSInfo.groovy b/src/org/stsci/OSInfo.groovy index a29a1db..5d6c93b 100644 --- a/src/org/stsci/OSInfo.groovy +++ b/src/org/stsci/OSInfo.groovy @@ -1,6 +1,6 @@ package org.stsci -class OSInfo { +class OSInfo implements Serializable { public String name public String version public String arch diff --git a/testing.groovy b/testing.groovy new file mode 100644 index 0000000..1436bcc --- /dev/null +++ b/testing.groovy @@ -0,0 +1,27 @@ +import org.stsci.* + +static void main(String[] args) { + final String PREFIX = "/tmp/miniconda3" + final String NAME = "astroconda35" + final String PKGS = "python=3.5 numpy=1.12 drizzlepac" + + cinst = new CondaInstaller(PREFIX) + cinst.install() + + c = new Conda(PREFIX) + assert c.prefix_exists == true + + c.override = true + c.channels.add("astropy") + c.channels.add("http://ssb.stsci.edu/astroconda") + c.channels.add("conda-forge") + + if (c.provides(NAME)) { + assert c.destroy(NAME) == 0 + } + assert c.create(NAME, PKGS) == 0 + c.activate(NAME) + assert c.environment_name == NAME + assert c.provides(NAME) == true +} + -- cgit