cookiecutter-django icon indicating copy to clipboard operation
cookiecutter-django copied to clipboard

Encapsulating package managers

Open foarsitter opened this issue 1 year ago • 1 comments

@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.

foarsitter avatar Mar 12 '24 08:03 foarsitter

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 😄

browniebroke avatar Apr 06 '24 08:04 browniebroke

Considering the progress uv is making I expect that there is no need to support more than one package manager.

foarsitter avatar Aug 27 '24 08:08 foarsitter