Closed ZanSara closed 1 year ago
Sorry it's taking me so long to get to these! I got a bit carried away with this one, experimenting with reading the pyproject.toml
file to dynamically generate these messages!
I used your farm-haystack repo as an example there, this has some potential but I'm unsure about structuring the entry point for such a system since pyproject.toml
is only available when cloning a repo I believe
So I'm putting that branch on hold for now and focusing on your proposal instead!
The idea of having custom messages is excellent! However, I'm afraid supplying tuples isn't too intuitive. I think having key-word arg message
is a bit more clear, what do you think?
I also had an idea that we could store the message in the ImportCatcher instance, and then relay that instance to the FakeModule instance. This seems to work pretty nicely. Please see the PR above before I merge it
Problem
Large projects often group optional dependencies into extras, which allow users to install groups of optional dependencies together. When one dependency from such group is missing, it would be nice to point users towards the extra that they should install, instead of giving a generic error message.
Solution
For now, simple customized error messages would be sufficient. They could be provided through the
generalimport
call, something like:We could also use a namedtuple here, but for now I decided to keep it simple.
PR coming soon :slightly_smiling_face: