Opened 4 years ago

Last modified 23 months ago

#20922 new defect

Update Flask(-babel)

Reported by: vbraun Owned by:
Priority: major Milestone: sage-8.4
Component: packages: standard Keywords:
Cc: jdemeyer, kcrisman, dimpase, gh-timokau Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: public/20922 (Commits) Commit: d18c2f2d20189526f8752adc67b5a749779ab8f5
Dependencies: Stopgaps:

Description (last modified by vbraun)

Flask 0.11.1 has a new dependency on https://pypi.python.org/simple/click/

Change History (18)

comment:1 Changed 4 years ago by vbraun

  • Component changed from PLEASE CHANGE to packages: standard
  • Description modified (diff)
  • Type changed from PLEASE CHANGE to defect

comment:2 Changed 4 years ago by vbraun

  • Branch set to u/vbraun/update_flask__babel_

comment:3 Changed 4 years ago by git

  • Commit set to ea5d90fddb95bc90e21796fdfe708cee4adc80e8

Branch pushed to git repo; I updated commit sha1. New commits:

ea5d90fAdd click as a standard package

comment:4 Changed 4 years ago by vbraun

  • Cc jdemeyer kcrisman added

A bunch of sagenb failures with the new flask/babel:

sage -t --long local/lib/python2.7/site-packages/sagenb/notebook/cell.py  # 11 doctests failed
sage -t --long local/lib/python2.7/site-packages/sagenb/notebook/worksheet.py  # 11 doctests failed
sage -t --long local/lib/python2.7/site-packages/sagenb/notebook/notebook.py  # 17 doctests failed
sage -t --long local/lib/python2.7/site-packages/sagenb/notebook/challenge.py  # 8 doctests failed
sage -t --long local/lib/python2.7/site-packages/sagenb/notebook/template.py  # 8 doctests failed

because some stuff in flask was moved around:

sage -t --long local/lib/python2.7/site-packages/sagenb/notebook/challenge.py
**********************************************************************
File "local/lib/python2.7/site-packages/sagenb/notebook/challenge.py", line 451, in sagenb.notebook.challenge.reCAPTCHAChallenge.html
Failed example:
    from sagenb.flask_version import base # random output -- depends on warnings issued by other sage packages
Exception raised:
    Traceback (most recent call last):
      File "/home/vbraun/Sage/git-develop/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 498, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/vbraun/Sage/git-develop/local/lib/python2.7/site-packages/sage/doctest/forker.py", line 861, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sagenb.notebook.challenge.reCAPTCHAChallenge.html[0]>", line 1, in <module>
        from sagenb.flask_version import base # random output -- depends on warnings issued by other sage packages
      File "/home/vbraun/Sage/git-develop/local/lib/python2.7/site-packages/sagenb/flask_version/base.py", line 4, in <module>
        from flask import Flask, Module, url_for, request, session, redirect, g, make_response, current_app, render_template
    ImportError: cannot import name Module
**********************************************************************
Last edited 4 years ago by vbraun (previous) (diff)

comment:5 Changed 3 years ago by chapoton

The replacement for "Module" may be "Blueprint", but the syntax is not quite the same.

comment:6 Changed 3 years ago by chapoton

  • Branch changed from u/vbraun/update_flask__babel_ to public/20922
  • Commit changed from ea5d90fddb95bc90e21796fdfe708cee4adc80e8 to 98d7b94fd064200fedf3edb3611f219f8e556530

rebased on 7.6.b5


New commits:

98d7b94Merge branch 'u/vbraun/update_flask__babel_' in 7.6.b5

comment:7 Changed 3 years ago by chapoton

Change from Module to Blueprint looks like that:

    class Module()
    def __init__(self, import_name, name=None, url_prefix=None,
                 static_path=None, subdomain=None):
        Blueprint.__init__(self, name, import_name, url_prefix=url_prefix,
                           subdomain=subdomain, template_folder='templates')

comment:8 Changed 2 years ago by chapoton

should we try to update ?

comment:9 Changed 2 years ago by kcrisman

Sure, if the notebook will still work. Is the code you have in comment:7 pretty standard as a workaround?

comment:10 Changed 2 years ago by chapoton

  • Cc dimpase added

A priori, the changes suggested in comment:7 are included in the notebook since a long time, and should already be in the notebook version inside sage.

So indeed, the matter is just now to see if updating flask breaks sagenb or not..

comment:11 Changed 2 years ago by fbissey

Dear me. I opened https://github.com/sagemath/sagenb/issues/437 because gentoo made a newer flask-babel stable. But then I have stuck sagenb with a dependency to an older version of flask. After updating flask and getting click I still get the stuff I posted in the github issue however. Plus I now have a deprecation warning that in sagenb/notebook/conf.py at line 13 flask.ext.babel should be changed to flask_babel.

comment:12 Changed 2 years ago by fbissey

Also #20627

comment:13 Changed 2 years ago by git

  • Commit changed from 98d7b94fd064200fedf3edb3611f219f8e556530 to d18c2f2d20189526f8752adc67b5a749779ab8f5

Branch pushed to git repo; I updated commit sha1. New commits:

ad6269eMerge branch 'public/20922' of trac.sagemath.org:sage into 8.2.b3
d18c2f2new-style spkg-install

comment:14 Changed 2 years ago by dimpase

Until https://github.com/sagemath/sagenb/issues/437 is resolved, this cannot go ahead.

comment:15 Changed 2 years ago by chapoton

Notebook has now a pull request to change some imports:

https://github.com/sagemath/sagenb/pull/438

comment:16 Changed 2 years ago by gh-timokau

  • Cc gh-timokau added

comment:18 Changed 23 months ago by chapoton

  • Milestone changed from sage-7.3 to sage-8.4

For this ticket, one has to first update to a new release of sagenb. Some pull requests in sagenb should probably be merged before this new release.

Note: See TracTickets for help on using tickets.