diff --git a/cookiecutter/config.py b/cookiecutter/config.py index a07aa1a8b..eb753ba1b 100644 --- a/cookiecutter/config.py +++ b/cookiecutter/config.py @@ -4,7 +4,7 @@ import logging import os -import poyo +import yaml from cookiecutter.exceptions import ConfigDoesNotExistException, InvalidConfiguration @@ -60,10 +60,10 @@ def get_config(config_path): ) logger.debug('config_path is %s', config_path) - with open(config_path, encoding='utf-8') as file_handle: + with open(config_path, encoding='utf-8') as yaml_file: try: - yaml_dict = poyo.parse_string(file_handle.read()) - except poyo.exceptions.PoyoException as e: + yaml_dict = yaml.safe_load(yaml_file) + except yaml.YAMLError as e: raise InvalidConfiguration( 'Unable to parse YAML file {}. Error: {}'.format(config_path, e) ) diff --git a/setup.py b/setup.py index 6ab7e9abd..18bb42c66 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ 'binaryornot>=0.4.4', 'Jinja2<3.0.0', 'click>=7.0', - 'poyo>=0.5.0', + 'pyyaml>=5.4', 'jinja2-time>=0.2.0', 'python-slugify>=4.0.0', 'requests>=2.23.0', diff --git a/tests/conftest.py b/tests/conftest.py index ee3eab6d7..23dc24d68 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -175,9 +175,3 @@ def user_config_file(user_dir, user_config_data): config_text = USER_CONFIG.format(**user_config_data) config_file.write(config_text) return str(config_file) - - -@pytest.fixture(autouse=True) -def disable_poyo_logging(): - """Fixture that disables poyo logging.""" - logging.getLogger('poyo').setLevel(logging.WARNING)