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

Install gRPC et al for testing except py26/lint/docs-rtd #1943

Merged
merged 3 commits into from
Jul 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gcloud/pubsub/test__gax.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,14 @@ def test_topic_publish_hit(self):
topic_path, message_pbs, options = gax_api._publish_called_with
self.assertEqual(topic_path, self.TOPIC_PATH)
message_pb, = message_pbs
self.assertEqual(message_pb.data, B64)
self.assertEqual(message_pb.data.decode('ascii'), B64)
self.assertEqual(message_pb.attributes, {})
self.assertEqual(options.is_bundling, False)

def test_topic_publish_miss_w_attrs_w_bytes_payload(self):
import base64
from gcloud.exceptions import NotFound
PAYLOAD = u'This is the message text'
PAYLOAD = b'This is the message text'
B64 = base64.b64encode(PAYLOAD)
MESSAGE = {'data': B64, 'attributes': {'foo': 'bar'}}
gax_api = _GAXPublisherAPI()
Expand Down Expand Up @@ -256,7 +256,7 @@ def test_topic_publish_error(self):
topic_path, message_pbs, options = gax_api._publish_called_with
self.assertEqual(topic_path, self.TOPIC_PATH)
message_pb, = message_pbs
self.assertEqual(message_pb.data, B64)
self.assertEqual(message_pb.data.decode('ascii'), B64)
self.assertEqual(message_pb.attributes, {})
self.assertEqual(options.is_bundling, False)

Expand Down
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
]

GRPC_EXTRAS = [
'grpcio >= 0.14.0',
'google-gax >= 0.12.1',
'gax-google-pubsub-v1 >= 0.7.10',
'gax-google-logging-v2 >= 0.7.10',
'grpcio >= 1.0rc1',
'google-gax >= 0.12.3, < 0.13dev',
'gax-google-pubsub-v1 >= 0.7.12, < 0.8dev',
'grpc-google-pubsub-v1 >= 0.7.12, < 0.8dev',
'gax-google-logging-v2 >= 0.7.12, < 0.8dev',
'grpc-google-logging-v2 >= 0.7.12, < 0.8dev',

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

]

if sys.version_info[:2] == (2, 7) and 'READTHEDOCS' not in os.environ:
Expand Down
75 changes: 34 additions & 41 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
envlist =
py27,py34,py35,cover,docs,lint

[testenv]
commands =
nosetests
[testing]
deps =
nose
nose-exclude
unittest2
setenv =
PYTHONPATH = {toxinidir}/_testing
covercmd =
nosetests \
--exclude-dir=system_tests \
Expand All @@ -23,29 +19,37 @@ covercmd =

[grpc]
deps =
grpcio >= 0.14.0
google-gax >= 0.12.1
gax-google-pubsub-v1 >= 0.7.10
gax-google-logging-v2 >= 0.7.10
grpcio >= 1.0rc1
google-gax >= 0.12.3, < 0.13dev
gax-google-pubsub-v1 >= 0.7.12, < 0.8dev
grpc-google-pubsub-v1 >= 0.7.12, < 0.8dev
gax-google-logging-v2 >= 0.7.12, < 0.8dev
grpc-google-logging-v2 >= 0.7.12, < 0.8dev

[testenv:py27]
basepython =
python2.7
[docs]
deps =
{[testenv]deps}

This comment was marked as spam.

This comment was marked as spam.

Sphinx
sphinx_rtd_theme

[testenv]
commands =
nosetests
deps =
{[testenv]deps}
{[testing]deps}
{[grpc]deps}

[testenv:py26]

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

basepython =
python2.6
deps =
{[testing]deps}
setenv =
PYTHONPATH =
PYTHONPATH = {toxinidir}/_testing

[testenv:py27-pandas]
basepython =
python2.7
commands =
{[testenv:py27]commands}
setenv =
{[testenv:py27]setenv}
deps =
{[testenv]deps}
pandas
Expand All @@ -54,25 +58,19 @@ deps =
basepython =
python2.7
commands =
{[testenv]covercmd} --cover-min-percentage=100
{[testing]covercmd} --cover-min-percentage=100
deps =
{[testenv]deps}
{[grpc]deps}
coverage
setenv =
PYTHONPATH =

[testenv:coveralls]
basepython = {[testenv:cover]basepython}
commands =
pip install gcloud[grpc]
{[testenv]covercmd}
{[testing]covercmd}
coveralls
deps =
{[testenv:cover]deps}
coveralls
setenv =
PYTHONPATH =
passenv = {[testenv:system-tests]passenv}

[testenv:codecov]
Expand Down Expand Up @@ -105,20 +103,22 @@ commands =
sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html
python {toxinidir}/scripts/verify_included_modules.py
deps =
Sphinx
sphinx_rtd_theme
{[testenv]deps}
{[docs]deps}
passenv = {[testenv:system-tests]passenv} SPHINX_RELEASE READTHEDOCS LOCAL_RTD

[testenv:docs-rtd]
setenv =
PYTHONPATH = {toxinidir}/_testing
LOCAL_RTD = True
basepython = {[testenv:docs]basepython}
commands =
python -c "import shutil; shutil.rmtree('docs/_build_rtd', ignore_errors=True)"
sphinx-build -W -b html -d docs/_build_rtd/doctrees docs docs/_build_rtd/html
python {toxinidir}/scripts/verify_included_modules.py
deps = {[testenv:docs]deps}
deps =
{[testing]deps}
{[docs]deps}
setenv =
PYTHONPATH = {toxinidir}/_testing
LOCAL_RTD = True
passenv = {[testenv:docs]passenv}

[pep8]
Expand All @@ -132,25 +132,18 @@ commands =
python {toxinidir}/scripts/pycodestyle_on_repo.py
python {toxinidir}/scripts/run_pylint.py
deps =
{[testing]deps}
pycodestyle
pylint >= 1.6.4
unittest2
psutil
Sphinx
setenv =
PYTHONPATH =
PYTHONPATH = {toxinidir}/_testing
passenv = {[testenv:system-tests]passenv}

[testenv:system-tests]
basepython =
python2.7
commands =
python {toxinidir}/system_tests/attempt_system_tests.py
setenv =
PYTHONPATH =
deps =
{[testenv]deps}
{[grpc]deps}
passenv = GOOGLE_* GCLOUD_* TRAVIS* encrypted_*

[testenv:system-tests3]
Expand Down