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

localtileserver fails with flask==3 #177

Closed
dfguerrerom opened this issue Oct 8, 2023 · 2 comments · Fixed by #178
Closed

localtileserver fails with flask==3 #177

dfguerrerom opened this issue Oct 8, 2023 · 2 comments · Fixed by #178

Comments

@dfguerrerom
Copy link

dfguerrerom commented Oct 8, 2023

Flask 3.0 was released last week, and now localtileserver will use this version during the requirements installation
I think flask<3 has to be pinned until the code is refactored.

Full traceback:

---> 28 from localtileserver import TileClient, get_leaflet_tile_layer
     29 from matplotlib import colorbar
     30 from matplotlib import colors as mpc

File ~/module-venv/se.plan/lib/python3.10/site-packages/localtileserver/__init__.py:3
      1 # flake8: noqa: F401
      2 from localtileserver._version import __version__
----> 3 from localtileserver.client import RemoteTileClient, TileClient, get_or_create_tile_client
      4 from localtileserver.report import Report
      5 from localtileserver.tiler import get_cache_dir, make_vsi, purge_cache

File ~/module-venv/se.plan/lib/python3.10/site-packages/localtileserver/client.py:28
     26 from localtileserver.configure import get_default_client_params
     27 from localtileserver.helpers import parse_shapely
---> 28 from localtileserver.manager import AppManager
     29 from localtileserver.tiler import (
     30     format_to_encoding,
     31     get_building_docs,
   (...)
     39     palette_valid_or_raise,
     40 )
     41 from localtileserver.utilities import ImageBytes, add_query_parameters, save_file_from_request

File ~/module-venv/se.plan/lib/python3.10/site-packages/localtileserver/manager.py:1
----> 1 from localtileserver.web import create_app
      4 class AppManager:
      5     _APP = None

File ~/module-venv/se.plan/lib/python3.10/site-packages/localtileserver/web/__init__.py:2
      1 # flake8: noqa: F401
----> 2 from localtileserver.web import rest, urls, views
      3 from localtileserver.web.application import create_app, run_app
      4 from localtileserver.web.blueprint import cache, tileserver

File ~/module-venv/se.plan/lib/python3.10/site-packages/localtileserver/web/rest.py:10
      8 from PIL import Image, ImageDraw, ImageOps
      9 from flask import request, send_file
---> 10 from flask_restx import Api, Resource as View
     11 import large_image
     12 from large_image.exceptions import (
     13     TileSourceError,
     14     TileSourceInefficientError,
     15     TileSourceXYZRangeError,
     16 )

File ~/module-venv/se.plan/lib/python3.10/site-packages/flask_restx/__init__.py:2
      1 from . import fields, reqparse, apidoc, inputs, cors
----> 2 from .api import Api  # noqa
      3 from .marshalling import marshal, marshal_with, marshal_with_field  # noqa
      4 from .mask import Mask

File ~/module-venv/se.plan/lib/python3.10/site-packages/flask_restx/api.py:20
     18     from flask.helpers import _endpoint_from_view_func
     19 except ImportError:
---> 20     from flask.scaffold import _endpoint_from_view_func
     21 from flask.signals import got_request_exception
     23 from jsonschema import RefResolver

ModuleNotFoundError: No module named 'flask.scaffold'
@banesullivan
Copy link
Owner

Thanks for pointing this out! Looks like an issue with flask_restx. I'll pin the dependencies for now and issue a patch release

dfguerrerom added a commit to openforis/sepal_ui that referenced this issue Nov 30, 2023
@banesullivan
Copy link
Owner

Looks like this was fixed upstream via python-restx/flask-restx#567, so I'm going to merge #191 to free this

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

Successfully merging a pull request may close this issue.

2 participants