nyl 0.7.2__tar.gz → 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. nyl-0.8.0/.changelog/0.8.0.toml +7 -0
  2. {nyl-0.7.2 → nyl-0.8.0}/PKG-INFO +1 -1
  3. {nyl-0.7.2 → nyl-0.8.0}/pyproject.toml +1 -1
  4. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/template.py +12 -2
  5. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/generator/__init__.py +2 -2
  6. {nyl-0.7.2 → nyl-0.8.0}/uv.lock +1 -1
  7. {nyl-0.7.2 → nyl-0.8.0}/.changelog/0.7.0.toml +0 -0
  8. {nyl-0.7.2 → nyl-0.8.0}/.changelog/0.7.1.toml +0 -0
  9. {nyl-0.7.2 → nyl-0.8.0}/.changelog/0.7.2.toml +0 -0
  10. {nyl-0.7.2 → nyl-0.8.0}/.envrc +0 -0
  11. {nyl-0.7.2 → nyl-0.8.0}/.github/workflows/docker.yaml +0 -0
  12. {nyl-0.7.2 → nyl-0.8.0}/.github/workflows/docs.yaml +0 -0
  13. {nyl-0.7.2 → nyl-0.8.0}/.github/workflows/python.yaml +0 -0
  14. {nyl-0.7.2 → nyl-0.8.0}/.github/workflows/update-flake-lock.yaml +0 -0
  15. {nyl-0.7.2 → nyl-0.8.0}/.gitignore +0 -0
  16. {nyl-0.7.2 → nyl-0.8.0}/README.md +0 -0
  17. {nyl-0.7.2 → nyl-0.8.0}/argocd-cmp/Dockerfile +0 -0
  18. {nyl-0.7.2 → nyl-0.8.0}/argocd-cmp/README.md +0 -0
  19. {nyl-0.7.2 → nyl-0.8.0}/argocd-cmp/plugin.yaml +0 -0
  20. {nyl-0.7.2 → nyl-0.8.0}/argocd-with-nyl/.envrc +0 -0
  21. {nyl-0.7.2 → nyl-0.8.0}/argocd-with-nyl/.secrets.yaml +0 -0
  22. {nyl-0.7.2 → nyl-0.8.0}/argocd-with-nyl/.sops.yaml +0 -0
  23. {nyl-0.7.2 → nyl-0.8.0}/argocd-with-nyl/README.md +0 -0
  24. {nyl-0.7.2 → nyl-0.8.0}/argocd-with-nyl/argocd.yaml +0 -0
  25. {nyl-0.7.2 → nyl-0.8.0}/argocd-with-nyl/nyl-project.yaml +0 -0
  26. {nyl-0.7.2 → nyl-0.8.0}/argocd-with-nyl/nyl-secrets.yaml +0 -0
  27. {nyl-0.7.2 → nyl-0.8.0}/docs/content/changelog.md +0 -0
  28. {nyl-0.7.2 → nyl-0.8.0}/docs/content/index.md +0 -0
  29. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/applysets.md +0 -0
  30. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/argocd-plugin.md +0 -0
  31. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/cluster-connectivity.md +0 -0
  32. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/configuration/environment.md +0 -0
  33. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/configuration/profiles.md +0 -0
  34. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/configuration/projects.md +0 -0
  35. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/configuration/secrets.md +0 -0
  36. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/configuration-api/profiles.md +0 -0
  37. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/configuration-api/secrets.md +0 -0
  38. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/glossary.md +0 -0
  39. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/templating/basics.md +0 -0
  40. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/templating/components.md +0 -0
  41. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/templating/inlining/helmcharts.md +0 -0
  42. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/templating/inlining/overview.md +0 -0
  43. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/templating/inlining/postprocessor.md +0 -0
  44. {nyl-0.7.2 → nyl-0.8.0}/docs/content/reference/templating/secrets.md +0 -0
  45. {nyl-0.7.2 → nyl-0.8.0}/docs/mkdocs.yml +0 -0
  46. {nyl-0.7.2 → nyl-0.8.0}/docs/pyproject.toml +0 -0
  47. {nyl-0.7.2 → nyl-0.8.0}/docs/uv.lock +0 -0
  48. {nyl-0.7.2 → nyl-0.8.0}/example/manifests/postgres.yaml +0 -0
  49. {nyl-0.7.2 → nyl-0.8.0}/example/nyl-profiles.yaml +0 -0
  50. {nyl-0.7.2 → nyl-0.8.0}/example/nyl-secrets.yaml +0 -0
  51. {nyl-0.7.2 → nyl-0.8.0}/example/secrets.yaml +0 -0
  52. {nyl-0.7.2 → nyl-0.8.0}/flake.lock +0 -0
  53. {nyl-0.7.2 → nyl-0.8.0}/flake.nix +0 -0
  54. {nyl-0.7.2 → nyl-0.8.0}/nix/uv.nix +0 -0
  55. {nyl-0.7.2 → nyl-0.8.0}/renovate.json +0 -0
  56. {nyl-0.7.2 → nyl-0.8.0}/src/kubernetes/README.md +0 -0
  57. {nyl-0.7.2 → nyl-0.8.0}/src/kubernetes/__init__.pyi +0 -0
  58. {nyl-0.7.2 → nyl-0.8.0}/src/kubernetes/dynamic/__init__.pyi +0 -0
  59. {nyl-0.7.2 → nyl-0.8.0}/src/kubernetes/dynamic/client.pyi +0 -0
  60. {nyl-0.7.2 → nyl-0.8.0}/src/kubernetes/dynamic/discovery.pyi +0 -0
  61. {nyl-0.7.2 → nyl-0.8.0}/src/kubernetes/dynamic/exceptions.pyi +0 -0
  62. {nyl-0.7.2 → nyl-0.8.0}/src/kubernetes/dynamic/resource.pyi +0 -0
  63. {nyl-0.7.2 → nyl-0.8.0}/src/kubernetes/watch/__init__.pyi +0 -0
  64. {nyl-0.7.2 → nyl-0.8.0}/src/kubernetes/watch/watch.pyi +0 -0
  65. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/__init__.py +0 -0
  66. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/__init__.py +0 -0
  67. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/add.py +0 -0
  68. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/argocd.py +0 -0
  69. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/crds.py +0 -0
  70. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/new.py +0 -0
  71. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/profile.py +0 -0
  72. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/run.py +0 -0
  73. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/secrets.py +0 -0
  74. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/tools/__init__.py +0 -0
  75. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/tools/bcrypt.py +0 -0
  76. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/tools/sops.py +0 -0
  77. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/commands/tun.py +0 -0
  78. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/generator/components.py +0 -0
  79. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/generator/dispatch.py +0 -0
  80. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/generator/dispatch_test.py +0 -0
  81. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/generator/helmchart.py +0 -0
  82. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/generator/statefulsecret.py +0 -0
  83. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/profiles/__init__.py +0 -0
  84. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/profiles/config.py +0 -0
  85. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/profiles/config_test.py +0 -0
  86. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/profiles/kubeconfig.py +0 -0
  87. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/profiles/tunnel.py +0 -0
  88. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/project/config.py +0 -0
  89. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/resources/__init__.py +0 -0
  90. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/resources/applyset.py +0 -0
  91. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/resources/applyset_test.py +0 -0
  92. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/resources/helmchart.py +0 -0
  93. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/resources/helmchart_test.py +0 -0
  94. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/resources/placeholder.py +0 -0
  95. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/resources/postprocessor.py +0 -0
  96. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/resources/postprocessor_test.py +0 -0
  97. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/resources/statefulsecret.py +0 -0
  98. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/secrets/__init__.py +0 -0
  99. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/secrets/config.py +0 -0
  100. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/secrets/config_test.py +0 -0
  101. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/secrets/kubernetes.py +0 -0
  102. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/secrets/null.py +0 -0
  103. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/secrets/sops.py +0 -0
  104. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/secrets/sops_test.py +0 -0
  105. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/templating.py +0 -0
  106. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/templating_test.py +0 -0
  107. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/di.py +0 -0
  108. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/fs.py +0 -0
  109. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/fs_test.py +0 -0
  110. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/kubectl.py +0 -0
  111. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/kubernetes.py +0 -0
  112. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/kvstore.py +0 -0
  113. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/loads.py +0 -0
  114. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/logging.py +0 -0
  115. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/shell.py +0 -0
  116. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/testing.py +0 -0
  117. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/typer.py +0 -0
  118. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/types.py +0 -0
  119. {nyl-0.7.2 → nyl-0.8.0}/src/nyl/tools/yaml.py +0 -0
  120. {nyl-0.7.2 → nyl-0.8.0}/tests/__init__.py +0 -0
  121. {nyl-0.7.2 → nyl-0.8.0}/tests/conftest.py +0 -0
@@ -0,0 +1,7 @@
1
+ release-date = "2025-01-22"
2
+
3
+ [[entries]]
4
+ id = "9b3b0ac8-767d-4207-8f87-2ed578b73147"
5
+ type = "improvement"
6
+ description = "Further improve on #56 by populating the namespace of resources earlier than later (e.g. before the `HelmChart` gets rendered, instead of only applying it to the resources generated by the `HelmChart` at the end)."
7
+ author = "@NiklasRosenstein"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nyl
3
- Version: 0.7.2
3
+ Version: 0.8.0
4
4
  Summary: Advanced templating engine for Kubernetes and GitOps.
5
5
  Author-email: Niklas Rosenstein <rosensteinniklas@gmail.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "nyl"
7
- version = "0.7.2"
7
+ version = "0.8.0"
8
8
  description = "Advanced templating engine for Kubernetes and GitOps."
9
9
  authors = [
10
10
  {name = "Niklas Rosenstein", email = "rosensteinniklas@gmail.com"},
@@ -210,12 +210,23 @@ def template(
210
210
  for source in load_manifests(paths):
211
211
  logger.opt(colors=True).info("Rendering manifests from <blue>{}</>.", source.file)
212
212
 
213
+ # Begin populating the default namespace to resources.
214
+ current_default_namespace = get_default_namespace_for_manifest(source, default_namespace)
215
+ populate_namespace_to_resources(source.manifests, current_default_namespace)
216
+
213
217
  source.manifests = template_engine.evaluate(source.manifests)
214
218
  if inline:
219
+
220
+ def new_generation(manifest: Manifest) -> Manifests:
221
+ breakpoint()
222
+ manifests = template_engine.evaluate(Manifests([manifest]))
223
+ populate_namespace_to_resources(manifests, current_default_namespace)
224
+ return manifests
225
+
215
226
  source.manifests = reconcile_generator(
216
227
  generator,
217
228
  source.manifests,
218
- on_generated=lambda m: template_engine.evaluate(Manifests([m])),
229
+ new_generation_callback=new_generation,
219
230
  skip_resources=[PostProcessor],
220
231
  )
221
232
 
@@ -242,7 +253,6 @@ def template(
242
253
  applyset = ApplySet.load(manifest)
243
254
  source.manifests.remove(manifest)
244
255
 
245
- current_default_namespace = get_default_namespace_for_manifest(source, default_namespace)
246
256
  if not applyset and project.config.settings.generate_applysets:
247
257
  if not current_default_namespace:
248
258
  logger.opt(colors=True).error(
@@ -37,7 +37,7 @@ class Generator(ABC, Generic[T]):
37
37
  def reconcile_generator(
38
38
  generator: Generator[Manifest],
39
39
  manifests: Manifests,
40
- on_generated: Callable[[Manifest], Manifests],
40
+ new_generation_callback: Callable[[Manifest], Manifests],
41
41
  skip_resources: Sequence[type[NylResource]] = (),
42
42
  ) -> Manifests:
43
43
  """
@@ -70,7 +70,7 @@ def reconcile_generator(
70
70
  queue.append(resource)
71
71
  else:
72
72
  for manifest in generator.generate(resource):
73
- queue.extend(on_generated(manifest))
73
+ queue.extend(new_generation_callback(manifest))
74
74
  loops += 1
75
75
 
76
76
  return result
@@ -384,7 +384,7 @@ wheels = [
384
384
 
385
385
  [[package]]
386
386
  name = "nyl"
387
- version = "0.7.1"
387
+ version = "0.7.2"
388
388
  source = { editable = "." }
389
389
  dependencies = [
390
390
  { name = "bcrypt" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes