Skip to content

RFC: Freedom to extend decouple with plugins. #115

Open

Description

@henriquebastos

Over the years, most ppl request adding features to decouple.

I think the API is quite mature and fits well it's purpose.

However 2 areas could be improved:

  1. An easy way to add new Repositories, so you can work with whatever data source you want. It could be either a complex file structure or a remote repository.
  2. An easy way to aggregate useful casts for different frameworks or projects.

My idea is to implement pytest's pluggy into decouple do enable this.

I don't know when I'll be able to code a POC, but I'll leave this issue as a request for comments.

Activity

  1. SterlingPeet commented on Jul 26, 2022

    @SterlingPeet

    I do think that pluggy is the way to go, I have rolled my own plugin system for some projects and then switched over to pluggy because it already has the features I needed.

    I am actually looking for a configuration tool like python-decouple that will allow me to hook up RPCs to update the configuration parameters during runtime. As a separate RPC request, I would also like to be able to save the current value back into the relevant underlying database.

    I have looked around but not quite found something that fits my needs. It seems that python-decouple may be one of the closest options, and I do appreciate the simplicity of it. Perhaps this functionality is more complexity than you want in python-decouple. I am trying to decide if I should attempt to shoehorn my solutions into a project like this, or fork into a new project with slightly different goals.

  2. henriquebastos commented on Jul 28, 2022

    @henriquebastos
    CollaboratorAuthor

    The behavior you're looking for seems different from how python-decouple works. However, with a proper plugin infrastructure you would have the liberty to do whatever you want on top of it.

    If you write a PR (with tests) to add the plugin infrastructure, I would gladly help refactor the code to make that central and enable what you desire.

    For me. it is important to keep decouple simple and composable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions