The goal of this repo is to provide an example of how to use the external packages feature of truss. This README will be more of a tutorial style to a

bolasm/truss-packages-example

submited by
Style Pass
2023-01-31 00:00:05

The goal of this repo is to provide an example of how to use the external packages feature of truss. This README will be more of a tutorial style to allow you to recreate a truss which uses external code.

The goal of the external packages feature is to allow code maintained outside of the truss itself to be used inside the truss (and potentially multiple trusses). The main goal here is code reuse and allowing for all the healthy gitops and testing that python teams are used and separating those concerns from truss.

To demonstrate, I've created two simple packges inside shared/ to represent the code that is maintained outside of the truss that I want to reuse. It's a very simple dataclass and a helper/utility method for demonstration.

This key holds a list of all the directories that I want to be accessible inside the code that I write in my truss. Since we want to access both packages in our shared/ directory, let's update this key to:

Note on paths: The path of the external packages must be relative to the config.yaml file. So shared/ is the parallel to reuse_truss, but it's one directory up from the config so we use ../shared.

Leave a Comment