A few issue with 6.2.0

Phil Thompson phil at riverbankcomputing.com
Sun Oct 24 18:00:17 BST 2021


On 24/10/2021 05:03, Damien Elmes wrote:
> One other issue I forgot to mention - QByteArray can't be pickled on 
> Python
> 10:
> 
>>>> from PyQt6.QtCore import QByteArray
>>>> import pickle
>>>> pickle.dumps(QByteArray(b"test"))
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats

Fixed in the next snapshot.

>> > - the macos_amd64 wheels should probably use 11_0 - they are currently
>> > 10_14, and pip refuses to install them with 'no matching distributions'
>> > on
>> > an Apple M1 machine.
>> 
>> That sounds like a pip bug as 10.4 is the minimum required version. 
>> What
>> is the output of 'pip --verbose debug'?
>> 
> 
> Sorry, that should have read _arm64 above.
> 
> dae at armmini ~ % ./venv2/bin/pip install pyqt6-webengine
> Collecting pyqt6-webengine
>   Using cached 
> PyQt6_WebEngine-6.2.0-cp36-abi3-macosx_10_14_universal2.whl
> (357 kB)
> Collecting PyQt6-sip<14,>=13.1
>   Using cached PyQt6_sip-13.1.0-cp39-cp39-macosx_11_0_arm64.whl
> ERROR: Could not find a version that satisfies the requirement
> PyQt6-WebEngine-Qt6>=6.2.0 (from pyqt6-webengine) (from versions: none)
> ERROR: No matching distribution found for PyQt6-WebEngine-Qt6>=6.2.0
> 
> dae at armmini ~ % ./venv2/bin/pip --verbose debug | grep cp39 | grep arm
> WARNING: This command is only meant for debugging. Do not use this with
> automation for parsing and getting these details, since the output and
> options of this command may change without notice.
>   cp39-cp39-macosx_11_0_arm64
>   cp39-abi3-macosx_11_0_arm64
>   cp39-none-macosx_11_0_arm64
> 
> dae at armmini ~ % ./venv2/bin/pip --verbose debug | grep cp39 | grep 
> universal
> WARNING: This command is only meant for debugging. Do not use this with
> automation for parsing and getting these details, since the output and
> options of this command may change without notice.
>   cp39-cp39-macosx_11_0_universal2
>   cp39-cp39-macosx_10_16_universal2
>   cp39-cp39-macosx_10_15_universal2
>   cp39-cp39-macosx_10_14_universal2
>   cp39-cp39-macosx_10_13_universal2
>   cp39-cp39-macosx_10_12_universal2
>   cp39-cp39-macosx_10_11_universal2
>   cp39-cp39-macosx_10_10_universal2
>   cp39-cp39-macosx_10_9_universal2
> [...]
> 
> Workaround for now is to specify the older arch:
> 
> ./venv2/bin/pip install pyqt6-qt6 pyqt6-webengine-qt6
> --platform=macosx_10_14_arm64 --only-binary=:all: --no-deps --target
> venv2/ext

So it only requires 11_0 with arm64, but 10_4 is Ok with universal2.

>> > codesign -s  - \
>> >
>> PyQt6/Qt6/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
>> 
>> I can't reproduce this (on an Intel Mac). The original file is not
>> signed.
>> 
> 
> I misspoke - the issue is arm64-specific - on arm64, unsigned code 
> won't
> run at all, so XCode will automatically
> give outputs an 'ad-hoc' signature when they are created:
> 
> dae at armmini ~ % codesign -dvv
> venv2/ext/PyQt6/Qt6/lib/QtWebEngineCore.framework/Versions/A/QtWebEngineCore
> Executable=/Users/dae/venv2/ext/PyQt6/Qt6/lib/QtWebEngineCore.framework/Versions/A/QtWebEngineCore
> Identifier=QtWebEngineCore
> Format=Mach-O thin (arm64)
> CodeDirectory v=20400 size=1122728 flags=0x20002(adhoc,linker-signed)
> hashes=35082+0 location=embedded
> Signature=adhoc
> [...]
> dae at armmini ~ % codesign -vv
> venv2/ext/PyQt6/Qt6/lib/QtWebEngineCore.framework/Versions/A/QtWebEngineCore
> venv2/ext/PyQt6/Qt6/lib/QtWebEngineCore.framework/Versions/A/QtWebEngineCore:
> valid on disk
> venv2/ext/PyQt6/Qt6/lib/QtWebEngineCore.framework/Versions/A/QtWebEngineCore:
> satisfies its Designated Requirement
> 
> The helper has an ad-hoc signature too, but it's malformed:
> 
> dae at armmini ~ % codesign -vv
> venv2/ext/PyQt6/Qt6/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
> venv2/ext/PyQt6/Qt6/lib/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess:
> invalid signature (code or signature have been modified)
> In architecture: arm64

I've uploaded to PyPI new arm64 wheels for PyQt6-Qt6 and 
PyQt6-WebEngine-Qt6. These use 11_0 in the wheel name and 
QtWebEngineProcess is the original fat binary from a Qt installation. 
Let me know if these are better.

>> > We also automatically add '# type: ignore' comments to any '.connect('
>> > line
>> > in generated uic files, as the types don't currently cover the signals.
>> > Apart from that, the typing is working great.
>> 
>> Can you give me an example of a modified file - just so that I get it
>> right first time.
>> 
> 
> Here's a few:
> 
>         self.buttonBox.accepted.connect(ChangeMap.accept)  # type: 
> ignore
>         
> self.fields.doubleClicked['QModelIndex'].connect(ChangeMap.accept)
>  # type: ignore
> 
> self.activeCheck.toggled['bool'].connect(self.activeList.setEnabled)  #
> type: ignore
> 
> Without them, we get errors like:
> 
> aqt/forms/taglimit_qt6.py:54: error: "Callable[[], None]" has no 
> attribute
> "connect"  [attr-defined]
> aqt/forms/taglimit_qt6.py:55: error: Value of type "Callable[[bool], 
> None]"
> is not indexable  [index]

Should be fixed in the next snapshot.

Thanks,
Phil


More information about the PyQt mailing list