Implementation:Nautechsystems Nautilus trader Pyproject Configuration
| Knowledge Sources | |
|---|---|
| Domains | Build_Tooling, Python |
| Last Updated | 2026-02-10 08:00 GMT |
Overview
Root Python project configuration defining package metadata, runtime dependencies, optional extras, development tool settings, and build system configuration for the NautilusTrader v1 package.
Description
The root pyproject.toml is the Python-side counterpart to Cargo.toml, governing the nautilus_trader v1.223.0 package. It uses poetry-core as the build backend with a custom build.py script for Rust+Cython compilation. Core runtime dependencies include numpy, pandas, pyarrow, msgspec, uvloop (non-Windows), click, fsspec, pytz, tqdm, and portion. Optional extras provide exchange adapter dependencies: betfair, ib (Interactive Brokers), docker, dydx, polymarket, and visualization.
The file also centralizes all Python tooling configuration: ruff (linter/formatter with 30+ rule categories), isort (import sorting), docformatter (docstring formatting), mypy (strict type checking), pytest (test paths, asyncio mode, doctest), and coverage (branch coverage with omit patterns). Python versions 3.12-3.14 are supported.
Usage
This file governs pip install nautilus_trader and pip install -e . for development. The build-system section triggers the custom build.py script. Tool configuration is picked up automatically by ruff, mypy, pytest, and other tools when run from the repository root.
Code Reference
Source Location
- Repository: Nautechsystems_Nautilus_trader
- File: pyproject.toml
- Lines: 1-342
Signature
[project]
name = "nautilus_trader"
version = "1.223.0"
requires-python = ">=3.12,<3.15"
dependencies = [
"click>=8.0.0,<9.0.0",
"fsspec>=2025.2.0",
"msgspec>=0.20.0,<1.0.0",
"numpy>=1.26.4",
"pandas>=2.3.3,<3.0.0",
"pyarrow>=22.0.0",
"uvloop==0.22.1; sys_platform != 'win32'",
# ...
]
[build-system]
requires = ["setuptools>=80", "poetry-core==2.2.1", "numpy>=1.26.4", "cython==3.2.4"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
build = "build.py"
[tool.ruff]
target-version = "py312"
line-length = 100
[tool.mypy]
python_version = "3.12"
disallow_incomplete_defs = true
[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "strict"
Import
# Install the package
pip install nautilus_trader
# Install with optional extras
pip install "nautilus_trader[betfair,ib]"
# Development install
pip install -e ".[dev,test]"
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| project.dependencies | List[String] | Yes | Runtime dependency specifications |
| build-system.requires | List[String] | Yes | Build-time dependency specifications |
| tool.poetry.build | String | Yes | Path to custom build script (build.py) |
| project.optional-dependencies | Table | No | Optional extras (betfair, ib, docker, etc.) |
Outputs
| Name | Type | Description |
|---|---|---|
| installed package | Package | nautilus_trader installed in site-packages |
| tool config | Configuration | Settings for ruff, mypy, pytest, isort, coverage |
Usage Examples
# Standard installation
pip install nautilus_trader
# Install with Betfair and Interactive Brokers adapters
pip install "nautilus_trader[betfair,ib]"
# Development setup with all tools
pip install -e ".[dev,test,docs]"
# Run linter using config from pyproject.toml
ruff check nautilus_trader/
# Run type checker using config from pyproject.toml
mypy nautilus_trader/
# Run tests using config from pyproject.toml
pytest