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

Upgrade Flask to 0.12 #1304

Closed
miketaylr opened this issue Jan 26, 2017 · 11 comments
Closed

Upgrade Flask to 0.12 #1304

miketaylr opened this issue Jan 26, 2017 · 11 comments
Assignees

Comments

@miketaylr
Copy link
Member

We're currently on 0.10.1

http://flask.pocoo.org/docs/0.12/upgrading/

@karlcow karlcow self-assigned this Jan 27, 2017
@karlcow
Copy link
Member

karlcow commented Jan 27, 2017

@karlcow
Copy link
Member

karlcow commented Jan 27, 2017

capture d ecran 2017-01-27 a 14 00 11

on my way… 🚶

karlcow added a commit to karlcow/webcompat.com that referenced this issue Jan 27, 2017
karlcow added a commit to karlcow/webcompat.com that referenced this issue Jan 27, 2017
@karlcow
Copy link
Member

karlcow commented Jan 27, 2017

Modifying requirements.txt to Flask==0.12

→ pip install -r config/requirements.txt 
…
…
Installing collected packages: Flask, click
  Found existing installation: Flask 0.10.1
    Uninstalling Flask:
      Successfully uninstalled Flask
Successfully installed Flask click
Cleaning up...

:)

→ python run.py
/Users/karl/code/webcompat.com/webcompat/__init__.py:11: ExtDeprecationWarning: Importing flask.ext.github is deprecated, use flask_github instead.
  from flask.ext.github import GitHub
/Users/karl/code/webcompat.com/webcompat/__init__.py:12: ExtDeprecationWarning: Importing flask.ext.limiter is deprecated, use flask_limiter instead.
  from flask.ext.limiter import Limiter
('secrets', '/Users/karl/code/webcompat.com')
 * Running on http://localhost:5000/ (Press CTRL+C to quit)
 * Restarting with stat
/Users/karl/code/webcompat.com/webcompat/__init__.py:11: ExtDeprecationWarning: Importing flask.ext.github is deprecated, use flask_github instead.
  from flask.ext.github import GitHub
/Users/karl/code/webcompat.com/webcompat/__init__.py:12: ExtDeprecationWarning: Importing flask.ext.limiter is deprecated, use flask_limiter instead.
  from flask.ext.limiter import Limiter
('secrets', '/Users/karl/code/webcompat.com')

fixing.

→ python run.py
('secrets', '/Users/karl/code/webcompat.com')
 * Running on http://localhost:5000/ (Press CTRL+C to quit)
 * Restarting with stat
('secrets', '/Users/karl/code/webcompat.com')
^C(webcompatcom)14:11:12 ~/code/webcompat.com
→ nosetests
.......................................
----------------------------------------------------------------------
Ran 39 tests in 11.567s

OK

@karlcow
Copy link
Member

karlcow commented Jan 27, 2017

😴 Let's try Pillow. Moving to 4.0.0

ok this one will be harder.

→ pip install --upgrade Pillow
Downloading/unpacking Pillow from https://pypi.python.org/packages/8d/80/eca7a2d1a3c2dafb960f32f844d570de988e609f5fd17de92e1cf6a01b0a/Pillow-4.0.0.tar.gz#md5=d5af224b0fa2c66dacc9814785fef9e7
  Downloading Pillow-4.0.0.tar.gz (11.1MB): 11.1MB downloaded
  Running setup.py (path:/Users/karl/.virtualenvs/webcompatcom/build/Pillow/setup.py) egg_info for package Pillow
    
    warning: no files found matching '*.sh'
    no previously-included directories found matching 'docs/_static'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.landscape.yaml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'build_children.sh'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
Downloading/unpacking olefile (from Pillow)
  Downloading olefile-0.44.zip (74kB): 74kB downloaded
  Running setup.py (path:/Users/karl/.virtualenvs/webcompatcom/build/olefile/setup.py) egg_info for package olefile
    
Installing collected packages: Pillow, olefile
  Found existing installation: Pillow 3.1.1
    Uninstalling Pillow:
      Successfully uninstalled Pillow
  Running setup.py install for Pillow
    
    warning: no files found matching '*.sh'
    no previously-included directories found matching 'docs/_static'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.landscape.yaml'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'build_children.sh'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    
    
    The headers or library files could not be found for zlib,
    a required dependency when compiling Pillow from source.
    
    Please see the install instructions at:
       http://pillow.readthedocs.io/en/latest/installation.html
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/karl/.virtualenvs/webcompatcom/build/Pillow/setup.py", line 791, in <module>
        raise RequiredDependencyException(msg)
    __main__.RequiredDependencyException:
    
    The headers or library files could not be found for zlib,
    a required dependency when compiling Pillow from source.
    
    Please see the install instructions at:
       http://pillow.readthedocs.io/en/latest/installation.html
    
    
    Complete output from command /Users/karl/.virtualenvs/webcompatcom/bin/python -c "import setuptools, tokenize;__file__='/Users/karl/.virtualenvs/webcompatcom/build/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bg/lmsn8jdx47748dbg0nrh2m8h0000gn/T/pip-uEFJY5-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/karl/.virtualenvs/webcompatcom/include/site/python2.7:
    running install

