crossplane-function-pythonic 0.0.6__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 (197) hide show
  1. crossplane_function_pythonic-0.0.6/.coveragerc +2 -0
  2. crossplane_function_pythonic-0.0.6/.devcontainer/devcontainer.json +17 -0
  3. crossplane_function_pythonic-0.0.6/.github/workflows/#ci.yaml# +269 -0
  4. crossplane_function_pythonic-0.0.6/.github/workflows/.#ci.yaml +1 -0
  5. crossplane_function_pythonic-0.0.6/.github/workflows/ci.yaml +269 -0
  6. crossplane_function_pythonic-0.0.6/.gitignore +215 -0
  7. crossplane_function_pythonic-0.0.6/.venv-default/.gitignore +2 -0
  8. crossplane_function_pythonic-0.0.6/.venv-default/CACHEDIR.TAG +4 -0
  9. crossplane_function_pythonic-0.0.6/.venv-default/bin/activate +87 -0
  10. crossplane_function_pythonic-0.0.6/.venv-default/bin/activate.csh +55 -0
  11. crossplane_function_pythonic-0.0.6/.venv-default/bin/activate.fish +103 -0
  12. crossplane_function_pythonic-0.0.6/.venv-default/bin/activate.nu +96 -0
  13. crossplane_function_pythonic-0.0.6/.venv-default/bin/activate.ps1 +61 -0
  14. crossplane_function_pythonic-0.0.6/.venv-default/bin/activate_this.py +38 -0
  15. crossplane_function_pythonic-0.0.6/.venv-default/bin/ipython +8 -0
  16. crossplane_function_pythonic-0.0.6/.venv-default/bin/ipython3 +8 -0
  17. crossplane_function_pythonic-0.0.6/.venv-default/bin/kopf +8 -0
  18. crossplane_function_pythonic-0.0.6/.venv-default/bin/pip +8 -0
  19. crossplane_function_pythonic-0.0.6/.venv-default/bin/pip-3.13 +8 -0
  20. crossplane_function_pythonic-0.0.6/.venv-default/bin/pip3 +8 -0
  21. crossplane_function_pythonic-0.0.6/.venv-default/bin/pip3.13 +8 -0
  22. crossplane_function_pythonic-0.0.6/.venv-default/bin/pygmentize +8 -0
  23. crossplane_function_pythonic-0.0.6/.venv-default/bin/python +1 -0
  24. crossplane_function_pythonic-0.0.6/.venv-default/bin/python3 +1 -0
  25. crossplane_function_pythonic-0.0.6/.venv-default/bin/python3.13 +1 -0
  26. crossplane_function_pythonic-0.0.6/.venv-default/pyvenv.cfg +8 -0
  27. crossplane_function_pythonic-0.0.6/.venv-default/share/man/man1/ipython.1 +60 -0
  28. crossplane_function_pythonic-0.0.6/.venv-test/.gitignore +2 -0
  29. crossplane_function_pythonic-0.0.6/.venv-test/CACHEDIR.TAG +4 -0
  30. crossplane_function_pythonic-0.0.6/.venv-test/bin/activate +87 -0
  31. crossplane_function_pythonic-0.0.6/.venv-test/bin/activate.csh +55 -0
  32. crossplane_function_pythonic-0.0.6/.venv-test/bin/activate.fish +103 -0
  33. crossplane_function_pythonic-0.0.6/.venv-test/bin/activate.nu +96 -0
  34. crossplane_function_pythonic-0.0.6/.venv-test/bin/activate.ps1 +61 -0
  35. crossplane_function_pythonic-0.0.6/.venv-test/bin/activate_this.py +38 -0
  36. crossplane_function_pythonic-0.0.6/.venv-test/bin/coverage +8 -0
  37. crossplane_function_pythonic-0.0.6/.venv-test/bin/coverage-3.13 +8 -0
  38. crossplane_function_pythonic-0.0.6/.venv-test/bin/coverage3 +8 -0
  39. crossplane_function_pythonic-0.0.6/.venv-test/bin/kopf +8 -0
  40. crossplane_function_pythonic-0.0.6/.venv-test/bin/pip +8 -0
  41. crossplane_function_pythonic-0.0.6/.venv-test/bin/pip-3.13 +8 -0
  42. crossplane_function_pythonic-0.0.6/.venv-test/bin/pip3 +8 -0
  43. crossplane_function_pythonic-0.0.6/.venv-test/bin/pip3.13 +8 -0
  44. crossplane_function_pythonic-0.0.6/.venv-test/bin/py.test +8 -0
  45. crossplane_function_pythonic-0.0.6/.venv-test/bin/pygmentize +8 -0
  46. crossplane_function_pythonic-0.0.6/.venv-test/bin/pytest +8 -0
  47. crossplane_function_pythonic-0.0.6/.venv-test/bin/python +1 -0
  48. crossplane_function_pythonic-0.0.6/.venv-test/bin/python3 +1 -0
  49. crossplane_function_pythonic-0.0.6/.venv-test/bin/python3.13 +1 -0
  50. crossplane_function_pythonic-0.0.6/.venv-test/pyvenv.cfg +8 -0
  51. crossplane_function_pythonic-0.0.6/Dockerfile +15 -0
  52. crossplane_function_pythonic-0.0.6/LICENSE +201 -0
  53. crossplane_function_pythonic-0.0.6/PKG-INFO +540 -0
  54. crossplane_function_pythonic-0.0.6/README.md +519 -0
  55. crossplane_function_pythonic-0.0.6/crossplane/pythonic/__init__.py +19 -0
  56. crossplane_function_pythonic-0.0.6/crossplane/pythonic/composite.py +670 -0
  57. crossplane_function_pythonic-0.0.6/crossplane/pythonic/function.py +260 -0
  58. crossplane_function_pythonic-0.0.6/crossplane/pythonic/main.py +187 -0
  59. crossplane_function_pythonic-0.0.6/crossplane/pythonic/packages.py +158 -0
  60. crossplane_function_pythonic-0.0.6/crossplane/pythonic/protobuf.py +941 -0
  61. crossplane_function_pythonic-0.0.6/examples/.dev/functions.yaml +13 -0
  62. crossplane_function_pythonic-0.0.6/examples/alert.tgz +0 -0
  63. crossplane_function_pythonic-0.0.6/examples/argo.tgz +0 -0
  64. crossplane_function_pythonic-0.0.6/examples/argocd-application/composition.yaml +87 -0
  65. crossplane_function_pythonic-0.0.6/examples/argocd-application/extra.yaml +53 -0
  66. crossplane_function_pythonic-0.0.6/examples/argocd-application/functions.yaml +13 -0
  67. crossplane_function_pythonic-0.0.6/examples/argocd-application/render.sh +3 -0
  68. crossplane_function_pythonic-0.0.6/examples/argocd-application/xr.yaml +6 -0
  69. crossplane_function_pythonic-0.0.6/examples/argocd-application/xrd.yaml +34 -0
  70. crossplane_function_pythonic-0.0.6/examples/argocd.tgz +0 -0
  71. crossplane_function_pythonic-0.0.6/examples/ds-mod/composition.yaml +36 -0
  72. crossplane_function_pythonic-0.0.6/examples/ds-mod/daemonset.yaml +35 -0
  73. crossplane_function_pythonic-0.0.6/examples/ds-mod/functions.yaml +9 -0
  74. crossplane_function_pythonic-0.0.6/examples/ds-mod/render.sh +3 -0
  75. crossplane_function_pythonic-0.0.6/examples/ds-mod/xr.yaml +8 -0
  76. crossplane_function_pythonic-0.0.6/examples/ds-mod/xrd.yaml +25 -0
  77. crossplane_function_pythonic-0.0.6/examples/eks-cluster/composition-v2.yaml +138 -0
  78. crossplane_function_pythonic-0.0.6/examples/eks-cluster/composition.yaml +124 -0
  79. crossplane_function_pythonic-0.0.6/examples/eks-cluster/definition.yaml +47 -0
  80. crossplane_function_pythonic-0.0.6/examples/eks-cluster/functions.yaml +8 -0
  81. crossplane_function_pythonic-0.0.6/examples/eks-cluster/render-v2.sh +3 -0
  82. crossplane_function_pythonic-0.0.6/examples/eks-cluster/render.sh +3 -0
  83. crossplane_function_pythonic-0.0.6/examples/eks-cluster/xr.yaml +12 -0
  84. crossplane_function_pythonic-0.0.6/examples/filing-system/README.md +13 -0
  85. crossplane_function_pythonic-0.0.6/examples/filing-system/composition.yaml +17 -0
  86. crossplane_function_pythonic-0.0.6/examples/filing-system/definition.yaml +21 -0
  87. crossplane_function_pythonic-0.0.6/examples/filing-system/function.yaml +10 -0
  88. crossplane_function_pythonic-0.0.6/examples/filing-system/kustomization.yaml +18 -0
  89. crossplane_function_pythonic-0.0.6/examples/filing-system/runtime.yaml +23 -0
  90. crossplane_function_pythonic-0.0.6/examples/filing-system/vcluster.py +38 -0
  91. crossplane_function_pythonic-0.0.6/examples/filing-system/vcluster.yaml +5 -0
  92. crossplane_function_pythonic-0.0.6/examples/function-go-templating/conditions/composition.yaml +35 -0
  93. crossplane_function_pythonic-0.0.6/examples/function-go-templating/conditions/functions.yaml +25 -0
  94. crossplane_function_pythonic-0.0.6/examples/function-go-templating/conditions/render.sh +3 -0
  95. crossplane_function_pythonic-0.0.6/examples/function-go-templating/conditions/xr.yaml +5 -0
  96. crossplane_function_pythonic-0.0.6/examples/function-go-templating/conditions/xrd.yaml +25 -0
  97. crossplane_function_pythonic-0.0.6/examples/function-go-templating/context/composition.yaml +42 -0
  98. crossplane_function_pythonic-0.0.6/examples/function-go-templating/context/environmentConfigs.yaml +10 -0
  99. crossplane_function_pythonic-0.0.6/examples/function-go-templating/context/functions.yaml +25 -0
  100. crossplane_function_pythonic-0.0.6/examples/function-go-templating/context/render.sh +3 -0
  101. crossplane_function_pythonic-0.0.6/examples/function-go-templating/context/xr.yaml +5 -0
  102. crossplane_function_pythonic-0.0.6/examples/function-go-templating/context/xrd.yaml +25 -0
  103. crossplane_function_pythonic-0.0.6/examples/function-go-templating/extra-resources/composition.yaml +29 -0
  104. crossplane_function_pythonic-0.0.6/examples/function-go-templating/extra-resources/extraResources.yaml +14 -0
  105. crossplane_function_pythonic-0.0.6/examples/function-go-templating/extra-resources/functions.yaml +9 -0
  106. crossplane_function_pythonic-0.0.6/examples/function-go-templating/extra-resources/render.sh +3 -0
  107. crossplane_function_pythonic-0.0.6/examples/function-go-templating/extra-resources/xr.yaml +6 -0
  108. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/fromYaml/composition.yaml +21 -0
  109. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/fromYaml/functions.yaml +9 -0
  110. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/fromYaml/render.sh +3 -0
  111. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/fromYaml/xr.yaml +9 -0
  112. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getComposedResource/composition.yaml +28 -0
  113. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getComposedResource/functions.yaml +9 -0
  114. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getComposedResource/observed.yaml +20 -0
  115. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getComposedResource/render.sh +3 -0
  116. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getComposedResource/xr.yaml +6 -0
  117. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getCompositeResource/composition.yaml +23 -0
  118. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getCompositeResource/functions.yaml +9 -0
  119. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getCompositeResource/render.sh +3 -0
  120. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getCompositeResource/xr.yaml +7 -0
  121. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getResourceCondition/composition.yaml +27 -0
  122. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getResourceCondition/functions.yaml +9 -0
  123. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getResourceCondition/observed.yaml +21 -0
  124. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getResourceCondition/render.sh +3 -0
  125. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/getResourceCondition/xr.yaml +12 -0
  126. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/include/composition.yaml +41 -0
  127. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/include/functions.yaml +9 -0
  128. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/include/render.sh +3 -0
  129. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/include/xr.yaml +7 -0
  130. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/toYaml/composition.yaml +21 -0
  131. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/toYaml/functions.yaml +9 -0
  132. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/toYaml/render.sh +3 -0
  133. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions/toYaml/xr.yaml +12 -0
  134. crossplane_function_pythonic-0.0.6/examples/function-go-templating/functions.yaml +15 -0
  135. crossplane_function_pythonic-0.0.6/examples/function-go-templating/inline/composition.yaml +36 -0
  136. crossplane_function_pythonic-0.0.6/examples/function-go-templating/inline/functions.yaml +9 -0
  137. crossplane_function_pythonic-0.0.6/examples/function-go-templating/inline/render.sh +3 -0
  138. crossplane_function_pythonic-0.0.6/examples/function-go-templating/inline/xr.yaml +6 -0
  139. crossplane_function_pythonic-0.0.6/examples/function-go-templating/recursive/composition-real.yaml +21 -0
  140. crossplane_function_pythonic-0.0.6/examples/function-go-templating/recursive/composition-wrapper.yaml +23 -0
  141. crossplane_function_pythonic-0.0.6/examples/function-go-templating/recursive/functions.yaml +9 -0
  142. crossplane_function_pythonic-0.0.6/examples/function-go-templating/recursive/render.sh +4 -0
  143. crossplane_function_pythonic-0.0.6/examples/function-go-templating/recursive/xr.yaml +8 -0
  144. crossplane_function_pythonic-0.0.6/examples/get-started-app/composition.yaml +41 -0
  145. crossplane_function_pythonic-0.0.6/examples/get-started-app/definition.yaml +35 -0
  146. crossplane_function_pythonic-0.0.6/examples/get-started-app/functions.yaml +8 -0
  147. crossplane_function_pythonic-0.0.6/examples/get-started-app/render.sh +3 -0
  148. crossplane_function_pythonic-0.0.6/examples/get-started-app/xr.yaml +7 -0
  149. crossplane_function_pythonic-0.0.6/examples/grafana/EFCObservability.yaml +1033 -0
  150. crossplane_function_pythonic-0.0.6/examples/grafana/README.md +6 -0
  151. crossplane_function_pythonic-0.0.6/examples/grafana/alert.py +104 -0
  152. crossplane_function_pythonic-0.0.6/examples/grafana/composition.yaml +30 -0
  153. crossplane_function_pythonic-0.0.6/examples/grafana/configmap.yaml +750 -0
  154. crossplane_function_pythonic-0.0.6/examples/grafana/dashboard.json +637 -0
  155. crossplane_function_pythonic-0.0.6/examples/grafana/extra.yaml +89 -0
  156. crossplane_function_pythonic-0.0.6/examples/grafana/functions.yaml +15 -0
  157. crossplane_function_pythonic-0.0.6/examples/grafana/observed.yaml +15 -0
  158. crossplane_function_pythonic-0.0.6/examples/grafana/render.sh +3 -0
  159. crossplane_function_pythonic-0.0.6/examples/grafana/run-pythonic.sh +3 -0
  160. crossplane_function_pythonic-0.0.6/examples/grafana/secret.yaml +9 -0
  161. crossplane_function_pythonic-0.0.6/examples/grafana/xr.yaml +26 -0
  162. crossplane_function_pythonic-0.0.6/examples/helm-copy-secret/composition.yaml +17 -0
  163. crossplane_function_pythonic-0.0.6/examples/helm-copy-secret/functions.yaml +8 -0
  164. crossplane_function_pythonic-0.0.6/examples/helm-copy-secret/kustomization.yaml +16 -0
  165. crossplane_function_pythonic-0.0.6/examples/helm-copy-secret/render.sh +3 -0
  166. crossplane_function_pythonic-0.0.6/examples/helm-copy-secret/run-function.sh +3 -0
  167. crossplane_function_pythonic-0.0.6/examples/helm-copy-secret/vcluster.py +63 -0
  168. crossplane_function_pythonic-0.0.6/examples/helm-copy-secret/xr.yaml +5 -0
  169. crossplane_function_pythonic-0.0.6/examples/helm-copy-secret/xrd.yaml +21 -0
  170. crossplane_function_pythonic-0.0.6/examples/single-purpose/functions.yaml +8 -0
  171. crossplane_function_pythonic-0.0.6/examples/single-purpose/render.sh +3 -0
  172. crossplane_function_pythonic-0.0.6/examples/single-purpose/xr.yaml +9 -0
  173. crossplane_function_pythonic-0.0.6/package/composite-composition.yaml +18 -0
  174. crossplane_function_pythonic-0.0.6/package/composite-definition.yaml +32 -0
  175. crossplane_function_pythonic-0.0.6/package/crossplane.yaml +5 -0
  176. crossplane_function_pythonic-0.0.6/package/input-definition.yaml +38 -0
  177. crossplane_function_pythonic-0.0.6/pyproject.toml +125 -0
  178. crossplane_function_pythonic-0.0.6/renovate.json +6 -0
  179. crossplane_function_pythonic-0.0.6/scripts/run_function.proto +370 -0
  180. crossplane_function_pythonic-0.0.6/scripts/setup-local.sh +205 -0
  181. crossplane_function_pythonic-0.0.6/tests/fn_cases/buckets.yaml +37 -0
  182. crossplane_function_pythonic-0.0.6/tests/fn_cases/clazz.py +5 -0
  183. crossplane_function_pythonic-0.0.6/tests/fn_cases/clazz.yaml +14 -0
  184. crossplane_function_pythonic-0.0.6/tests/fn_cases/composed.yaml +57 -0
  185. crossplane_function_pythonic-0.0.6/tests/fn_cases/conditions.yaml +85 -0
  186. crossplane_function_pythonic-0.0.6/tests/fn_cases/context.yaml +46 -0
  187. crossplane_function_pythonic-0.0.6/tests/fn_cases/do-nothing.yaml +6 -0
  188. crossplane_function_pythonic-0.0.6/tests/fn_cases/extra-resources.yaml +74 -0
  189. crossplane_function_pythonic-0.0.6/tests/fn_cases/get-started-app.yaml +98 -0
  190. crossplane_function_pythonic-0.0.6/tests/fn_cases/inline.yaml +82 -0
  191. crossplane_function_pythonic-0.0.6/tests/fn_cases/unknowns-fatal.yaml +72 -0
  192. crossplane_function_pythonic-0.0.6/tests/fn_cases/unknowns-info.yaml +55 -0
  193. crossplane_function_pythonic-0.0.6/tests/fn_cases/unknowns-warning.yaml +73 -0
  194. crossplane_function_pythonic-0.0.6/tests/fn_cases/yaml.yaml +36 -0
  195. crossplane_function_pythonic-0.0.6/tests/test_fn.py +75 -0
  196. crossplane_function_pythonic-0.0.6/tests/test_protobuf_values.py +210 -0
  197. crossplane_function_pythonic-0.0.6/tests/utils.py +253 -0
