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

Unasync'ed base dispatchers #742

Closed
wants to merge 2 commits into from
Closed

Conversation

florimondmanca
Copy link
Member

Refs #722

First smoll step towards unasync'ing HTTPX…: unasync AsyncDispatcher into SyncDispatcher. Allows us to setup the tooling and avoid impacting any public piece of API.

Mostly done, but marking as a draft as this is probably only worth considering once 0.11 is out…

@florimondmanca florimondmanca added the refactor Issues and PRs related to code refactoring label Jan 8, 2020
@florimondmanca
Copy link
Member Author

Just tried it out locally… the build works 👍

$ pip install "git+https://github.com/encode/httpx.git@unasynced-base-dispatchers"
$ python
Python 3.8.0 (default, Oct 16 2019, 18:21:21)
[Clang 11.0.0 (clang-1100.0.33.8)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import httpx
>>> r = httpx.get('https://www.google.com')
>>> httpx._sync.dispatch.base.SyncDispatcher
<class 'httpx._sync.dispatch.base.SyncDispatcher'>
>>> httpx.dispatch.base.SyncDispatcher
<class 'httpx._sync.dispatch.base.SyncDispatcher'>
>>>

@@ -21,7 +21,9 @@ pytest-trio
pytest-cov
trio
trustme
unasync==0.4.*
Copy link
Member Author

@florimondmanca florimondmanca Jan 8, 2020

Choose a reason for hiding this comment

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

That's a bit funny, but listing unasync in the build-system.requires entry doesn't actually install it in a way that's available to the Python interpreter. I don't know when/where those dependencies are installed exactly — probably managed by pip in an opaque location…?

@florimondmanca
Copy link
Member Author

florimondmanca commented Jan 8, 2020

Ah yes, the build will fail until python-trio/unasync@2c2c9b7 gets released. 😄 (I had a patched version of unasync installed locally.)

@florimondmanca
Copy link
Member Author

Closing, we can revisit if/when moving forward on this in httpcore

@florimondmanca florimondmanca deleted the unasynced-base-dispatchers branch January 30, 2020 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Issues and PRs related to code refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant