Increase Python minimum version to 3.8
Once Ubuntu 20.04 has been out for a year and Anaconda supports it, let's update to Python 3.8.
Link issues together to show that they're related. Learn more.
When these merge requests are accepted, this issue will be closed automatically.
Activity
- Michael Kuron changed due date to April 01, 2021
changed due date to April 01, 2021
- Owner
Sounds good to me
- Michael Kuron mentioned in merge request !191 (merged)
mentioned in merge request !191 (merged)
- Author Maintainer
We don't have to do it strictly by date, the issue deadline was meant as the earliest possible date. Is there any specific Python 3.8 feature you would like to use or some particularly ugly piece of code that could be cleaned up with Python 3.8 syntax? Until that is the case, upgrading is probably not worth the hassle.
Edited by Michael Kuron - Owner
Yes, I would agree with that. As far as I know, we don't actually use a python 3.8 feature so far so there is no real reason why not to support python 3.6 at the moment.
- Michael Kuron removed due date
removed due date
- Michael Kuron unassigned @holzer
unassigned @holzer
Alright, now even Debian stable has 3.9 as the default. And yes, there are some features, which I would like to use. The walrus operator, positional-only parameters for the API functions, more f-string features, and dataclasses. Plus, Python 3.10 will have structural pattern matching, which would help pystencils a lot. If we never update the requirement, we will never get there.
I would propose to have 3.8 as the minimal version, since the current LTS of Ubuntu has that.
Edited by Jan Hönig- Owner
I would be ok with that if there are features which really help pystencils. From my perspective it is not a good idea to just increase the restrictions for the sake of increasing them, or in other words as long as every piece of pystencils supports python 3.6 we should also have python 3.6 as minimal version. If you propose some code in pystencils which needs python 3.9 etc. and using python 3.9 makes the code indeed way better than I would say we can increase the minimal version immediately.
In the CI we already have a pipeline for python 3.9 so it pystencils should be completely compatible.
@kuron what is your opinion on that.
- Michael Kuron mentioned in merge request !259 (merged)
mentioned in merge request !259 (merged)
- Author Maintainer
I would be ok with that if there are features which really help pystencils. [...] as long as every piece of pystencils supports python 3.6 we should also have python 3.6 as minimal version
I fully agree with you, @holzer. @hoenig, please add something to pystencils that requires Python 3.8. Right now the build on !259 (merged) passes even though we still have Docker images that contain Python 3.6 or 3.7.
- Owner
We will add dataclasses for the creation functions in pystencils and lbmpy. This should make our top level functions better usable.
- Author Maintainer
dataclasses
That‘s a 3.7 feature. Please find a 3.8 feature that is useful for pystencils and make use of it as part of !259 (merged).
assignment expression, positional-only parameters for the API functions, more f-string features
Moreover, today I started working on !261 (merged) and now it raises the question, whether we want to upgrade to 3.8 or 3.9. 3.9 introduced Type Hinting Generics In Standard Collections which I am (currently) using. I could implement it using the
typing
module (see List). But this would just increase the workload, since if we upgrade to any Python version >3.8 things likeList
is already deprecated.I think
pystencils
desperetly needs type hints. And I also think that building for the past doesn't make any sense in a research environment. Should we then update directly to 3.9?Edited by Jan HönigWow, we can't go to 3.9 easily, because of conda. We tried it: https://i10git.cs.fau.de/pycodegen/pycodegen/-/jobs/625908