jic-dtool / dservercore

Given a dataset UUID returns a URI to where the dataset is stored
MIT License
4 stars 5 forks source link

Several extensions to mongo refactor #47

Closed jotelha closed 1 year ago

jotelha commented 1 year ago

This PR sums up a few atomic earlier PRs, namely,

Next to this,

Importantly, I have moved the the loading of entry points and the instantiation of plugins from the dtool_lookup_server/__init__.py module-wide scope to the app factory and refactored all access to these plugins by using current_app (https://flask.palletsprojects.com/en/2.3.x/api/#flask.current_app) imported from the flask modules. This modification is necessary because plugins and their tests will fail due to circular imports whenever they import utility functions from the core dtool_lookup_server, e.g. something from dtool_lookup_server.utils. Besides that, it's probably cleaner this way anyway, having one plugin instance per app instance.