Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REL 3.0-beta #206

Merged
merged 27 commits into from
Jul 13, 2023
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2f64091
Feature/zipline3dev (#18)
MBounouar Jun 28, 2023
a5bfff7
fix pytest config
MBounouar Jun 29, 2023
2150466
pandas < 2 is no longer tested or supported
MBounouar Jun 30, 2023
e74e00f
fix ci yml pandas2
MBounouar Jun 30, 2023
d90c1d2
updated pre-commit hooks
stefan-jansen Jul 11, 2023
c738d28
avoid warning
stefan-jansen Jul 11, 2023
fbd97b0
full CI on push to main
stefan-jansen Jul 11, 2023
104215f
update actions
stefan-jansen Jul 11, 2023
c180619
3.0 updates
stefan-jansen Jul 11, 2023
728c005
fix python-version
stefan-jansen Jul 11, 2023
0862fec
fix python-version
stefan-jansen Jul 11, 2023
157e2bb
fix python-version
stefan-jansen Jul 11, 2023
04a948c
fix python-version
stefan-jansen Jul 11, 2023
19499f5
fix python-version
stefan-jansen Jul 11, 2023
4e9855f
fix python-version
stefan-jansen Jul 11, 2023
e7f8640
fix python-version
stefan-jansen Jul 11, 2023
b4044d2
fix python-version
stefan-jansen Jul 11, 2023
964f4a9
fix python-version
stefan-jansen Jul 11, 2023
46fa320
fix python-version
stefan-jansen Jul 11, 2023
5da048e
skip certain tests when running GHA
stefan-jansen Jul 12, 2023
476e96f
fail GHA pytest immediately
stefan-jansen Jul 12, 2023
87cf23a
working around GHA test failures
stefan-jansen Jul 12, 2023
d473418
working around GHA test failures
stefan-jansen Jul 12, 2023
8f31a22
working around GHA test failures
stefan-jansen Jul 12, 2023
431fe7b
working around GHA test failures
stefan-jansen Jul 12, 2023
3d7cd9e
working around GHA test failures
stefan-jansen Jul 12, 2023
d1b3329
working around GHA test failures
stefan-jansen Jul 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 72 additions & 58 deletions .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,86 +1,100 @@
alembic==1.8.1
alembic==1.11.1
appdirs==1.4.4
attrs==22.1.0
bcolz-zipline==1.2.6
black==22.10.0
Bottleneck==1.3.5
certifi==2022.9.24
beautifulsoup4==4.12.2
black==22.12.0
blosc2==2.2.4
Bottleneck==1.3.7
cachetools==5.3.1
certifi==2023.5.7
cffi==1.15.1
cfgv==3.3.1
charset-normalizer==2.1.1
click==8.0.4
contourpy==1.0.6
coverage==6.5.0
chardet==5.1.0
charset-normalizer==3.1.0
click==8.1.3
colorama==0.4.6
contourpy==1.0.7
coverage==7.2.7
cryptography==41.0.1
cycler==0.11.0
Cython==0.29.35
distlib==0.3.6
empyrical-reloaded==0.5.8
exchange-calendars==3.3
empyrical-reloaded==0.5.9
exchange-calendars==4.2.8
execnet==1.9.0
filelock==3.8.0
flake8==5.0.4
fonttools==4.38.0
greenlet==2.0.1
h5py==3.7.0
identify==2.5.9
filelock==3.12.2
flake8==6.0.0
fonttools==4.39.4
frozendict==2.3.8
greenlet==2.0.2
h5py==3.8.0
html5lib==1.1
identify==2.5.24
idna==3.4
iniconfig==1.1.1
iniconfig==2.0.0
intervaltree==3.1.0
iso3166==2.1.1
iso4217==1.11.20220401
kiwisolver==1.4.4
korean-lunar-calendar==0.3.1
lru-dict==1.1.8
lxml==4.9.1
lru-dict==1.2.0
lxml==4.9.2
Mako==1.2.4
MarkupSafe==2.1.1
matplotlib==3.6.2
MarkupSafe==2.1.3
matplotlib==3.7.1
mccabe==0.7.0
msgpack==1.0.5
multipledispatch==0.6.0
multitasking==0.0.11
mypy-extensions==0.4.3
networkx==2.8.8
nodeenv==1.7.0
mypy-extensions==1.0.0
ndindex==1.7
networkx==3.1
nodeenv==1.8.0
numexpr==2.8.4
numpy==1.23.5
packaging==21.3
pandas==1.5.1
numpy==1.25.0
packaging==23.1
pandas==2.0.2
pandas-datareader==0.10.0
parameterized==0.8.1
pathspec==0.10.2
parameterized==0.9.0
pathspec==0.11.1
patsy==0.5.3
Pillow==9.3.0
platformdirs==2.5.4
Pillow==9.5.0
platformdirs==3.5.3
pluggy==1.0.0
pre-commit==2.20.0
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
pyluach==2.0.2
pre-commit==3.3.2
py-cpuinfo==9.0.0
pycodestyle==2.10.0
pycparser==2.21
pyflakes==3.0.1
pyluach==2.2.0
pyparsing==3.0.9
pytest==6.2.5
pytest-cov==4.0.0
pytest-rerunfailures==10.3
pyproject-api==1.5.2
pytest==7.4.0
pytest-cov==4.1.0
pytest-rerunfailures==11.1.2
pytest-timeout==2.1.0
pytest-xdist==3.0.2
pytest-xdist==3.3.1
python-dateutil==2.8.2
python-interface==1.6.1
pytz==2022.6
pytz==2023.3
PyYAML==6.0
requests==2.28.1
responses==0.22.0
scipy==1.9.3
requests==2.31.0
responses==0.23.1
scipy==1.11.0
six==1.16.0
sortedcontainers==2.4.0
SQLAlchemy==1.4.44
statsmodels==0.13.5
TA-Lib==0.4.25
tables==3.7.0
testfixtures==7.0.3
toml==0.10.2
tomli==2.0.1
soupsieve==2.4.1
SQLAlchemy==2.0.17
statsmodels==0.14.0
TA-Lib==0.4.26
tables==3.8.0
testfixtures==7.1.0
toolz==0.12.0
tox==3.27.1
trading-calendars==2.1.1
types-toml==0.10.8.1
urllib3==1.26.12
virtualenv==20.16.7
yfinance==0.1.87
tox==4.6.3
types-PyYAML==6.0.12.10
typing_extensions==4.6.3
tzdata==2023.3
urllib3==2.0.3
virtualenv==20.23.1
webencodings==0.5.1
yfinance==0.2.22
23 changes: 11 additions & 12 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
@@ -11,13 +11,13 @@ on:

jobs:
build_wheels:
name: Wheels for py${{ matrix.python }} on ${{ matrix.os }} - upload to ${{github.event.inputs.target}}
name: Wheels for ${{ matrix.python }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest , windows-latest, macos-latest ]
python: [ 38, 39, '310' , '311']
python: [ "cp38", "cp39", "cp310", "cp311" ]
arch: [ auto64 ]

steps:
@@ -26,10 +26,10 @@ jobs:
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python }}

