Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-2682

Fix mypy issues following the update to mypy 0.901

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: NoFixVersionApplicable
    • Fix Version/s: 5.2.2
    • Component/s: Framework

      Description

      Mypy is getting better and better, and the last update found new issues:

      $ tox -e types
      nxdrive/constants.py:6: error: Library stubs not installed for "requests.exceptions" (or incompatible with Python 3.9)
      nxdrive/utils.py:1095: error: Library stubs not installed for "requests" (or incompatible with Python 3.9)
      nxdrive/utils.py:1096: error: Library stubs not installed for "requests.exceptions" (or incompatible with Python 3.9)
      nxdrive/client/proxy.py:4: error: Library stubs not installed for "requests" (or incompatible with Python 3.9)
      nxdrive/client/proxy.py:4: note: Hint: "python3 -m pip install types-requests"
      nxdrive/client/proxy.py:4: note: (or run "mypy --install-types" to install all missing stub packages)
      nxdrive/client/proxy.py:4: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
      nxdrive/objects.py:11: error: Library stubs not installed for "dateutil" (or incompatible with Python 3.9)
      nxdrive/objects.py:12: error: Library stubs not installed for "dateutil.tz" (or incompatible with Python 3.9)
      nxdrive/dao/base.py:23: error: Signature of "execute" incompatible with supertype "Cursor"
      nxdrive/dao/base.py:28: error: Too many arguments for "execute" of "Cursor"
      nxdrive/updater/base.py:8: error: Library stubs not installed for "requests" (or incompatible with Python 3.9)
      nxdrive/updater/base.py:9: error: Library stubs not installed for "yaml" (or incompatible with Python 3.9)
      nxdrive/updater/base.py:9: note: Hint: "python3 -m pip install types-PyYAML"
      nxdrive/engine/tracker.py:9: error: Library stubs not installed for "requests" (or incompatible with Python 3.9)
      nxdrive/client/remote_client.py:23: error: Library stubs not installed for "requests" (or incompatible with Python 3.9)
      nxdrive/direct_edit.py:17: error: Library stubs not installed for "requests" (or incompatible with Python 3.9)
      nxdrive/engine/queue_manager.py:254: error: unused "type: ignore" comment
      nxdrive/engine/engine.py:16: error: Library stubs not installed for "requests" (or incompatible with Python 3.9)
      nxdrive/manager.py:15: error: Library stubs not installed for "requests" (or incompatible with Python 3.9)
      nxdrive/gui/view.py:4: error: Library stubs not installed for "dateutil.tz" (or incompatible with Python 3.9)
      nxdrive/gui/view.py:4: note: Hint: "python3 -m pip install types-python-dateutil"
      nxdrive/gui/view.py:499: error: Argument 1 to "format_datetime" of "Translator" has incompatible type "Optional[datetime]"; expected "datetime"
      nxdrive/gui/view.py:510: error: Argument 1 to "format_datetime" of "Translator" has incompatible type "Optional[datetime]"; expected "datetime"
      nxdrive/gui/view.py:629: error: Argument 1 to "format_datetime" of "Translator" has incompatible type "Optional[datetime]"; expected "datetime"
      nxdrive/gui/view.py:640: error: Argument 1 to "format_datetime" of "Translator" has incompatible type "Optional[datetime]"; expected "datetime"
      nxdrive/gui/api.py:10: error: Library stubs not installed for "requests" (or incompatible with Python 3.9)
      Found 22 errors in 14 files (checked 100 source files)
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 20 minutes
                  20m