This PR only changes the structure of some files (in a way that makes other diffs hard). It does not change functionality that exists already.
Basically, this will divide EnvManager into a lower level EnvBase class (in env_basic.py) and an EnvManager class (in env_manager.py) that inherits from EnvBase. What makes this a compatible change is that, having emptied out the previous contents of env_base.py into these two other files, I then re-import EnvManager back into env_base.py so that anything doing from dcicutils.env_base import EnvManager can still find it.
Aside to @dmichaels-harvard, who might not be familiar with this technique, the exported function in this file is entirely a no-op that I invented. The file contents that are now:
from dcicutils.misc_utils import exported
from .env_manager import EnvManager
exported(EnvManager) # It used to live here
would work just as well if env_base.py only contained:
from .env_manager import EnvManager
but it would be harder to see what was going on. PyCharm and other linters would think the import was unused, but that's because they don't scan other files for
from dcicutils.env_base import EnvManager
I would prefer to make the incompatible change that would break this, and I'll make a layered PR that offers that change instead so you can choose that, but that will create cascade work in other repos in order to take this change.
This PR only changes the structure of some files (in a way that makes other diffs hard). It does not change functionality that exists already.
Basically, this will divide EnvManager into a lower level
EnvBase
class (inenv_basic.py
) and anEnvManager
class (inenv_manager.py
) that inherits fromEnvBase
. What makes this a compatible change is that, having emptied out the previous contents ofenv_base.py
into these two other files, I then re-importEnvManager
back intoenv_base.py
so that anything doingfrom dcicutils.env_base import EnvManager
can still find it.Aside to @dmichaels-harvard, who might not be familiar with this technique, the
exported
function in this file is entirely a no-op that I invented. The file contents that are now:would work just as well if
env_base.py
only contained:but it would be harder to see what was going on. PyCharm and other linters would think the import was unused, but that's because they don't scan other files for
I would prefer to make the incompatible change that would break this, and I'll make a layered PR that offers that change instead so you can choose that, but that will create cascade work in other repos in order to take this change.