-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Support for Newer Python Versions #2616
Comments
Thank you @ssanderson. This is excellent news. As I don't have the full picture on all the challenges faced, would it make sense to have new major releases (backward incompatible) to drop support of the old python versions or soon to be (2.7, 3.5) as well as the old dependencies (pandas, numpy) ? Regarding the process for the releases, I was thinking about first creating a sheet file with all the dependencies used in zipline with their release schedule and supported versions as part of the constraints on the sought upgrade process. This said, I've done a tentative to upgrade Zipline's dependencies to the latest versions from the latest conda distribution release, run the tests and review the errors. I've noted the following:
Dependencies:
Thanks |
I would very much welcome support for more recent versions, @ssanderson . My two cents here may be a little simplistic, but here it goes: Break backwards compatibility. Let those who for reason want to stay on Python 3.5 keep using Zipline 1.3. Throw out backwards compatibility for 2.7 and 3.5 for the next version of Zipline. It's unreasonable to expect software updates for ancient platforms. I'd be a happy camper if Zipline 1.4 (or perhaps a 2.0 denotation is in order), would require Python 3.7+ and Pandas 0.25+. ac |
It isn't really viable for the Quantopian team to drop support for 2.7 or 3.5 until we've dropped support for those versions on the Quantopian platform. That's likely to happen relatively soon for 2.7, but 3.5 is going to be around for at least a few more months. We have similar challenges w/r/t upgrading pandas. There are a lot of breaking changes that are likely to affect Zipline algorithms in newer versions of pandas, so upgrading pandas unconditionally on Quantopian would have a significant cost for our users. This is made trickier by the fact that python 3.7+ is only compatible with relatively recent versions of pandas (I think 0.22 or 0.23). I think the most realistic path forward for Q is something like:
"Support", in the above, means something like "a passing CI build that gives us strong confidence that the core Zipline functionality works correctly on all supported platforms". The biggest challenge here, besides just getting things working, is that adding many more entries to our build matrix would likely result in build times getting significantly (i.e., at least 2x) slower, because we'd hit enough workers that Travis wouldn't be able to run all our builds in parallel. We've looked into paying Travis for more workers in the past, but in the interim since we last did so, GitHub Actions was released, which seems like it's superior in basically every way. |
@ssanderson there are many ways to solve this. Just on the top of my mind:
That said, regarding the backwards compatibility, the 1.3.X version can be "freeze" supporting the current python and pandas version and the next major version (1.4 or 2.0) would at the same time drop support to 2.7, maybe 3.5 and start supporting 3.7 or 3.8. @AndreasClenow said it well. |
@ssanderson #2631 introduces solution 2. described above, giving a way of reducing number of build. I believe solution 3. is also a valid and will work on a PR. |
FYI Pandas v1.0 was released on 29 Jan 2020. "The pandas 1.0 release removed a lot of functionality that was deprecated in previous releases. It is recommended to first upgrade to pandas 0.25 and to ensure your code is working without warnings, before upgrading to pandas 1.0." |
Plans are pretty ambitious, which is great. 😊 A little step forward: #2643 |
@ssanderson Maybe that would be a good reason to drop Python 2.7 (and maybe 3.5 too) from AppVeyor pipelines. That means, do not officially support those versions in Windows from now on. That would reduce the load on AppVeyor pipelines, which seem to be the slower and which can even block (#2619). I think users would appreciate more support towards newer Python/package versions instead of supporting old stuff that they probably don't use. I understand you want to still support old stuff in Linux until you update your projects at Quantopian, but Windows may be treated differently. 😊 |
My hope in the relatively near term is to switch our CI over to GitHub Actions (see #2637), which should improve the speed
I think this makes sense. Broadly, I think our goal should be to support roughly two use cases:
Generally speaking, since the majority of Zipline maintenance has been done by Q employees, we've done a good job at prioritizing (1) and a not-so-great job of prioritizing (2). The challenge is made harder by the fact that (2) generally requires more regular investment to stay up to date, which is harder for us to prioritize at Q since we're not using these newer versions ourselves. I think the best path forward for making progress toward better support for (2) is for us to make it easier for community members to help us with the maintenance burden of supporting newer versions of packages. Besides switching over to actions, I think the other thing that would help in that effort would be to use conda forge to support installation with conda instead of maintaining our own conda packages for many of zipline's dependencies. I wrote about this in a bit more depth in the GitHub Actions issue I linked above. |
Great start! It would be wonderful if I can start from your env setup and chipping away at the task list. @ssanderson, would it make sense to start a branch specifically for porting to newer Python and packages, and start labelling/tagging issues with "Python3.7", so that the many eager community users/volunteers can help with this much needed upgrade? |
One of the blockers to this is how far away the current code is to the last release - I use zipline on Windows outside Quantopian and would be willing to contribute as part of my role at work, but until we are using the version I can contribute to, it's difficult (there are numerous changes needed in my repo to data structures, etc. between 1.3 and master to be made in an upgrade, even before I could help with fixes for version changes). Obviously the backwards compatibility is a big issue with letting loose on newer versions, and supporting your own platform will come before external users, but speaking from experience, external users are looking to alternatives due to the perceived lack of support of this package (2 years since last release). |
Python3.8 has MacOSX build problems as well |
So sad to hear the recent news about Q. One thing comes to mind though, is there any plans on what's going to happen to Zipline regarding support for newer libraries/Python? As far as my understanding goes (correct me if I wrong), it was hard to bump up dependencies in Zipline and its relevant packages (e.g. Alphalens) because they were used to support Quantopian algorithm IDE. |
This branch https://github.com/quantopian/zipline/tree/new-new-new is worth looking into for the bump to pandas 1.1.3.. |
A new release of Zipline now supports Python 3.7+. |
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:
Additional Thoughts
The text was updated successfully, but these errors were encountered: