-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Description
Background
Zipline currently officially supports running on Python 2.7 and Python 3.5. These are the Python versions currently available on Quantopian.
These are both relatively old versions of Python, and many Zipline users (including users internally at Quantopian) would like to be able to use Zipline on more modern versions of Python. Supporting newer Python versions is particularly important because Python 2.7 is no longer supported by the Python Software Foundation, and Python 3.5 will reach end of life in September 2020.
We'd like to support a range of modern Python versions without dramatically increasing the cost of maintaining Zipline. In the short term, this probably means adding CI builds for Zipline on 3.6 and 3.7 (possibly also 3.8?). In the medium-to-long term, we need a more sustainable process for adding new Python versions without having to expend a ton of effort. This is especially important now that Python has adopted an annual release cadence.
Challenges
Supporting new Python versions is more challenging for Zipline than the average Python project, for a few reasons:
- We maintain backwards compatibility for older Python versions, so adding support for newer Pythons increases the total range of versions that we need to test, package, and triage issues for.
- We also maintain backwards compatibility for relatively old versions of NumPy and Pandas. At the time of this writing, Quantopian supports pandas 0.18.1, which was released in May of 2016. That version of pandas has a few notable bugs on Python 3.6, and it doesn't work at all on Python 3.7+ and above due to an issue in Cython. Supporting newer versions of Python requires us to also support a larger range of numpy and pandas versions, which further increases our maintenance burden.
- We currently build our own conda packages are part of Zipline's Travis and Appveyor builds. These package builds take a while, and (I believe) can't be easily updated by non-Quantopian employees, which effectively means that only Q employees can work on this.
Additional Thoughts
- One of the biggest costs of adding new Python versions is that it adds new entries to the Travis/Appveyor build matrices. Since the number of workers in these builds are limited, adding new entries causes the builds to run in serial, which slows down development. One promising alternative would be to switch to using Github Actions, which provides a pretty generous number of workers for open source projects. @gmanoim-quantopian has prototyped a version of this over in trading-calendars. I think we could replace a lot of the complexity in our Travis/Appveyor config with a much simpler Github Actions setup.
- Another big maintenance headache here is building our own conda packages. We might benefit from switching to Conda Forge for many of these dependencies.