Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-3513

Test failures with mypy 0.990

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.3.3
    • Affects Version/s: None
    • Component/s: None
    • None

      A new version of mypy is out (0.990) and is causing the mypy tests to fail:

      Run mypy --install-types --non-interactive bson gridfs tools pymongo
      Collecting types-pyOpenSSL
        Downloading types_pyOpenSSL-22.1.0.2-py3-none-any.whl (6.7 kB)
      Collecting types-requests
        Using cached types_requests-2.28.11.2-py3-none-any.whl (14 kB)
      Collecting types-cryptography
        Using cached types_cryptography-3.3.23.1-py3-none-any.whl (30 kB)
      Collecting types-urllib3<1.27
        Using cached types_urllib3-1.26.25.1-py3-none-any.whl (14 kB)
      Installing collected packages: types-urllib3, types-cryptography, types-requests, types-pyOpenSSL
      Successfully installed types-cryptography-3.3.23.1 types-pyOpenSSL-22.1.0.2 types-requests-2.28.11.2 types-urllib3-1.26.25.1
      pymongo/monitor.py: note: In function "_shutdown_resources":
      Installing missing stub packages:
      /opt/hostedtoolcache/Python/3.10.8/x64/bin/python -m pip install types-pyOpenSSL types-requests
      
      
      Found 2 errors in 1 file (checked 83 source files)
      pymongo/monitor.py:433: error: Function "Callable[[], Any]" could always be
      true in boolean context  [truthy-function]
              if shutdown:
                 ^~~~~~~~
      pymongo/monitor.py:436: error: Function "Callable[[], Any]" could always be
      true in boolean context  [truthy-function]
              if shutdown:
                 ^~~~~~~~
      

      https://github.com/ShaneHarvey/mongo-python-driver/actions/runs/3413638003/jobs/5680585700#step:5:37

      Looks like the changes to pin the mypy version in PYTHON-3243 do not work.

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: