Skip to content

Commit 55f94ca

Browse files
committed
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
1 parent 9b0160a commit 55f94ca

File tree

9 files changed

+177
-0
lines changed

9 files changed

+177
-0
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ script:
1818
- (cd error_reporting && tox -e py27)
1919
- (cd resource_manager && tox -e py27)
2020
- (cd monitoring && tox -e py27)
21+
- (cd vision && tox -e py27)
2122
- tox -e py34
2223
- (cd core && tox -e py34)
2324
- (cd bigtable && tox -e py34)
@@ -31,6 +32,7 @@ script:
3132
- (cd error_reporting && tox -e py34)
3233
- (cd resource_manager && tox -e py34)
3334
- (cd monitoring && tox -e py34)
35+
- (cd vision && tox -e py34)
3436
- tox -e lint
3537
- tox -e cover
3638
- (cd core && tox -e cover)
@@ -45,6 +47,7 @@ script:
4547
- (cd error_reporting && tox -e cover)
4648
- (cd resource_manager && tox -e cover)
4749
- (cd monitoring && tox -e cover)
50+
- (cd vision && tox -e cover)
4851
- tox -e system-tests
4952
- tox -e system-tests3
5053
- scripts/update_docs.sh

scripts/verify_included_modules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
'pubsub',
7272
'resource_manager',
7373
'storage',
74+
'vision',
7475
)
7576

7677

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
'google-cloud-pubsub',
6363
'google-cloud-resource-manager',
6464
'google-cloud-storage',
65+
'google-cloud-vision',
6566
]
6667

6768
setup(

tox.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ deps =
1616
{toxinidir}/error_reporting
1717
{toxinidir}/resource_manager
1818
{toxinidir}/monitoring
19+
{toxinidir}/vision
1920
pytest
2021
covercmd =
2122
py.test --quiet \
@@ -95,6 +96,12 @@ covercmd =
9596
--cov-append \
9697
--cov-config {toxinidir}/.coveragerc \
9798
monitoring/unit_tests
99+
py.test --quiet \
100+
--cov=google.cloud \
101+
--cov=unit_tests \
102+
--cov-append \
103+
--cov-config {toxinidir}/.coveragerc \
104+
vision/unit_tests
98105
coverage report --show-missing --fail-under=100
99106

100107
[testenv]

vision/.coveragerc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[run]
2+
branch = True
3+
4+
[report]
5+
fail_under = 100
6+
show_missing = True
7+
exclude_lines =
8+
# Re-enable the standard pragma
9+
pragma: NO COVER
10+
# Ignore debug-only repr
11+
def __repr__

vision/MANIFEST.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include README.rst
2+
graft google
3+
graft unit_tests
4+
global-exclude *.pyc

vision/README.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Python Client for Google Cloud Vision
2+
=====================================
3+
4+
Python idiomatic client for `Google Cloud Vision`_
5+
6+
.. _Google Cloud Vision: https://cloud.google.com/vision/
7+
8+
- `Homepage`_
9+
- `API Documentation`_
10+
11+
.. _Homepage: https://googlecloudplatform.github.io/google-cloud-python/
12+
.. _API Documentation: http://googlecloudplatform.github.io/google-cloud-python/
13+
14+
Quick Start
15+
-----------
16+
17+
::
18+
19+
$ pip install --upgrade google-cloud-vision
20+
21+
Authentication
22+
--------------
23+
24+
With ``google-cloud-python`` we try to make authentication as painless as
25+
possible. Check out the `Authentication section`_ in our documentation to
26+
learn more. You may also find the `authentication document`_ shared by all
27+
the ``google-cloud-*`` libraries to be helpful.
28+
29+
.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html
30+
.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication
31+
32+
Using the API
33+
-------------
34+
35+
The Google Cloud `Vision`_ (`Vision API docs`_) API enables developers to
36+
understand the content of an image by encapsulating powerful machine
37+
learning models in an easy to use REST API. It quickly classifies images
38+
into thousands of categories (e.g., "sailboat", "lion", "Eiffel Tower"),
39+
detects individual objects and faces within images, and finds and reads
40+
printed words contained within images. You can build metadata on your
41+
image catalog, moderate offensive content, or enable new marketing
42+
scenarios through image sentiment analysis. Analyze images uploaded
43+
in the request or integrate with your image storage on Google Cloud
44+
Storage.
45+
46+
.. _Vision: https://cloud.google.com/vision/
47+
.. _Vision API docs: https://cloud.google.com/vision/reference/rest/
48+
49+
See the ``google-cloud-python`` API `Vision documentation`_ to learn
50+
how to analyze images using this library.
51+
52+
.. _Vision documentation: https://google-cloud-python.readthedocs.io/en/stable/vision-usage.html

vision/setup.py

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Copyright 2016 Google Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import os
16+
17+
from setuptools import find_packages
18+
from setuptools import setup
19+
20+
21+
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
22+
23+
with open(os.path.join(PACKAGE_ROOT, 'README.rst')) as file_obj:
24+
README = file_obj.read()
25+
26+
# NOTE: This is duplicated throughout and we should try to
27+
# consolidate.
28+
SETUP_BASE = {
29+
'author': 'Google Cloud Platform',
30+
'author_email': 'jjg+google-cloud-python@google.com',
31+
'scripts': [],
32+
'url': 'https://github.com/GoogleCloudPlatform/google-cloud-python',
33+
'license': 'Apache 2.0',
34+
'platforms': 'Posix; MacOS X; Windows',
35+
'include_package_data': True,
36+
'zip_safe': False,
37+
'classifiers': [
38+
'Development Status :: 4 - Beta',
39+
'Intended Audience :: Developers',
40+
'License :: OSI Approved :: Apache Software License',
41+
'Operating System :: OS Independent',
42+
'Programming Language :: Python :: 2',
43+
'Programming Language :: Python :: 2.7',
44+
'Programming Language :: Python :: 3',
45+
'Programming Language :: Python :: 3.4',
46+
'Programming Language :: Python :: 3.5',
47+
'Topic :: Internet',
48+
],
49+
}
50+
51+
52+
REQUIREMENTS = [
53+
'google-cloud-core',
54+
]
55+
56+
setup(
57+
name='google-cloud-vision',
58+
version='0.20.0dev',
59+
description='Python Client for Google Cloud Vision',
60+
long_description=README,
61+
namespace_packages=[
62+
'google',
63+
'google.cloud',
64+
],
65+
packages=find_packages(),
66+
install_requires=REQUIREMENTS,
67+
**SETUP_BASE
68+
)

vision/tox.ini

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[tox]
2+
envlist =
3+
py27,py34,py35,cover
4+
5+
[testing]
6+
deps =
7+
{toxinidir}/../core
8+
pytest
9+
covercmd =
10+
py.test --quiet \
11+
--cov=google.cloud.vision \
12+
--cov=unit_tests \
13+
--cov-config {toxinidir}/.coveragerc \
14+
unit_tests
15+
16+
[testenv]
17+
commands =
18+
py.test --quiet {posargs} unit_tests
19+
deps =
20+
{[testing]deps}
21+
22+
[testenv:cover]
23+
basepython =
24+
python2.7
25+
commands =
26+
{[testing]covercmd}
27+
deps =
28+
{[testenv]deps}
29+
coverage
30+
pytest-cov

0 commit comments

Comments
 (0)