Skip to content

Commit

Permalink
Release 1.161.0
Browse files Browse the repository at this point in the history
See release notes.
  • Loading branch information
cjdsellers authored Dec 9, 2022
2 parents 9a90b77 + 1884cd6 commit ad0f3f0
Show file tree
Hide file tree
Showing 201 changed files with 7,935 additions and 3,879 deletions.
12 changes: 6 additions & 6 deletions .docker/nautilus_trader.dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM python:3.10-slim as base
FROM python:3.11-slim as base
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.2.0 \
POETRY_VERSION=1.2.2 \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_NO_INTERACTION=1 \
Expand All @@ -26,20 +26,20 @@ RUN curl -sSL https://install.python-poetry.org | python3 -

# Install package requirements (split step and with --no-root to enable caching)
COPY poetry.lock pyproject.toml build.py ./
RUN poetry install --no-root --no-dev
RUN poetry install --no-root --only main

# Build nautilus_trader
COPY nautilus_core ./nautilus_core
RUN (cd nautilus_core && cargo build --release)

COPY nautilus_trader ./nautilus_trader
COPY README.md ./
RUN poetry install --only=main
RUN poetry install --only main
RUN poetry build -f wheel
RUN python -m pip install ./dist/*whl --force
RUN find /usr/local/lib/python3.10/site-packages -name "*.pyc" -exec rm -f {} \;
RUN find /usr/local/lib/python3.11/site-packages -name "*.pyc" -exec rm -f {} \;

# Final application image
FROM base as application
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY examples ./examples
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
arch: [x64, ARM64]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
name: build - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
arch: [x64]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
name: build - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: codeql-analysis

on:
pull_request:
branches: [ master ]
branches: [master]
schedule:
- cron: '42 13 * * 4'

Expand All @@ -14,8 +14,8 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
language: ['python']
# CodeQL supports ['cpp', 'csharp', 'go', 'java', 'javascript', 'python']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: docker

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

jobs:
build-docker-images:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ jobs:
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"

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

# Build project
- name: Build project
run: poetry install
run: poetry install --with docs

- name: Get branch name
id: branch-name
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
arch: [x64, ARM64]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
name: test-pip-install - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:

tag-release:
needs: [test-pip-install]
name: tag-release - Python 3.10 (ubuntu-latest)
name: tag-release - Python 3.11 (ubuntu-latest)
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create-release.outputs.upload_url }}
Expand All @@ -77,7 +77,7 @@ jobs:
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"

# Install build dependencies
- name: Install build dependencies
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:

publish-sdist:
needs: [tag-release]
name: publish-sdist - Python 3.10 (ubuntu-latest)
name: publish-sdist - Python 3.11 (ubuntu-latest)
runs-on: ubuntu-latest
env:
COPY_TO_SOURCE: false # Do not copy built *.so files back into source tree
Expand All @@ -153,7 +153,7 @@ jobs:
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"

# Install build dependencies
- name: Install build dependencies
Expand Down Expand Up @@ -211,9 +211,9 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: [x64] # Temporarily pause ARM64 in build matrix
arch: [x64, ARM64]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10"]
python-version: ["3.9", "3.10", "3.11"]
name: publish-wheels - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }})
runs-on: ${{ matrix.os }}
env:
Expand Down
13 changes: 8 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
.env/
.git/
.idea/
.ipynb_checkpoints
.mypy_cache/
.nox/
.profile/
Expand All @@ -38,14 +39,16 @@ logs/
venv*/

.DS_Store
!tests/integration_tests/adapters/betfair/responses/*.log
tests/test_data/catalog/
PERF.JSON
*dask-worker-space*
output.json
.ipynb_checkpoints
*dask-worker-space*

docs/**/*.ipynb
examples/backtest/notebooks/catalog
nautilus_trader/**/.gitignore
docs/**/*.ipynb
nautilus_trader/test_kit/mocks/.nautilus/
tests/test_data/catalog/

