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

More entrypoints #1431

Merged
merged 18 commits into from Feb 12, 2018

Conversation

Projects
None yet
2 participants
@noirbizarre
Copy link
Member

noirbizarre commented Feb 12, 2018

This PR cleanups plugins magic import and switch the necessary ones to entrypoints. (udata.views, udata.metrics, udata.models and udata.tasks)
Their usage has been rationalized and all necessary functions grouped into the udata.entrypoints module.

This introduce the following changes:

  • harvesters are only available if the plugin is enabled (avoid adding features/content with just installing a package)
  • default no_check linkchecker is always available (not entrypoint anymore), others need to be activated in PLUGINS
  • migrations are associated to udata.models entrypoint
  • sentry can now detect all plugins and will report every versions
  • plugin logging is now properly handled
  • each enabled plugin can provide translations which are automatically loaded
  • the info command is now splitted in two commands info config which allows to inspect the config and info plugins to inspect plugins
  • the metrics list command has been added

This PR also adds an entrypoints documentation (ie. extending udata)

@noirbizarre noirbizarre added this to the 1.3.0 milestone Feb 12, 2018

@noirbizarre noirbizarre self-assigned this Feb 12, 2018

@noirbizarre noirbizarre requested a review from opendatateam/etalab Feb 12, 2018

@abulte
Copy link
Member

abulte left a comment

More legibility, more possibilities, nice!

iter should be renamed I think.


## Themes

You can totally customize the udata apparence with themes.

This comment has been minimized.

@abulte

abulte Feb 12, 2018

Member

s/apparence/appearance/


### Metrics (`udata.metrics`)

A module entrypoint allowing to register new metrics

This comment has been minimized.

@abulte

### Translations

Any registered plugin may also expose translations in its roots module `translations` directory.

This comment has been minimized.

@abulte

abulte Feb 12, 2018

Member

s/roots/root/

### Translations

Any registered plugin may also expose translations in its roots module `translations` directory.
They will automatically discovered and loaded if the plugin is enabled.

This comment has been minimized.

@abulte

## Contributing

At last but not least, if none of hte above match your needs,

This comment has been minimized.

@abulte

abulte Feb 12, 2018

Member

s/At last/ Last/
s/hte/the/

@@ -3,11 +3,40 @@

import pkg_resources

# Here for documention purpose

This comment has been minimized.

@abulte

abulte Feb 12, 2018

Member

s/documention/documentation/

pass


def iter(name):

This comment has been minimized.

@abulte

abulte Feb 12, 2018

Member

/!\ built-in function name

@@ -32,7 +33,7 @@ def init_app(app):
register_signal, register_logger_signal
)
from raven.contrib.flask import Sentry
except:
except Exception:

This comment has been minimized.

@abulte

abulte Feb 12, 2018

Member

Maybe ImportError?

@noirbizarre noirbizarre force-pushed the noirbizarre:more-entrypoints branch from e1efc70 to 149286f Feb 12, 2018

@noirbizarre

This comment has been minimized.

Copy link
Member Author

noirbizarre commented Feb 12, 2018

Done 👍

@abulte

abulte approved these changes Feb 12, 2018

@noirbizarre noirbizarre merged commit 17c9cc1 into opendatateam:master Feb 12, 2018

3 checks passed

ci/circleci: assets Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: python Your tests passed on CircleCI!
Details

@noirbizarre noirbizarre deleted the noirbizarre:more-entrypoints branch Feb 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.