Skip to content

Commit 4a002a1

Browse files
author
Christopher Wang
authored
Merge pull request #4 from zapier/python-3
Python 3 compatibility
2 parents 3a0dc6d + 64b1a73 commit 4a002a1

File tree

61 files changed

+546
-736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+546
-736
lines changed

.travis.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
language: python
2-
python:
3-
- "2.6"
4-
- "2.7"
5-
- "pypy"
2+
matrix:
3+
include:
4+
- python: 2.6
5+
env: TOXENV=py26
6+
- python: 3.6
7+
env: TOXENV=py36
8+
- python: pypy
9+
env: TOXENV=pypy
610
install:
7-
- python setup.py install
8-
- pip install -r test_requirements.txt
11+
- pip install tox
912
script:
10-
- python setup.py test
13+
- tox -e $TOXENV

fixtures/analytics_autoselects.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
- request: !!python/object:vcr.request.Request
1+
interactions:
2+
- request:
23
body: ''
3-
headers: !!python/object/apply:__builtin__.frozenset
4-
- - !!python/tuple [User-Agent, Swiftype-Python/1.0.0]
5-
- !!python/tuple [Content-Type, application/json]
6-
host: localhost
4+
headers:
5+
Content-Type: [application/json]
6+
User-Agent: [Swiftype-Python/1.0.0]
77
method: GET
8-
path: /api/v1/engines/api-test/analytics/autoselects.json?auth_token=a-test-api-key
9-
port: 3000
10-
protocol: http
8+
uri: http://localhost:3000/api/v1/engines/api-test/analytics/autoselects.json?auth_token=a-test-api-key
119
response:
1210
body: {string: '[["2014-01-06",0],["2014-01-05",0],["2014-01-04",0],["2014-01-03",0],["2014-01-02",0],["2014-01-01",0],["2013-12-31",0],["2013-12-30",0],["2013-12-29",0],["2013-12-28",0],["2013-12-27",0],["2013-12-26",0],["2013-12-25",0],["2013-12-24",0],["2013-12-23",0]]'}
13-
headers: {cache-control: 'max-age=0, private, must-revalidate', connection: close,
14-
content-type: application/json; charset=utf-8, etag: '"d4e02fbdbba3a819f576e328f1a08201"',
15-
server: thin 1.5.0 codename Knife, x-request-id: e9796df35b44951f138f20e31a1ef70e,
16-
x-runtime: '0.017000', x-ua-compatible: IE=Edge}
11+
headers: {}
1712
status: {code: 200, message: OK}
13+
version: 1
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
- request: !!python/object:vcr.request.Request
1+
interactions:
2+
- request:
23
body: ''
3-
headers: !!python/object/apply:__builtin__.frozenset
4-
- - !!python/tuple [User-Agent, Swiftype-Python/1.0.0]
5-
- !!python/tuple [Content-Type, application/json]
6-
host: localhost
4+
headers:
5+
Content-Type: [application/json]
6+
User-Agent: [Swiftype-Python/1.0.0]
77
method: GET
8-
path: /api/v1/engines/api-test/analytics/autoselects.json?auth_token=a-test-api-key&start_date=2013-12-31&end_date=2014-01-01
9-
port: 3000
10-
protocol: http
8+
uri: http://localhost:3000/api/v1/engines/api-test/analytics/autoselects.json?auth_token=a-test-api-key&start_date=2013-12-31&end_date=2014-01-01
119
response:
1210
body: {string: '[["2014-01-01",0],["2013-12-31",0]]'}
13-
headers: {cache-control: 'max-age=0, private, must-revalidate', connection: close,
14-
content-type: application/json; charset=utf-8, etag: '"0fcfc6befc63f00afcd764be995a341a"',
15-
server: thin 1.5.0 codename Knife, x-request-id: f4eec152cb66eec412b1b501ed65a650,
16-
x-runtime: '0.018431', x-ua-compatible: IE=Edge}
11+
headers: {}
1712
status: {code: 200, message: OK}
13+
version: 1

