Replace PyYAML with ruamel.yaml (#1416)

* Remove Python 3.7 and 3.8 from github actions workflows

* Update lockfile after running poetry update a couple times

* Update poetry lock

* Remove Python 3.7 and 3.8 from pyproject.toml and run poetry lock

* Switch from pyyaml to ruamel.yaml

* Remove duplicate editor key in config

* Use ruamel.yaml instead of pyyaml in legacy template.py

* Prevent ruamel from collapsing config YAML

* Run make format
This commit is contained in:
Micah Jerome Ellison 2022-03-12 13:24:31 -08:00 committed by GitHub
parent e46b5a171f
commit d3de5b778b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 154 additions and 129 deletions

View file

@ -1,6 +1,5 @@
default_hour: 9
default_minute: 0
editor: ""
encrypt: false
highlight: true
editor: "vim"

View file

@ -8,7 +8,7 @@ from xml.etree import ElementTree
from pytest_bdd import then
from pytest_bdd.parsers import parse
import yaml
from ruamel.yaml import YAML
from jrnl.config import scope_config
@ -121,7 +121,7 @@ def config_var_on_disk(config_on_disk, journal_name, should_or_should_not, some_
if journal_name:
actual = actual["journals"][journal_name]
expected = yaml.load(some_yaml, Loader=yaml.SafeLoader)
expected = YAML(typ="safe").load(some_yaml)
actual_slice = actual
if type(actual) is dict:
@ -152,7 +152,7 @@ def config_var_in_memory(
if journal_name:
actual = actual["journals"][journal_name]
expected = yaml.load(some_yaml, Loader=yaml.SafeLoader)
expected = YAML(typ="safe").load(some_yaml)
actual_slice = actual
if type(actual) is dict: