Skip to content

Commit 602f6c3

Browse files
authored
Release 1.220.0
See release notes.
2 parents af72cab + 1149efe commit 602f6c3

File tree

1,487 files changed

+159020
-37133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,487 files changed

+159020
-37133
lines changed

.cargo/config.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ rustflags = [
55
"-Aclippy::drop_non_drop",
66
]
77

8+
[target.'cfg(target_os = "linux")']
9+
rustflags = [
10+
"-C", "link-arg=-Wl,--gc-sections",
11+
"-C", "link-arg=-Wl,--as-needed",
12+
"-C", "link-arg=-Wl,-z,norelro",
13+
"-C", "relocation-model=pic",
14+
]
15+
816
[target.x86_64-apple-darwin]
917
rustflags = [
1018
"-C", "link-arg=-undefined",

.docker/DockerfileUbuntu

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ RUN apt-get update && apt-get install -y \
4040
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
4141
ENV PATH="/root/.cargo/bin:${PATH}"
4242

43-
# Install mold linker
44-
RUN curl -L https://github.com/rui314/mold/releases/download/v2.35.1/mold-2.35.1-x86_64-linux.tar.gz | tar -xz -C /usr/local --strip-components=1
45-
4643
# Install uv
4744
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
4845
ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}"

.docker/docker-compose.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
version: '3.5'
2-
31
services:
42
postgres:
53
container_name: nautilus-database
64
image: postgres
75
environment:
8-
POSTGRES_USER: ${POSTGRES_USER:-postgres}
6+
POSTGRES_USER: ${POSTGRES_USER:-nautilus}
97
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pass}
10-
POSTGRES_DATABASE: nautilus
8+
POSTGRES_DB: ${POSTGRES_DB:-nautilus}
119
PGDATA: /data/postgres
1210
volumes:
1311
- nautilus-database:/data/postgres
@@ -37,7 +35,7 @@ services:
3735
container_name: nautilus-redis
3836
image: redis
3937
ports:
40-
- 6379:6379
38+
- "6379:6379"
4139
restart: unless-stopped
4240
networks:
4341
- nautilus-network

.docker/nautilus_trader.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,4 @@ RUN find /usr/local/lib/python3.13/site-packages -name "*.pyc" -exec rm -f {} \;
4747
FROM base AS application
4848

4949
COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
50+
COPY --from=builder /usr/local/bin/ /usr/local/bin/

.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Environment Variables for NautilusTrader
2+
# Copy this file to .env and update with your actual values
3+
4+
# Data Paths
5+
# NAUTILUS_PATH should point to the root directory containing your Nautilus data
6+
# The catalog will be automatically located at NAUTILUS_PATH/catalog
7+
NAUTILUS_PATH=/path/to/nautilus/data

.github/OVERVIEW.md

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,37 @@
66
This directory contains reusable composite actions and workflow definitions for
77
CI/CD, testing, publishing, and automation within the NautilusTrader repository.
88

9-
## Composite Actions (`.github/actions`)
9+
## Composite actions (`.github/actions`)
1010

11-
- **common-setup**: prepares the environment (OS packages, Rust toolchain, Python,
12-
sccache, mold, pre-commit).
11+
- **common-setup**: prepares the environment (OS packages, Rust toolchain, Python, sccache, pre-commit).
1312
- **common-test-data**: caches large test data under `tests/test_data/large`.
14-
- **common-wheel-build**: builds and installs Python wheels across Linux,
15-
macOS, and Windows for multiple Python versions.
16-
- **publish-wheels**: publishes built wheels to Cloudflare R2, manages old wheel
17-
cleanup and index generation.
13+
- **common-wheel-build**: builds and installs Python wheels across Linux, macOS, and Windows for multiple Python versions.
14+
- **publish-wheels**: publishes built wheels to Cloudflare R2, manages old wheel cleanup and index generation.
1815
- **upload-artifact-wheel**: uploads the latest wheel artifact to GitHub Actions.
1916

2017
## Workflows (`.github/workflows`)
2118

