Re: Python version dependencies in pkg

From: Tatsuki Makino <tatsuki_makino_at_hotmail.com>
Date: Fri, 30 Sep 2022 07:07:54 UTC
Shane Ambler wrote on 2022/09/30 13:54:
> On 30/9/22 7:05 am, Tatsuki Makino wrote:
>> Currently, two versions of Python are allowed to be installed on FreeBSD.
>> One is Python 2.7 but EOL.
> 
> You can install as many python major versions as you want or need, that
> means you can also install many of the py modules for each version. Note
> that some have conflicts and some only need concurrent option added to
> them to prevent conflicts.
> 
> Being the maintainer of some py modules, I have them all installed so
> I can verify that all py versions build and install without conflict.

Yes, we need to consider with regard to conflicts.
But it is difficult to cause conflicts unless we go the extra way.
Because...

USES=python means USES=python:3.7+. It is so by default value of _PYTHON_ARGS.
If we want to use 2.7, we need to deliberately make them use it.

And there is only one FLAVOR for Python, the default version.
This can be checked with a command like the following

make -C /usr/ports/multimedia/libopenshot/ -V USE_PYTHON:Mallflavors -V FLAVORS

This means that it is not possible to propagate FLAVOR other than the default version.
No packages other than the default version will be created.
It is USE_PYTHON=allflavors that allows the use of FLAVOR other than the default version.
Such a port will produce multiple FLAVORs with the following command.

make -C /usr/ports/math/py-numpy/ -V USES:Mpython\* -V USE_PYTHON:Mallflavors -V FLAVORS

The results will vary depending on the version range.

make -C /usr/ports/math/py-numpy/ -V USES:Mpython\* -V USE_PYTHON:Mallflavors -V FLAVORS USES=python:2.7-3.8


...
Conflicts can only happen intentionally.
And, I wrote the earlier email because I think "this is a great mechanism" :)

Regards.