envdir
envdir copied to clipboard
__init__ import masks module name
The from .__main__ import runner
statement in __init__.py
masks the name of the envdir.runner
module. This is especially problematic as envdir.runner
module contains the exception class Response
.
This seems to mean that to use the API one must not only have two import statements, but you must also pollute the local namespace.
from envdir.runner import Response
import envdir
@grady do you feel like creating a PR to fix this?
I would be happy to create a patch, but I'm not certain what the best course of action is.
The most backwards compatible thing I can think of that fixes the two import issue is to:
- move the exception class to its own module
- import the exception class into the runner module namespace.
However that doesn't address the masking problem. I can't think of a good way to deal with that in a manner that doesn't break anything.
If it is judged reasonable to abandon the idea of envdir.runner
as an object, then that is straightforward to implement. That seems less backwards incompatible to me than changing the name of the envdir.runner
module, but that is just speculation on my part.