Code review comment for lp:~rconradharris/nova/backup_schedule_extension

Revision history for this message
Rick Harris (rconradharris) wrote :

> Can we put this at the top of the file with the other imports. Unit tests are going to be run anyway > so putting the import down here doesn't seem to do much.

Having `import tempo` in the `__init__` means that it won't be imported unless the Backup_schedule class is actually created.

Since the unit-tests don't actually construct the Backup_schedule class, this means `tempo` isn't required to run the tests.

This also means that `tempo` isn't required in a production environment unless the backup schedule extension is used.

Since API extensions are eager-loaded--everything in the 'contrib' directory is imported in search of an Extension class--I think it makes sense not to have 3rd party imports in the module-scope.

If we did, that would mean that users would be required to have every dependency of every (optional) extension. I don't think that scales.

« Back to merge proposal