From e40a3a23fb6649758f40e9b67e3f3100ec23f116 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Thu, 30 Jul 2020 12:57:56 -0500 Subject: Fix missing dependency error messages for yaml and toml --- config_file/parsers/toml_parser.py | 3 ++- config_file/parsers/yaml_parser.py | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/config_file/parsers/toml_parser.py b/config_file/parsers/toml_parser.py index 58e20b9..1c7f8a7 100644 --- a/config_file/parsers/toml_parser.py +++ b/config_file/parsers/toml_parser.py @@ -9,11 +9,12 @@ from config_file.exceptions import MissingDependencyError from .base_parser import BaseParser + class TomlParser(BaseParser): def __init__(self, file_contents: str): if not TOML_AVAILABLE: raise MissingDependencyError( - "It doesn't appear `toml` is installed, but a toml " + "It doesn't appear `tomlkit` is installed, but a toml " "file was attempted to be used. Install the `toml` " "extra first with `pip install config-file[toml]`." ) diff --git a/config_file/parsers/yaml_parser.py b/config_file/parsers/yaml_parser.py index 1937e17..babe873 100644 --- a/config_file/parsers/yaml_parser.py +++ b/config_file/parsers/yaml_parser.py @@ -14,12 +14,12 @@ class YamlParser(BaseParser): def __init__(self, file_contents: str): if not YAML_AVAILABLE: raise MissingDependencyError( - "It doesn't appear `PyYaml` is installed, but a yaml " - "file was attempted to be used. Install the `toml` " - "extra first with `pip install config-file[toml]`." + "It doesn't appear `ruamel.yaml` is installed, but a yaml " + "file was attempted to be used. Install the `yaml` " + "extra first with `pip install config-file[yaml]`." ) - - yaml = YAML(typ='safe') + + yaml = YAML(typ="safe") yaml.loads = round_trip_load yaml.dumps = round_trip_dump -- cgit v1.2.3