Skip to content
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

Formalize the definition and import location of plugin factories #2498

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Feb 18, 2019

Fixes #2176

Even though each factory is designed to load a specific sub class of the base classes for the various entry point groups and therefore it could be argued that they should be defined in the corresponding module, these "functions" are not actual factories as such and are really syntactic sugar to load a plugin class through an entry point . As such, it was decided to define all plugin factories in aiida.plugins.factories and expose them to be imported from aiida.plugins.

In this PR I also took the liberty to rename some modules for consistency and to simplify development.
Short overview of the changes:

  • All test modules now have the test_ prefix
  • Moved aiida.orm.implementation.authinfo to aiida.orm.implementation.authinfos
  • Moved aiida.orm.implementation.computer to aiida.orm.implementation.computers
  • Moved aiida.scheduler to aiida.schedulers
  • Moved aiida.transport to aiida.transports

This will make it easier to switch to generic testing frameworks as well
as make it easier to distinguish them from implementation files in an
editor that without the prefix often share the same name.
Also refactored the `computer` and `authinfo` modules for both backend
implementations to get rid of the pre-commit exceptions.
To keep in line with the naming scheme of the other modules the respective
modules have been renamed to their plurals:

 * `aiida.scheduler` -> `aiida.schedulers`
 * `aiida.transport` -> `aiida.transports`
The are exposed and importable from `aiida.plugins`.
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.4%) to 69.555% when pulling 7867877 on sphuber:fix_2176_relocate_plugin_factories into 6791557 on aiidateam:provenance_redesign.

@sphuber sphuber merged commit 5395aaa into aiidateam:provenance_redesign Feb 18, 2019
@sphuber sphuber deleted the fix_2176_relocate_plugin_factories branch February 18, 2019 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants