Rename csv_utils to _csv_utils and fix imports#3738
Conversation
Signed-off-by: Ulincsys <ulincsys@gmail.com>
|
I dont like the idea of renaming a shared utility like this because of a unique issue with click. I didnt see another way until i read:
This makes me think: could we import the needed csv utils in this already-prefixed CLI util file instead and then wherever its needed in the CLI can import it from that already-prefixed file? |
Is there a specific objection you have as to why renaming the file is improper? It doesn't really matter to me how this issue gets resolved, I just took the approach that required the least changes to achieve the desired effect. |
A bad assumption that this utils file existed somewhere else in the code and that we were having the CSV module dictate filenames outside of its module. I think this is fine for now. Long term I think id like to find a better way to discover click modules (maybe an AST parsing based system to lightly parse each file?), but this is fine for now |
Description
csv_utils.pyto_csv_utils.pyaugur/application/clidirectory is assumed by Click to be a CLI multicommand submodule, unless that file's name begins with an underscore_. Thecsv_utils.pyfile is not a multicommand submodule, and so must be prefixed with an underscore to exclude it from dynamic loading during multicommand processing.augur.application.cli.tasksmulticommand submodule previously importedclear_rabbitmq_messagesandraise_open_file_limitfrom the basebackendmulticommand submodule, but they have since moved toaugur.application.cli._cli_utilWith this patch, running
augur --helpsuccessfully loads all multicommand submodules and displays the global help message.This PR fixes #3627
Signed commits