Skip to content

Commit

Permalink
fix(deps): require google-api-core >= 1.31.5, >= 2.3.2 on v1 release (#…
Browse files Browse the repository at this point in the history
…1166)

* chore(deps): allow google-api-core v2 on v1 release

* chore: also update cloud-core

* test: update tests to support latest google-cloud-core (#276)

`google-cloud-core` version 1.4.2 populates `prettyPrint=false` by
default. Update the connection tests to expect a value for
`prettyPrint`.

* ci: fix docs build

* chore: update system tests and samples to use and @google.com email address (#942)

* chore: update system tests and samples to use and @google.com email address

* Add group prefix

* fixed access entry some more

Co-authored-by: Tim Swast <swast@google.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
Co-authored-by: Jim Fulton <jim@jimfulton.info>
  • Loading branch information
4 people committed Mar 25, 2022
1 parent 3bd9672 commit 34d9bec
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 43 deletions.
35 changes: 1 addition & 34 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def blacken(session):
def docs(session):
"""Build the docs."""

session.install("ipython", "recommonmark", "sphinx", "sphinx_rtd_theme")
session.install("ipython", "recommonmark", "sphinx<3.0.0", "sphinx_rtd_theme")
session.install("google-cloud-storage")
session.install("-e", ".[all]")

Expand All @@ -223,36 +223,3 @@ def docs(session):
os.path.join("docs", ""),
os.path.join("docs", "_build", "html", ""),
)


@nox.session(python="3.8")
def docfx(session):
"""Build the docfx yaml files for this library."""

session.install("-e", ".")
session.install("sphinx", "alabaster", "recommonmark", "sphinx-docfx-yaml")

shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
session.run(
"sphinx-build",
"-T", # show full traceback on exception
"-N", # no colors
"-D",
(
"extensions=sphinx.ext.autodoc,"
"sphinx.ext.autosummary,"
"docfx_yaml.extension,"
"sphinx.ext.intersphinx,"
"sphinx.ext.coverage,"
"sphinx.ext.napoleon,"
"sphinx.ext.todo,"
"sphinx.ext.viewcode,"
"recommonmark"
),
"-b",
"html",
"-d",
os.path.join("docs", "_build", "doctrees", ""),
os.path.join("docs", ""),
os.path.join("docs", "_build", "html", ""),
)
4 changes: 2 additions & 2 deletions samples/update_dataset_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def update_dataset_access(dataset_id):

entry = bigquery.AccessEntry(
role="READER",
entity_type="userByEmail",
entity_id="sample.bigquery.dev@gmail.com",
entity_type="groupByEmail",
entity_id="cloud-developer-relations@google.com",
)

entries = list(dataset.access_entries)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
release_status = "Development Status :: 5 - Production/Stable"
dependencies = [
'enum34; python_version < "3.4"',
"google-api-core >= 1.21.0, < 2.0dev",
"google-cloud-core >= 1.4.1, < 2.0dev",
"google-api-core >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0",
"google-cloud-core >= 1.4.1, < 3.0dev",
"google-resumable-media >= 0.6.0, < 2.0dev",
"six >=1.13.0,< 2.0.0dev",
]
Expand Down
28 changes: 23 additions & 5 deletions tests/unit/test__http.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,33 @@ 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

conn = self._make_one(object())
URI = "/".join([conn.DEFAULT_API_ENDPOINT, "bigquery", conn.API_VERSION, "foo"])
self.assertEqual(conn.build_api_url("/foo"), URI)
uri = conn.build_api_url("/foo")
scheme, netloc, path, qs, _ = urlsplit(uri)
self.assertEqual("%s://%s" % (scheme, netloc), conn.API_BASE_URL)
self.assertEqual(path, "/".join(["", "bigquery", conn.API_VERSION, "foo"]))
parms = dict(parse_qsl(qs))
pretty_print = parms.pop("prettyPrint", "false")
self.assertEqual(pretty_print, "false")
self.assertEqual(parms, {})

def test_build_api_url_w_custom_endpoint(self):
custom_endpoint = "https://www.foo-googleapis.com"
from six.moves.urllib.parse import parse_qsl
from six.moves.urllib.parse import urlsplit

custom_endpoint = "https://foo-bigquery.googleapis.com"
conn = self._make_one(object(), api_endpoint=custom_endpoint)
URI = "/".join([custom_endpoint, "bigquery", conn.API_VERSION, "foo"])
self.assertEqual(conn.build_api_url("/foo"), URI)
uri = conn.build_api_url("/foo")
scheme, netloc, path, qs, _ = urlsplit(uri)
self.assertEqual("%s://%s" % (scheme, netloc), custom_endpoint)
self.assertEqual(path, "/".join(["", "bigquery", conn.API_VERSION, "foo"]))
parms = dict(parse_qsl(qs))
pretty_print = parms.pop("prettyPrint", "false")
self.assertEqual(pretty_print, "false")
self.assertEqual(parms, {})

def test_build_api_url_w_extra_query_params(self):
from six.moves.urllib.parse import parse_qsl
Expand Down

0 comments on commit 34d9bec

Please sign in to comment.