[wp-trac] [WordPress Trac] #54504: Update Requests library to version 2.0.0

WordPress Trac noreply at wordpress.org
Thu Nov 24 00:45:05 UTC 2022


#54504: Update Requests library to version 2.0.0
-------------------------------------------------+-------------------------
 Reporter:  jrf                                  |       Owner:
                                                 |  SergeyBiryukov
     Type:  task (blessed)                       |      Status:  reopened
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  External Libraries                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php80 php81 has-patch has-unit-      |     Focuses:
  tests early early-like-actually-early          |
-------------------------------------------------+-------------------------

Comment (by jrf):

 @peterwilsoncc I appreciate what you are trying to do and I agree that we
 should concentrate on getting the Upgrader component fixed, but I can't
 let this stand.

 Apologies in advance @azaozz, but enough is enough. I'm calling you out
 now: **what you are saying is technically ''and'' factually incorrect.**

 You have been told so time and time again, but as you don't seem to
 ''want'' to understand it, I will now *proof* it to you in excruciating
 detail.

 > However looking at https://github.com/WordPress/wordpress-
 develop/pull/1624/files#diff-
 339369deb37417feede85bbf7991a48f8ad44ec96e389ed42cecda99f2f2e98a there
 seem to be many changes to other WP files.

 I have rebased the above PR against `trunk`, updated the PR to Requests
 2.0.5 and made some small updates to bridge the differences in `trunk`
 between when the original PR was created and now.

 The original PR contained 2 commits:
 1. The updates to the Requests native files ''(66 files changed, ++3062
 --1765)''
 2. The updates to the WP Core files to upgrade to Requests 2.0.0. ''(12
 files changed, ++58 --58)''

 I've now split the PR into 5 commits:
 1. Only updates the files copied in from Requests ''(66 files changed,
 ++3178 --1882)''
 2. Updates WP to work with Requests 2.0, including silencing deprecation
 notices and updating 1 test **(2 files changed, ++10 --2)**
 3. Upgrades WP to Requests 2.0 - code changes only ''(4 files changed,
 ++21 --28)''
 4. Upgrades WP to Requests 2.0 - test changes only ''(6 files changed,
 ++12 --13)''
 5. Upgrades WP to Requests 2.0 - documentation changes only ''(7 files
 changed, ++22 --22)''

 To do a minimal update, this means **only commit 1 and 2 are needed**,
 which effectively changes **8 (!!) lines in WP Core** and that includes
 silencing deprecation notices about the use of the old class names.

 Realistically, you could even get away with just making the change on line
 21 and line 478 of the `wp-includes/class-wp-http.php` file, which means
 **2 lines of code changed in WP core**. That's it. That's all that is
 required.

 To do a full ''upgrade'', **33 lines of code** need to be updated in WP
 Core and that includes updates to the tests. 33 LOC changed for a complete
 upgrade to a new major of a dependency is still F* all.

 > what should an open source project do with contributions that do not
 follow its philosophy and seem to be disregarding its rules?

 Requests is still an EXTERNAL dependency. An external dependency closely
 affiliated with WP, but an independent project used by some 5000 other
 projects aside from WP and it should be respected as such.

 I mean you don't go making demands of the maintainers of SimplePie,
 PHPMailer or Sodium Compat to comply with arbitrary WP rules ?

 Oh and just in case you missed it: PHPMailer introduced namespaces a while
 back and SimplePie has done so recently as well. Are you going to ask them
 to reverse these code improvements ?

 Be grateful that the changes as made in Requests were done in such a
 considerate way towards WP instead of spreading misinformation about non-
 existing breaking changed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54504#comment:81>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list