Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reading yaml file using poyo - ValueError: Parent of ChildMixin instance needs to be a Container. #1513

Closed
acturner opened this issue Apr 10, 2021 · 5 comments
Labels
bug This issue/PR relates to a bug. duplicate

Comments

@acturner
Copy link

acturner commented Apr 10, 2021

Description:

When using a nested configuration which includes a list (see the list of authors in example template), we obtain an error from poyo simply trying to read the yaml file:

ValueError: Parent of ChildMixin instance needs to be a Container.

What I've run:

  1. git clone https://github.com/acturner/cookiecutter-value-error
  2. cookiecutter cookiecutter-value-error --config-file=cookiecutter-value-error/init.yaml --no-input
@acturner acturner changed the title Error reading yaml file using poyo: ValueError: Parent of ChildMixin instance needs to be a Container. Error reading yaml file using poyo - ValueError: Parent of ChildMixin instance needs to be a Container. Apr 10, 2021
simobasso added a commit to simobasso/cookiecutter that referenced this issue Apr 11, 2021
@simobasso
Copy link
Member

Hey @acturner, thanks for spotted out. Can you please check #1516 if fix your issue?

@acturner
Copy link
Author

@simobasso #1516 does not fix this issue, unfortunately. The error comes from poyo and I don't know why (drop-in replacement of pyyaml for poyo here fixes the problem but I know we can't use pyyaml).

@simobasso
Copy link
Member

simobasso commented Apr 19, 2021

Hey, @acturner, thanks for the follow-up.

Yes, #1516 doesn't fix this issue.

It seems we have a lot of duplicated issue of the same bug; I'll try to link all of this issue to track better how to solve the issue at the root.

refs: #1232

@simobasso simobasso added bug This issue/PR relates to a bug. duplicate labels Apr 20, 2021
@glumia
Copy link
Contributor

glumia commented Apr 26, 2021

I looked into it, it's a problem with poyo not being able to correctly parse the list of authors dictionaries in the yaml file. There's even an open issue for that (hackebrot/poyo#12) dating back to 2016.

+1 for switching to PyYAML, as @samj1912 said in #1515 (comment) they now provide pre-compiled binaries for windows so cross-platform compatibility shouldn't be a problem anymore.

@glumia
Copy link
Contributor

glumia commented Apr 30, 2021

Fixed with #1489.

cagonza6 pushed a commit to cagonza6/cookiecutter that referenced this issue Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug. duplicate
Projects
None yet
Development

No branches or pull requests

3 participants