conda / ceps

Conda Enhancement Proposals
Creative Commons Zero v1.0 Universal
19 stars 24 forks source link

Conda Fetch Plugin Hook #44

Open travishathaway opened 1 year ago

travishathaway commented 1 year ago

This CEP proposed a new plugin hook that will allow plugin authors to completely customize the way that network requests are made. Please check what is currently on the CEP and use this pull request as a forum to discuss changes or oppositions to it.

jezdez commented 1 year ago

BTW as some inspiration for people creating requests-style session classes: https://github.com/dcoles/pycurl-requests

travishathaway commented 1 year ago

@jezdez,

I really like your "transmitter" idea. You pointed something out that I felt more and more awkward about as I was writing the plugin prototype, which is the naming of the CondaSession class. I'd also like to rename that class in any implementation we go with too.

Also, thank you for adding those high level UX examples. I will definitely make room for those in the CEP too (under "Specification").

travishathaway commented 1 year ago

@jezdez,

I switched this back to fetch for now 😅 . It's shorter and easier to type than transmitter. It also aligns with the original "spirit" of this work (whatever that means 😂).

travishathaway commented 1 year ago

I wonder if we should be including support for adding additional adapters here too:

Perhaps it makes sense to be able to expose just these as hooks too.

milljm commented 1 year ago

I would be interested in this. We ended up creating a mock object for our session purposes. It would be nice to move to something more supported by the community.

    with mock.patch('conda.gateways.connection.session.CondaSession',
                    return_value=CondaSessionRSA()):
travishathaway commented 1 year ago

We recently had a new feature request in conda repository that could also be supported by this new plugin hook:

This would also be a good case for allowing plugin authors for adding additional adapters.