Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Oct 2022 13:57:53 +1030
From:      Shane Ambler <FreeBSD@ShaneWare.Biz>
To:        Tatsuki Makino <tatsuki_makino@hotmail.com>, ports@freebsd.org
Subject:   Re: Python version dependencies in pkg
Message-ID:  <adf633cd-9c47-c1a1-0201-3121d55f60e3@ShaneWare.Biz>
In-Reply-To: <PSAPR03MB5639F69C594D482C7A152DC0FA569@PSAPR03MB5639.apcprd03.prod.outlook.com>
References:  <8B490359-27A3-410C-AE98-C1362D4FA9F0@gushi.org> <CAN6yY1sGnDF-oReRMFeVz78oGoTfUvsvwUOQwoBZWN9ibjTw3A@mail.gmail.com> <B2A3A400-F21A-4E92-8116-41E7945E4E5C@gushi.org> <CAN6yY1ujCH9Xnv3QN-GF8hN75v%2BxGkOTHrsr25jzxGNGdYW2vQ@mail.gmail.com> <89D2B2D7-FA3D-46F5-A93B-4846950A157C@gushi.org> <65597c37-813b-d0ed-ea9f-8591b68cf097@gwdg.de> <20220929083939.Horde.Viq2uLBgUctcrsgmaJxN_1u@webmail.leidinger.net> <F4395689-FFD7-4591-BE5C-3F15983BF82D@gushi.org> <PSAPR03MB5639D5A4E9655F3AE61361E6FA579@PSAPR03MB5639.apcprd03.prod.outlook.com> <1fdde4e6-fa80-720f-7c85-8417d2a3b642@ShaneWare.Biz> <PSAPR03MB5639F69C594D482C7A152DC0FA569@PSAPR03MB5639.apcprd03.prod.outlook.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 30/9/22 4:37 pm, Tatsuki Makino wrote:
> 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.

While making or updating a port, I build and install for each flavour
before testing with poudriere

make FLAVOR=py38 stage-qa install clean
make FLAVOR=py39 stage-qa install clean
make FLAVOR=py310 stage-qa install clean

I find that this doesn't carry through to dependencies so I end up
setting FLAVOR in the env

setenv FLAVOR py310; make stage-qa install clean

and bash would be - export FLAVOR=py310; make install

This also works for non-py flavours

cd devel/binutils
make FLAVOR=aarch64 install
make FLAVOR=arm_none_eabi install
make FLAVOR=mingw32 install

> 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.

conflicts with python modules happen when installing files into the same
place, such as adding cli commands to ../bin or installing docs, the
concurrent option adds a flavour suffix to resolve most conflicts


-- 
FreeBSD - the place to B...Software Developing

Shane Ambler




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?adf633cd-9c47-c1a1-0201-3121d55f60e3>