Fix the Travis CI build to work on 3.5

This commit is contained in:
Travis Ralston 2018-07-09 12:28:27 -06:00
parent c65c6e2e70
commit 7ada960206
3 changed files with 8 additions and 9 deletions

View file

@ -8,13 +8,10 @@ sudo: false
git: git:
depth: 1 depth: 1
before_install: install:
- sudo apt-get update - sudo apt-get update
- sudo apt-get install python3.5 - sudo apt-get install python3.5 python3.5-dev
- sudo pip install --upgrade virtualenv
# test-and-build does the installation, so tell travis to skip the
# installation step
install: true
script: script:
- ./scripts/test-and-build.sh - ./scripts/test-and-build.sh

View file

@ -8,3 +8,4 @@ jsonschema >= 2.6.0
PyYAML >= 3.12 PyYAML >= 3.12
requests >= 2.18.4 requests >= 2.18.4
towncrier == 18.6.0rc1 towncrier == 18.6.0rc1
six >= 1.11.0

View file

@ -29,9 +29,10 @@ import os.path
import re import re
import subprocess import subprocess
import sys import sys
import urllib.request, urllib.parse, urllib.error
import yaml import yaml
import requests.utils
from functools import reduce from functools import reduce
from six.moves.urllib.parse import urlencode
matrix_doc_dir=reduce(lambda acc,_: os.path.dirname(acc), matrix_doc_dir=reduce(lambda acc,_: os.path.dirname(acc),
list(range(1, 5)), os.path.abspath(__file__)) list(range(1, 5)), os.path.abspath(__file__))
@ -524,7 +525,7 @@ class MatrixUnits(Units):
if param_loc == "path": if param_loc == "path":
path_template = path_template.replace( path_template = path_template.replace(
"{%s}" % param_name, urllib.parse.quote(example) "{%s}" % param_name, requests.utils.requote_uri(example)
) )
elif param_loc == "query": elif param_loc == "query":
if type(example) == list: if type(example) == list:
@ -564,7 +565,7 @@ class MatrixUnits(Units):
) )
endpoint["res_headers"] = headers endpoint["res_headers"] = headers
query_string = "" if len( query_string = "" if len(
example_query_params) == 0 else "?" + urllib.parse.urlencode( example_query_params) == 0 else "?" + urlencode(
example_query_params) example_query_params)
if example_body: if example_body:
endpoint["example"][ endpoint["example"][