-
Notifications
You must be signed in to change notification settings - Fork 395
reverse generated-python direction #1459
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
Conversation
b2a96b3
to
07c87f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This duplication is something that annoys me too 😞 . Good to merge once the tests are passing.
In future we could probably add this to pre-commit so the scripts gets updated automatically as part of linting.
helm-chart/binderhub/values.yaml
Outdated
@@ -17,7 +17,7 @@ nodeSelector: {} | |||
|
|||
image: | |||
name: jupyterhub/k8s-binderhub | |||
tag: 'local' | |||
tag: local |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use a round trip, the quotes may not be left for a string that needs them i think.
Retainig explicit quotes for the tag has been relevant in the past i recall, perhaps not by chartpress generates image tags, but i'm still cautious preferring to see us having the yaml include quotes foe our placeholder values where they could be needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The quotes were removed by the roundtrip serialization. I did not remove them. I left the change here because every re-write of the file will strip it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, this is how we have configured ruamel.yaml in chartpress to avoid this kind of issue.
# use safe roundtrip yaml loader capable or preserving usage of no/single/double
# quotes for a string for example
yaml = YAML(typ="rt")
yaml.preserve_quotes = True
yaml.indent(mapping=2, offset=2, sequence=4)
The indent settings is relevant to be compatible with prettier formatting, at least if not having a rout-tripped format to retain.
exampleList:
- without-indent-settings
# this is the kind of formatting we systematically
# use and enforce with prettier, and requires explicit
# configuration of ruamel.yaml at least when generating
# new yaml files, but I'm uncertain if it's required when
# round-tripping on existing files with existing list entries
anotherExampleList:
- with-indent-settings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it! I remembered the indent setting (it's the same here), but forgot the quotes. Will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
07c87f5
to
1959791
Compare
Make binderspawner_mixin.py canonical, instead of python-in-yaml easier to edit with editors, linters, etc. removes use of redundant pyyaml
1959791
to
a9ff870
Compare
jupyterhub/binderhub#1459 Merge pull request #1459 from minrk/reverse-generated-spawner
Make binderspawner_mixin.py canonical, instead of python-in-yaml
easier to edit with editors, linters, etc.
removes use of redundant pyyaml in favor of ruamel.yaml, needed for roundtrip yaml editing