NYUCCL / psiTurk

An open platform for science on Amazon Mechanical Turk.
https://psiturk.org
MIT License
277 stars 140 forks source link

`MarkupSafe` removes deprecated `soft_unicode` in v2.1.0 #541

Closed jmuchovej closed 2 years ago

jmuchovej commented 2 years ago

https://markupsafe.palletsprojects.com/en/2.1.x/changes/#version-2-1-0

Error, if you need it: ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/markupsafe/__init__.py)

I can open/submit a PR in a few hours fixing this, just now right now. This will break any installations past 17 Feb 2022, so it seems rather high-priority.

jacob-lee commented 2 years ago

I don't see this package in psiturks's requirements. Is it a dependency of Flask's perhaps? In that case, I'm not sure this is an issue that we can address here...

On Mon, Feb 21, 2022, 6:39 PM John Muchovej @.***> wrote:

https://markupsafe.palletsprojects.com/en/2.1.x/changes/#version-2-1-0

Error, if you need it: ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/markupsafe/init.py)

I can open/submit a PR in a few hours fixing this, just now right now. This will break any installations past 17 Feb 2022, so it seems rather high-priority.

— Reply to this email directly, view it on GitHub https://github.com/NYUCCL/psiTurk/issues/541, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM5SQNHGPNVOD4BZX7UCBLU4LEK5ANCNFSM5O72STIQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

jmuchovej commented 2 years ago

So, this is coming from Flask. Here's the full traceback.

Traceback (most recent call last):
  File "/usr/local/Caskroom/miniconda/base/bin/psiturk", line 8, in <module>
    sys.exit(process())
  File "/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/psiturk/command_line.py", line 14, in process
    launch_shell()
  File "/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/psiturk/command_line.py", line 94, in launch_shell
    import psiturk.psiturk_shell as ps
  File "/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/psiturk/psiturk_shell.py", line 17, in <module>
    from psiturk.amt_services_wrapper import MTurkServicesWrapper
  File "/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/psiturk/amt_services_wrapper.py", line 13, in <module>
    from .amt_services import MTurkServices
  File "/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/psiturk/amt_services.py", line 9, in <module>
    from flask import jsonify
  File "/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/flask/__init__.py", line 14, in <module>
    from jinja2 import escape
  File "/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/usr/local/Caskroom/miniconda/base/lib/python3.8/site-packages/markupsafe/__init__.py)
deargle commented 2 years ago

I'm seeing recommendations that we pin markupsafe to 2.0.1: https://github.com/aws/aws-sam-cli/issues/3661#issuecomment-1043965261

I didn't do a full pip freeze to make the requirements list, which I think had some benefit or other, but this soft_unicode thing is a downside.

edit: actually, since we're on an old flask, we should pin to a lower markupsafe, and also pin itsdangerous. We should probably bump Flask, but not yet. https://github.com/pallets/flask/issues/4455