diff --git a/.travis.yml b/.travis.yml index f48275f47025..fd48a9497082 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ script: - (cd bigquery && tox -e py27) - (cd pubsub && tox -e py27) - (cd logging && tox -e py27) + - (cd dns && tox -e py27) - tox -e py34 - (cd core && tox -e py34) - (cd bigtable && tox -e py34) @@ -21,6 +22,7 @@ script: - (cd bigquery && tox -e py34) - (cd pubsub && tox -e py34) - (cd logging && tox -e py34) + - (cd dns && tox -e py34) - tox -e lint - tox -e cover - (cd core && tox -e cover) @@ -30,6 +32,7 @@ script: - (cd bigquery && tox -e cover) - (cd pubsub && tox -e cover) - (cd logging && tox -e cover) + - (cd dns && tox -e cover) - tox -e system-tests - tox -e system-tests3 - scripts/update_docs.sh diff --git a/dns/.coveragerc b/dns/.coveragerc new file mode 100644 index 000000000000..a54b99aa14b7 --- /dev/null +++ b/dns/.coveragerc @@ -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__ diff --git a/dns/MANIFEST.in b/dns/MANIFEST.in new file mode 100644 index 000000000000..cb3a2b9ef4fa --- /dev/null +++ b/dns/MANIFEST.in @@ -0,0 +1,4 @@ +include README.rst +graft google +graft unit_tests +global-exclude *.pyc diff --git a/dns/README.rst b/dns/README.rst new file mode 100644 index 000000000000..1f76c88cf343 --- /dev/null +++ b/dns/README.rst @@ -0,0 +1,44 @@ +Python Client for Google Cloud DNS +================================== + + Python idiomatic client for `Google Cloud DNS`_ + +.. _Google Cloud DNS: https://cloud.google.com/dns/ + +- `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-dns + +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 Cloud `DNS`_ API (`DNS API docs`_) provides methods that you can use to +manage DNS for your applications. + +.. _DNS: https://cloud.google.com/dns/ +.. _DNS API docs: https://cloud.google.com/dns/docs/apis + +See the ``google-cloud-python`` API `DNS documentation`_ to learn +how to manage DNS records using this Client Library. + +.. _DNS documentation: https://google-cloud-python.readthedocs.io/en/stable/dns-usage.html diff --git a/dns/google/__init__.py b/dns/google/__init__.py new file mode 100644 index 000000000000..b2b833373882 --- /dev/null +++ b/dns/google/__init__.py @@ -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__) diff --git a/dns/google/cloud/__init__.py b/dns/google/cloud/__init__.py new file mode 100644 index 000000000000..8ac7b74af136 --- /dev/null +++ b/dns/google/cloud/__init__.py @@ -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__) diff --git a/google/cloud/dns/__init__.py b/dns/google/cloud/dns/__init__.py similarity index 100% rename from google/cloud/dns/__init__.py rename to dns/google/cloud/dns/__init__.py diff --git a/google/cloud/dns/changes.py b/dns/google/cloud/dns/changes.py similarity index 100% rename from google/cloud/dns/changes.py rename to dns/google/cloud/dns/changes.py diff --git a/google/cloud/dns/client.py b/dns/google/cloud/dns/client.py similarity index 100% rename from google/cloud/dns/client.py rename to dns/google/cloud/dns/client.py diff --git a/google/cloud/dns/connection.py b/dns/google/cloud/dns/connection.py similarity index 100% rename from google/cloud/dns/connection.py rename to dns/google/cloud/dns/connection.py diff --git a/google/cloud/dns/resource_record_set.py b/dns/google/cloud/dns/resource_record_set.py similarity index 100% rename from google/cloud/dns/resource_record_set.py rename to dns/google/cloud/dns/resource_record_set.py diff --git a/google/cloud/dns/zone.py b/dns/google/cloud/dns/zone.py similarity index 100% rename from google/cloud/dns/zone.py rename to dns/google/cloud/dns/zone.py diff --git a/dns/setup.py b/dns/setup.py new file mode 100644 index 000000000000..c6d669a06847 --- /dev/null +++ b/dns/setup.py @@ -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-dns', + version='0.20.0dev', + description='Python Client for Google Cloud DNS', + long_description=README, + namespace_packages=[ + 'google', + 'google.cloud', + ], + packages=find_packages(), + install_requires=REQUIREMENTS, + **SETUP_BASE +) diff --git a/dns/tox.ini b/dns/tox.ini new file mode 100644 index 000000000000..125c7ec7ef15 --- /dev/null +++ b/dns/tox.ini @@ -0,0 +1,30 @@ +[tox] +envlist = + py27,py34,py35,cover + +[testing] +deps = + {toxinidir}/../core + pytest +covercmd = + py.test --quiet \ + --cov=google.cloud.dns \ + --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 diff --git a/unit_tests/dns/__init__.py b/dns/unit_tests/__init__.py similarity index 100% rename from unit_tests/dns/__init__.py rename to dns/unit_tests/__init__.py diff --git a/unit_tests/dns/test_changes.py b/dns/unit_tests/test_changes.py similarity index 100% rename from unit_tests/dns/test_changes.py rename to dns/unit_tests/test_changes.py diff --git a/unit_tests/dns/test_client.py b/dns/unit_tests/test_client.py similarity index 100% rename from unit_tests/dns/test_client.py rename to dns/unit_tests/test_client.py diff --git a/unit_tests/dns/test_connection.py b/dns/unit_tests/test_connection.py similarity index 100% rename from unit_tests/dns/test_connection.py rename to dns/unit_tests/test_connection.py diff --git a/unit_tests/dns/test_resource_record_set.py b/dns/unit_tests/test_resource_record_set.py similarity index 100% rename from unit_tests/dns/test_resource_record_set.py rename to dns/unit_tests/test_resource_record_set.py diff --git a/unit_tests/dns/test_zone.py b/dns/unit_tests/test_zone.py similarity index 100% rename from unit_tests/dns/test_zone.py rename to dns/unit_tests/test_zone.py diff --git a/scripts/verify_included_modules.py b/scripts/verify_included_modules.py index a7471162d3de..8484e66a5337 100644 --- a/scripts/verify_included_modules.py +++ b/scripts/verify_included_modules.py @@ -63,6 +63,7 @@ 'bigtable', 'core', 'datastore', + 'dns', 'logging', 'pubsub', 'storage', diff --git a/setup.py b/setup.py index f2ed94ddb062..0855da714c45 100644 --- a/setup.py +++ b/setup.py @@ -54,6 +54,7 @@ 'google-cloud-bigtable', 'google-cloud-core', 'google-cloud-datastore', + 'google-cloud-dns', 'google-cloud-logging', 'google-cloud-pubsub', 'google-cloud-storage', diff --git a/tox.ini b/tox.ini index ec17f620abb2..65041c500343 100644 --- a/tox.ini +++ b/tox.ini @@ -11,6 +11,7 @@ deps = {toxinidir}/bigquery {toxinidir}/pubsub {toxinidir}/logging + {toxinidir}/dns pytest covercmd = py.test --quiet \ @@ -60,6 +61,12 @@ covercmd = --cov-append \ --cov-config {toxinidir}/.coveragerc \ logging/unit_tests + py.test --quiet \ + --cov=google.cloud \ + --cov=unit_tests \ + --cov-append \ + --cov-config {toxinidir}/.coveragerc \ + dns/unit_tests coverage report --show-missing --fail-under=100 [testenv]