- name: Set Xcode version
uses: maxim-lobanov/setup-xcode@v1
@@ -39,13 +39,13 @@ jobs:

- name: Wheels macOS / Linux
if: runner.os != 'Windows'
uses: pypa/cibuildwheel@v2.13.0
uses: pypa/cibuildwheel@v2.14.0
env:
CIBW_BEFORE_ALL_LINUX: ./tools/install_talib.sh
CIBW_BEFORE_ALL_MACOS: brew install ta-lib
CIBW_ARCHS_LINUX: ${{ matrix.arch }}
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BUILD: "cp${{ matrix.python }}-*"
CIBW_BUILD: "${{ matrix.python }}-*"
CIBW_SKIP: "*-musllinux_*"
CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.15

@@ -56,10 +56,9 @@ jobs:

- name: Wheels Windows
if: runner.os == 'Windows'
uses: pypa/cibuildwheel@v2.13.0
uses: pypa/cibuildwheel@v2.14.0
env:
CIBW_BUILD: "cp${{ matrix.python }}-win_amd64"
CIBW_TEST_SKIP: "cp311-win_amd64"
CIBW_BUILD: "${{ matrix.python }}-win_amd64"
CIBW_BEFORE_TEST_WINDOWS: >
call "c:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64 &&
call ./tools/install_talib.bat
@@ -81,7 +80,7 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.9'
python-version: '3.11'

- name: Build sdist
run: |
5 changes: 4 additions & 1 deletion .github/workflows/ci_tests_full.yml
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@ name: CI Tests

