Werkzeug v1.0 build issues

Werkzeug 1.0 (released Feb 6) removed support for importing from the top-level werkzeug module. This means that imports need to be done directly from their module instead. Below is an example

Imports like this one:

from werkzeug import url_quote

Shold be change to this:

from werkzeug.urls import url_quote

Impact

  • Build errors: If you submit pull request you’ll see build errors on the release builds but likely not on the lowest builds.
  • Invenio v3.1 and v3.2 fails to run.

We are working on pushing out new releases of Invenio v3.1 and v3.2 to pin Werkzeug.

How to fix build errors

The new Invenio releases will not fix the build errors you see in modules. To fix the build errors there are two ways:

  1. If the build error is caused by a third-party library:
    • Pin Werkzeug in setup.py to "Werkzeug>=0.15,<1.0.0"
  2. If the build error is caused by the Invenio module:
    • If possible fix the import (see above) and do not pin Werkzeug. In most cases, the change is backward compatible so that the import also works on older Werkzeug versions.

Invenio by default supports Flask v1.0+ meaning that oldest Werkzeug release that we supports is Werkzeug v0.15.

We meet similar problems with flask-login>0.4. Do you have planned to pin also flask-login?

Yes, we’ll try to push out a new Invenio-Accounts release that pins Flask-Login.