running build

running build_py

creating build

creating build/lib.macosx-10.12-intel-2.7

creating build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/__init__.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/_binary.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/_tkinter_finder.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/_util.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/BdfFontFile.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/BmpImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/BufrStubImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ContainerIO.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/CurImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/DcxImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/DdsImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/EpsImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ExifTags.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/features.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/FitsStubImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/FliImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/FontFile.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/FpxImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/FtexImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/GbrImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/GdImageFile.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/GifImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/GimpGradientFile.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/GimpPaletteFile.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/GribStubImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/Hdf5StubImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/IcnsImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/IcoImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/Image.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageChops.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageCms.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageColor.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageDraw.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageDraw2.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageEnhance.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageFile.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageFilter.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageFont.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageGrab.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageMath.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageMode.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageMorph.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageOps.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImagePalette.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImagePath.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageQt.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageSequence.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageShow.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageStat.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageTk.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageTransform.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImageWin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/ImtImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/IptcImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/Jpeg2KImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/JpegImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/JpegPresets.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/McIdasImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/MicImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/MpegImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/MpoImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/MspImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/OleFileIO.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/PaletteFile.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/PalmImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/PcdImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/PcfFontFile.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/PcxImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/PdfImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/PixarImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/PngImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/PpmImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/PsdImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/PSDraw.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/PyAccess.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/SgiImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/SpiderImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/SunImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/TarIO.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/TgaImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/TiffImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/TiffTags.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/WalImageFile.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/WebPImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/WmfImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/XbmImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/XpmImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

copying PIL/XVThumbImagePlugin.py -> build/lib.macosx-10.12-intel-2.7/PIL

running egg_info

writing requirements to Pillow.egg-info/requires.txt

writing Pillow.egg-info/PKG-INFO

writing top-level names to Pillow.egg-info/top_level.txt

writing dependency_links to Pillow.egg-info/dependency_links.txt

warning: manifest_maker: standard file '-c' not found



reading manifest file 'Pillow.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

warning: no files found matching '*.sh'

no previously-included directories found matching 'docs/_static'

warning: no previously-included files found matching '.coveragerc'

warning: no previously-included files found matching '.editorconfig'

warning: no previously-included files found matching '.landscape.yaml'

warning: no previously-included files found matching 'appveyor.yml'

warning: no previously-included files found matching 'build_children.sh'

warning: no previously-included files found matching 'tox.ini'

warning: no previously-included files matching '.git*' found anywhere in distribution

warning: no previously-included files matching '*.pyc' found anywhere in distribution

warning: no previously-included files matching '*.so' found anywhere in distribution

writing manifest file 'Pillow.egg-info/SOURCES.txt'

running build_ext





The headers or library files could not be found for zlib,

a required dependency when compiling Pillow from source.



Please see the install instructions at:

   http://pillow.readthedocs.io/en/latest/installation.html



Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/Users/karl/.virtualenvs/webcompatcom/build/Pillow/setup.py", line 791, in <module>

    raise RequiredDependencyException(msg)

__main__.RequiredDependencyException:



The headers or library files could not be found for zlib,

a required dependency when compiling Pillow from source.



Please see the install instructions at:

   http://pillow.readthedocs.io/en/latest/installation.html





----------------------------------------
  Rolling back uninstall of Pillow
Cleaning up...
Command /Users/karl/.virtualenvs/webcompatcom/bin/python -c "import setuptools, tokenize;__file__='/Users/karl/.virtualenvs/webcompatcom/build/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bg/lmsn8jdx47748dbg0nrh2m8h0000gn/T/pip-uEFJY5-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/karl/.virtualenvs/webcompatcom/include/site/python2.7 failed with error code 1 in /Users/karl/.virtualenvs/webcompatcom/build/Pillow
Storing debug log for failure in /Users/karl/.pip/pip.log

ok zlib is missing. Let's see.

# on macos
xcode-select --install

after this

Successfully installed Pillow olefile
Cleaning up...

ok. Just to be sure.

→ nosetests
.......................................
----------------------------------------------------------------------
Ran 39 tests in 9.978s

OK

Manually testing images upload.
This is working.

karlcow added a commit to karlcow/webcompat.com that referenced this issue Jan 27, 2017
karlcow added a commit to karlcow/webcompat.com that referenced this issue Jan 27, 2017
karlcow added a commit to karlcow/webcompat.com that referenced this issue Jan 27, 2017
@karlcow
Copy link
Member

