sdss / marvin

Data access and visualization for MaNGA. http://sdss-marvin.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
56 stars 32 forks source link

marvin is broken by flask-jwt-extended>4.0.0 #720

Closed briandigiorgio closed 3 years ago

briandigiorgio commented 3 years ago

Description of Bug The required dependency flask_jwt_extended has updated to v4.0.0 and introduced a number of changes that break old code, listed here https://flask-jwt-extended.readthedocs.io/en/stable/v4_upgrade_guide/?highlight=fresh_jwt_required

This affects marvin because it relies on the fresh_jwt_required decorator, which has been changed to jwt_required(fresh=True). Because the decorator no longer exists, the import in line 10 of __init__.py fails.

This can be fixed by doing pip install flask_jwt_extended<4.0 because otherwise marvin cannot be imported.

To Reproduce Do a fresh install of marvin and all dependencies, or just update flask_jwt_extended to >4.0

Output from check_marvin System Checks Your Python Version: 3.8.2 Full Version: 3.8.2 (default, Sep 16 2020, 22:09:38) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]

OS Checks Platform: linux Full info: posix.uname_result(sysname='Linux', nodename='graymalkin.ucolick.org', release='3.10.0-957.12.1.el7.x86_64', version='#1 SMP Mon Apr 29 14:59:59 UTC 2019', machine='x86_64')

Distribution Checks Is Python from Anaconda or Miniconda? False

Package Checks Numpy version: 1.19.2 Matplotlib version: 3.3.2 Your Matplotlib backend is TkAgg

Netrc Checks Have a .netrc file? True Netrc with permissions 600? True

Marvin Checks [INFO]: No release version set. Setting default to DR15 [WARNING]: path /data/manga/spectro/redux/v2_4_3/drpall-v2_4_3.fits cannot be found. Setting drpall to None. (MarvinUserWarning) [WARNING]: path /data/manga/spectro/analysis/v2_4_3/2.2.1/dapall-v2_4_3-2.2.1.fits cannot be found. Setting dapall to None. (MarvinUserWarning) Marvin imported? True Marvin version: 2.5.2 Does Marvin have a URLMap for API use? True Has a db? False

Marvin Paths: $SAS_BASE_DIR: /home/bdigiorg/sas $MANGA_SPECTRO_REDUX: /data/manga/spectro/redux $MANGA_SPECTRO_ANALYSIS: /data/manga/spectro/analysis $TREE_DIR: /home/bdigiorg/.pyenv/versions/3.8.2/lib/python3.8/site-packages/tree $MARVIN_BRAIN_DIR: None $SDSS_ACCESS_DIR: None DRPall Path: None sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('128.114.22.234', 54732), raddr=('155.101.19.80', 443)>

briandigiorgio commented 3 years ago

Here's the full traceback:

<ipython-input-5-86893d82dac6> in <module>
----> 1 import marvin

~/anaconda3/lib/python3.7/site-packages/marvin/__init__.py in <module>
    773     os.environ['MARVIN_DIR'] = marvindir
    774 
--> 775 from marvin.api.api import Interaction
    776 from marvin.api.base import arg_validate
    777 

~/anaconda3/lib/python3.7/site-packages/marvin/api/__init__.py in <module>
      8 from brain.utils.general import build_routemap
      9 from flask import current_app
---> 10 from flask_jwt_extended import fresh_jwt_required
     11 from webargs import ValidationError, fields, validate
     12 from webargs.flaskparser import parser, use_args, use_kwargs

ImportError: cannot import name 'fresh_jwt_required' from 'flask_jwt_extended' (/home/brian/anaconda3/lib/python3.7/site-packages/flask_jwt_extended/__init__.py)
havok2063 commented 3 years ago

@briandigiorgio Thanks for this. This is a known and was also addressed here #719. I'll aim to release a quick patch pinning the requirement, with a longer term plan to look at upgrading to flask-jwt-extended to 4.0.0

briandigiorgio commented 3 years ago

Great, sorry about the extra issue. I didn't scroll down far enough to see it in the last one.

havok2063 commented 3 years ago

Closing as pinned requirement is in place