cookiecutter-django
cookiecutter-django copied to clipboard
Encapsulating package managers
@Andrew-Chen-Wang, @luzfcb & @browniebroke I would like to have your opinion about this draft.
In this PR I'm trying to encapsulate pip so we can implement a variety of package managers.
One of the problems I'm experiencing is to determine which package manager is selected. I solved this by passing the cookiecutter variable to the install extension but it clutters the DX imho. {{ "ruff"|install}} is looking a way better then {{ "ruff"|install(cookiecutter)}}.
What do you think about this approach?
Feel free to fork or push to this branch.
Something that might work better is chaining the filters instead like
{{ install(cookiecutter, "development") }}
That's a good idea, I think that looks nicer... Going one step further, can we do something like this:
# install dev deps
{{ install(cookiecutter, dev=True) }}
# install prod
{{ install(cookiecutter, prod=True) }}
# install package(s)
{{ install(cookiecutter, "ruff", "flake8") }}
After my initial pushback, I think the idea is growing on me 😄
Considering the progress uv is making I expect that there is no need to support more than one package manager.