Uploaded image for project: 'Request For Comments'
  1. Request For Comments
  2. RFC-48

Add Python requests package as external dependency

    XMLWordPrintable

    Details

    • Type: RFC
    • Status: Implemented
    • Resolution: Done
    • Component/s: DM
    • Labels:
      None
    • Location:
      dm-devel

      Description

      In database team we are developing services, some of the internal, which use HTTP for communication protocol and are typically based on RESTful architecture. To implement client side bindings for these services in Python we need reasonable HTTP client library which satisfies small set of requirements (copied from DM-2593):

      • support for arbitrary methods (GET, POST, PUT, DELETE)
      • basic and digest authentication
      • support for HTTPS (optional)
      • multi-part POST
      • POST data streaming

      Standard Python modules for HTTP are lacking in few areas. Out of several existing external packages requests looks most complete and widely used. Python library documentation in fact proposes to use requests instead of standard modules for high-level interface.

      We are proposing to add requests package as an external dependency to DM stack. Currently only qserv is going to depend on it but it's likely that over time there will be other users for that package. The requests package itself does not have other required dependencies and includes its own copy of urllib3 package but optionally (if HTTPS support is needed) may use pyasn1, ndg-httpsclient, and pyOpenSSL.

        Attachments

          Issue Links

            Activity

            Hide
            rowen Russell Owen added a comment -

            It looks nice and simple. I see that requests only uses synchronous I/O. Are you going to use threads to avoid blocking?

            Show
            rowen Russell Owen added a comment - It looks nice and simple. I see that requests only uses synchronous I/O. Are you going to use threads to avoid blocking?
            Hide
            salnikov Andy Salnikov added a comment -

            We do not have immediate need for concurrency yet (but we sure will have in the future) so I have not thought about it much. Threads look like the reasonable option, yes, multiprocessing may be another depending on the particular use case.

            Show
            salnikov Andy Salnikov added a comment - We do not have immediate need for concurrency yet (but we sure will have in the future) so I have not thought about it much. Threads look like the reasonable option, yes, multiprocessing may be another depending on the particular use case.
            Hide
            jbecla Jacek Becla added a comment -

            I will add that both John Swinbank and I are using requests in some small jira-related tools, eg in jira.py and build-ldm-240.py.

            Show
            jbecla Jacek Becla added a comment - I will add that both John Swinbank and I are using requests in some small jira-related tools, eg in jira.py and build-ldm-240.py .
            Hide
            salnikov Andy Salnikov added a comment -

            No objections filed, I'm going say it's adopted. Will ask for help getting the package published.

            Show
            salnikov Andy Salnikov added a comment - No objections filed, I'm going say it's adopted. Will ask for help getting the package published.
            Hide
            tjenness Tim Jenness added a comment -

            I think this can be marked as Implemented given that a requests package does exist and was updated to the valid version in DM-2993 (and previously in DM-2727).

            Show
            tjenness Tim Jenness added a comment - I think this can be marked as Implemented given that a requests package does exist and was updated to the valid version in DM-2993 (and previously in DM-2727 ).
            Hide
            salnikov Andy Salnikov added a comment -

            Thanks, Tim Jenness! Much appreciated!

            Show
            salnikov Andy Salnikov added a comment - Thanks, Tim Jenness ! Much appreciated!

              People

              Assignee:
              salnikov Andy Salnikov
              Reporter:
              salnikov Andy Salnikov
              Watchers:
              Andy Salnikov, Jacek Becla, Mario Juric, Russell Owen, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Planned End: