Skip to content

Commit 3af2d13

Browse files
committed
Making language subpackage into a proper package.
- Adding README, setup.py, MANIFEST.in, .coveragerc and tox.ini - Adding google-cloud-language as a dependency to the umbrella package - Adding the language subdirectory into the list of packages for verifying the docs - Incorporating the language subdirectory into the umbrella coverage report - Adding the language only tox tests to the Travis config - Adding {toxinidir}/../core as a dependency for the language tox config
1 parent 4a3dc28 commit 3af2d13

File tree

9 files changed

+173
-0
lines changed

9 files changed

+173
-0
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ script:
1414
- (cd pubsub && tox -e py27)
1515
- (cd logging && tox -e py27)
1616
- (cd dns && tox -e py27)
17+
- (cd language && tox -e py27)
1718
- tox -e py34
1819
- (cd core && tox -e py34)
1920
- (cd bigtable && tox -e py34)
@@ -23,6 +24,7 @@ script:
2324
- (cd pubsub && tox -e py34)
2425
- (cd logging && tox -e py34)
2526
- (cd dns && tox -e py34)
27+
- (cd language && tox -e py34)
2628
- tox -e lint
2729
- tox -e cover
2830
- (cd core && tox -e cover)
@@ -33,6 +35,7 @@ script:
3335
- (cd pubsub && tox -e cover)
3436
- (cd logging && tox -e cover)
3537
- (cd dns && tox -e cover)
38+
- (cd language && tox -e cover)
3639
- tox -e system-tests
3740
- tox -e system-tests3
3841
- scripts/update_docs.sh

language/.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__

language/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

language/README.rst

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Python Client for Google Cloud Natural Language
2+
===============================================
3+
4+
Python idiomatic client for `Google Cloud Natural Language`_
5+
6+
.. _Google Cloud Natural Language: https://cloud.google.com/natural-language/
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-language
20+
$ # OR
21+
$ pip install --upgrade google-cloud-natural-language
22+
23+
Authentication
24+
--------------
25+
26+
With ``google-cloud-python`` we try to make authentication as painless as
27+
possible. Check out the `Authentication section`_ in our documentation to
28+
learn more. You may also find the `authentication document`_ shared by all
29+
the ``google-cloud-*`` libraries to be helpful.
30+
31+
.. _Authentication section: http://google-cloud-python.readthedocs.io/en/latest/google-cloud-auth.html
32+
.. _authentication document: https://github.com/GoogleCloudPlatform/gcloud-common/tree/master/authentication
33+
34+
Using the API
35+
-------------
36+
37+
The Google Cloud `Natural Language`_ API (`Natural Language API docs`_)
38+
provides natural language understanding technologies to developers,
39+
including sentiment analysis, entity recognition, and syntax analysis.
40+
This API is part of the larger Cloud Machine Learning API.
41+
42+
.. _Natural Language: https://cloud.google.com/natural-language/
43+
.. _Natural Language API docs: https://cloud.google.com/natural-language/reference/rest/
44+
45+
See the ``google-cloud-python`` API `Natural Language documentation`_ to learn
46+
how to analyze text with this API.
47+
48+
.. _Natural Language documentation: https://google-cloud-python.readthedocs.io/en/stable/language-usage.html

language/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-language',
58+
version='0.20.0dev',
59+
description='Python Client for Google Cloud Natural Language',
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+
)

language/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.language \
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

scripts/verify_included_modules.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
'core',
6565
'datastore',
6666
'dns',
67+
'language',
6768
'logging',
6869
'pubsub',
6970
'storage',

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
'google-cloud-core',
5656
'google-cloud-datastore',
5757
'google-cloud-dns',
58+
'google-cloud-language',
5859
'google-cloud-logging',
5960
'google-cloud-pubsub',
6061
'google-cloud-storage',

tox.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ deps =
1212
{toxinidir}/pubsub
1313
{toxinidir}/logging
1414
{toxinidir}/dns
15+
{toxinidir}/language
1516
pytest
1617
covercmd =
1718
py.test --quiet \
@@ -67,6 +68,12 @@ covercmd =
6768
--cov-append \
6869
--cov-config {toxinidir}/.coveragerc \
6970
dns/unit_tests
71+
py.test --quiet \
72+
--cov=google.cloud \
73+
--cov=unit_tests \
74+
--cov-append \
75+
--cov-config {toxinidir}/.coveragerc \
76+
language/unit_tests
7077
coverage report --show-missing --fail-under=100
7178

7279
[testenv]

0 commit comments

Comments
 (0)