New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DM-26403: Reorganize ButlerURI into separate files #410
Conversation
72669e8
to
6e97d8a
Compare
@@ -33,7 +33,7 @@ | |||
Union, | |||
) | |||
|
|||
from ._butlerUri import ButlerURI | |||
from .uri import ButlerURI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still wanted the directory to be called _butlerUri
-- which would mean this line doesn't change. I understand that the s3utils and webdavutils imports into the tests then look weird but I think I can live with that. In the longer term the s3utils and webdavutils tests should disappear because ButlerURI should be testing all that anyhow. That leaves us only with the test_butler.py imports which need a bit more thought.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want me to rename the whole uri/ directory to _butlerUri/ then? Do I keep a file called _butlerUri.py in that directory too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I want the directory renamed and the _butlerUri.py to still be in that subdirectory.
# Should only expose ButlerURI | ||
|
||
from ._butlerUri import ButlerURI | ||
__all__ = ("ButlerURI",) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't usually put __all__
in __init__.py
since for the way we use __init__.py
it mostly is for forwarding symbols anyhow. The __all__
here does not serve any purpose so can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, wasn't sure will fix
from .http import ButlerHttpURI | ||
subclass = ButlerHttpURI | ||
elif parsed.scheme == "resource": | ||
# Rules for scheme names disasllow pkg_resource |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor typo in this comment. Maybe that was mine originally 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
Make new _butlerUri directory with files for each class providing an implementation of a URI-handler
Merge webdavutils.py into http.py for _butlerUri and simply move s3utils into the folder for now. Someday we can perhaps make s3utils go away but not today...
45fc803
to
b8e3527
Compare
This should be ready now, rebased into 2 commits |
Splitting butler URI backends into separate files for ease of eventual splitting off into separate package.