Conversation
So we can enable no-implicit-reexport, which gets onyl detected on re-export use, such as in the test suite.
Either explicitely "re-export" (I which there was a nicer way, as renaming also falls under this) or change the imports to import from the source. flake8 doesn't understand this, so just disable the warning of unused vars there. Maybe ruff will be smarter there. Fixes quodlibet#699
|
|
||
| from mutagen import StreamInfo | ||
| from mutagen.apev2 import APEv2File, error, delete | ||
| from mutagen.apev2 import APEv2File, error as error, delete |
There was a problem hiding this comment.
Without it we get:
tests/test_wavpack.py:4: error: Module "mutagen.wavpack" does not explicitly export attribute "error" [attr-defined]
Found 1 error in 1 file (checked 108 source files)
suggestions welcome.
There was a problem hiding this comment.
I see, yes. Somewhat makes sense. Wouldn't the alternative be to put it into __all__? Otherwise yes, if mypy is happy with the as definition it should be fine.
| from ._util import ID3EncryptionUnsupportedError as ID3EncryptionUnsupportedError, \ | ||
| ID3JunkFrameError as ID3JunkFrameError, ID3BadUnsynchData as ID3BadUnsynchData, \ | ||
| ID3BadCompressedData as ID3BadCompressedData, ID3TagError as ID3TagError, \ | ||
| ID3Warning as ID3Warning, BitPaddedInt as _BitPaddedIntForPicard |
There was a problem hiding this comment.
I wonder if we could get rid of the BitPaddedInt export here. As I see it this was added for compatibility with Picard before version 1.4 (https://tickets.metabrainz.org/browse/PICARD-833) ten years ago. Picard isn't using this import anymore since that time, and I think we don't need to expect the next mutagen version to be compatible with that old Picard versions.
There was a problem hiding this comment.
sounds good, thanks for investigating
Either explicitely "re-export" (I whish there was a nicer way, as renaming
also falls under this) or change the imports to import from the source.
flake8 doesn't understand this, so just disable the warning of unused vars
there. Maybe ruff will be smarter there.
Fixes #699