Skip to content

Commit a609621

Browse files
authored
Merge pull request #1943 from tseaver/grpc-except-py26-lint-rtd
Install gRPC et al for testing except py26/lint/docs-rtd
2 parents a316dd6 + acaa3b2 commit a609621

File tree

3 files changed

+43
-48
lines changed

3 files changed

+43
-48
lines changed

gcloud/pubsub/test__gax.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,14 @@ def test_topic_publish_hit(self):
218218
topic_path, message_pbs, options = gax_api._publish_called_with
219219
self.assertEqual(topic_path, self.TOPIC_PATH)
220220
message_pb, = message_pbs
221-
self.assertEqual(message_pb.data, B64)
221+
self.assertEqual(message_pb.data.decode('ascii'), B64)
222222
self.assertEqual(message_pb.attributes, {})
223223
self.assertEqual(options.is_bundling, False)
224224

225225
def test_topic_publish_miss_w_attrs_w_bytes_payload(self):
226226
import base64
227227
from gcloud.exceptions import NotFound
228-
PAYLOAD = u'This is the message text'
228+
PAYLOAD = b'This is the message text'
229229
B64 = base64.b64encode(PAYLOAD)
230230
MESSAGE = {'data': B64, 'attributes': {'foo': 'bar'}}
231231
gax_api = _GAXPublisherAPI()
@@ -256,7 +256,7 @@ def test_topic_publish_error(self):
256256
topic_path, message_pbs, options = gax_api._publish_called_with
257257
self.assertEqual(topic_path, self.TOPIC_PATH)
258258
message_pb, = message_pbs
259-
self.assertEqual(message_pb.data, B64)
259+
self.assertEqual(message_pb.data.decode('ascii'), B64)
260260
self.assertEqual(message_pb.attributes, {})
261261
self.assertEqual(options.is_bundling, False)
262262

setup.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020
]
2121

2222
GRPC_EXTRAS = [
23-
'grpcio >= 0.14.0',
24-
'google-gax >= 0.12.1',
25-
'gax-google-pubsub-v1 >= 0.7.10',
26-
'gax-google-logging-v2 >= 0.7.10',
23+
'grpcio >= 1.0rc1',
24+
'google-gax >= 0.12.3, < 0.13dev',
25+
'gax-google-pubsub-v1 >= 0.7.12, < 0.8dev',
26+
'grpc-google-pubsub-v1 >= 0.7.12, < 0.8dev',
27+
'gax-google-logging-v2 >= 0.7.12, < 0.8dev',
28+
'grpc-google-logging-v2 >= 0.7.12, < 0.8dev',
2729
]
2830

2931
if sys.version_info[:2] == (2, 7) and 'READTHEDOCS' not in os.environ:

tox.ini

Lines changed: 34 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22
envlist =
33
py27,py34,py35,cover,docs,lint
44

5-
[testenv]
6-
commands =
7-
nosetests
5+
[testing]
86
deps =
97
nose
108
nose-exclude
119
unittest2
12-
setenv =
13-
PYTHONPATH = {toxinidir}/_testing
1410
covercmd =
1511
nosetests \
1612
--exclude-dir=system_tests \
@@ -23,29 +19,37 @@ covercmd =
2319

2420
[grpc]
2521
deps =
26-
grpcio >= 0.14.0
27-
google-gax >= 0.12.1
28-
gax-google-pubsub-v1 >= 0.7.10
29-
gax-google-logging-v2 >= 0.7.10
22+
grpcio >= 1.0rc1
23+
google-gax >= 0.12.3, < 0.13dev
24+
gax-google-pubsub-v1 >= 0.7.12, < 0.8dev
25+
grpc-google-pubsub-v1 >= 0.7.12, < 0.8dev
26+
gax-google-logging-v2 >= 0.7.12, < 0.8dev
27+
grpc-google-logging-v2 >= 0.7.12, < 0.8dev
3028

