statnett / quick-xmltodict

Efficient XML-to-dict conversion backed by Rust
MIT License
2 stars 0 forks source link

Pylint compatibility #11

Open nbaju1 opened 3 months ago

nbaju1 commented 3 months ago

Cool package!

Is there a way to make this compatible with linters like Pylint? From Pylint No name 'parse' in module 'quick_xmltodict'. I'm guessing this is due to the package being Rust backed?

danhje commented 3 months ago

Hi @nbaju1, thanks for the interest in the package.

I think the error stems from the fact that Pylint doesn't load C extensions by default, for security reasons. I tried running Pylint with --extension-pkg-allow-list=quick_xmltodict, and the error disappeared. If you don't want to have to pass this argument every time, you can apparently allow all C extensions through a config file. You could of course also just mute that specific error if you don't want the whole C extension to be analyzed. You can read more about those three options here (I don't know why those tips aren't also found on the help page for the no-name-in-module error you're getting).

Let me know if this doesn't work for you and you think there's something I can do that I've overlooked, that will make Pylint happy.