22-
- **build.yml**: runs pre-commit, Rust tests, Python tests, builds wheels on multiple
23-
platforms, and uploads wheel artifacts.
24-
- **build-docs.yml**: dispatches a repository event to trigger the documentation build
25-
on `master` and `nightly` pushes.
26-
- **codeql-analysis.yml**: schedules and runs CodeQL security scans on pull requests
27-
and periodically via cron.
19+
- **build.yml**: runs pre-commit, Rust tests, Python tests, builds wheels on multiple platforms, and uploads wheel artifacts.
20+
- **build-docs.yml**: dispatches a repository event to trigger the documentation build on `master` and `nightly` pushes.
21+
- **codeql-analysis.yml**: schedules and runs CodeQL security scans on pull requests and periodically via cron.
2822
- **coverage.yml**: (optional) coverage report generation for the `nightly` branch.
29-
- **docker.yml**: builds and pushes Docker images (`nautilus_trader`, `jupyterlab`)
30-
for `master` and `nightly` branches using Buildx and QEMU.
31-
- **nightly-merge.yml**: automatically merges `develop` into `nightly` when the
32-
latest `develop` workflows succeed.
33-
- **performance.yml**: runs Rust/Python performance benchmarks on the `nightly` branch
34-
and reports to CodSpeed.
23+
- **docker.yml**: builds and pushes Docker images (`nautilus_trader`, `jupyterlab`) for `master` and `nightly` branches using Buildx and QEMU.
24+
- **nightly-merge.yml**: automatically merges `develop` into `nightly` when the latest `develop` workflows succeed.
25+
- **performance.yml**: runs Rust/Python performance benchmarks on the `nightly` branch and reports to CodSpeed.
3526

3627
## Security
3728

38-
- **Immutable Action Pinning**: all third-party actions are pinned to specific commit
39-
SHAs to guarantee immutability and reproducibility.
40-
- **Hardened Runners**: most workflows employ `step-security/harden-runner` with an
41-
`egress-policy: audit` to reduce attack surface and monitor outbound traffic.
42-
- **Secret Management**: no secrets or credentials are stored in the repo. AWS, PyPI,
43-
and other credentials are provided via GitHub Secrets and injected at runtime.
44-
- **Code Scanning**: CodeQL is enabled for continuous security analysis.
45-
- **Dependency Pinning**: key tools (pre-commit, Python versions, Rust toolchain,
46-
mold, cargo-nextest) are locked to fixed versions or SHAs.
47-
- **Least-Privilege Tokens**: workflows default the `GITHUB_TOKEN` to
29+
- **Immutable action pinning**: all third-party actions are pinned to specific commit SHAs to guarantee immutability and reproducibility.
30+
- **Hardened runners**: most workflows employ `step-security/harden-runner` with an `egress-policy: audit` to reduce attack surface and monitor outbound traffic.
31+
- **Secret management**: no secrets or credentials are stored in the repo. AWS, PyPI, and other credentials are provided via GitHub Secrets and injected at runtime.
32+
- **Code scanning**: CodeQL is enabled for continuous security analysis.
33+
- **Dependency pinning**: key tools (pre-commit, Python versions, Rust toolchain, cargo-nextest) are locked to fixed versions or SHAs.
34+
- **Least-privilege tokens**: workflows default the `GITHUB_TOKEN` to
4835
`contents: read, actions: read` and selectively elevate scopes (e.g.
4936
`contents: write`) only for the jobs that need to tag a release or upload
5037
assets. This follows the principle of least privilege and limits blast
5138
radius if a job is compromised.
52-
- **Caching**: caches for sccache, pip/site-packages, pre-commit, and test data
53-
speed up workflows while preserving hermetic builds.
39+
- **Caching**: caches for sccache, pip/site-packages, pre-commit, and test data speed up workflows while preserving hermetic builds.
5440

5541
For updates or changes to actions or workflows, please adhere to the repository's
5642
CONTRIBUTING guidelines and maintain these security best practices.

