From c8b87560c71be186dd2459538992df0a072e0b9a Mon Sep 17 00:00:00 2001 From: Tim McCormack Date: Thu, 29 Apr 2021 13:45:08 +0000 Subject: [PATCH] doc: Describe how to upgrade a single dependency (#27471) --- requirements/README.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/requirements/README.rst b/requirements/README.rst index 1855331536..0aef1b4c24 100644 --- a/requirements/README.rst +++ b/requirements/README.rst @@ -1,3 +1,6 @@ +Requirements/dependencies +========================= + These directories specify the Python (and system) dependencies for the LMS and Studio. - ``edx`` contains the normal Python requirements files @@ -8,3 +11,16 @@ These directories specify the Python (and system) dependencies for the LMS and S directly in the requirements directory.) .. _OEP-18: https://github.com/edx/open-edx-proposals/blob/master/oeps/oep-0018-bp-python-dependencies.rst + +Upgrading just one dependency +----------------------------- + +Want to upgrade/downgrade just *one* dependency without pulling in other upgrades? Here's how: + +1. Add ``my-dep==1.2.3`` to ``requirements/constraints.txt`` temporarily (pin the specific version you want to upgrade to) +2. Run ``make compile-requirements`` to recompute dependencies with this new constraint +3. Remove your constraint + +The resulting changes can then be committed. + +This is particularly useful when you need to downgrade a dependency which brought in a bug but don't want to roll back all dependency changes. It's also considerably safer than trying to manually edit the ``*.txt`` files, which can easily result in incompatible dependency versions.