-
Notifications
You must be signed in to change notification settings - Fork 31
Description
Given that you are generating a prod.txt and dev.txt where dev is a child of prod. If you add/remove a dependency from prod.txt then dev.txt is not necessarily modified at all since dev.txt simply includes -r prod.txt. When combining this with env caching, it means you cannot generate the cache key using only dev.txt but instead have to include both prod.txt and dev.txt in order to properly manage the invalidate/regenerate the cache.
For example, in Github actions, because my project utilizes several different envs, I am forced to use a hash of all files in the requirements dir. This ends up with the cache key including ${{ hashFiles('requirements/**.txt') }}. This is imperfect since I am then overly aggressive with invalidation/regeneration since all envs will be purged if any of the envs are changed.
Is there a better solution for this I am unaware of? Would we be open to an arg that tells pip-compile-multi to include all packages within the child .txt (avoid using -r prod.txt)? Or perhaps we could include the SHA1 of all parent files in the header comment?