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

HTTP Client #7

Merged
merged 6 commits into from
Jul 25, 2024
Merged

HTTP Client #7

merged 6 commits into from
Jul 25, 2024

Conversation

apetenchea
Copy link
Member

@apetenchea apetenchea commented Jun 23, 2024

This PR lays the foundation for the asynchronous HTTP Client

The following classes are introduced:

  • HTTPClient - abstract base class
  • AioHTTPClient - client implementation, based on aiohttp
  • DefaultHTTPClient - alias for AioHTTPClient
  • Request - request skeleton (might be subject to change later)
  • Response - response skeleton (might be subject to change later)
  • Method - using an enum instead of a string because we have more control over what values we'll put in it, and because most editors can make sense of it and offer better type hints

Testing
Basic unit tests have been introduced, see test_http.py. Test configuration will be in conftest.py. ATM I'm testing it locally, it's a bit early for a full CI. I'll make sure we get that as soon as we have a few extra tests. For now, just do pytest -s.

Documentation
We've got docstrings so far, and the sphinx build is working: python -m sphinx docs docs/_build. The cool thing is that we can now point to the documentation of other projects, for example whenever a parameter has type aiohttp.BasicAuth, the docs are actually going to point to that type, and the project's documentation url is derived automatically using the intersphinx_mapping.
I wanted to add support for numpy docstrings, because of their concise format, but that would be in a later PR, see this example for details.

Version adjustments
Some of the pre-commit tools were bumped to a more recent version (we should do that at some point also at python-arango.

Note: I have created a page for development ideas

@apetenchea apetenchea self-assigned this Jun 23, 2024
@apetenchea apetenchea marked this pull request as ready for review July 21, 2024 17:23
Copy link
Member

@aMahanna aMahanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@apetenchea apetenchea merged commit 318bd83 into main Jul 25, 2024
3 checks passed
@apetenchea apetenchea deleted the feature/http-client branch July 25, 2024 18:23
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.

2 participants