aider/requirements/requirements-help.txt
Claudia Pellegrino 31c4198cee
fix: let fewer conflicts occur across requirements
**tl;dr** Introduce a common umbrella constraints file (that works
across requirement extras) to avoid package version conflicts and
to reduce the need for manual pinning in `*.in` files.

Previously, spurious package version conflicts could sometimes occur
across requirements for `pip install -e .`, `pip install -e .[help]`,
`pip install -e .[playwright]`, and so on. Here’s why:

- There are five different requirement configs: the set of base
  requirements (`requirements.txt`) and four additional requirement sets\
  (aka "extras"): `dev`, `help`, `browser`, and `playwright`.

- Each of those five configurations spans its own tree of dependencies
  [1]. Those five trees can slightly overlap. (For example, `greenlet`
  is a transitive requirement for both the `help` and `playwright`
  trees, respectively.)

- If you want to resolve those dependency trees so you get concrete
  version numbers, you can’t just look at each tree independently.
  This is because when trees overlap, they sometimes pull in the same
  package for different reasons, respectively, and maybe with different
  version constraints.
  For example, the `help` tree pulls in `greenlet`, because `sqlalchemy`
  requires it. At the same time, the `playwright` tree also pulls in
  `greenlet` because it’s needed by the `playwright` package.
  Resolving those constraints strictly individually (i.e., per tree) is
  usually a mistake. It may work for a while, but occasionally you’re
  going to end up with two conflicting versions of the same package.

To prevent those version conflicts from occurring, the five
`pip-compile` invocations were designed as a chain.
The process starts at the smallest tree (i.e., the base
`requirements.in` file). It calculates the version numbers for the tree,
remembers the result, and feeds it into the calculation of the next
tree.

The chain design somewhat helped mitigate conflicts, but not always.
The reason for that is that the chain works like a greedy algorithm:
once a decision has been made for a given package in a tree, that
decision is immediately final, and the compilation process isn’t allowed
to go back and change that decision if it learns new information.
New information comes in all the time, because larger trees usually have
more complex constraints than smaller trees, and the process visits
larger trees later, facing additional constraints as it hops from tree
to tree. Sometimes it bumps into a new constraint against a package for
which it has already made a decision earlier (i.e., it has pinned the
concrete version number in the `requirements*.txt` file of an earlier
tree).

That’s why the greedy chain-based method, even though it mostly works
just fine, can never avoid spurious conflicts entirely.
To help mitigate those conflicts, pinning entries were manually added to
`requirements.in` files on a case-by-case basis as conflicts occurred.
Those entries can make the file difficult to reason about, and they must
be kept in sync manually as packages get upgraded. That’s a maintenance
burden.

Turning the chain into an umbrella may help. Instead of hopping from
tree to tree, look at the entire forest at once, calculate all the
concrete version numbers for all trees in one fell swoop, and save the
results in a common, all-encompassing umbrella file.

Armed with the umbrella file (called `common-constraints.txt`), visit
each tree (in any order – it no longer matters) and feed it just the
umbrella file as a constraint, along with its own `*.in` file as the
input.
Chaining is no longer necessary, because the umbrella file already
contains all version constraints for all the packages one tree could
possibly need, and then some.

This technique should reduce manual pinning inside `*.in` files, and
makes sure that computed version numbers no longer contradict each other
across trees.

[1]: From a graph theory point of view, I’m being blatantly incorrect
here; those dependency graphs are usually not trees, because they have
cycles. I’m still going to call them "trees" for the sake of this
discussion, because the word "tree" feels less abstract and intimidating
and hopefully more relatable.
2025-03-02 02:50:03 +01:00

301 lines
7.1 KiB
Text