fixtures/analytics_searches.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
- request: !!python/object:vcr.request.Request
1+
interactions:
2+
- request:
23
body: ''
3-
headers: !!python/object/apply:__builtin__.frozenset
4-
- - !!python/tuple [User-Agent, Swiftype-Python/1.0.0]
5-
- !!python/tuple [Content-Type, application/json]
6-
host: localhost
4+
headers:
5+
Content-Type: [application/json]
6+
User-Agent: [Swiftype-Python/1.0.0]
77
method: GET
8-
path: /api/v1/engines/api-test/analytics/searches.json?auth_token=a-test-api-key
9-
port: 3000
10-
protocol: http
8+
uri: http://localhost:3000/api/v1/engines/api-test/analytics/searches.json?auth_token=a-test-api-key
119
response:
1210
body: {string: '[["2014-01-06",0],["2014-01-05",0],["2014-01-04",0],["2014-01-03",0],["2014-01-02",0],["2014-01-01",0],["2013-12-31",0],["2013-12-30",0],["2013-12-29",0],["2013-12-28",0],["2013-12-27",0],["2013-12-26",0],["2013-12-25",0],["2013-12-24",0],["2013-12-23",0]]'}
13-
headers: {cache-control: 'max-age=0, private, must-revalidate', connection: close,
14-
content-type: application/json; charset=utf-8, etag: '"d4e02fbdbba3a819f576e328f1a08201"',
15-
server: thin 1.5.0 codename Knife, x-request-id: 135751460e794fb220b4219bc1ce3ad0,
16-
x-runtime: '0.047857', x-ua-compatible: IE=Edge}
11+
headers: {}
1712
status: {code: 200, message: OK}
13+
version: 1
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
- request: !!python/object:vcr.request.Request
1+
interactions:
2+
- request:
23
body: ''
3-
headers: !!python/object/apply:__builtin__.frozenset
4-
- - !!python/tuple [User-Agent, Swiftype-Python/1.0.0]
5-
- !!python/tuple [Content-Type, application/json]
6-
host: localhost
4+
headers:
5+
Content-Type: [application/json]
6+
User-Agent: [Swiftype-Python/1.0.0]
77
method: GET
8-
path: /api/v1/engines/api-test/analytics/searches.json?auth_token=a-test-api-key&start_date=2013-12-31&end_date=2014-01-01
9-
port: 3000
10-
protocol: http
8+
uri: http://localhost:3000/api/v1/engines/api-test/analytics/searches.json?auth_token=a-test-api-key&start_date=2013-12-31&end_date=2014-01-01
119
response:
1210
body: {string: '[["2014-01-01",0],["2013-12-31",0]]'}
13-
headers: {cache-control: 'max-age=0, private, must-revalidate', connection: close,
14-
content-type: application/json; charset=utf-8, etag: '"0fcfc6befc63f00afcd764be995a341a"',
15-
server: thin 1.5.0 codename Knife, x-request-id: b39c5688e2b0e601eb4a3199eaecab58,
16-
x-runtime: '0.018621', x-ua-compatible: IE=Edge}
11+
headers: {}
1712
status: {code: 200, message: OK}
13+
version: 1
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
- request: !!python/object:vcr.request.Request
1+
interactions:
2+
- request:
23
body: ''
3-
headers: !!python/object/apply:__builtin__.frozenset
4-
- - !!python/tuple [User-Agent, Swiftype-Python/1.0.0]
5-
- !!python/tuple [Content-Type, application/json]
6-
host: localhost
4+
headers:
5+
Content-Type: [application/json]
6+
User-Agent: [Swiftype-Python/1.0.0]
77
method: GET
8-
path: /api/v1/engines/api-test/analytics/top_no_result_queries_in_range.json?auth_token=a-test-api-key
9-
port: 3000
10-
protocol: http
8+
uri: http://localhost:3000/api/v1/engines/api-test/analytics/top_no_result_queries_in_range.json?auth_token=a-test-api-key
119
response:
1210
body: {string: '[["foo",2],["bar",1]]'}
13-
headers: {cache-control: 'max-age=0, private, must-revalidate', connection: close,
14-
content-type: application/json; charset=utf-8, etag: '"d751713988987e9331980363e24189ce"',
15-
server: thin 1.5.0 codename Knife, x-request-id: 4ba743d24f32e8bf5f2c24bc091ae320,
16-
x-runtime: '0.022363', x-ua-compatible: IE=Edge}
11+
headers: {}
1712
status: {code: 200, message: OK}
13+
version: 1
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
- request: !!python/object:vcr.request.Request
1+
interactions:
2+
- request:
23
body: ''
3-
headers: !!python/object/apply:__builtin__.frozenset
4-
- - !!python/tuple [User-Agent, Swiftype-Python/1.0.0]
5-
- !!python/tuple [Content-Type, application/json]
6-
host: localhost
4+
headers:
5+
Content-Type: [application/json]
6+
User-Agent: [Swiftype-Python/1.0.0]
77
method: GET
8-
path: /api/v1/engines/api-test/analytics/top_no_result_queries_in_range.json?auth_token=a-test-api-key&start_date=2013-12-31&end_date=2014-01-01
9-
port: 3000
10-
protocol: http
8+
uri: http://localhost:3000/api/v1/engines/api-test/analytics/top_no_result_queries_in_range.json?auth_token=a-test-api-key&start_date=2013-12-31&end_date=2014-01-01
119
response:
1210
body: {string: '[["foo",2],["bar",1]]'}
13-
headers: {cache-control: 'max-age=0, private, must-revalidate', connection: close,
14-
content-type: application/json; charset=utf-8, etag: '"d751713988987e9331980363e24189ce"',
15-
server: thin 1.5.0 codename Knife, x-request-id: 404ac03a546269759b387b3d20558581,
16-
x-runtime: '0.018528', x-ua-compatible: IE=Edge}
11+
headers: {}
1712
status: {code: 200, message: OK}
13+
version: 1

