diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9ee60f7..c07f148 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:aea14a583128771ae8aefa364e1652f3c56070168ef31beb203534222d842b8b + digest: sha256:0ffe3bdd6c7159692df5f7744da74e5ef19966288a6bf76023e8e04e0c424d7d diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 59a3e00..611c6ef 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -41,7 +41,7 @@ python3 -m pip install --upgrade --quiet nox python3 -m nox --version # If this is a continuous build, send the test log to the FlakyBot. -# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. +# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then cleanup() { chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/.kokoro/test-samples-impl.sh b/.kokoro/test-samples-impl.sh index 311a8d5..8a324c9 100755 --- a/.kokoro/test-samples-impl.sh +++ b/.kokoro/test-samples-impl.sh @@ -80,7 +80,7 @@ for file in samples/**/requirements.txt; do EXIT=$? # If this is a periodic build, send the test log to the FlakyBot. - # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot. + # See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot. if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot $KOKORO_GFILE_DIR/linux_amd64/flakybot diff --git a/CHANGELOG.md b/CHANGELOG.md index d9732fa..c3b48a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-dns/#history +### [0.33.1](https://www.github.com/googleapis/python-dns/compare/v0.33.0...v0.33.1) (2021-09-20) + + +### Bug Fixes + +* remove six ([#115](https://www.github.com/googleapis/python-dns/issues/115)) ([95f94ef](https://www.github.com/googleapis/python-dns/commit/95f94ef4d75273deae56dc8ecfcc708e2be84d03)) + ## [0.33.0](https://www.github.com/googleapis/python-dns/compare/v0.32.3...v0.33.0) (2021-07-23) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index fabb623..4bff766 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -50,9 +50,9 @@ You'll have to create a development environment using a Git checkout: # Configure remotes such that you can pull changes from the googleapis/python-dns # repository into your local repository. $ git remote add upstream git@github.com:googleapis/python-dns.git - # fetch and merge changes from upstream into master + # fetch and merge changes from upstream into main $ git fetch upstream - $ git merge upstream/master + $ git merge upstream/main Now your local repo is set up such that you will push changes to your GitHub repo, from which you can submit a pull request. @@ -110,12 +110,12 @@ Coding Style variables:: export GOOGLE_CLOUD_TESTING_REMOTE="upstream" - export GOOGLE_CLOUD_TESTING_BRANCH="master" + export GOOGLE_CLOUD_TESTING_BRANCH="main" By doing this, you are specifying the location of the most up-to-date - version of ``python-dns``. The the suggested remote name ``upstream`` - should point to the official ``googleapis`` checkout and the - the branch should be the main branch on that remote (``master``). + version of ``python-dns``. The + remote name ``upstream`` should point to the official ``googleapis`` + checkout and the branch should be the default branch on that remote (``main``). - This repository contains configuration for the `pre-commit `__ tool, which automates checking @@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the ``README``. Due to the reStructuredText (``rst``) parser used by PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst`` instead of -``https://github.com/googleapis/python-dns/blob/master/CONTRIBUTING.rst``) +``https://github.com/googleapis/python-dns/blob/main/CONTRIBUTING.rst``) may cause problems creating links or rendering the description. .. _description on PyPI: https://pypi.org/project/google-cloud-dns @@ -234,7 +234,7 @@ We support: Supported versions can be found in our ``noxfile.py`` `config`_. -.. _config: https://github.com/googleapis/python-dns/blob/master/noxfile.py +.. _config: https://github.com/googleapis/python-dns/blob/main/noxfile.py We also explicitly decided to support Python 3 beginning with version 3.6. diff --git a/README.rst b/README.rst index dec61f3..5a23005 100644 --- a/README.rst +++ b/README.rst @@ -10,7 +10,7 @@ manage DNS for your applications. - `Product Documentation`_ .. |alpha| image:: https://img.shields.io/badge/support-alpha-orange.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#alpha-support + :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#alpha-support .. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-dns.svg :target: https://pypi.org/project/google-cloud-dns/ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-dns.svg diff --git a/docs/conf.py b/docs/conf.py index 68e9222..3d44936 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -76,8 +76,8 @@ # The encoding of source files. # source_encoding = 'utf-8-sig' -# The master toctree document. -master_doc = "index" +# The root toctree document. +root_doc = "index" # General information about the project. project = "google-cloud-dns" @@ -110,6 +110,7 @@ # directories to ignore when looking for source files. exclude_patterns = [ "_build", + "**/.nox/**/*", "samples/AUTHORING_GUIDE.md", "samples/CONTRIBUTING.md", "samples/snippets/README.rst", @@ -279,7 +280,7 @@ # author, documentclass [howto, manual, or own class]). latex_documents = [ ( - master_doc, + root_doc, "google-cloud-dns.tex", "google-cloud-dns Documentation", author, @@ -313,7 +314,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, "google-cloud-dns", "google-cloud-dns Documentation", [author], 1,) + (root_doc, "google-cloud-dns", "google-cloud-dns Documentation", [author], 1,) ] # If true, show URL addresses after external links. @@ -327,7 +328,7 @@ # dir menu entry, description, category) texinfo_documents = [ ( - master_doc, + root_doc, "google-cloud-dns", "google-cloud-dns Documentation", author, diff --git a/google/cloud/dns/changes.py b/google/cloud/dns/changes.py index 759997c..aaf03b6 100644 --- a/google/cloud/dns/changes.py +++ b/google/cloud/dns/changes.py @@ -14,8 +14,6 @@ """Define API ResourceRecordSets.""" -import six - from google.cloud._helpers import _rfc3339_to_datetime from google.cloud.exceptions import NotFound from google.cloud.dns.resource_record_set import ResourceRecordSet @@ -105,7 +103,7 @@ def name(self, value): :type value: str :param value: New name for the changeset. """ - if not isinstance(value, six.string_types): + if not isinstance(value, str): raise ValueError("Pass a string") self._properties["id"] = value diff --git a/google/cloud/dns/zone.py b/google/cloud/dns/zone.py index fb37f6b..71ab81c 100644 --- a/google/cloud/dns/zone.py +++ b/google/cloud/dns/zone.py @@ -14,8 +14,6 @@ """Define API ManagedZones.""" -import six - from google.api_core import page_iterator from google.cloud._helpers import _rfc3339_to_datetime from google.cloud.exceptions import NotFound @@ -143,7 +141,7 @@ def description(self, value): :raises: ValueError for invalid value types. """ - if not isinstance(value, six.string_types) and value is not None: + if not isinstance(value, str) and value is not None: raise ValueError("Pass a string, or None") self._properties["description"] = value @@ -170,7 +168,7 @@ def name_server_set(self, value): :raises: ValueError for invalid value types. """ - if not isinstance(value, six.string_types) and value is not None: + if not isinstance(value, str) and value is not None: raise ValueError("Pass a string, or None") self._properties["nameServerSet"] = value diff --git a/noxfile.py b/noxfile.py index d896e7f..935a924 100644 --- a/noxfile.py +++ b/noxfile.py @@ -84,9 +84,15 @@ def default(session): constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install("asyncmock", "pytest-asyncio", "-c", constraints_path) - - session.install("mock", "pytest", "pytest-cov", "-c", constraints_path) + session.install( + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", + "-c", + constraints_path, + ) session.install("-e", ".", "-c", constraints_path) diff --git a/owlbot.py b/owlbot.py index 85a4fda..0db9e0e 100644 --- a/owlbot.py +++ b/owlbot.py @@ -18,6 +18,7 @@ import synthtool as s from synthtool import gcp +from synthtool.languages import python common = gcp.CommonTemplates() @@ -27,4 +28,7 @@ templated_files = common.py_library(microgenerator=True) s.move(templated_files, excludes=["docs/multiprocessing.rst"]) +python.py_samples(skip_readmes=True) + s.shell.run(["nox", "-s", "blacken"], hide_output=False) + diff --git a/renovate.json b/renovate.json index c048955..c21036d 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,9 @@ { "extends": [ - "config:base", ":preserveSemverRanges" + "config:base", + "group:all", + ":preserveSemverRanges", + ":disableDependencyDashboard" ], "ignorePaths": [".pre-commit-config.yaml"], "pip_requirements": { diff --git a/scripts/readme-gen/templates/install_deps.tmpl.rst b/scripts/readme-gen/templates/install_deps.tmpl.rst index a0406db..275d649 100644 --- a/scripts/readme-gen/templates/install_deps.tmpl.rst +++ b/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -12,7 +12,7 @@ Install Dependencies .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup -#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. +#. Create a virtualenv. Samples are compatible with Python 3.6+. .. code-block:: bash diff --git a/setup.py b/setup.py index fc05b3f..bcd82c5 100644 --- a/setup.py +++ b/setup.py @@ -22,13 +22,18 @@ name = "google-cloud-dns" description = "Google Cloud DNS API client library" -version = "0.33.0" +version = "0.33.1" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' # 'Development Status :: 5 - Production/Stable' release_status = "Development Status :: 3 - Alpha" -dependencies = ["google-cloud-core >= 1.3.0, < 3.0dev"] +dependencies = [ + # NOTE: Maintainers, please do not require google-cloud-core>=2.x.x + # Until this issue is closed + # https://github.com/googleapis/google-cloud-python/issues/10566 + "google-cloud-core >= 1.3.0, < 3.0dev", +] extras = {} diff --git a/tests/unit/test__http.py b/tests/unit/test__http.py index 479ccc5..3da656d 100644 --- a/tests/unit/test__http.py +++ b/tests/unit/test__http.py @@ -28,8 +28,8 @@ def _make_one(self, *args, **kw): return self._get_target_class()(*args, **kw) def test_build_api_url_no_extra_query_params(self): - from six.moves.urllib.parse import parse_qsl - from six.moves.urllib.parse import urlsplit + from urllib.parse import parse_qsl + from urllib.parse import urlsplit conn = self._make_one(object()) uri = conn.build_api_url("/foo") @@ -42,8 +42,8 @@ def test_build_api_url_no_extra_query_params(self): self.assertEqual(parms, {}) def test_build_api_url_w_custom_endpoint(self): - from six.moves.urllib.parse import parse_qsl - from six.moves.urllib.parse import urlsplit + from urllib.parse import parse_qsl + from urllib.parse import urlsplit custom_endpoint = "https://foo-dns.googleapis.com" conn = self._make_one(object(), api_endpoint=custom_endpoint) @@ -57,8 +57,8 @@ def test_build_api_url_w_custom_endpoint(self): self.assertEqual(parms, {}) def test_build_api_url_w_extra_query_params(self): - from six.moves.urllib.parse import parse_qsl - from six.moves.urllib.parse import urlsplit + from urllib.parse import parse_qsl + from urllib.parse import urlsplit conn = self._make_one(object()) uri = conn.build_api_url("/foo", {"bar": "baz"}) diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index aaa5a8a..81930cd 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -192,7 +192,6 @@ def test_quotas_w_kind_key(self): self.assertEqual(req["path"], "/%s" % PATH) def test_list_zones_defaults(self): - import six from google.cloud.dns.zone import ManagedZone ID_1 = "123" @@ -225,7 +224,7 @@ def test_list_zones_defaults(self): conn = client._connection = _Connection(DATA) iterator = client.list_zones() - page = six.next(iterator.pages) + page = next(iterator.pages) zones = list(page) token = iterator.next_page_token @@ -243,7 +242,6 @@ def test_list_zones_defaults(self): self.assertEqual(req["path"], "/%s" % PATH) def test_list_zones_explicit(self): - import six from google.cloud.dns.zone import ManagedZone ID_1 = "123" @@ -275,7 +273,7 @@ def test_list_zones_explicit(self): conn = client._connection = _Connection(DATA) iterator = client.list_zones(max_results=3, page_token=TOKEN) - page = six.next(iterator.pages) + page = next(iterator.pages) zones = list(page) token = iterator.next_page_token diff --git a/tests/unit/test_zone.py b/tests/unit/test_zone.py index 21d55bc..2b240bb 100644 --- a/tests/unit/test_zone.py +++ b/tests/unit/test_zone.py @@ -412,7 +412,6 @@ def test_delete_w_alternate_client(self): self.assertEqual(req["path"], "/%s" % PATH) def test_list_resource_record_sets_defaults(self): - import six from google.cloud.dns.resource_record_set import ResourceRecordSet PATH = "projects/%s/managedZones/%s/rrsets" % (self.PROJECT, self.ZONE_NAME) @@ -450,7 +449,7 @@ def test_list_resource_record_sets_defaults(self): iterator = zone.list_resource_record_sets() self.assertIs(zone, iterator.zone) - page = six.next(iterator.pages) + page = next(iterator.pages) rrsets = list(page) token = iterator.next_page_token @@ -469,7 +468,6 @@ def test_list_resource_record_sets_defaults(self): self.assertEqual(req["path"], "/%s" % PATH) def test_list_resource_record_sets_explicit(self): - import six from google.cloud.dns.resource_record_set import ResourceRecordSet PATH = "projects/%s/managedZones/%s/rrsets" % (self.PROJECT, self.ZONE_NAME) @@ -510,7 +508,7 @@ def test_list_resource_record_sets_explicit(self): max_results=3, page_token=TOKEN, client=client2 ) self.assertIs(zone, iterator.zone) - page = six.next(iterator.pages) + page = next(iterator.pages) rrsets = list(page) token = iterator.next_page_token @@ -574,7 +572,6 @@ def _get_changes(self, token, changes_name): return result def test_list_changes_defaults(self): - import six from google.cloud.dns.changes import Changes from google.cloud.dns.resource_record_set import ResourceRecordSet @@ -590,7 +587,7 @@ def test_list_changes_defaults(self): iterator = zone.list_changes() self.assertIs(zone, iterator.zone) - page = six.next(iterator.pages) + page = next(iterator.pages) changes = list(page) token = iterator.next_page_token @@ -625,7 +622,6 @@ def test_list_changes_defaults(self): self.assertEqual(req["path"], "/%s" % (path,)) def test_list_changes_explicit(self): - import six from google.cloud.dns.changes import Changes from google.cloud.dns.resource_record_set import ResourceRecordSet @@ -644,7 +640,7 @@ def test_list_changes_explicit(self): max_results=3, page_token=page_token, client=client2 ) self.assertIs(zone, iterator.zone) - page = six.next(iterator.pages) + page = next(iterator.pages) changes = list(page) token = iterator.next_page_token