Skip to content

Commit

Permalink
Release 1.183.0
Browse files Browse the repository at this point in the history
See release notes.
  • Loading branch information
cjdsellers authored Jan 12, 2024
2 parents f1b643d + 038e93f commit 178d621
Show file tree
Hide file tree
Showing 1,325 changed files with 13,336 additions and 8,743 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: build-wheels

# Build wheels on every push to `develop` branch

on:
push:
branches: [develop]
branches: [nightly]

jobs:
build-wheels:
Expand Down
126 changes: 101 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: build

# Build and test NautilusTrader

on:
push:
branches: [master, develop]
branches: [master, nightly, develop]
pull_request:
branches: [develop]

Expand All @@ -14,7 +12,7 @@ jobs:
fail-fast: false
matrix:
arch: [x64]
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]
defaults:
run:
Expand All @@ -38,21 +36,11 @@ jobs:
working-directory: ${{ github.workspace }}

- name: Set up Rust tool-chain (Linux, Windows) stable
if: (runner.os == 'Linux') || (runner.os == 'Windows')
uses: actions-rust-lang/[email protected]
with:
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt, clippy

# Work around as actions-rust-lang does not seem to work on macOS yet
- name: Set up Rust tool-chain (macOS) stable
if: runner.os == 'macOS'
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION }}
override: true
components: rustfmt, clippy

- name: Set up Python environment
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -99,24 +87,20 @@ jobs:
# pre-commit run --hook-stage manual gitlint-ci
pre-commit run --all-files
- name: Install Redis (macOS)
if: runner.os == 'macOS'
run: |
brew install redis
redis-server --daemonize yes
- name: Install Redis (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install redis-server
redis-server --daemonize yes
- name: Run nautilus_core cargo tests (Linux, macOS)
if: (runner.os == 'Linux') || (runner.os == 'macOS')
run: make cargo-test
- name: Run nautilus_core cargo tests (Linux)
if: runner.os == 'Linux'
run: |
cargo install cargo-nextest
make cargo-test
- name: Run tests (Linux, macOS)
if: (runner.os == 'Linux') || (runner.os == 'macOS')
- name: Run tests (Linux)
if: runner.os == 'Linux'
run: |
make pytest
make test-examples
Expand All @@ -129,3 +113,95 @@ jobs:
poetry run pytest --ignore=tests/performance_tests --new-first --failed-first
env:
PARALLEL_BUILD: false

build-macos:
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/nightly'
strategy:
fail-fast: false
matrix:
arch: [x64]
os: [macos-latest]
python-version: ["3.10", "3.11", "3.12"]
defaults:
run:
shell: bash
name: build - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
BUILD_MODE: debug
RUST_BACKTRACE: 1

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get Rust version from rust-toolchain.toml
id: rust-version
run: |
version=$(awk -F\" '/version/ {print $2}' nautilus_core/rust-toolchain.toml)
echo "Rust toolchain version $version"
echo "RUST_VERSION=$version" >> $GITHUB_ENV
working-directory: ${{ github.workspace }}

# Work around as actions-rust-lang does not seem to work on macOS yet
- name: Set up Rust tool-chain (macOS) stable
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION }}
override: true
components: rustfmt, clippy

- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Get Poetry version from poetry-version
run: |
version=$(cat poetry-version)
echo "POETRY_VERSION=$version" >> $GITHUB_ENV
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ env.POETRY_VERSION }}

- name: Install build dependencies
run: python -m pip install --upgrade pip setuptools wheel pre-commit msgspec

- name: Setup cached pre-commit
id: cached-pre-commit
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-${{ matrix.python-version }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Set poetry cache-dir
run: echo "POETRY_CACHE_DIR=$(poetry config cache-dir)" >> $GITHUB_ENV

- name: Poetry cache
id: cached-poetry
uses: actions/cache@v3
with:
path: ${{ env.POETRY_CACHE_DIR }}
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }}

- name: Run pre-commit
run: |
# pre-commit run --hook-stage manual gitlint-ci
pre-commit run --all-files
- name: Install Redis (macOS)
run: |
brew install redis
redis-server --daemonize yes
- name: Run nautilus_core cargo tests (macOS)
run: |
cargo install cargo-nextest
make cargo-test
- name: Run tests (macOS)
run: |
make pytest
make test-examples
6 changes: 2 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: coverage

# Run code coverage analysis for NautilusTrader

on:
push:
branches: [develop]
branches: [nightly]

jobs:
build:
Expand All @@ -13,7 +11,7 @@ jobs:
matrix:
arch: [x64]
os: [ubuntu-latest]
python-version: ["3.10"]
python-version: ["3.10"] # Fails on 3.11 due Cython
name: build - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
runs-on: ${{ matrix.os }}

Expand Down
24 changes: 11 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: docker

# Build NautilusTrader docker images

on:
push:
branches: [master, develop]
branches: [master, nightly]

