FS#74443 - [httpbin] Backport a patch for werkzeug 2.1 compatibility

Attached to Project: Community Packages
Opened by Chih-Hsuan Yen (yan12125) - Monday, 11 April 2022, 11:43 GMT
Last edited by Chih-Hsuan Yen (yan12125) - Friday, 15 April 2022, 02:12 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

$ python -c 'import httpbin'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.10/site-packages/httpbin/__init__.py", line 3, in <module>
from .core import *
File "/usr/lib/python3.10/site-packages/httpbin/core.py", line 22, in <module>
from werkzeug.wrappers import BaseResponse
ImportError: cannot import name 'BaseResponse' from 'werkzeug.wrappers' (/usr/lib/python3.10/site-packages/werkzeug/wrappers/__init__.py)

Upstream appears practically dead (last commit from 2018), so I propose to backport the proposed fix linked below instead of waiting for upstream developers.

Additional info:
* community/httpbin 0.7.0-8
* A proposed fix: https://github.com/postmanlabs/httpbin/pull/674. This fix is compatible with werkzeug>=2.1 but not older. https://github.com/postmanlabs/httpbin/pull/674#issuecomment-1088503584 gives a patch compatible with both old and new versions.

Steps to reproduce:
see above
This task depends upon

Closed by  Chih-Hsuan Yen (yan12125)
Friday, 15 April 2022, 02:12 GMT
Reason for closing:  Fixed
Additional comments about closing:  httpbin 0.7.0-9
Comment by Chih-Hsuan Yen (yan12125) - Monday, 11 April 2022, 12:20 GMT
I noticed that upstream PR 674 conflicts with an exsiting patch in Arch. Here is the combined patch. I've also mentioned the conflict at https://github.com/postmanlabs/httpbin/pull/674#issuecomment-1094961538, but I'm not going to submit it upstream as I don't like to leave my pull request open for years.
Comment by Chih-Hsuan Yen (yan12125) - Thursday, 14 April 2022, 12:28 GMT
After discussing with other developers on the upstream pull request, it turns out that keeping compatibility with older werkzeug can be quite complicated. I changed my mind - I propose to only consider the latest werkzeug and use the simplest patch https://github.com/maximino-dev/httpbin/commit/5cc81ce87a3c447a127e4a1a707faf9f3b1c9b6b.patch to replace the current httpbin-werkzeug-2.0.0.patch.

Loading...