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

Vision semi-GAPIC #3373

Merged
merged 34 commits into from
Jun 2, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a558ef1
[WIP] Vision semi-GAPIC
lukesneeringer May 3, 2017
bbc0bc8
[WIP] Vision semi-GAPIC, with future proof single feature methods.
May 3, 2017
6f627e4
WIP
May 3, 2017
2f69e39
WIP
lukesneeringer May 3, 2017
16daf25
WIP
May 3, 2017
7d975cb
[WIP] More Vision work.
May 4, 2017
04811d0
Working Vision client.
May 4, 2017
92cea0f
Re-adding old system tests; about to port.
May 4, 2017
f926516
Adding basic system tests.
May 4, 2017
cab525d
Rewrote usage docs for Vision
May 4, 2017
29ae515
Re-add old manual layer.
May 9, 2017
7249a15
Deprecate the old manual layer.
May 9, 2017
026a3c2
Remove requirements.txt
May 9, 2017
047d8d5
Re-add fail-under: 100 in .coveragerc
May 9, 2017
d01b94a
Fix credentials in unit test.
May 10, 2017
05063c3
Only run system tests where credentials are set.
May 10, 2017
6e0f282
File object support.
lukesneeringer May 15, 2017
18dce1c
Vision unit tests for file handling.
May 16, 2017
27593d7
Merge branch 'master' into vision-semi-gapic
lukesneeringer May 23, 2017
42c2b2e
Fix Vision MANIFEST.in
May 23, 2017
d4cdde4
Update versions in metapackage.
May 23, 2017
5566806
Modify a docstring. See if it makes sphinx not warn.
May 23, 2017
4604703
Let Sphinx warn.
May 23, 2017
11e02c3
Merge branch 'public-master' into vision-semi-gapic
Jun 1, 2017
4cf25eb
Wrangle Vision docs.
Jun 1, 2017
d97ed34
Improve proto docs (e.g. there are some now).
Jun 1, 2017
276df35
Greatly improve docs
Jun 1, 2017
8d4b5c5
Remove a trailing colon from see, fixes 63 warnings.
Jun 1, 2017
085fca8
Remove a trailing colon from see, fixes 63 warnings.
Jun 1, 2017
b89d3e6
Wipe out all trailing colons after the word See
Jun 1, 2017
6fdb2f4
Vision docs (and no warnings).
Jun 2, 2017
2148eb0
Improve docs.
Jun 2, 2017
0dc3ac5
Move GAPIC docs into their own directory.
Jun 2, 2017
36c8927
Add intersphinx for gax/grpc
Jun 2, 2017
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
Prev Previous commit
Next Next commit
Adding basic system tests.
  • Loading branch information
Luke Sneeringer committed May 4, 2017
commit f92651693a16efd81cfca45d6fb6e780d964ef0b
2 changes: 1 addition & 1 deletion vision/google/cloud/vision/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _create_single_feature_method(feature, enum):
"""

# Get the actual feature value to send.
feature_value = enum.__dict__[feature]
feature_value = {'type': enum.__dict__[feature]}

# Define the function to be returned.
def inner(self, image, options=None):
Expand Down
3 changes: 2 additions & 1 deletion vision/google/cloud/vision/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def annotate_image(self, request, options=None):
# This method allows features not to be specified, and you get all
# of them.
protobuf.setdefault(request, 'features', self._get_all_features())
return self.batch_annotate_images([request], options=options)[0]
r = self.batch_annotate_images([request], options=options)
return r.responses[0]

def _get_all_features(self):
"""Return a list of all features.
Expand Down
24 changes: 19 additions & 5 deletions vision/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
import nox


LOCAL_DEPS = ('../core/',)


@nox.session
@nox.parametrize('python_version', ['2.7', '3.4', '3.5', '3.6'])
def unit_tests(session, python_version):
Expand All @@ -31,7 +28,7 @@ def unit_tests(session, python_version):
session.interpreter = 'python{}'.format(python_version)

# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
session.install('mock', 'pytest', 'pytest-cov')
session.install('-e', '.')

# Run py.test against the unit tests.
Expand All @@ -42,6 +39,23 @@ def unit_tests(session, python_version):
)


@nox.session
@nox.parametrize('python_version', ['2.7', '3.6'])
def system_tests(session, python_version):
"""Run the unit test suite."""

# Run unit tests against all supported versions of Python.
session.interpreter = 'python{}'.format(python_version)

# Install all test dependencies, then install this package in-place.
session.install('pytest', '../core/', '../storage/')
session.install('../test_utils/')
session.install('-e', '.')

# Run py.test against the unit tests.
session.run('py.test', '--quiet', 'tests/system.py')


@nox.session
def lint(session):
"""Run flake8.
Expand All @@ -50,7 +64,7 @@ def lint(session):
serious code quality issues.
"""
session.interpreter = 'python3.6'
session.install('flake8', *LOCAL_DEPS)
session.install('flake8')
session.install('.')
session.run('flake8', 'google/cloud/vision.py')

Expand Down
Binary file added vision/tests/data/car.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision/tests/data/faces.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision/tests/data/full-text.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision/tests/data/landmark.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision/tests/data/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added vision/tests/data/text.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading