Skip to content

Import mechanism from Python entry_points#25

Draft
maarten-ic wants to merge 2 commits intodevelopfrom
feature/import-from-entrypoints
Draft

Import mechanism from Python entry_points#25
maarten-ic wants to merge 2 commits intodevelopfrom
feature/import-from-entrypoints

Conversation

@maarten-ic
Copy link
Collaborator

@maarten-ic maarten-ic commented Mar 4, 2026

Prototype import mechanism for discovering yMMSL configuration provided by Python entry_points.

See iterorganization/IMAS-Streams#12 on how a python package may use this:

  • Declare entry-points in pyproject.toml:
    [project.entry-points."ymmsl.path"]
    "imas_streams/data_source.ymmsl" = "imas_streams.muscle3_datasource:DATA_SOURCE"
  • The entry point should resolve to a string attribute containing a valid yMMSL configuration. See https://setuptools.pypa.io/en/latest/userguide/entry_point.html for further details on the entry point mechanism.

TODO:

  • Discuss proposed solution
  • Decide whether YMMSL_PATH or entry points take precedence
  • Use importlib_metadata backport for python < 3.10
  • Clean up code and add docstrings
  • Document the mechanism

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.

1 participant