karlcow commented Jan 27, 2017

Babel. no issue

Flask-Limiter. Upgrade ok. but testing complaining

→ nosetests
/Users/karl/.virtualenvs/webcompatcom/lib/python2.7/site-packages/flask_limiter/extension.py:124: UserWarning: Use of the default `get_ipaddr` function is discouraged. Please refer to https://flask-limiter.readthedocs.org/#rate-limit-domain for the recommended configuration
  UserWarning
.......................................
----------------------------------------------------------------------
Ran 39 tests in 5.604s

OK

https://flask-limiter.readthedocs.io/en/stable/#rate-limit-domain

Earlier versions of Flask-Limiter defaulted the rate limiting domain to the requesting users’ ip-address retreived via the flask_limiter.util.get_ipaddr() function. This behavior is being deprecated (since version 0.9.2) as it can be susceptible to ip spoofing with certain environment setups (more details at github issue #41 & flask apps and ip spoofing).

It is now recommended to explicitly provide a keying function as part of the Limiter initialization (Rate Limit Key Functions). Two utility methods are still provided:

  • flask_limiter.util.get_ipaddr(): uses the last ip address in the X-Forwarded-For header, else falls back to the remote_address of the request
  • flask_limiter.util.get_remote_address(): uses the remote_address of the request.

The tests are passing and I think we are fine. We are not using the IP address for the rate_limit on search but the username.

Let's move on.

karlcow added a commit to karlcow/webcompat.com that referenced this issue Jan 27, 2017
karlcow added a commit to karlcow/webcompat.com that referenced this issue Jan 27, 2017
@karlcow
Copy link
Member

karlcow commented Jan 27, 2017

Flask-WTF

→ nosetests
/Users/karl/.virtualenvs/webcompatcom/lib/python2.7/site-packages/flask_limiter/extension.py:124: UserWarning: Use of the default `get_ipaddr` function is discouraged. Please refer to https://flask-limiter.readthedocs.org/#rate-limit-domain for the recommended configuration
  UserWarning
.........................../Users/karl/code/webcompat.com/webcompat/helpers.py:150: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0.
  bug_form = IssueForm()
....../Users/karl/code/webcompat.com/webcompat/helpers.py:150: FlaskWTFDeprecationWarning: "flask_wtf.Form" has been renamed to "FlaskForm" and will be removed in 1.0.
  bug_form = IssueForm()
......
----------------------------------------------------------------------
Ran 39 tests in 6.506s

OK

ok editing the code for be future proof.

→ nosetests
/Users/karl/.virtualenvs/webcompatcom/lib/python2.7/site-packages/flask_limiter/extension.py:124: UserWarning: Use of the default `get_ipaddr` function is discouraged. Please refer to https://flask-limiter.readthedocs.org/#rate-limit-domain for the recommended configuration
  UserWarning
.......................................
----------------------------------------------------------------------
Ran 39 tests in 9.026s

OK

karlcow added a commit to karlcow/webcompat.com that referenced this issue Jan 27, 2017
@karlcow
Copy link
Member

karlcow commented Jan 27, 2017

Github-Flask. No issue.

@karlcow
Copy link
Member

karlcow commented Jan 27, 2017

ua-parser. No issue.

karlcow added a commit to karlcow/webcompat.com that referenced this issue Jan 27, 2017
@karlcow
Copy link
Member

karlcow commented Jan 27, 2017

ok last one. This one, I hope will not break things. requests.

no. issue.

Our next stop will be… Intern… but I should wait for @miketaylr to have finished the issue #1277

karlcow added a commit to karlcow/webcompat.com that referenced this issue Jan 27, 2017
@karlcow
Copy link
Member

karlcow commented Jan 27, 2017

→ pip list -lo
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
funcsigs (0.4) - Latest: 1.0.2 [wheel]
itsdangerous (0.23) - Latest: 0.24 [sdist]
Jinja2 (2.7.2) - Latest: 2.9.4 [wheel]
limits (1.0.4) - Latest: 1.2.1 [wheel]
MarkupSafe (0.19) - Latest: 0.23 [sdist]
pbr (1.8.1) - Latest: 1.10.0 [wheel]
SQLAlchemy (0.9.3) - Latest: 1.1.5 [sdist]
virtualenv (1.10.1) - Latest: 15.1.0 [wheel]
Werkzeug (0.10.4) - Latest: 0.11.15 [wheel]

@miketaylr
Copy link
Member Author

Whoa nice, @karlcow!

Our next stop will be… Intern… but I should wait for @miketaylr to have finished the issue #1277

I'd say go ahead send a PR now. Intern 2 on master works, and Intern 3... is uh, running up against some bugs.

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

No branches or pull requests

2 participants