-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Minimum supported Python 3 version bump #6297
Comments
Practically speaking, what do we gain from upgrading to 3.6? Are there any special features we would need / like? Otherwise, I don't see a specific reason to stop supporting Xenial... |
tldr; my opinion is get type annotation checking throughout Meson before doing Python 3.6 refactoring. We may not be ready to gain significant benefits from making Python 3.6 a Meson minimum until late spring or summer 2020. In the data science / aerospace / geoscience realm, I see robust adoption of Python 3.6. Generally my sense is people clung to 2.7 and then over the past 12 months have jumped straight to 3.6, due to issues with some big data science libraries not yet working with 3.7. Some significant libraries like xarray already have a Python 3.6 minimum. However, on the hardware dev side of those industries, I see a slower adoption of new Linux distros. I see dev machines/servers hanging on to Ubuntu LTS (and Windows versions) to EOL and even a bit past EOL for offline systems due to driver/library compatibility issues and sluggish OEM SDK updates. They maybe could be brought to use non-system Python 3.6 in whatever form. With Python 3.5 EOL in Sept 2020, we could take the next N months refactoring key pain points to stand ready for maximum internal Meson quality of life benefits from 3.6 like f-strings and widespread pathlib use. My first thought is we'd want to get type annotation checking more thoroughly implemented throughout Meson to avoid breakages in the refactoring. Regardless of when the switch is, maybe we can think about what may need to change to get type annotation working almost everywhere in Meson for whenever 3.6 refactoring would occur -- the compiler mixins are one key area that's heavily interdependent. |
Here's the list of new features in 3.6: https://docs.python.org/3/whatsnew/3.6.html the big ones are inline variable annotations: foo: typing.List[str] = []
vs
foo = [] # type: typing.List[str] if also lets you do forward typing declarations: foo: int
if os.system().startswith('linux'):
foo = 2
else:
foo = 3 An f-strings is the other big one. f = 'foo'
'mystring : %s' % f
'mystring : {}'.format(f)
f'mystring: {f}' Which is obviously really nice. Speaking of compiler type annotations, I'm working on that right now. |
For the record, Ubuntu 16.04 (Xenial) support ends April 2021 and security support ends April 2024. I personally don't think it should stop us from depending on Python3.6, but that's going to annoy some people for sure. I'm currently working for a client who still uses 16.04 and is not planning to upgrade any time soon. Again, I'm not saying this is a blocker, but we have to be prepared for complains, so better have solid reasons. |
That being said, I can't wait to use f-strings ! |
I think that since Meson is by definition working heavily with strings, there is a real quality assurance benefit to end users from f-strings (avoiding internal mistakes). Have we tried using PyInstaller for more than just .msi on Windows? That is, could we distribute using pyinstaller a standalone Meson "program" using PyInstaller for MacOS, Linux, BSD, etc. as well as the existing Windows Meson .msi. That would be for users without Python 3.6 already installed. |
That's not the problem. People who use those old distros have to use the distro provided Python due to reasons. Otherwise they could just install their own Python version and use that. |
There are pypi download stats btw, including Python versions: https://pypistats.org/packages/meson |
@jpakkane If openSUSE Leap 15.1 is any guide to SLES 15 (and these days minor Leap versions are roughly twinned to SLES Service Packs), the current Python 3 in there is 3.6. |
That plot naturally doesn't capture apt/yum, but then that category of use cases isn't as impacted by the switch--just whatever would hit their -backports. It may be interesting to watch this graph for a while--will there be a bump from year-end/beginning system/python upgrades, and how rapidly will Debian Buster, Ubuntu 20.04, etc. be adopted into the summer. It could be nice to let all the refactoring settle out for a release cycle or two, before dropping Python 3.5, to leave a good quality last version for Python 3.5 users. Maybe these internal quality improvements could warrant a Meson 1.0 release, dropping Python 3.5 or by Meson 1.1 or so dropping Python 3.5 Meson Python 3.4 -> 3.5 discussion |
See also #2891 |
From Twitter, recent benchmark showing f-strings can be a few times faster than .format()
A reply, noting how f-strings are "so fast"
|
How about adopting a clear policy like this one: https://numpy.org/neps/nep-0029-deprecation_policy.html It does not have to be 42 months. Even without such a policy, I suggest to inform users n months before dropping support for a specific python version. |
Yes and NEP29 itself may need updating to account for new 12-month Python release cycle. NEP29 says to drop Python 3.6 support in July 2020--just a more aggressive cycle for data science. A possible joint ruleset:
That's more complex than calendar months, but may be more representative of Meson's user base. |
You don't know when they will support a newer version of Python. |
That's true, maybe calendar based is more suitable due to the sureness of date for that reason. |
I found some information regarding python 3.6 on centos EPEL. Would this help? https://cjsawer.whitewillow.co.uk/2018/08/29/epel-python-3-6-with-pip-on-centos-7/ |
Another thought for a Python version deprecation ruleset:
From the weekly downloads Python 3.5 was about 47% Nov 1 week, 35% Dec 1 week, and this last week about 26%. If that trend continued, maybe in February 2020 we'd have below 10% of Meson downloads being Python 3.5. |
Looking at a few very popular projects, like Numpy and Requests, Python 3.5 is in the 15-20% range, with Python 3.6 the most popular. For Spyder IDE, Python 3.5 is in the 5-10% range with Python 3.7 by far the most popular. NEP29 deprecates Python 3.5 on Jan 7, 2020. |
Given how fast multiple users complained when Meson 0.53.0 regressed on Ubuntu 16.04, I think that proof the point that we are not ready to bump dependency to >3.5.2, IMHO. |
#6438 and associated discussion may provide a long-term solution for this. Having Meson be coded in a recent Python version syntax, while post-processing releases and perhaps even PRs/master to a rolling branch that's compatible with older Python versions. |
Maybe this can help, link to a resource on downloading Python 3.6 on Ubuntu. This can be helpful if a Meson user would like to use a newer implementation of Meson that uses Python 3.6. |
This does seem crazy to me; why would people running an OS released nearly 4 years ago expect to install the latest release of a tool and feel like they shouldn't need to install a newer version of the tool's prerequisites? Especially since that's easy to do, as @michaelbadcrumble points out. If they must adhere to their release's outdated version of, in this case, python, then too bad, you can't have the latest version of your tool. Stay with the older version of meson that's compatible with your older environment. |
As in most problems in the real world, the issue is not black and white, but instead there are shades of gray. There are many people doing development on LTS releases and every time we require something newer than is there by default, we are adding to their development burden. Thus the question is not about dropping all support or supporting everything perfectly forever, but instead working out a suitable point in time to do the bump so that we balance our desire to get Hot New Stuff vs not inconveniencing downstream developers too much. |
|
https://www.phoronix.com/scan.php?page=news_item&px=RHEL-8.2-Beta-Released
|
Yes, fair enough. It is a bit of a high-wire balancing act, yes. |
SLES 15 has python 3.6. |
Bumping this again. Maybe the time has finally come? The only thing requiring 3.5 seems to be Xenial and since that is the old-old stable, I'd say we no longer need to support it. |
repology seems to have versions for many distros: https://repology.org/project/python/versions From the big ones: debian oldstable (stretch) (superseded since Juli 2019), raspian oldstable (superseded since Juli 2019), ubuntu < 18.04 |
If people still need meson on those distros, the best solution would be to make pyinstaller or similar, provide standalone binaries with embedded python. There are already similar resources for cmake and ninja. |
For the last 6 months, PyPi downloads show ~10% of Meson downloads are for Python 3.5. As discussed earlier there are plenty of other important download pathways for Meson. Since I feel type annotation is important for any project and particularly for projects the size of Meson, and the type annotation is significantly better in Python 3.6 along with benefit of f-strings, this seems worthwhile. Should we wait to take advantage of Python 3.6 syntax until there is next Meson release to ensure we can rollback if user backlash is too great? |
To upgrade the code to python 3.6, you can try to use these tools: |
At some point we should update the minimum version of Python 3. Here's what the distros currently have:
Xenial is probably old enough that we don't have to keep supporting it. 3.6 seems to be widely available, but is that so. Are there platforms where we'd need to support 3.5?
The text was updated successfully, but these errors were encountered: