anvilistas / amoni

A command line utility for local development of Anvil apps.
Other
14 stars 4 forks source link

Option to select version for dependencies #20

Open erikcw opened 1 year ago

erikcw commented 1 year ago

I'm in the process of setting up an existing anvil app with amoni to streamline local development. However, my app has several dependencies that are pinned to specific versions and amoni checks out the latest commit from each repo. For example, anvil_extras==v2.1.3.

It would be really nice to be able to set the dependencies version, maybe a UX like: amoni app add --as-dependency https://github.com/anvilistas/anvil-extras.git anvil_extras C6ZZPAPN4YYF5NVJ --version v2.1.3

Another possible way to pass this information in could be to augment the git repo URL, similar to pip install -e "git+https://github.com/anvilistas/anvil-extras@v2.1.3#egg=anvil_extras". This approach is nice because it allows some flexibility in using tags/commits/branches without adding separate flags for each.

To the best of my knowledge, there isn't a way to pin a submodule at a specific tag or commit hash in .gitmodules. I did find this blog post and it seems to work after testing: https://twoguysarguing.wordpress.com/2010/11/14/tie-git-submodules-to-a-particular-commit-or-branch/

Since amoni app add already performs commits changes made to the local repo, adding this seems like a natural extension.