Issues handling Python 3.10 in portfiles

Chris Jones jonesc at hep.phy.cam.ac.uk
Fri Sep 10 18:53:26 UTC 2021


Hi

> On 10 Sep 2021, at 7:04 pm, Christopher Chavez <chrischavez at gmx.us> wrote:
> 
> Python 3.10.0 is expected to be released 2021-10-04, which will become the python310 port.
> 
> Just want to remind others to be on the lookout for portfiles (usually for ports not having `python` as the primary category) with version string handling that erroneously assumed there would never be Python 3.10, 3.11, etc.: naïvely adding Python 3.10 to these ports without further adjustment will cause them to instead erroneously interpret the Python version e.g. as "31.0", "3.1", "3.0", or "1.0".
> https://lists.macports.org/pipermail/macports-dev/2020-October/042521.html
> 
> I corrected several examples already, but I doubt that I found all of them:
> https://github.com/macports/macports-ports/pulls?q=is%3Apr+author%3Achrstphrchvz+is%3Aclosed+python+3.10

Strictly speaking the fixes in the above link are still flawed, as they still make the assumption the major version will only either be a single digit. Yes, i concede we are some way from python 10.x…. But still a better fix i think is, if a port needs to hardcode a list of python versions, to do so with the dot(s), as then removing the dots to form the dotless strings has no ambiguity in it, unlike doing the reverse to add one in the correct place.

( we had similar issues when gcc and clang both hit version 10, and doing the above was invariably the better more robust fix )

Cheers Chris

> 
> Christopher A. Chavez



More information about the macports-dev mailing list