Hacker News new | ask | show | jobs
by mariocesar 2214 days ago
Yes !! I just create a Makefile target and pip-tools is all I need. I create a requirements.in and that is all. So far never feel that has to be more complicated than that. And when I want to upgrade a package I update the requirements.in if I need to and run `make -B` for this:

  default: requirements-develop.txt
    pip install -r requirements-develop.txt

  requirements.txt:
    pip-compile -v requirements.in

  requirements-develop.txt: requirements.txt
    pip-compile -v requirements-develop.in
I so nice to just write `make` than doing all the Poetry, Pipenv stuff, that honestly I feel is not adding nothing really really useful to the workflow.
1 comments

Does it pin versions of 2nd degree dependencies too? Like pip freeze would do? Also, when you remove a package, does it know to clear packages that were its deps and are not needed anymore?
pip-tools can do both of those, yes.

For the second, pip-compile computes the new requirements.txt (which is effectively the lockfile) from scratch, and pip-sync (not shown in that Makefile fragment) removes packages that are no longer listed there.

Thanks a lot for the reply. I'll include it some time soon in the article update
Yes, and yes