!nautilus_core/lib/**/*
!nautilus_trader/core/includes/**
!tests/integration_tests/adapters/betfair/responses/*.log
83 changes: 15 additions & 68 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ repos:
# General checks
##############################################################################
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: forbid-new-submodules
- id: fix-encoding-pragma
Expand Down Expand Up @@ -36,7 +36,7 @@ repos:
# Python/Cython formatting and linting
##############################################################################
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.2
rev: v3.3.1
hooks:
- id: pyupgrade
name: pyupgrade (ensure latest syntax)
Expand Down Expand Up @@ -100,58 +100,21 @@ repos:
types-toml,
]

- repo: https://github.com/john-hen/Flake8-pyproject
rev: 1.2.2
hooks:
- id: Flake8-pyproject
name: flake8-pyproject

- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
name: flake8 (Python)
additional_dependencies:
- bandit # Pin due issue https://github.com/PyCQA/bandit/issues/841
- flake8-2020
# - flake8-bandit
- flake8-bugbear
- flake8-coding
# - flake8-comprehensions
- flake8-debugger
- flake8-deprecated==1.3
# - flake8-docstrings
- flake8-pep3101
- flake8-string-format
# - flake8-rst-docstrings
- flake8-typing-imports
# - pep8-naming
types: [python]
args: [
--max-complexity=10,
--max-line-length=150,
--statistics,
--ignore=C101 E203 E252 E402 D100 D101 D102 S101 S403 S404 W503,
--min-python-version=3.8.0
]
- id: flake8
name: flake8 (Cython)
name: flake8
types_or: [python, cython]
entry: "flake8p"
additional_dependencies:
- bandit # Pin due issue https://github.com/PyCQA/bandit/issues/841
- flake8-2020
# - flake8-bandit
- flake8-bugbear
- flake8-coding
- flake8-comprehensions
- flake8-debugger
- flake8-deprecated==1.3
- flake8-docstrings
- flake8-pep3101
- flake8-string-format
- flake8-rst-docstrings
- flake8-typing-imports
- pep8-naming
types: [cython]
args: [
--max-complexity=10,
--max-line-length=150,
--statistics,
--ignore=C101 D100 E225 E226 E227 E252 E402 E999 W503,
]
- Flake8-pyproject

- repo: https://github.com/pycqa/pydocstyle
rev: 6.1.1
Expand All @@ -169,24 +132,8 @@ repos:
hooks:
- id: nbstripout

# flake8 ignore justifications
# ----------------------------
# C101: Coding magic comment not found
# D100: Missing docstring in public module (picks up entire test suite)
# D101: Missing docstring in public class (picks up entire test suite)
# D102: Missing docstring in public method (picks up entire test suite)
# E203: whitespace before ':' (conflicts with Black)
# E225: missing whitespace around operator (picks up cython casting)
# E226: missing whitespace around arithmetic operator (picks up C pointers)
# E227: missing whitespace around bitwise or shift operator (picks up C pointers)
# E252: spaces around default argument assignment (incorrect syntax)
# E402: module level import not at top of file (workaround to assist imports in examples)
# E999: SyntaxError: invalid syntax (cimport seen as invalid syntax)
# S101: Use of assert detected (use of assert normal for pytest)
# S403: Consider possible security implications associated with pickle module (pickle ok!)

# pydocstyle ignore justifications
# --------------------------------
# pydocstyle ignore reasons
# -------------------------
# D100: Missing docstring in public module **fix**
# D102: Missing docstring in public method **fix**
# D103: Missing docstring in public function **fix**
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ REGISTRY?=ghcr.io/
IMAGE?=${REGISTRY}${PROJECT}
GIT_TAG:=$(shell git rev-parse --abbrev-ref HEAD)
IMAGE_FULL?=${IMAGE}:${GIT_TAG}
EXTRAS?="docker ib redis"
EXTRAS?="betfair docker ib redis"
.PHONY: install build clean docs format pre-commit
.PHONY: cargo-update cargo-test cargo-test-arm64
.PHONY: update docker-build docker-build-force docker-push
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ as specified in the `pyproject.toml`. However, we highly recommend installing us
git clone https://github.com/nautechsystems/nautilus_trader
cd nautilus_trader
poetry install --only main --extras "ib redis"
poetry install --only main --extras "docker ib redis"
Refer to the [Installation Guide](https://docs.nautilustrader.io/getting_started/installation.html) for other options and further details.
Expand All @@ -208,7 +208,7 @@ point we will follow a formal process for releases, with deprecation periods for
A `Makefile` is provided to automate most installation and build tasks. It provides the following targets:
- `make install` -- Installs the package using poetry
- `make build` -- Runs the Cython build script
- `make clean` -- Cleans all none source artifacts from the repository
- `make clean` -- Cleans all non-source artifacts from the repository
- `make docs` -- Builds the documentation HTML using Sphinx
- `make pre-commit` -- Runs the pre-commit checks over all files
Expand Down
27 changes: 27 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
# NautilusTrader 1.161.0 Beta

Released on TBD (UTC).

### Breaking Changes
- Renamed `OrderFactory.bracket_market` to `OrderFactory.bracket_market_entry`
- Renamed `OrderFactory.bracket_limit` to `OrderFactory.bracket_limit_entry`
- Renamed `OrderFactory` bracket order `price` and `trigger_price` parameters

### Enhancements
- Consolidated config objects to `msgspec` providing better performance and correctness
- Added `OrderFactory.bracket_stop_limit_entry_stop_limit_tp(...)`
- Numerous improvements to the Interactive Brokers adapter, thanks @limx0 and @rsmb7z
- Removed dependency on `pydantic`

### Fixes
- Fixed `STOP_MARKET` order behaviour to fill at market on immediate trigger
- Fixed `STOP_LIMIT` order behaviour to fill at market on immediate trigger and marketable
- Fixed `STOP_LIMIT` order behaviour to fill at market on processed trigger and marketable
- Fixed `LIMIT_IF_TOUCHED` order behaviour to fill at market on immediate trigger and marketable
- Fixed Binance start and stop time units for bar (kline) requests, thanks @Tzumx
- `RiskEngineConfig.bypass` set to `True` will now correctly bypass throttlers, thanks @DownBadCapital
- Fixed updating of emulated orders
- Numerous fixes to the Interactive Brokers adapter, thanks @limx0 and @rsmb7z

---

# NautilusTrader 1.160.0 Beta

Released on 28th November 2022 (UTC).
Expand Down
Loading

0 comments on commit ad0f3f0

Please sign in to comment.