Home   Manual

Minimum Python Version for User Scripts

Avogadro 2 has a plugin feature that allows for users to write command scripts using Python. This is actually how the input generators function, with the format for each program being specified in separate Python scripts.

The initial intention seems to have been to make it so these scripts would work for anyone with Python 3.5+. However, with the 2.0 release of Avogadro likely not occurring until at least the end of the year and Python 3.6 reaching end of life around this time, it may worth bumping up the minimum version. One major benefit of this would the inclusion of f-strings, which were introduced in Python 3.6 and are very convenient for formatting text.

To make this change, it would be useful to know what version of Python people use on their computers, to avoid a case where the minimum version is set higher than what most people actually use. This was mentioned on a couple open pull-requests on the avogenerators Github. Personally, I have different versions across different computers, but I think all of them are at least up to Python 3.7. I think this would be a reasonable minimum version, as it is likely a lot of users are at least up to this version and it has features like f-strings that would make it more convenient than 3.5.

Home - Python Developer's Guide v.s.
Development Cycle - Python Developer's Guide
Python 3.5 end of life was 11 months ago.

Thanks for both the pull requests and posting the thread.

I’m always reluctant to push language versions - we’re still using C++11 for example. I also know a lot of people who don’t really update Python unless they have to. (I only recently switched to 3.8.)

I ran a poll on Twitter

It’s obviously not very scientific, but I think the results are informative:

My general experience with open source maintaining is that the minimum version requirement is often really old. For example, Avogadro 1.x was downloaded over 1M times including a lot of users in Vietnam, Thailand, and many places where OS and hardware were old.

I talked a bit with @mhanwell and with Greg Landrum, who develops RDKit.

I think 3.6 is probably the right way to go. RHEL 8 is at 3.6, for example

I think 3.6 would make sense. f-strings were really the main thing I think these command scripts were missing out on. I don’t think there are any additions in Python 3.7+ that are “must haves” for these sorts of scripts. I also don’t expect there to be any bugs that crop in 3.6 after end of life that would have any major effect on small scripts, so its probably for the best to move the minimum version up conservatively.

1 Like

https://pypistats.org is a supercool way to see what downloaders of a PyPI package are using.

2 Likes

Thanks - that’s incredibly useful. I pulled stats for a few popular packages, e.g. urllib3 - 3.6 is still ~20% of downloaders. That’s behind 3.7, but I think reinforces that 3.6 is a good baseline for now.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.