Files
edx-platform/requirements
Kyle McCormick ed8d0e28bb build: add docs to github.in & ensure ArbiBOM sees changes to it (#31824)
Nine different URL-specified Python dependencies had
accumulated in edx-platform, noticably increasing the amount
time it took to install edx-platform requirements.

After many developer hours of work, we are nearly finished
converting them to PyPI-hosted depencencies:
openedx/wg-developer-experience#153

We're making these updates in hopes that we don't end
up with so many URL-specified depencencies again.
We're also updating OEP-18:
https://github.com/openedx/open-edx-proposals/pull/450

The CODEOWNERS update would mean that Arbi-BOM is notified
on all future PRs that change github.in. At the moment, edx-platform
does not *require* CODEOWNER review, so this is not a *hard* gate to
github.in changes.
2023-03-06 15:15:01 +00:00
..
2018-04-13 14:10:40 -04:00
2023-01-30 11:27:27 -05:00
2022-05-24 15:15:00 +05:00

Requirements/dependencies
=========================

These directories specify the Python (and system) dependencies for the LMS and Studio.

- ``edx`` contains the normal Python requirements files
- ``edx-sandbox`` contains the requirements files for Codejail
- ``constraints.txt`` is shared between the two

(In a normal `OEP-18`_-compliant repository, the ``*.in`` and ``*.txt`` files would be
directly in the requirements directory.)

.. _OEP-18: https://github.com/openedx/open-edx-proposals/blob/master/oeps/oep-0018-bp-python-dependencies.rst

Upgrading/downgrading just one dependency
-----------------------------------------

Want to upgrade just *one* dependency without pulling in other upgrades? Here's how:

1. Change your dependency to a minimum-version constraint, e.g. ``my-dep>=1.2.3`` (or update the constraint if it already exists)
2. Run ``make compile-requirements`` to recompute dependencies with this new constraint

If you instead need to surgically *downgrade* a dependency, perhaps in order to revert a change which broke things:

1. Add an exact-match or max-version constraint to ``constraints.txt`` with a comment explaining why (and ideally a ticket or issue link)
2. Lower the minimum-version constraint, if it exists

    - Not sure if there is one? Try going on to the next step and seeing if it complains!

3. Run ``make compile-requirements``

This is considerably safer than trying to manually edit the ``*.txt`` files, which can easily result in incompatible dependency versions.