diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2017-06-26 23:01:39 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2017-06-26 23:01:39 -0400 |
commit | 4fd86f9c8b7b3b79e03a3f38f93aefb03468bd28 (patch) | |
tree | 742af2191f59978bc7ebf6c1e9c948aadc71acb0 | |
parent | 48d4553375e41109d45ad1efb408c38760866750 (diff) | |
download | groovy-sandbox-4fd86f9c8b7b3b79e03a3f38f93aefb03468bd28.tar.gz |
Serializable, I guess
-rw-r--r-- | src/org/stsci/Conda.groovy | 2 | ||||
-rw-r--r-- | src/org/stsci/CondaInstaller.groovy | 2 | ||||
-rw-r--r-- | src/org/stsci/OSInfo.groovy | 2 | ||||
-rw-r--r-- | testing.groovy | 27 |
4 files changed, 30 insertions, 3 deletions
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<String, String> 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 +} + |