From 292baa3e7f078a07550f88a47ef52a04cd2659ca Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Wed, 8 Sep 2021 18:21:17 -0700 Subject: [PATCH] Switch from pystache to chevron for mustache template support (pystache no longer maintained uses use_2to3 which was deprecated in the most recent release of setuptools; see https://github.com/pypa/setuptools/issues/2769) --- recipe/meta.yaml | 2 +- requirements.txt | 2 +- yggdrasil/drivers/OSRModelDriver.py | 4 ++-- yggdrasil/yamlfile.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 545194deb..6771f9e9d 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -52,6 +52,7 @@ requirements: - sysv_ipc # [unix] - zeromq run: + - chevron - cmake # [not win] - czmq - flaky @@ -65,7 +66,6 @@ requirements: - pyperf - pint # [py2k] - psutil - - pystache - python - python-rapidjson # [not py2k] - pyyaml diff --git a/requirements.txt b/requirements.txt index 4a63c538f..1ab8d129a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +chevron flask jsonschema>=3 matplotlib @@ -5,7 +6,6 @@ numpy>=1.13.0 pandas pyperf psutil -pystache python-rapidjson pyyaml pyzmq diff --git a/yggdrasil/drivers/OSRModelDriver.py b/yggdrasil/drivers/OSRModelDriver.py index cc8372c82..bcee85475 100644 --- a/yggdrasil/drivers/OSRModelDriver.py +++ b/yggdrasil/drivers/OSRModelDriver.py @@ -5,7 +5,7 @@ import subprocess import tempfile import logging -import pystache +import chevron import io as sio import warnings import xml.etree.ElementTree as ET @@ -203,7 +203,7 @@ def wrap_xml(self, src, dst): """ with open(src, 'r') as fd: src_contents = fd.read() - src_contents = pystache.render( + src_contents = chevron.render( sio.StringIO(src_contents).getvalue(), self.set_env()) root = ET.fromstring(src_contents) timesync = self.timesync diff --git a/yggdrasil/yamlfile.py b/yggdrasil/yamlfile.py index a3f1afc7c..8572f5be6 100644 --- a/yggdrasil/yamlfile.py +++ b/yggdrasil/yamlfile.py @@ -1,7 +1,7 @@ import os import copy import pprint -import pystache +import chevron import yaml import json import git @@ -101,7 +101,7 @@ def load_yaml(fname): fname = os.path.join(os.getcwd(), 'stream') # Mustache replace vars yamlparsed = fd.read() - yamlparsed = pystache.render( + yamlparsed = chevron.render( sio.StringIO(yamlparsed).getvalue(), dict(os.environ)) if fname.endswith('.json'): yamlparsed = json.loads(yamlparsed)