Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Making vision subpackage into a proper package.
- Adding README, setup.py, MANIFEST.in, .coveragerc and tox.ini
- Adding google-cloud-vision as a dependency to the umbrella
  package
- Adding the vision subdirectory into the list of packages
  for verifying the docs
- Incorporating the vision subdirectory into the umbrella
  coverage report
- Adding the vision only tox tests to the Travis config
- Adding {toxinidir}/../core as a dependency for the vision
  tox config
  • Loading branch information
dhermes committed Sep 26, 2016
commit 55f94caf032d8b5495bab1b191900489bd22a536
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ script:
- (cd error_reporting && tox -e py27)
- (cd resource_manager && tox -e py27)
- (cd monitoring && tox -e py27)
- (cd vision && tox -e py27)
- tox -e py34
- (cd core && tox -e py34)
- (cd bigtable && tox -e py34)
Expand All @@ -31,6 +32,7 @@ script:
- (cd error_reporting && tox -e py34)
- (cd resource_manager && tox -e py34)
- (cd monitoring && tox -e py34)
- (cd vision && tox -e py34)
- tox -e lint
- tox -e cover
- (cd core && tox -e cover)
Expand All @@ -45,6 +47,7 @@ script:
- (cd error_reporting && tox -e cover)
- (cd resource_manager && tox -e cover)
- (cd monitoring && tox -e cover)
- (cd vision && tox -e cover)
- tox -e system-tests
- tox -e system-tests3
- scripts/update_docs.sh
Expand Down
1 change: 1 addition & 0 deletions scripts/verify_included_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
'pubsub',
'resource_manager',
'storage',
'vision',
)


Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
'google-cloud-pubsub',
'google-cloud-resource-manager',
'google-cloud-storage',
'google-cloud-vision',
]

setup(
Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ deps =
{toxinidir}/error_reporting
{toxinidir}/resource_manager
{toxinidir}/monitoring
{toxinidir}/vision
pytest
covercmd =
py.test --quiet \
Expand Down Expand Up @@ -95,6 +96,12 @@ covercmd =
--cov-append \
--cov-config {toxinidir}/.coveragerc \
monitoring/unit_tests
py.test --quiet \
--cov=google.cloud \
--cov=unit_tests \
--cov-append \
--cov-config {toxinidir}/.coveragerc \
vision/unit_tests
coverage report --show-missing --fail-under=100

[testenv]
Expand Down
11 changes: 11 additions & 0 deletions vision/.coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[run]
branch = True

[report]
fail_under = 100
show_missing = True
exclude_lines =
# Re-enable the standard pragma
pragma: NO COVER
# Ignore debug-only repr
def __repr__
4 changes: 4 additions & 0 deletions vision/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include README.rst
graft google
graft unit_tests
global-exclude *.pyc
52 changes: 52 additions & 0 deletions vision/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
Python Client for Google Cloud Vision
=====================================

Python idiomatic client for `Google Cloud Vision`_

.. _Google Cloud Vision: https://cloud.google.com/vision/

- `Homepage`_
- `API Documentation`_

.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/
.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/

Quick Start
-----------

::

$ pip install --upgrade google-cloud-vision

Authentication
--------------

With ``google-cloud-python`` we try to make authentication as painless as
possible. Check out the `Authentication section`_ in our documentation to
learn more. You may also find the `authentication document`_ shared by all
the ``google-cloud-*`` libraries to be helpful.

.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html
.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication

Using the API
-------------

The Google Cloud `Vision`_ (`Vision API docs`_) API enables developers to
understand the content of an image by encapsulating powerful machine
learning models in an easy to use REST API. It quickly classifies images
into thousands of categories (e.g., "sailboat", "lion", "Eiffel Tower"),
detects individual objects and faces within images, and finds and reads
printed words contained within images. You can build metadata on your
image catalog, moderate offensive content, or enable new marketing
scenarios through image sentiment analysis. Analyze images uploaded
in the request or integrate with your image storage on Google Cloud
Storage.

.. _Vision: https://cloud.google.com/vision/
.. _Vision API docs: https://cloud.google.com/vision/reference/rest/

See the ``google-cloud-python`` API `Vision documentation`_ to learn
how to analyze images using this library.

.. _Vision documentation: https://google-cloud-python.readthedocs.io/en/stable/vision-usage.html
68 changes: 68 additions & 0 deletions vision/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from setuptools import find_packages
from setuptools import setup


PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))

with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj:
README = file_obj.read()

# NOTE: This is duplicated throughout and we should try to
# consolidate.
SETUP_BASE = {
'author': 'Google Cloud Platform',
'author_email': 'jjg+google-cloud-python@google.com',
'scripts': [],
'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python',
'license': 'Apache 2.0',
'platforms': 'Posix; MacOS X; Windows',
'include_package_data': True,
'zip_safe': False,
'classifiers': [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Internet',
],
}


REQUIREMENTS = [
'google-cloud-core',
]

setup(
name='google-cloud-vision',
version='0.20.0dev',
description='Python Client for Google Cloud Vision',
long_description=README,
namespace_packages=[
'google',
'google.cloud',
],
packages=find_packages(),
install_requires=REQUIREMENTS,
**SETUP_BASE
)
30 changes: 30 additions & 0 deletions vision/tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[tox]
envlist =
py27,py34,py35,cover

[testing]
deps =
{toxinidir}/../core
pytest
covercmd =
py.test --quiet \
--cov=google.cloud.vision \
--cov=unit_tests \
--cov-config {toxinidir}/.coveragerc \
unit_tests

[testenv]
commands =
py.test --quiet {posargs} unit_tests
deps =
{[testing]deps}

[testenv:cover]
basepython =
python2.7
commands =
{[testing]covercmd}
deps =
{[testenv]deps}
coverage
pytest-cov