A template for writing a composition function in Python
Go to file
Bob Haddleton c227474213
Merge pull request #118 from crossplane/renovate/ipython-9.x
chore(deps): update dependency ipython to v9.1.0
2025-04-23 14:08:42 -05:00
.github chore(deps): update dependency ubuntu to v24 2024-10-10 04:48:06 +00:00
example Use a more illustrative default example 2024-10-09 21:44:22 -07:00
function Use a more illustrative default example 2024-10-09 21:44:22 -07:00
package Use a more illustrative default example 2024-10-09 21:44:22 -07:00
tests Use a more illustrative default example 2024-10-09 21:44:22 -07:00
.gitignore Initial commit 2023-11-21 13:48:35 -08:00
Dockerfile Add function-template-python 2023-11-21 18:24:54 -08:00
LICENSE Initial commit 2023-11-21 13:48:35 -08:00
README.md Use latest hatch, with `hatch fmt` and `hatch test` 2024-10-09 21:43:31 -07:00
pyproject.toml chore(deps): update dependency ipython to v9.1.0 2025-04-07 10:45:37 +00:00
renovate.json Add renovate.json 2023-11-21 21:48:54 +00:00

README.md

function-template-python

CI

A template for writing a composition function in Python.

To learn how to use this template:

If you just want to jump in and get started:

  1. Replace function-template-python with your function's name in package/crossplane.yaml.
  2. Add your logic to RunFunction in function/fn.py
  3. Add tests for your logic in test/test_fn.py
  4. Update this file, README.md, to be about your function!

This template uses Python, Docker, and the Crossplane CLI to build functions.

# Run the code in development mode, for crossplane beta render
hatch run development

# Lint and format the code - see pyproject.toml
hatch fmt

# Run unit tests - see tests/test_fn.py
hatch test

# Build the function's runtime image - see Dockerfile
$ docker build . --tag=runtime

# Build a function package - see package/crossplane.yaml
$ crossplane xpkg build -f package --embed-runtime-image=runtime