31-
[testenv:py27]
32-
basepython =
33-
python2.7
29+
[docs]
30+
deps =
31+
{[testenv]deps}
32+
Sphinx
33+
sphinx_rtd_theme
34+
35+
[testenv]
3436
commands =
3537
nosetests
3638
deps =
37-
{[testenv]deps}
39+
{[testing]deps}
3840
{[grpc]deps}
41+
42+
[testenv:py26]
43+
basepython =
44+
python2.6
45+
deps =
46+
{[testing]deps}
3947
setenv =
40-
PYTHONPATH =
48+
PYTHONPATH = {toxinidir}/_testing
4149

4250
[testenv:py27-pandas]
4351
basepython =
4452
python2.7
45-
commands =
46-
{[testenv:py27]commands}
47-
setenv =
48-
{[testenv:py27]setenv}
4953
deps =
5054
{[testenv]deps}
5155
pandas
@@ -54,25 +58,19 @@ deps =
5458
basepython =
5559
python2.7
5660
commands =
57-
{[testenv]covercmd} --cover-min-percentage=100
61+
{[testing]covercmd} --cover-min-percentage=100
5862
deps =
5963
{[testenv]deps}
60-
{[grpc]deps}
6164
coverage
62-
setenv =
63-
PYTHONPATH =
6465

6566
[testenv:coveralls]
6667
basepython = {[testenv:cover]basepython}
6768
commands =
68-
pip install gcloud[grpc]
69-
{[testenv]covercmd}
69+
{[testing]covercmd}
7070
coveralls
7171
deps =
7272
{[testenv:cover]deps}
7373
coveralls
74-
setenv =
75-
PYTHONPATH =
7674
passenv = {[testenv:system-tests]passenv}
7775

7876
[testenv:codecov]
@@ -105,20 +103,22 @@ commands =
105103
sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html
106104
python {toxinidir}/scripts/verify_included_modules.py
107105
deps =
108-
Sphinx
109-
sphinx_rtd_theme
106+
{[testenv]deps}
107+
{[docs]deps}
110108
passenv = {[testenv:system-tests]passenv} SPHINX_RELEASE READTHEDOCS LOCAL_RTD
111109

112110
[testenv:docs-rtd]
113-
setenv =
114-
PYTHONPATH = {toxinidir}/_testing
115-
LOCAL_RTD = True
116111
basepython = {[testenv:docs]basepython}
117112
commands =
118113
python -c "import shutil; shutil.rmtree('docs/_build_rtd', ignore_errors=True)"
119114
sphinx-build -W -b html -d docs/_build_rtd/doctrees docs docs/_build_rtd/html
120115
python {toxinidir}/scripts/verify_included_modules.py
121-
deps = {[testenv:docs]deps}
116+
deps =
117+
{[testing]deps}
118+
{[docs]deps}
119+
setenv =
120+
PYTHONPATH = {toxinidir}/_testing
121+
LOCAL_RTD = True
122122
passenv = {[testenv:docs]passenv}
123123

124124
[pep8]
@@ -132,25 +132,18 @@ commands =
132132
python {toxinidir}/scripts/pycodestyle_on_repo.py
133133
python {toxinidir}/scripts/run_pylint.py
134134
deps =
135+
{[testing]deps}
135136
pycodestyle
136137
pylint >= 1.6.4
137-
unittest2
138-
psutil
139-
Sphinx
140138
setenv =
141-
PYTHONPATH =
139+
PYTHONPATH = {toxinidir}/_testing
142140
passenv = {[testenv:system-tests]passenv}
143141

144142
[testenv:system-tests]
145143
basepython =
146144
python2.7
147145
commands =
148146
python {toxinidir}/system_tests/attempt_system_tests.py
149-
setenv =
150-
PYTHONPATH =
151-
deps =
152-
{[testenv]deps}
153-
{[grpc]deps}
154147
passenv = GOOGLE_* GCLOUD_* TRAVIS* encrypted_*
155148

156149
[testenv:system-tests3]

0 commit comments

Comments
 (0)