Skip to content
This repository has been archived by the owner on Nov 22, 2024. It is now read-only.

Conda CI failing on main: ImportError: cannot import name 'url_quote' from 'werkzeug.urls' #38

Closed
johnandersen777 opened this issue Oct 16, 2023 · 1 comment · Fixed by #40

Comments

@johnandersen777
Copy link

$ python -m pytest
============================= test session starts ==============================
platform linux -- Python 3.8.16[pypy-7.3.11-final], pytest-7.2.1, pluggy-1.3.0
rootdir: /home/runner/work/scitt-api-emulator/scitt-api-emulator
plugins: anyio-4.0.0
collected 0 items / 2 errors

==================================== ERRORS ====================================
______________________ ERROR collecting tests/test_cli.py ______________________
ImportError while importing test module '/home/runner/work/scitt-api-emulator/scitt-api-emulator/tests/test_cli.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/share/miniconda/envs/scitt/lib/pypy3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_cli.py:7: in <module>
    from scitt_emulator import cli, server
scitt_emulator/cli.py:6: in <module>
    from scitt_emulator import client, server
scitt_emulator/server.py:9: in <module>
    from flask import Flask, request, send_file, make_response
/usr/share/miniconda/envs/scitt/lib/pypy3.8/site-packages/flask/__init__.py:5: in <module>
    from .app import Flask as Flask
/usr/share/miniconda/envs/scitt/lib/pypy3.8/site-packages/flask/app.py:30: in <module>
    from werkzeug.urls import url_quote
E   ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/share/miniconda/envs/scitt/lib/pypy3.8/site-packages/werkzeug/urls.py)
_____________________ ERROR collecting tests/test_docs.py ______________________
ImportError while importing test module '/home/runner/work/scitt-api-emulator/scitt-api-emulator/tests/test_docs.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/share/miniconda/envs/scitt/lib/pypy3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_docs.py:24: in <module>
    from .test_cli import (
tests/test_cli.py:7: in <module>
    from scitt_emulator import cli, server
scitt_emulator/cli.py:6: in <module>
    from scitt_emulator import client, server
scitt_emulator/server.py:9: in <module>
    from flask import Flask, request, send_file, make_response
/usr/share/miniconda/envs/scitt/lib/pypy3.8/site-packages/flask/__init__.py:5: in <module>
    from .app import Flask as Flask
/usr/share/miniconda/envs/scitt/lib/pypy3.8/site-packages/flask/app.py:30: in <module>
    from werkzeug.urls import url_quote
E   ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/share/miniconda/envs/scitt/lib/pypy3.8/site-packages/werkzeug/urls.py)
=============================== warnings summary ===============================
../../../../../usr/share/miniconda/envs/scitt/lib/pypy3.8/site-packages/requests_toolbelt/_compat.py:56
  /usr/share/miniconda/envs/scitt/lib/pypy3.8/site-packages/requests_toolbelt/_compat.py:56: DeprecationWarning: 'urllib3.contrib.pyopenssl' module is deprecated and will be removed in a future release of urllib3 2.x. Read more in this issue: https://github.com/urllib3/urllib3/issues/2680
    from requests.packages.urllib3.contrib.pyopenssl \

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
ERROR tests/test_cli.py
ERROR tests/test_docs.py
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
========================= 1 warning, 2 errors in 1.81s =========================
Error: Process completed with exit code 2.
@aj-stein-nist
Copy link
Contributor

Seems like this is the issue: https://stackoverflow.com/a/77214086. I can PR an issue tomorrow or Thursday.

johnandersen777 pushed a commit to johnandersen777/scitt-api-emulator that referenced this issue Nov 10, 2023
johnandersen777 pushed a commit to johnandersen777/scitt-api-emulator that referenced this issue Nov 13, 2023
johnandersen777 pushed a commit to johnandersen777/scitt-api-emulator that referenced this issue Nov 14, 2023
johnandersen777 pushed a commit to johnandersen777/scitt-api-emulator that referenced this issue Nov 17, 2023
This approach does not work for conda

Signed-off-by: John Andersen <[email protected]>
aj-stein-nist added a commit to aj-stein-nist/scitt-api-emulator that referenced this issue Nov 22, 2023
In order to fix scitt-community#38, we need to hard
pin the version of Werkzeug used by Flask to avoid the changes after
to how functions are organized in the library's modules.

See PR Sanster/IOPaint#390 with a related solution (not specific to
Anaconda approach, but informative).

See [StackOverflow](https://stackoverflow.com/a/77217971) post for
details.
aj-stein-nist added a commit to aj-stein-nist/scitt-api-emulator that referenced this issue Nov 22, 2023
In order to fix scitt-community#38, we need to hard
pin the version of Werkzeug used by Flask to avoid the changes after
to how functions are organized in the library's modules.

See PR Sanster/IOPaint#390 with a related solution (not specific to
Anaconda approach, but informative).

See [StackOverflow](https://stackoverflow.com/a/77217971) post for
details.
johnandersen777 pushed a commit to johnandersen777/scitt-api-emulator that referenced this issue Nov 23, 2023
In order to fix scitt-community#38, we need to hard
pin the version of Werkzeug used by Flask to avoid the changes after
to how functions are organized in the library's modules.

See PR Sanster/IOPaint#390 with a related solution (not specific to
Anaconda approach, but informative).

See [StackOverflow](https://stackoverflow.com/a/77217971) post for
details.
johnandersen777 pushed a commit to johnandersen777/scitt-api-emulator that referenced this issue Nov 23, 2023
In order to fix scitt-community#38, we need to hard
pin the version of Werkzeug used by Flask to avoid the changes after
to how functions are organized in the library's modules.

See PR Sanster/IOPaint#390 with a related solution (not specific to
Anaconda approach, but informative).

See [StackOverflow](https://stackoverflow.com/a/77217971) post for
details.
SteveLasker pushed a commit that referenced this issue Nov 27, 2023
In order to fix #38, we need to hard
pin the version of Werkzeug used by Flask to avoid the changes after
to how functions are organized in the library's modules.

See PR Sanster/IOPaint#390 with a related solution (not specific to
Anaconda approach, but informative).

See [StackOverflow](https://stackoverflow.com/a/77217971) post for
details.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants