Timeline and If limitation...

Phil Thompson phil at riverbankcomputing.com
Mon May 12 16:00:58 BST 2025


On 09/05/2025 10:47, Phil Thompson wrote:
> On 09/05/2025 00:42, Matt Newell wrote:
>> It seems impossible to enable sip code for older versions because you 
>> can't
>> test for any version in a timeline that may not be defined in the 
>> installed
>> version.
>> 
>> Specifically:
>> 
>> %If (- Qt_6_6_0)
>> %Include my_std_optional.sip
>> %End
>> 
>> fails with any qt/pyqt less than 6.6.0 because the timeline doesn't 
>> contain
>> that version.
>> 
>> Right now I have to test for the pyqt version ahead of time, define a 
>> new
>> feature, and disable that if the version isn't met.
>> 
>> I think it would be nice to have the %If feature when passed a range 
>> to
>> have the following behavior:
>> 
>> %If (Qt_6_6_0 -)  # Evals to false if the tag/qualifier is not defined
>> %If (- Qt_6_6_0) # Evals to true if the tag/qualifier is not defined
>> 
>> %If (Qt_6_5_0 - Qt_6_6_0) # Evals to false if neither is defined, true 
>> if
>> one or the other is defined and the tag is in the timeline above/equal 
>> to
>> the left value or below/equal to the right value.
>> 
>> Thanks,
>> Matt Newell
> 
> Hmm - I thought that was the current behaviour. Can you try the
> attached patch just to see if the fix is that simple.

...nearly. The attached should do it.

I plan to release SIP v6.11 later this week.

Phil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parser_manager.py.diff
Type: text/x-diff
Size: 766 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20250512/91e48539/attachment.diff>


More information about the PyQt mailing list