DataDog / riot

A Python virtual env builder and command runner
https://ddriot.readthedocs.io/
Apache License 2.0
23 stars 15 forks source link

feat: add requirements caching #196

Closed majorgreys closed 1 year ago

majorgreys commented 2 years ago

This change adds the riot requirements <hash> command, which uses pip-compile to generate a requirements lockfile for the venv identified by the hash. It also adds the -c/--recompile-requirements flag to riot run. When set, this flag causes the requirements.txt lockfile and the venv itself to be regenerated. When omitted, the requirements lockfile is only built if it does not already exist.

This is a useful feature because it reduces duplicated work during riot run. In current master, every riot run has to build the dependency tree for its venv before installing those dependencies. With this change, the built dependency tree is saved in the form of a lockfile and reused on subsequent riot run invocations.

emmettbutler commented 1 year ago

@brettlangdon I signed the commit to make CI pass, but the diff is the same. Could you re-approve?