jobs:
build-docker-images:
Expand Down Expand Up @@ -47,18 +45,18 @@ jobs:
id: branch-name
uses: tj-actions/[email protected]

- name: Build nautilus_trader image (develop)
if: ${{ steps.branch-name.outputs.current_branch == 'develop' }}
id: docker_build_trader_develop
- name: Build nautilus_trader image (nightly)
if: ${{ steps.branch-name.outputs.current_branch == 'nightly' }}
id: docker_build_trader_nightly
uses: docker/build-push-action@v5
with:
file: ".docker/nautilus_trader.dockerfile"
push: true
tags: ghcr.io/${{ github.repository_owner }}/nautilus_trader:develop
tags: ghcr.io/${{ github.repository_owner }}/nautilus_trader:nightly
cache-from: type=gha
cache-to: type=gha
- name: Digest nautilus_trader image
run: echo ${{ steps.docker_build_trader_develop.outputs.digest }}
run: echo ${{ steps.docker_build_trader_nightly.outputs.digest }}

- name: Build nautilus_trader image (latest)
if: ${{ steps.branch-name.outputs.current_branch == 'master' }}
Expand All @@ -73,20 +71,20 @@ jobs:
- name: Digest nautilus_trader image
run: echo ${{ steps.docker_build_trader_latest.outputs.digest }}

- name: Build jupyterlab image (develop)
if: ${{ steps.branch-name.outputs.current_branch == 'develop' }}
id: docker_build_jupyterlab_develop
- name: Build jupyterlab image (nightly)
if: ${{ steps.branch-name.outputs.current_branch == 'nightly' }}
id: docker_build_jupyterlab_nightly
uses: docker/build-push-action@v5
with:
file: ".docker/jupyterlab.dockerfile"
push: true
tags: ghcr.io/${{ github.repository_owner }}/jupyterlab:develop
tags: ghcr.io/${{ github.repository_owner }}/jupyterlab:nightly
cache-from: type=gha
cache-to: type=gha
build-args: |
GIT_TAG=${{ steps.branch-name.outputs.current_branch }}
- name: Digest jupyterlab image
run: echo ${{ steps.docker_build_jupyterlab_develop.outputs.digest }}
run: echo ${{ steps.docker_build_jupyterlab_nightly.outputs.digest }}

- name: Build jupyterlab image (latest)
if: ${{ steps.branch-name.outputs.current_branch == 'master' }}
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: docs

# Build and deploy the NautilusTrader documentation

on:
push:
branches: [master, develop]
branches: [nightly]

jobs:
docs:
Expand Down Expand Up @@ -75,16 +73,16 @@ jobs:
- name: Add CNAME
run: echo "docs.nautilustrader.io" >> docs/build/html/CNAME

- name: Publish docs (develop)
if: ${{ steps.branch-name.outputs.current_branch == 'develop' }}
- name: Publish docs (nightly)
if: ${{ steps.branch-name.outputs.current_branch == 'nightly' }}
uses: s0/git-publish-subdir-action@develop
env:
REPO: self
BRANCH: gh-pages
FOLDER: docs/build/html
SQUASH_HISTORY: false
GITHUB_TOKEN: ${{ secrets.GHPAGES_ACCESS }}
TARGET_DIR: develop
TARGET_DIR: nightly

- name: Publish docs (latest)
if: ${{ steps.branch-name.outputs.current_branch == 'master' }}
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/nightly-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: nightly-merge

on:
push:
branches: [nightly-merge-test]
# schedule:
# - cron: '0 14 * * *' # At 14:00 UTC every day

jobs:
nightly-merge:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags

# Temporary config before nautilus-bot account
- name: Configure Git
run: |
git config --local user.email "[email protected]"
git config --local user.name "Chris Sellers"
- name: Merge develop into nightly
run: |
git checkout nightly
git merge --no-ff origin/develop -m "Automated merge of develop into nightly"
- name: Push changes
run: |
git push origin nightly
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
.ruff_cache/
.vscode/

/catalog/

__pycache__
_build/
build/
catalog/
data_catalog/
dist/
env/
Expand All @@ -59,6 +60,7 @@ examples/backtest/notebooks/catalog
nautilus_trader/**/.gitignore
nautilus_trader/test_kit/mocks/.nautilus/
tests/test_data/catalog/
tests/unit_tests/persistence/catalog
bench_data/

!tests/integration_tests/adapters/betfair/responses/*.log
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ repos:
types: [python]

- repo: https://github.com/psf/black
rev: 23.12.0
rev: 23.12.1
hooks:
- id: black
types_or: [python, pyi]
Expand All @@ -82,7 +82,7 @@ repos:
exclude: "docs/_pygments/monokai.py"

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.1.12
hooks:
- id: ruff
args: ["--fix"]
Expand Down
Loading

0 comments on commit 178d621

Please sign in to comment.