@@ -48,10 +48,94 @@ print(f"Total UC spending: £{agg.result / 1e9:.1f}bn")
4848
4949## Installation
5050
51+ ### As a library
52+
5153``` bash
5254pip install policyengine
5355```
5456
57+ This installs both UK and US country models. To install only one:
58+
59+ ``` bash
60+ pip install policyengine[uk] # UK model only
61+ pip install policyengine[us] # US model only
62+ ```
63+
64+ ### For development
65+
66+ ``` bash
67+ git clone https://github.com/PolicyEngine/policyengine.py.git
68+ cd policyengine.py
69+ uv pip install -e .[dev] # install with dev dependencies (pytest, ruff, mypy, etc.)
70+ ```
71+
72+ ## Development
73+
74+ ### Running configurations
75+
76+ | Configuration | Install | Use case |
77+ | ---------------| ---------| ----------|
78+ | ** Library user** | ` pip install policyengine ` | Using the package in your own code |
79+ | ** UK only** | ` pip install policyengine[uk] ` | Only need UK simulations |
80+ | ** US only** | ` pip install policyengine[us] ` | Only need US simulations |
81+ | ** Developer** | ` uv pip install -e .[dev] ` | Contributing to the package |
82+
83+ ### Common commands
84+
85+ ``` bash
86+ make format # ruff format
87+ make test # pytest with coverage
88+ make docs # build Jupyter Book documentation
89+ make clean # remove caches, build artifacts, .h5 files
90+ ```
91+
92+ ### Testing
93+
94+ Tests require a ` HUGGING_FACE_TOKEN ` environment variable for downloading datasets:
95+
96+ ``` bash
97+ export HUGGING_FACE_TOKEN=hf_...
98+ make test
99+ ```
100+
101+ To run a specific test:
102+
103+ ``` bash
104+ pytest tests/test_models.py -v
105+ pytest tests/test_parametric_reforms.py -k " test_uk" -v
106+ ```
107+
108+ ### Linting and type checking
109+
110+ ``` bash
111+ ruff format . # format code
112+ ruff check . # lint
113+ mypy src/policyengine # type check (informational — not yet enforced in CI)
114+ ```
115+
116+ ### CI pipeline
117+
118+ PRs trigger the following checks:
119+
120+ | Check | Status | Command |
121+ | -------| --------| ---------|
122+ | Lint + format | Required | ` ruff check . ` + ` ruff format --check . ` |
123+ | Tests (Python 3.13) | Required | ` make test ` |
124+ | Tests (Python 3.14) | Required | ` make test ` |
125+ | Mypy | Informational | ` mypy src/policyengine ` |
126+ | Docs build | Required | Jupyter Book build |
127+
128+ ### Versioning and releases
129+
130+ This project uses [ towncrier] ( https://towncrier.readthedocs.io/ ) for changelog management. When making a PR, add a changelog fragment:
131+
132+ ``` bash
133+ # Fragment types: breaking, added, changed, fixed, removed
134+ echo " Description of change" > changelog.d/my-change.added
135+ ```
136+
137+ On merge, the versioning workflow bumps the version, builds the changelog, and creates a GitHub Release.
138+
55139## Features
56140
57141- ** Multi-country support** : UK and US tax-benefit systems
0 commit comments