Skip to content

Commit

Permalink
Add more modern pythons to travis
Browse files Browse the repository at this point in the history
  • Loading branch information
kkopachev authored and marcelometal committed Nov 24, 2019
1 parent 8114928 commit 3479f80
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 39 deletions.
34 changes: 5 additions & 29 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,21 @@
language: python
python:
- '2.7'
- '3.2'
- '3.3'
- '3.4'
- '3.5'
- 2.7
- 3.5
- 3.6
- 3.7
- 3.8
- pypy
cache:
directories:
- $HOME/.cache/pip
sudo: false
matrix:
fast_finish: true

addons:
apt:
packages:
- libcurl4-openssl-dev
- python-numpy
- python-opencv
- libopencv-dev
- libjpeg-dev
- libpng-dev
- libx264-dev
- libass-dev
- libvpx1
- libvpx-dev
- libwebp-dev
- webp
- gifsicle
- python-numpy
- python-scipy
- cython
install:
- make setup
# Coveralls 4.0 doesn't support Python 3.2
- if [ "$TRAVIS_PYTHON_VERSION" == "3.2" ]; then travis_retry pip install coverage==3.7.1; fi
- pip install coveralls

script: make ci_test

after_success:
coveralls

8 changes: 4 additions & 4 deletions libthumbor/django/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ def generate_url(request):
try:
if 'width' in args:
args['width'] = int(args['width'])
except ValueError as e:
except ValueError:
error_message = "The width value '%s' is not an integer." % \
args['width']

try:
if 'height' in args:
args['height'] = int(args['height'])
except ValueError as e:
except ValueError:
error_message = "The height value '%s' is not an integer." % \
args['height']

Expand All @@ -55,13 +55,13 @@ def generate_url(request):
(int(args['crop_left']), int(args['crop_top'])),
(int(args['crop_right']), int(args['crop_bottom']))
)
except KeyError as e:
except KeyError:
error_message = '''
Missing values for cropping.
Expected all 'crop_left', 'crop_top',
'crop_right', 'crop_bottom' values.
'''
except ValueError as e:
except ValueError:
error_message = '''
Invalid values for cropping.
Expected all 'crop_left', 'crop_top',
Expand Down
12 changes: 6 additions & 6 deletions libthumbor/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,12 @@ def get_url_parts(**options):
class Url(object):

unsafe_or_hash = r'(?:(?:(?P<unsafe>unsafe)|(?P<hash>.+?))/)?'
debug = '(?:(?P<debug>debug)/)?'
meta = '(?:(?P<meta>meta)/)?'
trim = '(?:(?P<trim>trim(?::(?:top-left|bottom-right))?(?::\d+)?)/)?'
crop = '(?:(?P<crop_left>\d+)x(?P<crop_top>\d+):(?P<crop_right>\d+)x(?P<crop_bottom>\d+)/)?'
fit_in = '(?:(?P<adaptive>adaptive-)?(?P<full>full-)?(?P<fit_in>fit-in)/)?'
dimensions = '(?:(?P<horizontal_flip>-)?(?P<width>(?:\d+|orig))?x(?P<vertical_flip>-)?(?P<height>(?:\d+|orig))?/)?'
debug = r'(?:(?P<debug>debug)/)?'
meta = r'(?:(?P<meta>meta)/)?'
trim = r'(?:(?P<trim>trim(?::(?:top-left|bottom-right))?(?::\d+)?)/)?'
crop = r'(?:(?P<crop_left>\d+)x(?P<crop_top>\d+):(?P<crop_right>\d+)x(?P<crop_bottom>\d+)/)?'
fit_in = r'(?:(?P<adaptive>adaptive-)?(?P<full>full-)?(?P<fit_in>fit-in)/)?'
dimensions = r'(?:(?P<horizontal_flip>-)?(?P<width>(?:\d+|orig))?x(?P<vertical_flip>-)?(?P<height>(?:\d+|orig))?/)?'
halign = r'(?:(?P<halign>left|right|center)/)?'
valign = r'(?:(?P<valign>top|bottom|middle)/)?'
smart = r'(?:(?P<smart>smart)/)?'
Expand Down

0 comments on commit 3479f80

Please sign in to comment.