-
-
Notifications
You must be signed in to change notification settings - Fork 397
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
POC: Vendor RequestEncodingMixin from requests #179
POC: Vendor RequestEncodingMixin from requests #179
Conversation
Thanks @Bobronium - I'll have time to have a closer look later tonight my time (+10), here's what I'd be changing on first pass.
That's pretty much the solution I'd be happy to debate on. I'll admit the LOC is larger than I anticipated, when I skimmed the source I read urllib3 as stdlib's urllib so that's on me, but I'm still here. Here's why. Having the module scope Let me qualify that this is all "IMO". I respect that your opinions may differ, but I think it is important that if I don't agree, I'll express why. I'm happy for my mind to be changed. I think your original issue that led to this work is totally valid and I'm 100% on board. I'd feel better about having a http client lib included in our dependencies if it could do what we needed, and was async, but we are specifically talking about regular old requests here. |
Just to be clear, I'm not planning to continue working on this PR, so please feel free to push changes to vendor-request-encoding-mixin if you're a maintainer, or open a separate PR. |
For sure, but do you have any opinion on the discussion points I've raised? |
If we're going with vendoring approach, I fully agree with points in bullet list. As a user, I preffer starlite to vendor requests, so I could deal with less dependencies :) As for To be clear, I'm not implying that starlite should have module |
Sure that's a valid point, what if I rephrased that as "a tool that is maybe overkill for this application"? I'm happy to use it in the right contexts, I'm just not sure that a workaround for a small testing dependency is a good use of it, and worry that it is promoting the quirkyness of needing requests for this one small thing in the first place. How would you feel if |
I don't see how using Maybe we're looking at this from different perspectives? I'm looking at this from where we are now and what we can do next, and I'm guessing you're looking at this from future perspective, e.g. when one could see only the end result without seeng a path to this result, as if the state where project ended up was desired from the beginning. |
Hmm. So, this is quite a lot of third party code. I don't want this in our code base, because it's "dirty". |
@Goldziher i agree that I don't want to pull in all that urllib3 code either. @Bobronium my question earlier was:
Requests dependencies: requires = [
"charset_normalizer~=2.0.0",
"idna>=2.5,<4",
"urllib3>=1.21.1,<1.27",
"certifi>=2017.4.17",
] Urllib3 dependencies: requires=[] But this still won't solve the issue of us providing requests for starlette's test utilities because we don't require their
I suppose that sums my position up. I've stated my position pretty clearly, I don't like having the getattr at the package namespace level just to support this quirk that we need requests for a testing utility. You have the option of going ahead with the getattr solution. We still have the option of doing nothing. We also have the option of making a breaking change and minimising the stuff we expose in the package namespace. We could prob use the exercise to clean up some of the class interfaces in terms of what are public and private attributes as well. |
See discussion in #174
There's code from requests as well as utllib3. The sole purpose of this PR is to demonstrate minimal amount of work required to have testing working without
requests
andurllib3
installed.