@@ -0,0 +1,2 @@
1
+ [run]
2
+ omit = tests/*
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "function-pythonic-devcontainer",
3
+ "image": "mcr.microsoft.com/devcontainers/python:3.12-bookworm",
4
+ "features": {
5
+ "ghcr.io/devcontainers-extra/features/hatch:2": {},
6
+ "ghcr.io/devcontainers/features/docker-in-docker:2": {
7
+ "version": "latest",
8
+ "enableNonRootDocker": "true",
9
+ "moby": "false"
10
+ },
11
+ "ghcr.io/joebowbeer/devcontainers-features/crossplane:1": {
12
+ "channel": "stable",
13
+ "version": "current"
14
+ }
15
+ },
16
+ "postCreateCommand": "hatch env create"
17
+ }
@@ -0,0 +1,269 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - release-*
8
+ pull_request: {}
9
+ workflow_dispatch:
10
+ inputs:
11
+ version:
12
+ description: Package version (e.g. v0.1.0)
13
+ required: false
14
+
15
+ env:
16
+ # Common versions
17
+ PYTHON_VERSION: '3.13.7' # TODO: Used?
18
+ HATCH_VERSION: '1.12.0'
19
+ DOCKER_BUILDX_VERSION: 'v0.26.1'
20
+
21
+ # These environment variables are important to the Crossplane CLI install.sh
22
+ # script. They determine what version it installs.
23
+ XP_CHANNEL: stable
24
+ XP_VERSION: current
25
+
26
+ # This CI job will automatically push new builds to xpkg.upbound.io if the
27
+ # XPKG_ACCESS_ID and XPKG_TOKEN secrets are set in the GitHub respository (or
28
+ # organization) settings. Create a token at https://accounts.upbound.io.
29
+ # XPKG_ACCESS_ID: ${{ secrets.XPKG_ACCESS_ID }}
30
+
31
+ # The package to push, without a version tag. The default matches GitHub. For
32
+ # example xpkg.upbound.io/crossplane/function-template-go.
33
+ # XPKG: xpkg.upbound.io/${{ github.repository}}
34
+ CROSSPLANE_REGORG: ghcr.io/${{ github.repository}}
35
+
36
+ # The PyPi project version to push. The default is v0.0.0+gitdate-gitsha.
37
+ PYPI_VERSION: ${{ inputs.version }}
38
+
39
+ # The package version to push. The default is 0.0.0-gitsha.
40
+ XPKG_VERSION: ${{ inputs.version }}
41
+
42
+ jobs:
43
+ # lint:
44
+ # runs-on: ubuntu-24.04
45
+ # steps:
46
+ # - name: Checkout
47
+ # uses: actions/checkout@v4
48
+
49
+ # - name: Setup Python
50
+ # uses: actions/setup-python@v5
51
+ # with:
52
+ # python-version: ${{ env.PYTHON_VERSION }}
53
+
54
+ # - name: Setup Hatch
55
+ # run: pipx install hatch==1.14.1
56
+
57
+ # - name: Lint
58
+ # run: hatch run lint:check
59
+
60
+ test:
61
+ runs-on: ubuntu-24.04
62
+ steps:
63
+ - name: Checkout
64
+ uses: actions/checkout@v4
65
+
66
+ - name: Setup Python
67
+ uses: actions/setup-python@v5
68
+ with:
69
+ python-version: ${{ env.PYTHON_VERSION }}
70
+
71
+ - name: Setup Hatch
72
+ run: pipx install hatch==1.14.1
73
+
74
+ - name: Run Unit Tests
75
+ run: hatch run test:ci
76
+
77
+ #- name: Pytest coverage comment
78
+ # uses: MishaKav/pytest-coverage-comment@v1.1.54
79
+ # with:
80
+ # badge-title: Coverage
81
+ # title: Coverage Report
82
+ # pytest-xml-coverage-path: reports/pytest-coverage.xml
83
+ # junitxml-title: Unit Tests
84
+ # junitxml-path: reports/pytest-junit.xml
85
+ #hide-badge: false
86
+ #hide-report: false
87
+ #create-new-comment: false
88
+ #hide-comment: false
89
+ #report-only-changed-files: false
90
+ #remove-link-from-badge: false
91
+ #unique-id-for-comment: python3.8
92
+
93
+ build-pypi:
94
+ runs-on: ubuntu-24.04
95
+ steps:
96
+ - name: Checkout
97
+ uses: actions/checkout@v4
98
+
99
+ - name: Setup Python
100
+ uses: actions/setup-python@v5
101
+ with:
102
+ python-version: ${{ env.PYTHON_VERSION }}
103
+
104
+ - name: Setup Hatch
105
+ run: pipx install hatch==${{ env.HATCH_VERSION }}
106
+
107
+ # If a version wasn't explicitly passed as a workflow_dispatch input we
108
+ # default to version v0.0.0+<git-commit-date>-<git-short-sha>, for example
109
+ # v0.0.0+20231101115142-1091066df799. This is a simple implementation of
110
+ # Go's pseudo-versions: https://go.dev/ref/mod#pseudo-versions.
111
+ - name: Set Default PyPI Project Version
112
+ if: env.PYPI_VERSION == ''
113
+ run: echo "PYPI_VERSION=v0.0.0+$(date -d@$(git show -s --format=%ct) +%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD)" >> $GITHUB_ENV
114
+
115
+ - name: Set PyPI Project Version
116
+ run: hatch version ${{ env.PYPI_VERSION }}
117
+
118
+ - name: Build Sdist and Wheel
119
+ run: hatch build
120
+
121
+ - name: Upload Sdist and Wheel to GitHub
122
+ uses: actions/upload-artifact@v4
123
+ with:
124
+ name: dist
125
+ path: "dist/*"
126
+ if-no-files-found: error
127
+ retention-days: 1
128
+
129
+ # We want to build most packages for the amd64 and arm64 architectures. To
130
+ # speed this up we build single-platform packages in parallel. We then upload
131
+ # those packages to GitHub as a build artifact. The push job downloads those
132
+ # artifacts and pushes them as a single multi-platform package.
133
+ build-xpkg:
134
+ needs:
135
+ - build-pypi
136
+ runs-on: ubuntu-24.04
137
+ strategy:
138
+ fail-fast: true
139
+ matrix:
140
+ arch:
141
+ - amd64
142
+ - arm64
143
+ steps:
144
+ - name: Setup QEMU
145
+ uses: docker/setup-qemu-action@v3
146
+ with:
147
+ platforms: all
148
+
149
+ - name: Setup Docker Buildx
150
+ uses: docker/setup-buildx-action@v3
151
+ with:
152
+ version: ${{ env.DOCKER_BUILDX_VERSION }}
153
+ install: true
154
+
155
+ - name: Checkout
156
+ uses: actions/checkout@v4
157
+
158
+ - name: Download Wheel from GitHub
159
+ uses: actions/download-artifact@v5
160
+ with:
161
+ name: dist
162
+ pattern: '*.whl'
163
+ path: dist
164
+
165
+ # We ask Docker to use GitHub Action's native caching support to speed up
166
+ # the build, per https://docs.docker.com/build/cache/backends/gha/.
167
+ - name: Build Runtime
168
+ id: image
169
+ uses: docker/build-push-action@v6
170
+ with:
171
+ context: .
172
+ platforms: linux/${{ matrix.arch }}
173
+ cache-from: type=gha
174
+ cache-to: type=gha,mode=max
175
+ target: image
176
+ build-args:
177
+ PYTHON_VERSION=${{ env.PYTHON_VERSION }}
178
+ outputs: type=docker,dest=runtime-${{ matrix.arch }}.tar
179
+
180
+ - name: Setup the Crossplane CLI
181
+ run: "mkdir bin && cd bin && curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
182
+
183
+ - name: Build Package
184
+ run: bin/crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar
185
+
186
+ - name: Upload Single-Platform Package
187
+ uses: actions/upload-artifact@v4
188
+ with:
189
+ name: package-${{ matrix.arch }}
190
+ path: "*.xpkg"
191
+ if-no-files-found: error
192
+ retention-days: 1
193
+
194
+ publish-pypi:
195
+ # Don't publish unless we were run with an explicit version.
196
+ if: ${{ inputs.version != '' }}
197
+ needs:
198
+ - build-xpkg # only publish if xpkg builds succeeds
199
+ runs-on: ubuntu-24.04
200
+ steps:
201
+ - name: Download Sdist and Wheel from GitHub
202
+ uses: actions/download-artifact@v5
203
+ with:
204
+ name: dist
205
+ path: dist
206
+
207
+ - name: Setup Hatch
208
+ run: pipx install hatch==${{ env.HATCH_VERSION }}
209
+
210
+ - name: Publish to PyPI
211
+ env:
212
+ HATCH_INDEX_USER: __token__
213
+ HATCH_INDEX_AUTH: ${{ secrets.PYPI_API_TOKEN }}
214
+ run: hatch publish --no-prompt
215
+
216
+ # This job downloads the single-platform packages built by the build job, and
217
+ # pushes them as a multi-platform package. We only push the package it the
218
+ # XPKG_ACCESS_ID and XPKG_TOKEN secrets were provided.
219
+ push-xpkg:
220
+ needs:
221
+ - build-xpkg
222
+ runs-on: ubuntu-24.04
223
+ permissions:
224
+ contents: read
225
+ packages: write
226
+ steps:
227
+ - name: Checkout
228
+ uses: actions/checkout@v4
229
+
230
+ - name: Download Single-Platform Packages
231
+ uses: actions/download-artifact@v4
232
+ with:
233
+ # See https://github.com/docker/build-push-action/blob/263435/README.md#summaries
234
+ pattern: "!*.dockerbuild"
235
+ path: .
236
+ merge-multiple: true
237
+
238
+ - name: Setup the Crossplane CLI
239
+ run: "mkdir bin && cd bin && curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
240
+
241
+ # If a version wasn't explicitly passed as a workflow_dispatch input we
242
+ # default to version v0.0.0-<git-commit-date>-<git-short-sha>, for example
243
+ # v0.0.0-20231101115142-1091066df799. This is a simple implementation of
244
+ # Go's pseudo-versions: https://go.dev/ref/mod#pseudo-versions.
245
+ - name: Set Default Multi-Platform Package Version
246
+ if: env.XPKG_VERSION == ''
247
+ run: echo "XPKG_VERSION=v0.0.0-$(date -d@$(git show -s --format=%ct) +%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD)" >> $GITHUB_ENV
248
+
249
+ # - name: Login to Upbound
250
+ # uses: docker/login-action@v3
251
+ # if: env.XPKG_ACCESS_ID != ''
252
+ # with:
253
+ # registry: xpkg.upbound.io
254
+ # username: ${{ secrets.XPKG_ACCESS_ID }}
255
+ # password: ${{ secrets.XPKG_TOKEN }}
256
+
257
+ # - name: Push Multi-Platform Package to Upbound
258
+ # if: env.XPKG_ACCESS_ID != ''
259
+ # run: "bin/crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"
260
+
261
+ - name: Login to GHCR
262
+ uses: docker/login-action@v3
263
+ with:
264
+ registry: ghcr.io
265
+ username: ${{ github.repository_owner }}
266
+ password: ${{ secrets.GITHUB_TOKEN }}
267
+
268
+ - name: Push Multi-Platform Package to GHCR
269
+ run: "bin/crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.CROSSPLANE_REGORG }}:${{ env.XPKG_VERSION }}"
@@ -0,0 +1 @@
1
+ pmcnerthney@pmcnerthney-D09Y4DQCH6.28405
@@ -0,0 +1,269 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - release-*
8
+ pull_request: {}
9
+ workflow_dispatch:
10
+ inputs:
11
+ version:
12
+ description: Package version (e.g. v0.1.0)
13
+ required: false
14
+
15
+ env:
16
+ # Common versions
17
+ PYTHON_VERSION: '3.13.7' # TODO: Used?
18
+ HATCH_VERSION: '1.12.0'
19
+ DOCKER_BUILDX_VERSION: 'v0.26.1'
20
+
21
+ # These environment variables are important to the Crossplane CLI install.sh
22
+ # script. They determine what version it installs.
23
+ XP_CHANNEL: stable
24
+ XP_VERSION: current
25
+
26
+ # This CI job will automatically push new builds to xpkg.upbound.io if the
27
+ # XPKG_ACCESS_ID and XPKG_TOKEN secrets are set in the GitHub respository (or
28
+ # organization) settings. Create a token at https://accounts.upbound.io.
29
+ # XPKG_ACCESS_ID: ${{ secrets.XPKG_ACCESS_ID }}
30
+
31
+ # The package to push, without a version tag. The default matches GitHub. For
32
+ # example xpkg.upbound.io/crossplane/function-template-go.
33
+ # XPKG: xpkg.upbound.io/${{ github.repository}}
34
+ CROSSPLANE_REGORG: ghcr.io/${{ github.repository}}
35
+
36
+ # The PyPi project version to push. The default is v0.0.0+gitdate-gitsha.
37
+ PYPI_VERSION: ${{ inputs.version }}
38
+
39
+ # The package version to push. The default is 0.0.0-gitsha.
40
+ XPKG_VERSION: ${{ inputs.version }}
41
+
42
+ jobs:
43
+ # lint:
44
+ # runs-on: ubuntu-24.04
45
+ # steps:
46
+ # - name: Checkout
47
+ # uses: actions/checkout@v4
48
+
49
+ # - name: Setup Python
50
+ # uses: actions/setup-python@v5
51
+ # with:
52
+ # python-version: ${{ env.PYTHON_VERSION }}
53
+
54
+ # - name: Setup Hatch
55
+ # run: pipx install hatch==1.14.1
56
+
57
+ # - name: Lint
58
+ # run: hatch run lint:check
59
+
60
+ test:
61
+ runs-on: ubuntu-24.04
62
+ steps:
63
+ - name: Checkout
64
+ uses: actions/checkout@v4
65
+
66
+ - name: Setup Python
67
+ uses: actions/setup-python@v5
68
+ with:
69
+ python-version: ${{ env.PYTHON_VERSION }}
70
+
71
+ - name: Setup Hatch
72
+ run: pipx install hatch==1.14.1
73
+
74
+ - name: Run Unit Tests
75
+ run: hatch run test:ci
76
+
77
+ #- name: Pytest coverage comment
78
+ # uses: MishaKav/pytest-coverage-comment@v1.1.54
79
+ # with:
80
+ # badge-title: Coverage
81
+ # title: Coverage Report
82
+ # pytest-xml-coverage-path: reports/pytest-coverage.xml
83
+ # junitxml-title: Unit Tests
84
+ # junitxml-path: reports/pytest-junit.xml
85
+ #hide-badge: false
86
+ #hide-report: false
87
+ #create-new-comment: false
88
+ #hide-comment: false
89
+ #report-only-changed-files: false
90
+ #remove-link-from-badge: false
91
+ #unique-id-for-comment: python3.8
92
+
93
+ build-pypi:
94
+ runs-on: ubuntu-24.04
95
+ steps:
96
+ - name: Checkout
97
+ uses: actions/checkout@v4
98
+
99
+ - name: Setup Python
100
+ uses: actions/setup-python@v5
101
+ with:
102
+ python-version: ${{ env.PYTHON_VERSION }}
103
+
104
+ - name: Setup Hatch
105
+ run: pipx install hatch==${{ env.HATCH_VERSION }}
106
+
107
+ # If a version wasn't explicitly passed as a workflow_dispatch input we
108
+ # default to version v0.0.0+<git-commit-date>-<git-short-sha>, for example
109
+ # v0.0.0+20231101115142-1091066df799. This is a simple implementation of
110
+ # Go's pseudo-versions: https://go.dev/ref/mod#pseudo-versions.
111
+ - name: Set Default PyPI Project Version
112
+ if: env.PYPI_VERSION == ''
113
+ run: echo "PYPI_VERSION=v0.0.0+$(date -d@$(git show -s --format=%ct) +%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD)" >> $GITHUB_ENV
114
+
115
+ - name: Set PyPI Project Version
116
+ run: hatch version ${{ env.PYPI_VERSION }}
117
+
118
+ - name: Build Sdist and Wheel
119
+ run: hatch build
120
+
121
+ - name: Upload Sdist and Wheel to GitHub
122
+ uses: actions/upload-artifact@v4
123
+ with:
124
+ name: dist
125
+ path: "dist/*"
126
+ if-no-files-found: error
127
+ retention-days: 1
128
+
129
+ # We want to build most packages for the amd64 and arm64 architectures. To
130
+ # speed this up we build single-platform packages in parallel. We then upload
131
+ # those packages to GitHub as a build artifact. The push job downloads those
132
+ # artifacts and pushes them as a single multi-platform package.
133
+ build-xpkg:
134
+ needs:
135
+ - build-pypi
136
+ runs-on: ubuntu-24.04
137
+ strategy:
138
+ fail-fast: true
139
+ matrix:
140
+ arch:
141
+ - amd64
142
+ - arm64
143
+ steps:
144
+ - name: Setup QEMU
145
+ uses: docker/setup-qemu-action@v3
146
+ with:
147
+ platforms: all
148
+
149
+ - name: Setup Docker Buildx
150
+ uses: docker/setup-buildx-action@v3
151
+ with:
152
+ version: ${{ env.DOCKER_BUILDX_VERSION }}
153
+ install: true
154
+
155
+ - name: Checkout
156
+ uses: actions/checkout@v4
157
+
158
+ - name: Download Wheel from GitHub
159
+ uses: actions/download-artifact@v5
160
+ with:
161
+ name: dist
162
+ pattern: '*.whl'
163
+ path: dist
164
+
165
+ # We ask Docker to use GitHub Action's native caching support to speed up
166
+ # the build, per https://docs.docker.com/build/cache/backends/gha/.
167
+ - name: Build Runtime
168
+ id: image
169
+ uses: docker/build-push-action@v6
170
+ with:
171
+ context: .
172
+ platforms: linux/${{ matrix.arch }}
173
+ cache-from: type=gha
174
+ cache-to: type=gha,mode=max
175
+ target: image
176
+ build-args:
177
+ PYTHON_VERSION=${{ env.PYTHON_VERSION }}
178
+ outputs: type=docker,dest=runtime-${{ matrix.arch }}.tar
179
+
180
+ - name: Setup the Crossplane CLI
181
+ run: "mkdir bin && cd bin && curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
182
+
183
+ - name: Build Package
184
+ run: bin/crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar
185
+
186
+ - name: Upload Single-Platform Package
187
+ uses: actions/upload-artifact@v4
188
+ with:
189
+ name: package-${{ matrix.arch }}
190
+ path: "*.xpkg"
191
+ if-no-files-found: error
192
+ retention-days: 1
193
+
194
+ publish-pypi:
195
+ # Don't publish unless we were run with an explicit version.
196
+ if: ${{ inputs.version != '' }}
197
+ needs:
198
+ - build-xpkg # only publish if xpkg builds succeeds
199
+ runs-on: ubuntu-24.04
200
+ steps:
201
+ - name: Download Sdist and Wheel from GitHub
202
+ uses: actions/download-artifact@v5
203
+ with:
204
+ name: dist
205
+ path: dist
206
+
207
+ - name: Setup Hatch
208
+ run: pipx install hatch==${{ env.HATCH_VERSION }}
209
+
210
+ - name: Publish to PyPI
211
+ env:
212
+ HATCH_INDEX_USER: __token__
213
+ HATCH_INDEX_AUTH: ${{ secrets.PYPI_API_TOKEN }}
214
+ run: hatch publish --no-prompt
215
+
216
+ # This job downloads the single-platform packages built by the build job, and
217
+ # pushes them as a multi-platform package. We only push the package it the
218
+ # XPKG_ACCESS_ID and XPKG_TOKEN secrets were provided.
219
+ push-xpkg:
220
+ needs:
221
+ - build-xpkg
222
+ runs-on: ubuntu-24.04
223
+ permissions:
224
+ contents: read
225
+ packages: write
226
+ steps:
227
+ - name: Checkout
228
+ uses: actions/checkout@v4
229
+
230
+ - name: Download Single-Platform Packages
231
+ uses: actions/download-artifact@v4
232
+ with:
233
+ # See https://github.com/docker/build-push-action/blob/263435/README.md#summaries
234
+ pattern: "!*.dockerbuild"
235
+ path: .
236
+ merge-multiple: true
237
+
238
+ - name: Setup the Crossplane CLI
239
+ run: "mkdir bin && cd bin && curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"
240
+
241
+ # If a version wasn't explicitly passed as a workflow_dispatch input we
242
+ # default to version v0.0.0-<git-commit-date>-<git-short-sha>, for example
243
+ # v0.0.0-20231101115142-1091066df799. This is a simple implementation of
244
+ # Go's pseudo-versions: https://go.dev/ref/mod#pseudo-versions.
245
+ - name: Set Default Multi-Platform Package Version
246
+ if: env.XPKG_VERSION == ''
247
+ run: echo "XPKG_VERSION=v0.0.0-$(date -d@$(git show -s --format=%ct) +%Y%m%d%H%M%S)-$(git rev-parse --short=12 HEAD)" >> $GITHUB_ENV
248
+
249
+ # - name: Login to Upbound
250
+ # uses: docker/login-action@v3
251
+ # if: env.XPKG_ACCESS_ID != ''
252
+ # with:
253
+ # registry: xpkg.upbound.io
254
+ # username: ${{ secrets.XPKG_ACCESS_ID }}
255
+ # password: ${{ secrets.XPKG_TOKEN }}
256
+
257
+ # - name: Push Multi-Platform Package to Upbound
258
+ # if: env.XPKG_ACCESS_ID != ''
259
+ # run: "bin/crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.XPKG }}:${{ env.XPKG_VERSION }}"
260
+
261
+ - name: Login to GHCR
262
+ uses: docker/login-action@v3
263
+ with:
264
+ registry: ghcr.io
265
+ username: ${{ github.repository_owner }}
266
+ password: ${{ secrets.GITHUB_TOKEN }}
267
+
268
+ - name: Push Multi-Platform Package to GHCR
269
+ run: "bin/crossplane --verbose xpkg push --package-files $(echo *.xpkg|tr ' ' ,) ${{ env.CROSSPLANE_REGORG }}:${{ env.XPKG_VERSION }}"