Solved Correct way of handling python flavors in port dependencies?

cmoerz

Member

Reaction score: 37
Messages: 98

I'm struggling to understand what the "correct" way for handling python flavors is.

I'm attempting to port some software that depends on py-qt5; on amd64, there's a binary packages for py37-qt5 only at the moment. So, I figured I'll make my port USE=python:3.7.

However, I hit a snag when I added dependencies to py-sutil the following way:
Code:
RUN_DEPENDS=${PYTHON_PKGNAMEPREFIX}psutil>0:sysutils/py-psutil@${PY_FLAVOR}

When I attempted a make package, this leads to
Code:
===>   xxx depends on executable: fvwm2 - found
===>   xxx depends on executable: pyuic5 - found
===>   xxx depends on package: py37-yaml>=3.11 - found
===>   xxx depends on package: py37-psutil>0 - not found
===>  py37-psutil-5.8.0 Unknown flavor 'py37', possible flavors: py38.
*** Error code 1

Stop.
make[2]: stopped in /usr/ports/sysutils/py-psutil

I gather, psutil is set to not support python 3.7, even though there is a binary package py37-psutil? What surprises me in particular, is the fact that psutil actually sets
Code:
USES=           python:3.6+
I read: it should support building flavor py37?

Right now, I see following options and I'm unsure how best to proceed:
  1. File a bug report with py-psutil port and ask to add FLAVORS=py37 (which seems to do the trick, as testing shows)
  2. be a complete PITA and argue that the ports system isn't working? (just kidding...)
  3. Change my port to not depend distinctly on python:3.7 and just live with having to compile py-qt5 for python 3.8 myself instead of using a binary package
  4. go into a cave and reflect on my life choices of porting software in the first place (still kidding...)
While option 3 obviously is the "easier" way forward, I wonder what one would do, if your port really does need a particular python version? I've searched for other ports that face this challenge but ended up none the wiser.

Or am I misinterpreting the inner workings of the ports system? After all, I can just as well pkg install py37-psutil and keep going back to make package. Having resolved the dependency, my port packaging appears to finish fine afterwards.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 12,308
Messages: 38,828


So, I figured I'll make my port USE=python:3.7.
The default is currently set to 3.8. It changed recently. Best is not to "fix" on a specific version at all and let it pick whatever is set as default. Unless you know for a fact the code is only supported on a specific version.
 

Zirias

Son of Beastie

Reaction score: 1,531
Messages: 2,654

I currently use USES= python:3.7+ because I'm way too lazy to test whether older python versions would be fine as well ;) With the +, a newer version is ok.
 
Top