.github/actions/common-setup/action.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,22 @@ runs:
4343
sudo apt-get install -y curl clang git make pkg-config
4444
sudo apt-get install -y python3-dev libpython3-dev
4545
sudo apt-get install -y capnproto libcapnp-dev
46+
sudo apt-get clean
47+
sudo rm -rf /var/lib/apt/lists/*
4648
47-
- name: Install mold
48-
# https://github.com/rui314/setup-mold
49-
uses: rui314/setup-mold@565a5a945b82f5759c6148485163f6ecd90da653 # v1
49+
- name: Install capnproto (macOS)
50+
if: runner.os == 'macOS'
51+
shell: bash
52+
run: |
53+
brew update
54+
brew install capnp
55+
brew cleanup
56+
57+
- name: Install capnproto (Windows)
58+
if: runner.os == 'Windows'
59+
shell: bash
60+
run: |
61+
choco install capnproto -y || echo "capnproto install via choco failed or unavailable"
5062
5163
# > --------------------------------------------------
5264
# > Rust
@@ -87,12 +99,11 @@ runs:
8799
run: |
88100
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
89101
90-
# Based on GitHub Actions runner constraints
91-
# and Nautilus Trader uncompressed package final size (~1 GiB)
92-
echo "SCCACHE_CACHE_SIZE=4G" >> $GITHUB_ENV
93-
echo "SCCACHE_IDLE_TIMEOUT=0" >> $GITHUB_ENV
94-
echo "SCCACHE_DIRECT=true" >> $GITHUB_ENV
95-
echo "SCCACHE_CACHE_MULTIARCH=1" >> $GITHUB_ENV
102+
# Respect pre-existing settings from the workflow env; otherwise set sane defaults
103+
if [ -z "${SCCACHE_CACHE_SIZE:-}" ]; then echo "SCCACHE_CACHE_SIZE=4G" >> $GITHUB_ENV; fi
104+
if [ -z "${SCCACHE_IDLE_TIMEOUT:-}" ]; then echo "SCCACHE_IDLE_TIMEOUT=0" >> $GITHUB_ENV; fi
105+
if [ -z "${SCCACHE_DIRECT:-}" ]; then echo "SCCACHE_DIRECT=true" >> $GITHUB_ENV; fi
106+
if [ -z "${SCCACHE_CACHE_MULTIARCH:-}" ]; then echo "SCCACHE_CACHE_MULTIARCH=1" >> $GITHUB_ENV; fi
96107
97108
echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV
98109
@@ -136,6 +147,11 @@ runs:
136147
with:
137148
python-version: ${{ inputs.python-version }}
138149

150+
- name: Ensure ~/.local/bin on PATH
151+
shell: bash
152+
run: |
153+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
154+
139155
- name: Get Python version
140156
shell: bash
141157
run: |

.github/actions/common-test-data/action.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ runs:
1010
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
1111
with:
1212
path: tests/test_data/large
13-
key: ${{ runner.os }}-large-files-${{ hashFiles('tests/test_data/large/checksums.json') }}
14-
restore-keys: ${{ runner.os }}-large-files-
13+
key: large-files-${{ hashFiles('tests/test_data/large/checksums.json') }}
14+
restore-keys: large-files-
15+
save-always: true
16+
enableCrossOsArchive: true

.github/actions/publish-wheels/action.yml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
name: Publish wheels (R2)
22
description: Publish wheels to Cloudflare R2
3-
inputs:
4-
cleanup-local-dist:
5-
description: 'Cleanup local dist directory after publishing to R2'
6-
required: false
7-
default: 'true'
83

94
runs:
105
using: "composite"
@@ -59,18 +54,3 @@ runs:
5954
shell: bash
6055
run: |
6156
bash ./scripts/ci/publish-wheels-r2-verify-files.sh
62-
63-
- name: Clean up local dist directory
64-
if: ${{ inputs.cleanup-local-dist == 'true' && success() }}
65-
shell: bash
66-
run: |
67-
set -euo pipefail
68-
69-
if [[ -d dist ]]; then
70-
echo "Found dist directory:"
71-
ls -lh dist/
72-
rm -rf dist/*
73-
echo "Cleanup completed"
74-
else
75-
echo "No dist directory found"
76-
fi

.github/pull_request_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
**NautilusTrader prioritizes correctness and reliability, please follow existing patterns for validation and testing.**
44

5+
- [ ] I have reviewed the `CONTRIBUTING.md` and followed the established practices
6+
57
## Summary
68

79
<!-- Provide a brief description of *what* changed, *why* it was changed, and the impact on the system or users (2–3 sentences). -->
@@ -24,6 +26,10 @@
2426

2527
<!-- If this is a breaking change, describe the impact and any migration steps required for users or developers. -->
2628

29+
## Documentation
30+
31+
- [ ] Documentation changes follow the style guide (`docs/developer_guide/docs.md`)
32+
2733
## Release notes
2834

2935
- [ ] I added a concise entry to `RELEASES.md` that follows the existing conventions (when applicable)

0 commit comments

Comments
 (0)