Only install cheetah (and only run the cheetah templating test) when in Python

2.  Cheetah is not compatible with Python 3.
This commit is contained in:
Barry Warsaw 2015-01-21 15:28:32 -05:00
parent 35e4d597e3
commit 65f89fb1b5
3 changed files with 13 additions and 2 deletions

View File

@ -1,7 +1,6 @@
# Pypi requirements for cloud-init to work
# Used for untemplating any files or strings with parameters.
cheetah
jinja2
# This is used for any pretty printing of tabular data.
@ -32,3 +31,6 @@ requests
# For patching pieces of cloud-config together
jsonpatch
# For Python 2/3 compatibility
six

View File

@ -175,6 +175,11 @@ else:
}
requirements = read_requires()
if sys.version_info < (3,):
requirements.append('cheetah')
setuptools.setup(name='cloud-init',
version=get_version(),
description='EC2 initialisation magic',
@ -187,6 +192,6 @@ setuptools.setup(name='cloud-init',
],
license='GPLv3',
data_files=data_files,
install_requires=read_requires(),
install_requires=requirements,
cmdclass=cmdclass,
)

View File

@ -16,6 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import six
import unittest
from . import helpers as test_helpers
import textwrap
@ -38,6 +41,7 @@ class TestTemplates(test_helpers.TestCase):
out_data = templater.basic_render(in_data, {'b': 2})
self.assertEqual(expected_data.strip(), out_data)
@unittest.skipIf(six.PY3, 'Cheetah is not compatible with Python 3')
def test_detection(self):
blob = "## template:cheetah"