pep8 job failing because of mypy

Bug #1931476 reported by Artom Lifshitz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Committed
Undecided
Stephen Finucane

Bug Description

When running `tox -e pep8` (either in CI or locally), there are mypy failures on nova/crypto.py

In CI, it looks like (from https://zuul.opendev.org/t/openstack/build/1e32efc260b84a94b6a9cfeba3c80976)

pep8 start: run-test
pep8 run-test: commands[0] | bash tools/mypywrap.sh
setting PATH=/home/zuul/src/opendev.org/openstack/nova/.tox/shared/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
[4860] /home/zuul/src/opendev.org/openstack/nova$ /usr/bin/bash tools/mypywrap.sh
nova/crypto.py:39:1: error: Library stubs not installed for "paramiko" (or incompatible with Python 3.8)
nova/crypto.py:39:1: note: Hint: "python3 -m pip install types-paramiko"
nova/crypto.py:39:1: note: (or run "mypy --install-types" to install all missing stub packages)
nova/crypto.py:39:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 23 source files)
ERROR: InvocationError for command /usr/bin/bash tools/mypywrap.sh (exited with code 1)
pep8 finish: run-test after 4.21 seconds
pep8 start: run-test-post
pep8 finish: run-test-post after 0.00 seconds

Locally, it looks like this:

[artom@zoe nova]$ python -m mypy nova/crypto.py
nova/crypto.py:31:1: error: Library stubs not installed for "cryptography.hazmat" (or incompatible with Python 3.9)
nova/crypto.py:31:1: note: Hint: "python3 -m pip install types-cryptography"
nova/crypto.py:31:1: note: (or run "mypy --install-types" to install all missing stub packages)
nova/crypto.py:31:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
nova/crypto.py:31:1: error: Library stubs not installed for "cryptography.hazmat.backends" (or incompatible with Python 3.9)
nova/crypto.py:32:1: error: Library stubs not installed for "cryptography.hazmat.primitives.asymmetric" (or incompatible with Python 3.9)
nova/crypto.py:32:1: error: Library stubs not installed for "cryptography.hazmat.primitives.asymmetric.padding" (or incompatible with Python 3.9)
nova/crypto.py:33:1: error: Library stubs not installed for "cryptography.hazmat.primitives" (or incompatible with Python 3.9)
nova/crypto.py:33:1: error: Library stubs not installed for "cryptography.hazmat.primitives.hashes" (or incompatible with Python 3.9)
nova/crypto.py:34:1: error: Library stubs not installed for "cryptography.hazmat.primitives.serialization" (or incompatible with Python 3.9)
nova/crypto.py:35:1: error: Library stubs not installed for "cryptography" (or incompatible with Python 3.9)
nova/crypto.py:35:1: error: Library stubs not installed for "cryptography.x509" (or incompatible with Python 3.9)
nova/crypto.py:39:1: error: Library stubs not installed for "paramiko" (or incompatible with Python 3.9)
nova/crypto.py:39:1: note: Hint: "python3 -m pip install types-paramiko"
Found 10 errors in 1 file (checked 1 source file)

Revision history for this message
Artom Lifshitz (notartom) wrote :

Fixed in https://review.opendev.org/c/openstack/nova/+/795533, didn't notice it until being told.

Changed in nova:
status: New → Fix Committed
assignee: nobody → Stephen Finucane (stephenfinucane)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.