Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Run mypy's stubtest too #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Dec 23, 2020
Merged

Run mypy's stubtest too #95

merged 17 commits into from
Dec 23, 2020

Conversation

altendky
Copy link
Collaborator

@altendky altendky commented Sep 30, 2020

Note:

Draft for:

  • Fixing Addressing the reported issues
  • Use released mypy version with proper constraint
    • If anyone else wants to hold this up on the release, I understand, but I don't feel the need to anymore since it is a test-only dependency.
  • Deal with (pile of) ignored items

@altendky altendky marked this pull request as draft September 30, 2020 15:14
@altendky
Copy link
Collaborator Author

altendky commented Oct 9, 2020

@BryceBeagle, here are the remaining to-be-reviewed allowances. I'm not sure what to make of them yet. They are all 'enumerations' and exactly the ones that have the enumerators nested inside the enumeration. Though there are only 25. So, maybe this is just details related to #106.

Full stubtest output
error: PyQt5.QtBluetooth.QBluetoothDeviceInfo.Field.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtCore.QAbstractItemModel.CheckIndexOption.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtCore.QByteArray.Base64DecodingStatus.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtCore.QCalendar.System.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtCore.QCborKnownTags.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtCore.QCborSimpleType.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtCore.QDateTime.YearRange.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtCore.Qt.HighDpiScaleFactorRoundingPolicy.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtGui.QColorSpace.Primaries.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtGui.QColorSpace.TransferFunction.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtGui.QTextBlockFormat.MarkerType.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtNetwork.QOcspCertificateStatus.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtNetwork.QOcspRevocationReason.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtNetwork.QSslCertificate.PatternSyntax.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtNetworkAuth.QAbstractOAuth.ContentType.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtNetworkAuth.QAbstractOAuth.Error.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtNetworkAuth.QAbstractOAuth.Stage.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtNetworkAuth.QAbstractOAuth.Status.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtNetworkAuth.QOAuth1.SignatureMethod.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtNetworkAuth.QOAuth1Signature.HttpRequestMethod.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtNfc.QNearFieldManager.AdapterState.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtTest.QAbstractItemModelTester.FailureReportingMode.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtWebEngineCore.QWebEngineUrlScheme.Syntax.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtWebEngineWidgets.QWebEnginePage.LifecycleState.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

error: PyQt5.QtWidgets.QActionGroup.ExclusionPolicy.__new__ is inconsistent, stub does not have argument "value"
Stub: at line 100
def (cls: Type[builtins.object]) -> Any
Runtime: at line 557 in file /usr/lib/python3.8/enum.py
def (cls, value)

@BryceBeagle
Copy link
Collaborator

BryceBeagle commented Oct 9, 2020

The signature of Enum.__new__ matches the runtime signature for each of those enums
https://github.com/python/cpython/blob/3da210b69f76bdd7f4e7fa2e3a12eab4dd478ed2/Lib/enum.py#L574-L580

Does this issue go away if you make these stub classes inherit from Enum/IntEnum instead of int?

@altendky
Copy link
Collaborator Author

altendky commented Oct 9, 2020

enum.IntEnum didn't seem to, but it is possible I was just tired and confused. For the record, the following issue was mentioned on Gitter as possibly relevant.

python/typeshed#4555 (comment)

@altendky altendky marked this pull request as ready for review October 15, 2020 01:21
@altendky
Copy link
Collaborator Author

Heh, looks like I should have added GHA with just Linux for now and made Windows/macOS checks separate additions... :]

@altendky altendky merged commit e9a2f2d into python-qt-tools:master Dec 23, 2020
@altendky altendky deleted the stubtest branch December 23, 2020 21:17
bluebird75 pushed a commit to bluebird75/PyQt5-stubs that referenced this pull request Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants