sudoblockio / tackle

Tackle is a programmable configuration language for building modular utilities, code generators, and CLIs with schema validation baked in.
Apache License 2.0
52 stars 2 forks source link

Figure out better lazy import functionality #174

Open robcxyz opened 1 year ago

robcxyz commented 1 year ago

Prior version of tackle put data in an init.py for importing lazy hooks (ie hooks with a dependency that would throw an error if it was imported directly and hence we only import it / install its dependency when we actually use it).

Future versions will want to also have this functionality but also be able to pin to various versions of a hook and thus, this needs to be rethought as those two parts should be combined into one. For instance for terraform you can have a lock file which is generated and points to specific versions of a provider. Lots of examples from other tools that have this functionality.

We should have some lock file ourselves and then further, that lock file should enable lazy importing. Building a hook right now to freeze dependencies making startup times much faster. Once that is done-ish, I think it is time to come up with the lock file format and then include an additional special argument like help to freeze the dependencies of a provider.

WIP issue, hopefully we launch before needing this and get some real feedback.