#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --allow-unsafe --constraint=requirements/common-constraints.txt --output-file=requirements/requirements-help.txt requirements/requirements-help.in
#
aiohappyeyeballs==2.4.6
# via
# -c requirements/common-constraints.txt
# aiohttp
aiohttp==3.11.13
# via
# -c requirements/common-constraints.txt
# huggingface-hub
# llama-index-core
aiosignal==1.3.2
# via
# -c requirements/common-constraints.txt
# aiohttp
annotated-types==0.7.0
# via
# -c requirements/common-constraints.txt
# pydantic
anyio==4.8.0
# via
# -c requirements/common-constraints.txt
# httpx
attrs==25.1.0
# via
# -c requirements/common-constraints.txt
# aiohttp
certifi==2025.1.31
# via
# -c requirements/common-constraints.txt
# httpcore
# httpx
# requests
charset-normalizer==3.4.1
# via
# -c requirements/common-constraints.txt
# requests
click==8.1.8
# via
# -c requirements/common-constraints.txt
# nltk
dataclasses-json==0.6.7
# via
# -c requirements/common-constraints.txt
# llama-index-core
deprecated==1.2.18
# via
# -c requirements/common-constraints.txt
# llama-index-core
dirtyjson==1.0.8
# via
# -c requirements/common-constraints.txt
# llama-index-core
filelock==3.17.0
# via
# -c requirements/common-constraints.txt
# huggingface-hub
# torch
# transformers
filetype==1.2.0
# via
# -c requirements/common-constraints.txt
# llama-index-core
frozenlist==1.5.0
# via
# -c requirements/common-constraints.txt
# aiohttp
# aiosignal
fsspec==2025.2.0
# via
# -c requirements/common-constraints.txt
# huggingface-hub
# llama-index-core
# torch
greenlet==3.0.3
# via
# -c requirements/common-constraints.txt
# sqlalchemy
h11==0.14.0
# via
# -c requirements/common-constraints.txt
# httpcore
httpcore==1.0.7
# via
# -c requirements/common-constraints.txt
# httpx
httpx==0.28.1
# via
# -c requirements/common-constraints.txt
# llama-index-core
huggingface-hub[inference]==0.29.1
# via
# -c requirements/common-constraints.txt
# llama-index-embeddings-huggingface
# sentence-transformers
# tokenizers
# transformers
idna==3.10
# via
# -c requirements/common-constraints.txt
# anyio
# httpx
# requests
# yarl
jinja2==3.1.5
# via
# -c requirements/common-constraints.txt
# torch
joblib==1.4.2
# via
# -c requirements/common-constraints.txt
# nltk
# scikit-learn
llama-index-core==0.12.20
# via
# -c requirements/common-constraints.txt
# -r requirements/requirements-help.in
# llama-index-embeddings-huggingface
llama-index-embeddings-huggingface==0.5.2
# via
# -c requirements/common-constraints.txt
# -r requirements/requirements-help.in
markupsafe==3.0.2
# via
# -c requirements/common-constraints.txt
# jinja2
marshmallow==3.26.1
# via
# -c requirements/common-constraints.txt
# dataclasses-json
mpmath==1.3.0
# via
# -c requirements/common-constraints.txt
# sympy
multidict==6.1.0
# via
# -c requirements/common-constraints.txt
# aiohttp
# yarl
mypy-extensions==1.0.0
# via
# -c requirements/common-constraints.txt
# typing-inspect
nest-asyncio==1.6.0
# via
# -c requirements/common-constraints.txt
# llama-index-core
networkx==3.2.1
# via
# -c requirements/common-constraints.txt
# llama-index-core
# torch
nltk==3.9.1
# via
# -c requirements/common-constraints.txt
# llama-index-core
numpy==1.26.4
# via
# -c requirements/common-constraints.txt
# llama-index-core
# scikit-learn
# scipy
# transformers
packaging==24.2
# via
# -c requirements/common-constraints.txt
# huggingface-hub
# marshmallow
# transformers
pillow==10.4.0
# via
# -c requirements/common-constraints.txt
# llama-index-core
# sentence-transformers
propcache==0.3.0
# via
# -c requirements/common-constraints.txt
# aiohttp
# yarl
pydantic==2.10.6
# via
# -c requirements/common-constraints.txt
# llama-index-core
pydantic-core==2.27.2
# via
# -c requirements/common-constraints.txt
# pydantic
pyyaml==6.0.2
# via
# -c requirements/common-constraints.txt
# huggingface-hub
# llama-index-core
# transformers
regex==2024.11.6
# via
# -c requirements/common-constraints.txt
# nltk
# tiktoken
# transformers
requests==2.32.3
# via
# -c requirements/common-constraints.txt
# huggingface-hub
# llama-index-core
# tiktoken
# transformers
safetensors==0.5.3
# via
# -c requirements/common-constraints.txt
# transformers
scikit-learn==1.6.1
# via
# -c requirements/common-constraints.txt
# sentence-transformers
scipy==1.13.1
# via
# -c requirements/common-constraints.txt
# scikit-learn
# sentence-transformers
sentence-transformers==3.4.1
# via
# -c requirements/common-constraints.txt
# llama-index-embeddings-huggingface
sniffio==1.3.1
# via
# -c requirements/common-constraints.txt
# anyio
sqlalchemy[asyncio]==2.0.38
# via
# -c requirements/common-constraints.txt
# llama-index-core
# sqlalchemy
sympy==1.13.3
# via
# -c requirements/common-constraints.txt
# torch
tenacity==9.0.0
# via
# -c requirements/common-constraints.txt
# llama-index-core
threadpoolctl==3.5.0
# via
# -c requirements/common-constraints.txt
# scikit-learn
tiktoken==0.9.0
# via
# -c requirements/common-constraints.txt
# llama-index-core
tokenizers==0.19.1
# via
# -c requirements/common-constraints.txt
# transformers
torch==2.2.2
# via
# -c requirements/common-constraints.txt
# sentence-transformers
tqdm==4.67.1
# via
# -c requirements/common-constraints.txt
# huggingface-hub
# llama-index-core
# nltk
# sentence-transformers
# transformers
transformers==4.44.2
# via
# -c requirements/common-constraints.txt
# sentence-transformers
typing-extensions==4.12.2
# via
# -c requirements/common-constraints.txt
# anyio
# huggingface-hub
# llama-index-core
# pydantic
# pydantic-core
# sqlalchemy
# torch
# typing-inspect
typing-inspect==0.9.0
# via
# -c requirements/common-constraints.txt
# dataclasses-json
# llama-index-core
urllib3==2.3.0
# via
# -c requirements/common-constraints.txt
# requests
wrapt==1.17.2
# via
# -c requirements/common-constraints.txt
# deprecated
# llama-index-core
yarl==1.18.3
# via
# -c requirements/common-constraints.txt
# aiohttp