envdir icon indicating copy to clipboard operation
envdir copied to clipboard

__init__ import masks module name

Open grady opened this issue 8 years ago • 2 comments

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 avatar Sep 09 '16 01:09 grady

@grady do you feel like creating a PR to fix this?

blueyed avatar Sep 11 '16 15:09 blueyed

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.

grady avatar Sep 11 '16 20:09 grady