GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Move pubsub code into a subpackage by dhermes · Pull Request #2419 · googleapis/google-cloud-python

Move pubsub code into a subpackage #2419

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.

Sign up for GitHub

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

Merged
dhermes merged 3 commits into googleapis:master from dhermes:make-pubsub-subpackage
Sep 26, 2016

Uh oh!

There was an error while loading. Please reload this page.

Merged

Move pubsub code into a subpackage #2419

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3 commits
Select commit Hold shift + click to select a range
c6558b9
Moving all pubsub files into subdirectory.
dhermes Sep 26, 2016
ddf2b34
Making pubsub subpackage into a proper package.
dhermes Sep 26, 2016
27380f9
Remove Pub / Sub deps from setup.py.
dhermes Sep 26, 2016
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

3 changes: 3 additions & 0 deletions 3 .travis.yml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,22 @@ script:
- (cd storage && tox -e py27)
- (cd datastore && tox -e py27)
- (cd bigquery && tox -e py27)
- (cd pubsub && tox -e py27)
- tox -e py34
- (cd core && tox -e py34)
- (cd bigtable && tox -e py34)
- (cd storage && tox -e py34)
- (cd datastore && tox -e py34)
- (cd bigquery && tox -e py34)
- (cd pubsub && tox -e py34)
- tox -e lint
- tox -e cover
- (cd core && tox -e cover)
- (cd bigtable && tox -e cover)
- (cd storage && tox -e cover)
- (cd datastore && tox -e cover)
- (cd bigquery && tox -e cover)
- (cd pubsub && tox -e cover)
- tox -e system-tests
- tox -e system-tests3
- scripts/update_docs.sh
Expand Down
11 changes: 11 additions & 0 deletions 11 pubsub/.coveragerc
Show comments
View file
Open in desktop
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 4 pubsub/MANIFEST.in
Show comments
View file
Open in desktop
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
61 changes: 61 additions & 0 deletions 61 pubsub/README.rst
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Python Client for Google Cloud Pub / Sub
========================================

Python idiomatic client for `Google Cloud Pub / Sub`_

.. _Google Cloud Pub / Sub: https://cloud.google.com/pubsub/docs

