For flake8, an import is considered "used" if it appears in a module's __all__. It seems that cython-lint is unaware of __all__ when considering which imports are used or unused.
Example:
# file.pyx
import numpy
__all__ = ["numpy"]
$ cython-lint file.pyx
file.pyx:1:8: 'numpy' imported but unused
Rename the above to file.py -- flake8 is clean.
Renaming the above to file.py and remove __all__:
$ flake8 file.py
file.py:1:1: F401 'numpy' imported but unused
For flake8, an import is considered "used" if it appears in a module's
__all__
. It seems that cython-lint is unaware of__all__
when considering which imports are used or unused.Example:
Rename the above to
file.py
-- flake8 is clean. Renaming the above tofile.py
and remove__all__
: