Description
Description
It's been a while that it's been good practice to pin all your dependencies. More and more, it's also becoming a good practice to also pin your nested dependencies. This is something we currently don't do.
Rationale
Recently, we had a couple of issues where upgrades of nested dependencies broke the generated projects:
- Added tornado <6.0 as an explicit dependency #1949
- Flower - Tornado version in dependency preventing start #1953
- Kombu==4.4.0 breaks celery / redis implementation Docker #1954
Use case(s) / visualization(s)
It would be nice for cookiecutter-django
to adopt this best practice, which would also avoid breaking too easily. The 3 tools trying to solve this problem that I know of are:
Pipenv & Poetry are a bit new and imply a radically different workflow. They were ruled out in the past as they only provide 2 sets of dependencies (dev & prod: #1621 #1425). Moreover, I'm not sure how maintainable the files they produce would be in the template with all the if/else branches we have.
So my personal favourite is pip-tools, the steps to do that would be:
- Make our current
requirements.txt
files intorequirements.in
files - Replace pinned versions with ranges wherever we care (e.g. Django)
- Generate the pinned
requirements.txt
- Add the various if/else to the generated requirements.txt
Then, on Travis, when pyup sends us an update, we would need to check that the requirements.in
don't produce any changes and is compatible. This is how they do it on Wharehouse (a.k.a the new PyPI). Ideally, we would do that for all combinations of the template (#591 would help).
PS: Some more reading on this topic.