- `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-pubsub

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

Google `Cloud Pub/Sub`_ (`Pub/Sub API docs`_) is designed to provide reliable,
many-to-many, asynchronous messaging between applications. Publisher
applications can send messages to a ``topic`` and other applications can
subscribe to that topic to receive the messages. By decoupling senders and
receivers, Google Cloud Pub/Sub allows developers to communicate between
independently written applications.

.. _Cloud Pub/Sub: https://cloud.google.com/pubsub/docs
.. _Pub/Sub API docs: https://cloud.google.com/pubsub/reference/rest/

See the ``google-cloud-python`` API `Pub/Sub documentation`_ to learn how to connect
to Cloud Pub/Sub using this Client Library.

.. _Pub/Sub documentation: https://googlecloudplatform.github.io/google-cloud-python/stable/pubsub-usage.html

To get started with this API, you'll need to create

.. code:: python

from google.cloud import pubsub

client = pubsub.Client()
topic = client.topic('topic_name')
topic.create()

topic.publish('this is the message_payload',
attr1='value1', attr2='value2')
20 changes: 20 additions & 0 deletions 20 pubsub/google/__init__.py
Show comments
View file
Open in desktop
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 20 pubsub/google/cloud/__init__.py
Show comments
View file
Open in desktop
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__)
0 google/cloud/pubsub/__init__.py → pubsub/google/cloud/pubsub/__init__.py
Show comments
View file
Open in desktop
File renamed without changes.
0 google/cloud/pubsub/_gax.py → pubsub/google/cloud/pubsub/_gax.py
Show comments
View file
Open in desktop
File renamed without changes.
0 google/cloud/pubsub/_helpers.py → pubsub/google/cloud/pubsub/_helpers.py
Show comments
View file
Open in desktop
File renamed without changes.
0 google/cloud/pubsub/client.py → pubsub/google/cloud/pubsub/client.py
Show comments
View file
Open in desktop
File renamed without changes.
0 google/cloud/pubsub/connection.py → pubsub/google/cloud/pubsub/connection.py
Show comments
View file
Open in desktop
File renamed without changes.
0 google/cloud/pubsub/iam.py → pubsub/google/cloud/pubsub/iam.py
Show comments
View file
Open in desktop
File renamed without changes.
0 google/cloud/pubsub/message.py → pubsub/google/cloud/pubsub/message.py
Show comments
View file
Open in desktop
File renamed without changes.
0 google/cloud/pubsub/subscription.py → pubsub/google/cloud/pubsub/subscription.py
Show comments
View file
Open in desktop
File renamed without changes.
0 google/cloud/pubsub/topic.py → pubsub/google/cloud/pubsub/topic.py
Show comments
View file
Open in desktop
File renamed without changes.
72 changes: 72 additions & 0 deletions 72 pubsub/setup.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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': '[email protected]',
'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',
'grpcio >= 1.0.0',
'google-gax >= 0.14.1, < 0.15dev',
'gapic-google-pubsub-v1 >= 0.9.0, < 0.10dev',
'grpc-google-pubsub-v1 >= 0.9.0, < 0.10dev',
]

setup(
name='google-cloud-pubsub',
version='0.20.0dev',
description='Python Client for Google Cloud Pub/Sub',
long_description=README,
namespace_packages=[
'google',
'google.cloud',
],
packages=find_packages(),
install_requires=REQUIREMENTS,
**SETUP_BASE
)
30 changes: 30 additions & 0 deletions 30 pubsub/tox.ini
Show comments
View file
Open in desktop
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.pubsub \
--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
0 unit_tests/pubsub/__init__.py → pubsub/unit_tests/__init__.py
Show comments
View file
Open in desktop
File renamed without changes.
0 unit_tests/pubsub/test__gax.py → pubsub/unit_tests/test__gax.py
Show comments
View file
Open in desktop
File renamed without changes.
0 unit_tests/pubsub/test__helpers.py → pubsub/unit_tests/test__helpers.py
Show comments
View file
Open in desktop
File renamed without changes.
0 unit_tests/pubsub/test_client.py → pubsub/unit_tests/test_client.py
Show comments
View file
Open in desktop
File renamed without changes.
0 unit_tests/pubsub/test_connection.py → pubsub/unit_tests/test_connection.py
Show comments
View file
Open in desktop
File renamed without changes.
0 unit_tests/pubsub/test_iam.py → pubsub/unit_tests/test_iam.py
Show comments
View file
Open in desktop
File renamed without changes.
0 unit_tests/pubsub/test_message.py → pubsub/unit_tests/test_message.py
Show comments
View file
Open in desktop
File renamed without changes.
0 unit_tests/pubsub/test_subscription.py → pubsub/unit_tests/test_subscription.py
Show comments
View file
Open in desktop
File renamed without changes.
0 unit_tests/pubsub/test_topic.py → pubsub/unit_tests/test_topic.py
Show comments
View file
Open in desktop
File renamed without changes.
1 change: 1 addition & 0 deletions 1 scripts/verify_included_modules.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
'bigtable',
'core',
'datastore',
'pubsub',
'storage',
)

Expand Down
3 changes: 1 addition & 2 deletions 3 setup.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,13 @@
'google-cloud-bigtable',
'google-cloud-core',
'google-cloud-datastore',
'google-cloud-pubsub',
'google-cloud-storage',
]

GRPC_PACKAGES = [
'grpcio >= 1.0.0',
'google-gax >= 0.14.1, < 0.15dev',
'gapic-google-pubsub-v1 >= 0.9.0, < 0.10dev',
'grpc-google-pubsub-v1 >= 0.9.0, < 0.10dev',
'gapic-google-logging-v2 >= 0.9.0, < 0.10dev',
'grpc-google-logging-v2 >= 0.9.0, < 0.10dev',
]
Expand Down
7 changes: 7 additions & 0 deletions 7 tox.ini
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ deps =
{toxinidir}/storage
{toxinidir}/datastore
{toxinidir}/bigquery
{toxinidir}/pubsub
pytest
covercmd =
py.test --quiet \
Expand Down Expand Up @@ -46,6 +47,12 @@ covercmd =
--cov-append \
--cov-config {toxinidir}/.coveragerc \
bigquery/unit_tests
py.test --quiet \
--cov=google.cloud \
--cov=unit_tests \
--cov-append \
--cov-config {toxinidir}/.coveragerc \
pubsub/unit_tests
coverage report --show-missing --fail-under=100

[testenv]
Expand Down
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.