|
| 1 | +# Dependencies |
| 2 | + |
| 3 | +This page describes how dependencies are laid out for **xlm-core** and how to install subsets for runtime, testing, docs, linting, and extras. |
| 4 | + |
| 5 | +## How packages are wired |
| 6 | + |
| 7 | +[`setup.py`](https://github.com/dhruvdcoder/xlm-core/blob/main/setup.py) loads **`requirements.txt`** at the repo root via `install_requires`: |
| 8 | + |
| 9 | +- `pip install xlm-core` installs those runtime dependencies. |
| 10 | +- **`requirements/core_requirements.txt`** is a complementary file with stricter pins, extra comments (e.g. Lightning / Torch / datasets), and tooling lines used for local/full dev installs—not every line is mirrored in `requirements.txt`. |
| 11 | + |
| 12 | +Run commands below from the **repository root** (where `setup.py` and `requirements/` live). |
| 13 | + |
| 14 | +## Requirement files overview |
| 15 | + |
| 16 | +| File | Purpose | |
| 17 | +|------|---------| |
| 18 | +| [`requirements.txt`](https://github.com/dhruvdcoder/xlm-core/blob/main/requirements.txt) (root) | Runtime dependencies used when publishing / `pip install xlm-core` | |
| 19 | +| [`requirements/core_requirements.txt`](https://github.com/dhruvdcoder/xlm-core/blob/main/requirements/core_requirements.txt) | Full core stack with version pins and inline notes | |
| 20 | +| [`requirements/test_requirements.txt`](https://github.com/dhruvdcoder/xlm-core/blob/main/requirements/test_requirements.txt) | pytest, hypothesis, coverage | |
| 21 | +| [`requirements/dev_requirements.txt`](https://github.com/dhruvdcoder/xlm-core/blob/main/requirements/dev_requirements.txt) | Notebooks / experiment tracking helpers | |
| 22 | +| [`requirements/docs_requirements.txt`](https://github.com/dhruvdcoder/xlm-core/blob/main/requirements/docs_requirements.txt) | MkDocs site build | |
| 23 | +| [`requirements/lint_requirements.txt`](https://github.com/dhruvdcoder/xlm-core/blob/main/requirements/lint_requirements.txt) | Typecheck, formatting, flake8 ecosystem | |
| 24 | +| [`requirements/extra_requirements.txt`](https://github.com/dhruvdcoder/xlm-core/blob/main/requirements/extra_requirements.txt) | Optional analysis / plotting (lighter set) | |
| 25 | +| [`requirements/plotting_requirements.txt`](https://github.com/dhruvdcoder/xlm-core/blob/main/requirements/plotting_requirements.txt) | Heavier plotting / stats stack | |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## Root `requirements.txt` |
| 30 | + |
| 31 | +**Install:** |
| 32 | + |
| 33 | +```bash |
| 34 | +pip install -r requirements.txt |
| 35 | +``` |
| 36 | + |
| 37 | +**Role:** Canonical list consumed by setuptools for `pip install xlm-core`. Matches the pinned core stack where it matters but may omit duplicated or heavily commented lines present in `core_requirements.txt`. |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +## Core requirements (`requirements/core_requirements.txt`) |
| 42 | + |
| 43 | +**Install:** |
| 44 | + |
| 45 | +```bash |
| 46 | +pip install -r requirements/core_requirements.txt |
| 47 | +``` |
| 48 | + |
| 49 | +**Role:** Day-to-day / CI-style full environment for training and pipelines: PyTorch, Lightning, Hydra extras, HF `datasets`, `transformers`, `torchdata`, `jaxtyping`, `tensorboard`, `simple_slurm`, etc. |
| 50 | + |
| 51 | +Inline comments document choices (Torch range, Lightning version, datasets upper bound). |
| 52 | + |
| 53 | +--- |
| 54 | + |
| 55 | +## Test dependencies |
| 56 | + |
| 57 | +**Install:** |
| 58 | + |
| 59 | +```bash |
| 60 | +pip install -r requirements/test_requirements.txt |
| 61 | +``` |
| 62 | + |
| 63 | +**Included packages:** |
| 64 | + |
| 65 | +- `pytest` |
| 66 | +- `hypothesis` |
| 67 | +- `coverage[toml]` |
| 68 | + |
| 69 | +For workflows and invocation, see also [Running tests](testing/running-tests.md). |
| 70 | + |
| 71 | +Coverage configuration and pytest markers live in `pyproject.toml`. |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +## Development (`requirements/dev_requirements.txt`) |
| 76 | + |
| 77 | +**Install:** |
| 78 | + |
| 79 | +```bash |
| 80 | +pip install -r requirements/dev_requirements.txt |
| 81 | +``` |
| 82 | + |
| 83 | +Includes `jupytext` and `wandb`. |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +## Documentation build (`requirements/docs_requirements.txt`) |
| 88 | + |
| 89 | +**Install:** |
| 90 | + |
| 91 | +```bash |
| 92 | +pip install -r requirements/docs_requirements.txt |
| 93 | +``` |
| 94 | + |
| 95 | +Includes `mkdocs`, `mkdocs-material`, `mkdocstrings` (Python handler), `mike`, and `mkdocs-api-autonav`. Used when building this site locally or in CI. |
| 96 | + |
| 97 | +--- |
| 98 | + |
| 99 | +## Lint / quality (`requirements/lint_requirements.txt`) |
| 100 | + |
| 101 | +**Install:** |
| 102 | + |
| 103 | +```bash |
| 104 | +pip install -r requirements/lint_requirements.txt |
| 105 | +``` |
| 106 | + |
| 107 | +Includes `mypy`, `pre-commit`, `black`, `flake8` and related plugins (`flake8-docstrings`, `flake8-annotations`, `flake8-black`), `pytest-flake8`, `autoflake`, `darglint`, and `pre-commit-hooks`. |
| 108 | + |
| 109 | +--- |
| 110 | + |
| 111 | +## Extra (`requirements/extra_requirements.txt`) |
| 112 | + |
| 113 | +**Install:** |
| 114 | + |
| 115 | +```bash |
| 116 | +pip install -r requirements/extra_requirements.txt |
| 117 | +``` |
| 118 | + |
| 119 | +Includes `matplotlib`, `seaborn`, `networkx`, and `wandb` (overlapping with dev for experiment tracking). |
| 120 | + |
| 121 | +--- |
| 122 | + |
| 123 | +## Plotting (`requirements/plotting_requirements.txt`) |
| 124 | + |
| 125 | +**Install:** |
| 126 | + |
| 127 | +```bash |
| 128 | +pip install -r requirements/plotting_requirements.txt |
| 129 | +``` |
| 130 | + |
| 131 | +Includes `matplotlib`, `seaborn`, `statsmodels`, and `tueplots` for richer plotting notebooks or papers-style figures. |
0 commit comments