Skip to content

Commit ef706e2

Browse files
authored
Merge pull request #866 from LalatenduMohanty/buidtime_runtime_docs
docs(concepts): add build vs runtime dependencies
2 parents 81d7024 + 36d2c16 commit ef706e2

3 files changed

Lines changed: 50 additions & 0 deletions

File tree

docs/concepts/dependencies.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Understanding Dependency Types
2+
==============================
3+
4+
Fromager tracks 5 dependency types, grouped into build-time and runtime categories.
5+
6+
Requirement Types
7+
-----------------
8+
9+
**Build-Time** (must be built before parent):
10+
11+
- ``build-system`` — From ``pyproject.toml`` ``[build-system].requires`` with a fallback to a default provider (see PEP 517)
12+
- ``build-backend`` — Returned by Fromager hooks, which call PEP 517 hooks like ``get_requires_for_build_wheel`` by default
13+
- ``build-sdist`` — Returned by Fromager hooks, which call PEP 517 hooks by default
14+
15+
.. note::
16+
17+
Both backend and sdist requirements are built before a package can be built.
18+
19+
**Runtime** (processed after parent is built):
20+
21+
- ``toplevel`` — Packages specified via CLI or requirements file
22+
- ``install`` — Runtime dependencies extracted from built wheel (``install_requires``)
23+
24+
Key Behavior
25+
------------
26+
27+
**Build dependency fails** → Parent **cannot build**
28+
29+
**Install dependency fails** → Parent **may still build** (failure occurs at runtime)
30+
31+
Identifying in graph.json
32+
-------------------------
33+
34+
Each edge shows ``req_type``:
35+
36+
.. code-block:: json
37+
38+
{"req_type": "build-system", "req": "setuptools>=45"}
39+
{"req_type": "install", "req": "requests>=2.28"}
40+
41+
Use ``fromager graph to-dot --install-only`` to filter runtime-only dependencies.

docs/concepts/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Concepts
2+
========
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
7+
dependencies
8+

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ those special cases directly into fromager.
2929
using.md
3030
getting-started.rst
3131
customization.md
32+
concepts/index.rst
3233
how-tos/index.rst
3334
hooks.rst
3435
files.md

0 commit comments

Comments
 (0)