diff --git a/qiskit/transpiler/passes/routing/cython/stochastic_swap/utils.pxd b/qiskit/transpiler/passes/routing/cython/stochastic_swap/utils.pxd index d45676f55f0c..f41e16fcea63 100644 --- a/qiskit/transpiler/passes/routing/cython/stochastic_swap/utils.pxd +++ b/qiskit/transpiler/passes/routing/cython/stochastic_swap/utils.pxd @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- #!python #cython: language_level = 3, cdivision = True, nonecheck = False #distutils: language = c++ @@ -14,6 +13,7 @@ # Any modifications or derivative works of this code must retain this # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. + from libcpp.vector cimport vector # Numeric layout -------------------------------------------------------------- diff --git a/tools/verify_headers.py b/tools/verify_headers.py index a904096ecfee..a56ab19a0009 100755 --- a/tools/verify_headers.py +++ b/tools/verify_headers.py @@ -11,6 +11,8 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. +"""Utility script to verify qiskit copyright file headers""" + import argparse import multiprocessing import os @@ -22,6 +24,7 @@ def discover_files(code_paths): + """Find all .py, .pyx, .pxd files in a list of trees""" out_paths = [] for path in code_paths: if os.path.isfile(path): @@ -30,12 +33,17 @@ def discover_files(code_paths): for directory in os.walk(path): dir_path = directory[0] for subfile in directory[2]: - if subfile.endswith(".py") or subfile.endswith(".pyx"): + if ( + subfile.endswith(".py") + or subfile.endswith(".pyx") + or subfile.endswith(".pxd") + ): out_paths.append(os.path.join(dir_path, subfile)) return out_paths def validate_header(file_path): + """Validate the header for a single file""" header = """# This code is part of Qiskit. # """ @@ -70,7 +78,7 @@ def validate_header(file_path): return (file_path, True, None) -def main(): +def _main(): default_path = os.path.join( os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "qiskit" ) @@ -80,7 +88,7 @@ def main(): type=str, nargs="*", default=[default_path], - help="Paths to scan by default uses ../qiskit from the" " script", + help="Paths to scan by default uses ../qiskit from the script", ) args = parser.parse_args() files = discover_files(args.paths) @@ -96,4 +104,4 @@ def main(): if __name__ == "__main__": - main() + _main()