on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: "0 9 * * 6"

@@ -35,7 +38,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- name: Checkout Zipline
6 changes: 3 additions & 3 deletions .github/workflows/ci_tests_quick.yml
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
python-version: "3.11"

- name: flake8 Lint
uses: py-actions/flake8@v2
@@ -37,7 +37,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10"]
python-version: ["3.11"]

steps:
- name: Checkout Zipline
@@ -80,7 +80,7 @@ jobs:
max_attempts: 3
retry_on: error
new_command_on_retry: python -m pip install tox tox-gh-actions .[test]
command: tox -e py310-pandas15
command: tox -e py311-pandas2

- name: Upload coverage data to Codecov
if: ${{ matrix.os == 'ubuntu-latest' }}
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
default_language_version:
python: python3.9
python: python3.11
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v3.4.0'
rev: 'v4.4.0'
hooks:
- id: check-added-large-files
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/ambv/black
rev: 22.3.0
rev: 23.7.0
hooks:
- id: black
additional_dependencies: ['click==8.0.4']
language_version: python3.9
- repo: https://gitlab.com/pycqa/flake8
rev: '3.9.1'
- repo: https://github.com/PyCQA/flake8
rev: '6.0.0'
hooks:
- id: flake8
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -24,23 +24,25 @@ by [Stefan Jansen](https://www.linkedin.com/in/applied-ai/) who is trying to kee
- **PyData Integration:** Input of historical data and output of performance statistics are based on Pandas DataFrames to integrate nicely into the existing PyData ecosystem.
- **Statistics and Machine Learning Libraries:** You can use libraries like matplotlib, scipy, statsmodels, and scikit-klearn to support development, analysis, and visualization of state-of-the-art trading systems.

> **Note:** Release 3.0 updates Zipline to use [pandas](https://pandas.pydata.org/pandas-docs/stable/whatsnew/v2.0.0.html) >= 2.0 and [SQLAlchemy](https://docs.sqlalchemy.org/en/20/) > 2.0. These are major version updates that may break existing code; please review the linked docs.

> **Note:** Release 2.4 updates Zipline to use [exchange_calendars](https://github.com/gerrymanoim/exchange_calendars) >= 4.2. This is a major version update and may break existing code (which we have tried to avoid but cannot guarantee). Please review the changes [here](https://github.com/gerrymanoim/exchange_calendars/issues/61).

## Installation

Zipline supports Python >= 3.8 and is compatible with current versions of the relevant [NumFOCUS](https://numfocus.org/sponsored-projects?_sft_project_category=python-interface) libraries, including [pandas](https://pandas.pydata.org/) and [scikit-learn](https://scikit-learn.org/stable/index.html).

### Using `pip`

If your system meets the pre-requisites described in the [installation instructions](https://zipline.ml4trading.io/install.html), you can install Zipline using `pip` by running:

```bash
pip install zipline-reloaded
```

> **Note:** Installation under Python 3.11 requires building `h5py` [from source](https://docs.h5py.org/en/stable/build.html#source-installation) until [wheels become available](https://github.com/h5py/h5py/issues/2146).

Alternatively, if you are using the [Anaconda](https://www.anaconda.com/products/individual) or [miniconda](https://docs.conda.io/en/latest/miniconda.html) distributions, you can use
### Using `conda`

> **Note:** We are currently working to transition the conda package to [conda-forge](https://conda-forge.org/docs/index.html).
If you are using the [Anaconda](https://www.anaconda.com/products/individual) or [miniconda](https://docs.conda.io/en/latest/miniconda.html) distributions, you install `zipline-reloaded` from the channel `conda-forge` like so:

```bash
conda install -c conda-forge zipline-reloaded
@@ -50,7 +52,7 @@ You can also [enable](https://docs.conda.io/projects/conda/en/latest/user-guide/

In case you are installing `zipline-reloaded` alongside other packages and encounter [conflict errors](https://github.com/conda/conda/issues/9707), consider using [mamba](https://github.com/mamba-org/mamba) instead.

See the [installation](https://zipline.ml4trading.io/install.html) section of the docs for more detailed instructions.
See the [installation](https://zipline.ml4trading.io/install.html) section of the docs for more detailed instructions and the corresponding [conda-forge site](https://github.com/conda-forge/zipline-reloaded-feedstock).

## Quickstart

Loading