Skip to content

Commit

Permalink
Merge pull request #2436 from dhermes/make-error_reporting-subpackage
Browse files Browse the repository at this point in the history
Move error reporting code into a subpackage
  • Loading branch information
dhermes authored Sep 26, 2016
2 parents 82c75bc + 655125e commit 2e49fde
Show file tree
Hide file tree
Showing 15 changed files with 216 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ script:
- (cd logging && tox -e py27)
- (cd dns && tox -e py27)
- (cd language && tox -e py27)
- (cd error_reporting && tox -e py27)
- tox -e py34
- (cd core && tox -e py34)
- (cd bigtable && tox -e py34)
Expand All @@ -25,6 +26,7 @@ script:
- (cd logging && tox -e py34)
- (cd dns && tox -e py34)
- (cd language && tox -e py34)
- (cd error_reporting && tox -e py34)
- tox -e lint
- tox -e cover
- (cd core && tox -e cover)
Expand All @@ -36,6 +38,7 @@ script:
- (cd logging && tox -e cover)
- (cd dns && tox -e cover)
- (cd language && tox -e cover)
- (cd error_reporting && tox -e cover)
- tox -e system-tests
- tox -e system-tests3
- scripts/update_docs.sh
Expand Down
11 changes: 11 additions & 0 deletions error_reporting/.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 error_reporting/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
49 changes: 49 additions & 0 deletions error_reporting/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Python Client for Stackdriver Error Reporting
=============================================

Python idiomatic client for `Stackdriver Error Reporting`_

.. _Stackdriver Error Reporting: https://cloud.google.com/error-reporting/

- `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-error-reporting

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 Stackdriver `Error Reporting`_ API (`Error Reporting API docs`_)
counts, analyzes and aggregates the crashes in your running cloud services.
A centralized error management interface displays the results with sorting
and filtering capabilities. A dedicated view shows the error details: time
chart, occurrences, affected user count, first and last seen dates and a
cleaned exception stack trace. Opt-in to receive email and mobile alerts
on new errors.

.. _Error Reporting: https://cloud.google.com/error-reporting/
.. _Error Reporting API docs: https://cloud.google.com/error-reporting/reference/

See the ``google-cloud-python`` API `Error Reporting documentation`_ to learn
how to get started using this library.

.. _Error Reporting documentation: https://google-cloud-python.readthedocs.io/en/stable/error-reporting-usage.html
20 changes: 20 additions & 0 deletions error_reporting/google/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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.

try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
20 changes: 20 additions & 0 deletions error_reporting/google/cloud/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2014 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.

try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
File renamed without changes.
File renamed without changes.
69 changes: 69 additions & 0 deletions error_reporting/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# 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',
'google-cloud-logging',
]

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

[testing]
deps =
{toxinidir}/../core
{toxinidir}/../logging
pytest
covercmd =
py.test --quiet \
--cov=google.cloud.error-reporting \
--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
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions scripts/verify_included_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
'core',
'datastore',
'dns',
'error_reporting',
'language',
'logging',
'pubsub',
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
'google-cloud-core',
'google-cloud-datastore',
'google-cloud-dns',
'google-cloud-error-reporting',
'google-cloud-language',
'google-cloud-logging',
'google-cloud-pubsub',
Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ deps =
{toxinidir}/logging
{toxinidir}/dns
{toxinidir}/language
{toxinidir}/error_reporting
pytest
covercmd =
py.test --quiet \
Expand Down Expand Up @@ -74,6 +75,12 @@ covercmd =
--cov-append \
--cov-config {toxinidir}/.coveragerc \
language/unit_tests
py.test --quiet \
--cov=google.cloud \
--cov=unit_tests \
--cov-append \
--cov-config {toxinidir}/.coveragerc \
error_reporting/unit_tests
coverage report --show-missing --fail-under=100

[testenv]
Expand Down

0 comments on commit 2e49fde

Please sign in to comment.