-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trying to get the package to produce a script; also change to markdow…
…n README
- Loading branch information
Showing
5 changed files
with
46 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# YAML2Jsonnet: Switch configuration languages | ||
|
||
Converts YAML into Jsonnet (specifically targetting YAML for Kubernetes) | ||
|
||
Suppose that you have some [YAML][] that you use for [Kubernetes][] (either hand-written or output by [Helm][]. Now you'd like to use | ||
[Jsonnet][] instead, for its fancier templating capabilities. This is a pain, because while YAML->JSON converters are easy to find, | ||
they produce ugly-looking (but valid!) Jsonnet. | ||
|
||
YAML2Jsonnet makes the conversion a little easier: it transforms the YAML into *slightly* prettier Jsonnet, preserving | ||
comments along the way. | ||
|
||
## Examples | ||
|
||
TODO | ||
|
||
## Development | ||
|
||
* Install [Poetry] | ||
* Install [Pre-commit] | ||
* Run `poetry install` to install dependencies | ||
* Run `poetry run python -m yaml2jsonnet /path/to/yaml` to convert a file | ||
* Probably, run `jsonnetfmt` on the output, since the only whitespace I provide is newlines | ||
|
||
|
||
[YAML]: https://yaml.org/ | ||
[Helm]: https://helm.sh/ | ||
[Jsonnet]: https://jsonnet.org/ | ||
[Kubernetes]: https://kubernetes.io/ | ||
[Poetry]: https://python-poetry.org/ | ||
[Pre-commit]: https://pre-commit.com/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
[tool.poetry] | ||
name = "yaml2jsonnet" | ||
version = "0.6.0" | ||
version = "0.7.0" | ||
description = "Convert from YAML to Jsonnet format, retaining comments" | ||
license = "AGPL-3.0-or-later" | ||
authors = ["Nathaniel Waisbrot <[email protected]>"] | ||
readme = "README.rst" | ||
readme = "README.md" | ||
repository = "https://github.com/waisbrot/yaml2jsonnet" | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
|
@@ -17,7 +17,7 @@ classifiers = [ | |
] | ||
|
||
[tool.poetry.scripts] | ||
yaml2jsonnet = 'yaml2jsonnet' | ||
yaml2jsonnet = 'yaml2jsonnet.cli:main' | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,3 @@ | ||
import logging | ||
from yaml2jsonnet.cli import main | ||
|
||
from yaml2jsonnet.cli import parse_args, run | ||
|
||
if __name__ == "__main__": | ||
args = parse_args() | ||
loglevel = logging.WARNING | ||
if args.v > 0: | ||
loglevel = logging.INFO | ||
if args.v > 1: | ||
loglevel = logging.DEBUG | ||
logging.basicConfig(level=loglevel) | ||
run(args) | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters