A template for writing a composition function in Python
Go to file
renovate[bot] e7861f217b
chore(deps): update dependency grpcio to v1.66.2
2024-09-28 15:27:30 +00:00
.github
example
function update to v1 types 2024-09-25 14:51:34 +02:00
package
tests update to v1 types 2024-09-25 14:51:34 +02:00
.gitignore
Dockerfile
LICENSE
README.md update to v1 types 2024-09-25 14:51:34 +02:00
pyproject.toml chore(deps): update dependency grpcio to v1.66.2 2024-09-28 15:27:30 +00:00
renovate.json

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 the code - see pyproject.toml
hatch run lint:check

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

# 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