fixtures/analytics_top_queries.yaml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
- request: !!python/object:vcr.request.Request
1+
interactions:
2+
- request:
23
body: ''
3-
headers: !!python/object/apply:__builtin__.frozenset
4-
- - !!python/tuple [User-Agent, Swiftype-Python/1.0.0]
5-
- !!python/tuple [Content-Type, application/json]
6-
host: localhost
4+
headers:
5+
Content-Type: [application/json]
6+
User-Agent: [Swiftype-Python/1.0.0]
77
method: GET
8-
path: /api/v1/engines/api-test/analytics/top_queries.json?auth_token=a-test-api-key
9-
port: 3000
10-
protocol: http
8+
uri: http://localhost:3000/api/v1/engines/api-test/analytics/top_queries.json?auth_token=a-test-api-key
119
response:
1210
body: {string: '[["dostoyevsky",2],["gatsby",1]]'}
13-
headers: {cache-control: 'max-age=0, private, must-revalidate', connection: close,
14-
content-type: application/json; charset=utf-8, etag: '"d751713988987e9331980363e24189ce"',
15-
server: thin 1.5.0 codename Knife, x-request-id: aad1a371b3b319c586ba9f1e47512d0e,
16-
x-runtime: '0.148543', x-ua-compatible: IE=Edge}
11+
headers: {}
1712
status: {code: 200, message: OK}
13+
version: 1
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
- request: !!python/object:vcr.request.Request
1+
interactions:
2+
- request:
23
body: ''
3-
headers: !!python/object/apply:__builtin__.frozenset
4-
- - !!python/tuple [User-Agent, Swiftype-Python/1.0.0]
5-
- !!python/tuple [Content-Type, application/json]
6-
host: localhost
4+
headers:
5+
Content-Type: [application/json]
6+
User-Agent: [Swiftype-Python/1.0.0]
77
method: GET
8-
path: /api/v1/engines/api-test/analytics/top_queries_in_range.json?auth_token=a-test-api-key&start_date=2013-12-31&end_date=2014-01-01
9-
port: 3000
10-
protocol: http
8+
uri: http://localhost:3000/api/v1/engines/api-test/analytics/top_queries_in_range.json?auth_token=a-test-api-key&start_date=2013-12-31&end_date=2014-01-01
119
response:
1210
body: {string: '[["dostoyevsky",2],["gatsby",1]]'}
13-
headers: {cache-control: 'max-age=0, private, must-revalidate', connection: close,
14-
content-type: application/json; charset=utf-8, etag: '"d751713988987e9331980363e24189ce"',
15-
server: thin 1.5.0 codename Knife, x-request-id: 235629bc196d3670614a343c86968f37,
16-
x-runtime: '0.015943', x-ua-compatible: IE=Edge}
11+
headers: {}
1712
status: {code: 200, message: OK}
13+
version: 1
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
- request: !!python/object:vcr.request.Request
1+
interactions:
2+
- request:
23
body: ''
3-
headers: !!python/object/apply:__builtin__.frozenset
4-
- - !!python/tuple [User-Agent, Swiftype-Python/1.0.0]
5-
- !!python/tuple [Content-Type, application/json]
6-
host: localhost
4+
headers:
5+
Content-Type: [application/json]
6+
User-Agent: [Swiftype-Python/1.0.0]
77
method: GET
8-
path: /api/v1/engines/api-test/analytics/top_queries.json?per_page=10&auth_token=a-test-api-key&page=2
9-
port: 3000
10-
protocol: http
8+
uri: http://localhost:3000/api/v1/engines/api-test/analytics/top_queries.json?per_page=10&auth_token=a-test-api-key&page=2
119
response:
1210
body: {string: '[["dostoyevsky",2],["gatsby",1]]'}
13-
headers: {cache-control: 'max-age=0, private, must-revalidate', connection: close,
14-
content-type: application/json; charset=utf-8, etag: '"d751713988987e9331980363e24189ce"',
15-
server: thin 1.5.0 codename Knife, x-request-id: 038ab193a41ca1d0f67e7dd676a5192d,
16-
x-runtime: '0.022563', x-ua-compatible: IE=Edge}
11+
headers: {}
1712
status: {code: 200, message: OK}
13+
version: 1

0 commit comments

Comments
 (0)