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

API tests fail after release of Werkzeug v3.0.0 #1861

Closed
asjohnston-asf opened this issue Oct 3, 2023 · 3 comments
Closed

API tests fail after release of Werkzeug v3.0.0 #1861

asjohnston-asf opened this issue Oct 3, 2023 · 3 comments

Comments

@asjohnston-asf
Copy link
Member

Our API requirements specify serverless-wsgi=3.0.2. serverless-wsgi has a dependency issue with wekzeug=3.0.0 (released 2023-09-30):

logandk/serverless-wsgi#247

This causes imports to fail for our API app when running tests. I'd expect to see similar errors were we to release to production.

https://github.com/ASFHyP3/hyp3/actions/runs/6384082982/job/17325993594

Traceback:
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_api/test_lambda_handler.py:3: in <module>
    from hyp3_api import lambda_handler
apps/api/src/hyp3_api/lambda_handler.py:1: in <module>
    import serverless_wsgi
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/serverless_wsgi.py:17: in <module>
    from werkzeug.urls import url_encode, url_unquote, url_unquote_plus
E   ImportError: cannot import name 'url_encode' from 'werkzeug.urls' (/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/werkzeug/urls.py)

A short-term workaround is likely to specify Werkzeug==2.3.7 in requirements-apps-api.txt.

@jtherrmann
Copy link
Contributor

jtherrmann commented Oct 19, 2023

Unfortunately the tests are now failing with new errors after bumping serverless-wsgi to 3.0.3, see #1872.

@jtherrmann
Copy link
Contributor

Looks like the position argument order changed for set_cookie, so I updated our tests to use keyword arguments for that method, and now all tests pass.

@jtherrmann
Copy link
Contributor

I opted to keep the Werkzeug pin, now at 3.0.0.

asjohnston-asf added a commit that referenced this issue May 8, 2024
remove unneeded Werkzeug pin in api requirements; see #1861
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

No branches or pull requests

2 participants