We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Expand the list of dependencies to run pre-release tests against
Context: https://github.com/googleapis/python-bigquery/issues/885

BigQuery Python client implicitly depended on `pytz` - this dependency was installed via `google-api-core` dependency. However, when `google-api-core` dropped `pytz` in the 2.0 release, users that upgraded that dependency suddenly started seeing import errors.

This should have been caught by pre-release tests, but at the moment we only do so for `pyarrow`, `pandas`, and `grpcio` dependencies. As discussed offline, this list should be extended with at least `google-api-core` and `google-clod-core` dependencies.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `noxfile.py`
Content:
```
1 # Copyright 2016 Google LLC
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 
15 from __future__ import absolute_import
16 
17 import pathlib
18 import os
19 import shutil
20 
21 import nox
22 
23 
24 PYTYPE_VERSION = "pytype==2021.4.9"
25 BLACK_VERSION = "black==19.10b0"
26 BLACK_PATHS = ("docs", "google", "samples", "tests", "noxfile.py", "setup.py")
27 
28 DEFAULT_PYTHON_VERSION = "3.8"
29 SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
30 UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]
31 CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
32 
33 # 'docfx' is excluded since it only needs to run in 'docs-presubmit'
34 nox.options.sessions = [
35     "unit_noextras",
36     "unit",
37     "system",
38     "snippets",
39     "cover",
40     "lint",
41     "lint_setup_py",
42     "blacken",
43     "pytype",
44     "docs",
45 ]
46 
47 
48 def default(session, install_extras=True):
49     """Default unit test session.
50 
51     This is intended to be run **without** an interpreter set, so
52     that the current ``python`` (on the ``PATH``) or the version of
53     Python corresponding to the ``nox`` binary the ``PATH`` can
54     run the tests.
55     """
56     constraints_path = str(
57         CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
58     )
59 
60     # Install all test dependencies, then install local packages in-place.
61     session.install(
62         "mock",
63         "pytest",
64         "google-cloud-testutils",
65         "pytest-cov",
66         "freezegun",
67         "-c",
68         constraints_path,
69     )
70 
71     install_target = ".[all]" if install_extras else "."
72     session.install("-e", install_target, "-c", constraints_path)
73 
74     session.install("ipython", "-c", constraints_path)
75 
76     # Run py.test against the unit tests.
77     session.run(
78         "py.test",
79         "--quiet",
80         "--cov=google/cloud/bigquery",
81         "--cov=tests/unit",
82         "--cov-append",
83         "--cov-config=.coveragerc",
84         "--cov-report=",
85         "--cov-fail-under=0",
86         os.path.join("tests", "unit"),
87         *session.posargs,
88     )
89 
90 
91 @nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
92 def unit(session):
93     """Run the unit test suite."""
94     default(session)
95 
96 
97 @nox.session(python=[UNIT_TEST_PYTHON_VERSIONS[0], UNIT_TEST_PYTHON_VERSIONS[-1]])
98 def unit_noextras(session):
99     """Run the unit test suite."""
100 
101     # Install optional dependencies that are out-of-date.
102     # https://github.com/googleapis/python-bigquery/issues/933
103     # There is no pyarrow 1.0.0 package for Python 3.9.
104     if session.python == UNIT_TEST_PYTHON_VERSIONS[0]:
105         session.install("pyarrow==1.0.0")
106 
107     default(session, install_extras=False)
108 
109 
110 @nox.session(python=DEFAULT_PYTHON_VERSION)
111 def pytype(session):
112     """Run type checks."""
113     # An indirect dependecy attrs==21.1.0 breaks the check, and installing a less
114     # recent version avoids the error until a possibly better fix is found.
115     # https://github.com/googleapis/python-bigquery/issues/655
116     session.install("attrs==20.3.0")
117     session.install("-e", ".[all]")
118     session.install("ipython")
119     session.install(PYTYPE_VERSION)
120     session.run("pytype")
121 
122 
123 @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
124 def system(session):
125     """Run the system test suite."""
126 
127     constraints_path = str(
128         CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
129     )
130 
131     # Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.
132     if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false":
133         session.skip("RUN_SYSTEM_TESTS is set to false, skipping")
134 
135     # Sanity check: Only run system tests if the environment variable is set.
136     if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""):
137         session.skip("Credentials must be set via environment variable.")
138 
139     # Use pre-release gRPC for system tests.
140     session.install("--pre", "grpcio", "-c", constraints_path)
141 
142     # Install all test dependencies, then install local packages in place.
143     session.install(
144         "mock", "pytest", "psutil", "google-cloud-testutils", "-c", constraints_path
145     )
146     if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "") == "true":
147         # mTLS test requires pyopenssl and latest google-cloud-storage
148         session.install("google-cloud-storage", "pyopenssl")
149     else:
150         session.install("google-cloud-storage", "-c", constraints_path)
151 
152     # Data Catalog needed for the column ACL test with a real Policy Tag.
153     session.install("google-cloud-datacatalog", "-c", constraints_path)
154 
155     session.install("-e", ".[all]", "-c", constraints_path)
156     session.install("ipython", "-c", constraints_path)
157 
158     # Run py.test against the system tests.
159     session.run("py.test", "--quiet", os.path.join("tests", "system"), *session.posargs)
160 
161 
162 @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
163 def snippets(session):
164     """Run the snippets test suite."""
165 
166     # Check the value of `RUN_SNIPPETS_TESTS` env var. It defaults to true.
167     if os.environ.get("RUN_SNIPPETS_TESTS", "true") == "false":
168         session.skip("RUN_SNIPPETS_TESTS is set to false, skipping")
169 
170     constraints_path = str(
171         CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
172     )
173 
174     # Install all test dependencies, then install local packages in place.
175     session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path)
176     session.install("google-cloud-storage", "-c", constraints_path)
177     session.install("grpcio", "-c", constraints_path)
178 
179     session.install("-e", ".[all]", "-c", constraints_path)
180 
181     # Run py.test against the snippets tests.
182     # Skip tests in samples/snippets, as those are run in a different session
183     # using the nox config from that directory.
184     session.run("py.test", os.path.join("docs", "snippets.py"), *session.posargs)
185     session.run(
186         "py.test",
187         "samples",
188         "--ignore=samples/snippets",
189         "--ignore=samples/geography",
190         *session.posargs,
191     )
192 
193 
194 @nox.session(python=DEFAULT_PYTHON_VERSION)
195 def cover(session):
196     """Run the final coverage report.
197 
198     This outputs the coverage report aggregating coverage from the unit
199     test runs (not system test runs), and then erases coverage data.
200     """
201     session.install("coverage", "pytest-cov")
202     session.run("coverage", "report", "--show-missing", "--fail-under=100")
203     session.run("coverage", "erase")
204 
205 
206 @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
207 def prerelease_deps(session):
208     """Run all tests with prerelease versions of dependencies installed.
209 
210     https://github.com/googleapis/python-bigquery/issues/95
211     """
212     # PyArrow prerelease packages are published to an alternative PyPI host.
213     # https://arrow.apache.org/docs/python/install.html#installing-nightly-packages
214     session.install(
215         "--extra-index-url", "https://pypi.fury.io/arrow-nightlies/", "--pre", "pyarrow"
216     )
217     session.install("--pre", "grpcio", "pandas")
218     session.install(
219         "freezegun",
220         "google-cloud-datacatalog",
221         "google-cloud-storage",
222         "google-cloud-testutils",
223         "IPython",
224         "mock",
225         "psutil",
226         "pytest",
227         "pytest-cov",
228     )
229     session.install("-e", ".[all]")
230 
231     # Print out prerelease package versions.
232     session.run("python", "-c", "import grpc; print(grpc.__version__)")
233     session.run("python", "-c", "import pandas; print(pandas.__version__)")
234     session.run("python", "-c", "import pyarrow; print(pyarrow.__version__)")
235 
236     # Run all tests, except a few samples tests which require extra dependencies.
237     session.run("py.test", "tests/unit")
238     session.run("py.test", "tests/system")
239     session.run("py.test", "samples/tests")
240 
241 
242 @nox.session(python=DEFAULT_PYTHON_VERSION)
243 def lint(session):
244     """Run linters.
245 
246     Returns a failure if the linters find linting errors or sufficiently
247     serious code quality issues.
248     """
249 
250     session.install("flake8", BLACK_VERSION)
251     session.install("-e", ".")
252     session.run("flake8", os.path.join("google", "cloud", "bigquery"))
253     session.run("flake8", "tests")
254     session.run("flake8", os.path.join("docs", "samples"))
255     session.run("flake8", os.path.join("docs", "snippets.py"))
256     session.run("black", "--check", *BLACK_PATHS)
257 
258 
259 @nox.session(python=DEFAULT_PYTHON_VERSION)
260 def lint_setup_py(session):
261     """Verify that setup.py is valid (including RST check)."""
262 
263     session.install("docutils", "Pygments")
264     session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
265 
266 
267 @nox.session(python=DEFAULT_PYTHON_VERSION)
268 def blacken(session):
269     """Run black.
270     Format code to uniform standard.
271     """
272 
273     session.install(BLACK_VERSION)
274     session.run("black", *BLACK_PATHS)
275 
276 
277 @nox.session(python=DEFAULT_PYTHON_VERSION)
278 def docs(session):
279     """Build the docs."""
280 
281     session.install("ipython", "recommonmark", "sphinx==4.0.1", "sphinx_rtd_theme")
282     session.install("google-cloud-storage")
283     session.install("-e", ".[all]")
284 
285     shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
286     session.run(
287         "sphinx-build",
288         "-W",  # warnings as errors
289         "-T",  # show full traceback on exception
290         "-N",  # no colors
291         "-b",
292         "html",
293         "-d",
294         os.path.join("docs", "_build", "doctrees", ""),
295         os.path.join("docs", ""),
296         os.path.join("docs", "_build", "html", ""),
297     )
298 
299 
300 @nox.session(python=DEFAULT_PYTHON_VERSION)
301 def docfx(session):
302     """Build the docfx yaml files for this library."""
303 
304     session.install("-e", ".")
305     session.install(
306         "sphinx==4.0.1", "alabaster", "recommonmark", "gcp-sphinx-docfx-yaml"
307     )
308 
309     shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
310     session.run(
311         "sphinx-build",
312         "-T",  # show full traceback on exception
313         "-N",  # no colors
314         "-D",
315         (
316             "extensions=sphinx.ext.autodoc,"
317             "sphinx.ext.autosummary,"
318             "docfx_yaml.extension,"
319             "sphinx.ext.intersphinx,"
320             "sphinx.ext.coverage,"
321             "sphinx.ext.napoleon,"
322             "sphinx.ext.todo,"
323             "sphinx.ext.viewcode,"
324             "recommonmark"
325         ),
326         "-b",
327         "html",
328         "-d",
329         os.path.join("docs", "_build", "doctrees", ""),
330         os.path.join("docs", ""),
331         os.path.join("docs", "_build", "html", ""),
332     )
333
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/noxfile.py b/noxfile.py
--- a/noxfile.py
+++ b/noxfile.py
@@ -214,7 +214,15 @@
     session.install(
         "--extra-index-url", "https://pypi.fury.io/arrow-nightlies/", "--pre", "pyarrow"
     )
-    session.install("--pre", "grpcio", "pandas")
+    session.install(
+        "--pre",
+        "google-api-core",
+        "google-cloud-bigquery-storage",
+        "google-cloud-core",
+        "google-resumable-media",
+        "grpcio",
+        "pandas",
+    )
     session.install(
         "freezegun",
         "google-cloud-datacatalog",

{"golden_diff": "diff --git a/noxfile.py b/noxfile.py\n--- a/noxfile.py\n+++ b/noxfile.py\n@@ -214,7 +214,15 @@\n     session.install(\n         \"--extra-index-url\", \"https://pypi.fury.io/arrow-nightlies/\", \"--pre\", \"pyarrow\"\n     )\n-    session.install(\"--pre\", \"grpcio\", \"pandas\")\n+    session.install(\n+        \"--pre\",\n+        \"google-api-core\",\n+        \"google-cloud-bigquery-storage\",\n+        \"google-cloud-core\",\n+        \"google-resumable-media\",\n+        \"grpcio\",\n+        \"pandas\",\n+    )\n     session.install(\n         \"freezegun\",\n         \"google-cloud-datacatalog\",\n", "issue": "Expand the list of dependencies to run pre-release tests against\nContext: https://github.com/googleapis/python-bigquery/issues/885\r\n\r\nBigQuery Python client implicitly depended on `pytz` - this dependency was installed via `google-api-core` dependency. However, when `google-api-core` dropped `pytz` in the 2.0 release, users that upgraded that dependency suddenly started seeing import errors.\r\n\r\nThis should have been caught by pre-release tests, but at the moment we only do so for `pyarrow`, `pandas`, and `grpcio` dependencies. As discussed offline, this list should be extended with at least `google-api-core` and `google-clod-core` dependencies.\n", "before_files": [{"content": "# Copyright 2016 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom __future__ import absolute_import\n\nimport pathlib\nimport os\nimport shutil\n\nimport nox\n\n\nPYTYPE_VERSION = \"pytype==2021.4.9\"\nBLACK_VERSION = \"black==19.10b0\"\nBLACK_PATHS = (\"docs\", \"google\", \"samples\", \"tests\", \"noxfile.py\", \"setup.py\")\n\nDEFAULT_PYTHON_VERSION = \"3.8\"\nSYSTEM_TEST_PYTHON_VERSIONS = [\"3.8\"]\nUNIT_TEST_PYTHON_VERSIONS = [\"3.6\", \"3.7\", \"3.8\", \"3.9\"]\nCURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()\n\n# 'docfx' is excluded since it only needs to run in 'docs-presubmit'\nnox.options.sessions = [\n    \"unit_noextras\",\n    \"unit\",\n    \"system\",\n    \"snippets\",\n    \"cover\",\n    \"lint\",\n    \"lint_setup_py\",\n    \"blacken\",\n    \"pytype\",\n    \"docs\",\n]\n\n\ndef default(session, install_extras=True):\n    \"\"\"Default unit test session.\n\n    This is intended to be run **without** an interpreter set, so\n    that the current ``python`` (on the ``PATH``) or the version of\n    Python corresponding to the ``nox`` binary the ``PATH`` can\n    run the tests.\n    \"\"\"\n    constraints_path = str(\n        CURRENT_DIRECTORY / \"testing\" / f\"constraints-{session.python}.txt\"\n    )\n\n    # Install all test dependencies, then install local packages in-place.\n    session.install(\n        \"mock\",\n        \"pytest\",\n        \"google-cloud-testutils\",\n        \"pytest-cov\",\n        \"freezegun\",\n        \"-c\",\n        constraints_path,\n    )\n\n    install_target = \".[all]\" if install_extras else \".\"\n    session.install(\"-e\", install_target, \"-c\", constraints_path)\n\n    session.install(\"ipython\", \"-c\", constraints_path)\n\n    # Run py.test against the unit tests.\n    session.run(\n        \"py.test\",\n        \"--quiet\",\n        \"--cov=google/cloud/bigquery\",\n        \"--cov=tests/unit\",\n        \"--cov-append\",\n        \"--cov-config=.coveragerc\",\n        \"--cov-report=\",\n        \"--cov-fail-under=0\",\n        os.path.join(\"tests\", \"unit\"),\n        *session.posargs,\n    )\n\n\n@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)\ndef unit(session):\n    \"\"\"Run the unit test suite.\"\"\"\n    default(session)\n\n\n@nox.session(python=[UNIT_TEST_PYTHON_VERSIONS[0], UNIT_TEST_PYTHON_VERSIONS[-1]])\ndef unit_noextras(session):\n    \"\"\"Run the unit test suite.\"\"\"\n\n    # Install optional dependencies that are out-of-date.\n    # https://github.com/googleapis/python-bigquery/issues/933\n    # There is no pyarrow 1.0.0 package for Python 3.9.\n    if session.python == UNIT_TEST_PYTHON_VERSIONS[0]:\n        session.install(\"pyarrow==1.0.0\")\n\n    default(session, install_extras=False)\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef pytype(session):\n    \"\"\"Run type checks.\"\"\"\n    # An indirect dependecy attrs==21.1.0 breaks the check, and installing a less\n    # recent version avoids the error until a possibly better fix is found.\n    # https://github.com/googleapis/python-bigquery/issues/655\n    session.install(\"attrs==20.3.0\")\n    session.install(\"-e\", \".[all]\")\n    session.install(\"ipython\")\n    session.install(PYTYPE_VERSION)\n    session.run(\"pytype\")\n\n\n@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)\ndef system(session):\n    \"\"\"Run the system test suite.\"\"\"\n\n    constraints_path = str(\n        CURRENT_DIRECTORY / \"testing\" / f\"constraints-{session.python}.txt\"\n    )\n\n    # Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.\n    if os.environ.get(\"RUN_SYSTEM_TESTS\", \"true\") == \"false\":\n        session.skip(\"RUN_SYSTEM_TESTS is set to false, skipping\")\n\n    # Sanity check: Only run system tests if the environment variable is set.\n    if not os.environ.get(\"GOOGLE_APPLICATION_CREDENTIALS\", \"\"):\n        session.skip(\"Credentials must be set via environment variable.\")\n\n    # Use pre-release gRPC for system tests.\n    session.install(\"--pre\", \"grpcio\", \"-c\", constraints_path)\n\n    # Install all test dependencies, then install local packages in place.\n    session.install(\n        \"mock\", \"pytest\", \"psutil\", \"google-cloud-testutils\", \"-c\", constraints_path\n    )\n    if os.environ.get(\"GOOGLE_API_USE_CLIENT_CERTIFICATE\", \"\") == \"true\":\n        # mTLS test requires pyopenssl and latest google-cloud-storage\n        session.install(\"google-cloud-storage\", \"pyopenssl\")\n    else:\n        session.install(\"google-cloud-storage\", \"-c\", constraints_path)\n\n    # Data Catalog needed for the column ACL test with a real Policy Tag.\n    session.install(\"google-cloud-datacatalog\", \"-c\", constraints_path)\n\n    session.install(\"-e\", \".[all]\", \"-c\", constraints_path)\n    session.install(\"ipython\", \"-c\", constraints_path)\n\n    # Run py.test against the system tests.\n    session.run(\"py.test\", \"--quiet\", os.path.join(\"tests\", \"system\"), *session.posargs)\n\n\n@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)\ndef snippets(session):\n    \"\"\"Run the snippets test suite.\"\"\"\n\n    # Check the value of `RUN_SNIPPETS_TESTS` env var. It defaults to true.\n    if os.environ.get(\"RUN_SNIPPETS_TESTS\", \"true\") == \"false\":\n        session.skip(\"RUN_SNIPPETS_TESTS is set to false, skipping\")\n\n    constraints_path = str(\n        CURRENT_DIRECTORY / \"testing\" / f\"constraints-{session.python}.txt\"\n    )\n\n    # Install all test dependencies, then install local packages in place.\n    session.install(\"mock\", \"pytest\", \"google-cloud-testutils\", \"-c\", constraints_path)\n    session.install(\"google-cloud-storage\", \"-c\", constraints_path)\n    session.install(\"grpcio\", \"-c\", constraints_path)\n\n    session.install(\"-e\", \".[all]\", \"-c\", constraints_path)\n\n    # Run py.test against the snippets tests.\n    # Skip tests in samples/snippets, as those are run in a different session\n    # using the nox config from that directory.\n    session.run(\"py.test\", os.path.join(\"docs\", \"snippets.py\"), *session.posargs)\n    session.run(\n        \"py.test\",\n        \"samples\",\n        \"--ignore=samples/snippets\",\n        \"--ignore=samples/geography\",\n        *session.posargs,\n    )\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef cover(session):\n    \"\"\"Run the final coverage report.\n\n    This outputs the coverage report aggregating coverage from the unit\n    test runs (not system test runs), and then erases coverage data.\n    \"\"\"\n    session.install(\"coverage\", \"pytest-cov\")\n    session.run(\"coverage\", \"report\", \"--show-missing\", \"--fail-under=100\")\n    session.run(\"coverage\", \"erase\")\n\n\n@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)\ndef prerelease_deps(session):\n    \"\"\"Run all tests with prerelease versions of dependencies installed.\n\n    https://github.com/googleapis/python-bigquery/issues/95\n    \"\"\"\n    # PyArrow prerelease packages are published to an alternative PyPI host.\n    # https://arrow.apache.org/docs/python/install.html#installing-nightly-packages\n    session.install(\n        \"--extra-index-url\", \"https://pypi.fury.io/arrow-nightlies/\", \"--pre\", \"pyarrow\"\n    )\n    session.install(\"--pre\", \"grpcio\", \"pandas\")\n    session.install(\n        \"freezegun\",\n        \"google-cloud-datacatalog\",\n        \"google-cloud-storage\",\n        \"google-cloud-testutils\",\n        \"IPython\",\n        \"mock\",\n        \"psutil\",\n        \"pytest\",\n        \"pytest-cov\",\n    )\n    session.install(\"-e\", \".[all]\")\n\n    # Print out prerelease package versions.\n    session.run(\"python\", \"-c\", \"import grpc; print(grpc.__version__)\")\n    session.run(\"python\", \"-c\", \"import pandas; print(pandas.__version__)\")\n    session.run(\"python\", \"-c\", \"import pyarrow; print(pyarrow.__version__)\")\n\n    # Run all tests, except a few samples tests which require extra dependencies.\n    session.run(\"py.test\", \"tests/unit\")\n    session.run(\"py.test\", \"tests/system\")\n    session.run(\"py.test\", \"samples/tests\")\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef lint(session):\n    \"\"\"Run linters.\n\n    Returns a failure if the linters find linting errors or sufficiently\n    serious code quality issues.\n    \"\"\"\n\n    session.install(\"flake8\", BLACK_VERSION)\n    session.install(\"-e\", \".\")\n    session.run(\"flake8\", os.path.join(\"google\", \"cloud\", \"bigquery\"))\n    session.run(\"flake8\", \"tests\")\n    session.run(\"flake8\", os.path.join(\"docs\", \"samples\"))\n    session.run(\"flake8\", os.path.join(\"docs\", \"snippets.py\"))\n    session.run(\"black\", \"--check\", *BLACK_PATHS)\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef lint_setup_py(session):\n    \"\"\"Verify that setup.py is valid (including RST check).\"\"\"\n\n    session.install(\"docutils\", \"Pygments\")\n    session.run(\"python\", \"setup.py\", \"check\", \"--restructuredtext\", \"--strict\")\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef blacken(session):\n    \"\"\"Run black.\n    Format code to uniform standard.\n    \"\"\"\n\n    session.install(BLACK_VERSION)\n    session.run(\"black\", *BLACK_PATHS)\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef docs(session):\n    \"\"\"Build the docs.\"\"\"\n\n    session.install(\"ipython\", \"recommonmark\", \"sphinx==4.0.1\", \"sphinx_rtd_theme\")\n    session.install(\"google-cloud-storage\")\n    session.install(\"-e\", \".[all]\")\n\n    shutil.rmtree(os.path.join(\"docs\", \"_build\"), ignore_errors=True)\n    session.run(\n        \"sphinx-build\",\n        \"-W\",  # warnings as errors\n        \"-T\",  # show full traceback on exception\n        \"-N\",  # no colors\n        \"-b\",\n        \"html\",\n        \"-d\",\n        os.path.join(\"docs\", \"_build\", \"doctrees\", \"\"),\n        os.path.join(\"docs\", \"\"),\n        os.path.join(\"docs\", \"_build\", \"html\", \"\"),\n    )\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef docfx(session):\n    \"\"\"Build the docfx yaml files for this library.\"\"\"\n\n    session.install(\"-e\", \".\")\n    session.install(\n        \"sphinx==4.0.1\", \"alabaster\", \"recommonmark\", \"gcp-sphinx-docfx-yaml\"\n    )\n\n    shutil.rmtree(os.path.join(\"docs\", \"_build\"), ignore_errors=True)\n    session.run(\n        \"sphinx-build\",\n        \"-T\",  # show full traceback on exception\n        \"-N\",  # no colors\n        \"-D\",\n        (\n            \"extensions=sphinx.ext.autodoc,\"\n            \"sphinx.ext.autosummary,\"\n            \"docfx_yaml.extension,\"\n            \"sphinx.ext.intersphinx,\"\n            \"sphinx.ext.coverage,\"\n            \"sphinx.ext.napoleon,\"\n            \"sphinx.ext.todo,\"\n            \"sphinx.ext.viewcode,\"\n            \"recommonmark\"\n        ),\n        \"-b\",\n        \"html\",\n        \"-d\",\n        os.path.join(\"docs\", \"_build\", \"doctrees\", \"\"),\n        os.path.join(\"docs\", \"\"),\n        os.path.join(\"docs\", \"_build\", \"html\", \"\"),\n    )\n", "path": "noxfile.py"}], "after_files": [{"content": "# Copyright 2016 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nfrom __future__ import absolute_import\n\nimport pathlib\nimport os\nimport shutil\n\nimport nox\n\n\nPYTYPE_VERSION = \"pytype==2021.4.9\"\nBLACK_VERSION = \"black==19.10b0\"\nBLACK_PATHS = (\"docs\", \"google\", \"samples\", \"tests\", \"noxfile.py\", \"setup.py\")\n\nDEFAULT_PYTHON_VERSION = \"3.8\"\nSYSTEM_TEST_PYTHON_VERSIONS = [\"3.8\"]\nUNIT_TEST_PYTHON_VERSIONS = [\"3.6\", \"3.7\", \"3.8\", \"3.9\"]\nCURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()\n\n# 'docfx' is excluded since it only needs to run in 'docs-presubmit'\nnox.options.sessions = [\n    \"unit_noextras\",\n    \"unit\",\n    \"system\",\n    \"snippets\",\n    \"cover\",\n    \"lint\",\n    \"lint_setup_py\",\n    \"blacken\",\n    \"pytype\",\n    \"docs\",\n]\n\n\ndef default(session, install_extras=True):\n    \"\"\"Default unit test session.\n\n    This is intended to be run **without** an interpreter set, so\n    that the current ``python`` (on the ``PATH``) or the version of\n    Python corresponding to the ``nox`` binary the ``PATH`` can\n    run the tests.\n    \"\"\"\n    constraints_path = str(\n        CURRENT_DIRECTORY / \"testing\" / f\"constraints-{session.python}.txt\"\n    )\n\n    # Install all test dependencies, then install local packages in-place.\n    session.install(\n        \"mock\",\n        \"pytest\",\n        \"google-cloud-testutils\",\n        \"pytest-cov\",\n        \"freezegun\",\n        \"-c\",\n        constraints_path,\n    )\n\n    install_target = \".[all]\" if install_extras else \".\"\n    session.install(\"-e\", install_target, \"-c\", constraints_path)\n\n    session.install(\"ipython\", \"-c\", constraints_path)\n\n    # Run py.test against the unit tests.\n    session.run(\n        \"py.test\",\n        \"--quiet\",\n        \"--cov=google/cloud/bigquery\",\n        \"--cov=tests/unit\",\n        \"--cov-append\",\n        \"--cov-config=.coveragerc\",\n        \"--cov-report=\",\n        \"--cov-fail-under=0\",\n        os.path.join(\"tests\", \"unit\"),\n        *session.posargs,\n    )\n\n\n@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)\ndef unit(session):\n    \"\"\"Run the unit test suite.\"\"\"\n    default(session)\n\n\n@nox.session(python=[UNIT_TEST_PYTHON_VERSIONS[0], UNIT_TEST_PYTHON_VERSIONS[-1]])\ndef unit_noextras(session):\n    \"\"\"Run the unit test suite.\"\"\"\n\n    # Install optional dependencies that are out-of-date.\n    # https://github.com/googleapis/python-bigquery/issues/933\n    # There is no pyarrow 1.0.0 package for Python 3.9.\n    if session.python == UNIT_TEST_PYTHON_VERSIONS[0]:\n        session.install(\"pyarrow==1.0.0\")\n\n    default(session, install_extras=False)\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef pytype(session):\n    \"\"\"Run type checks.\"\"\"\n    # An indirect dependecy attrs==21.1.0 breaks the check, and installing a less\n    # recent version avoids the error until a possibly better fix is found.\n    # https://github.com/googleapis/python-bigquery/issues/655\n    session.install(\"attrs==20.3.0\")\n    session.install(\"-e\", \".[all]\")\n    session.install(\"ipython\")\n    session.install(PYTYPE_VERSION)\n    session.run(\"pytype\")\n\n\n@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)\ndef system(session):\n    \"\"\"Run the system test suite.\"\"\"\n\n    constraints_path = str(\n        CURRENT_DIRECTORY / \"testing\" / f\"constraints-{session.python}.txt\"\n    )\n\n    # Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true.\n    if os.environ.get(\"RUN_SYSTEM_TESTS\", \"true\") == \"false\":\n        session.skip(\"RUN_SYSTEM_TESTS is set to false, skipping\")\n\n    # Sanity check: Only run system tests if the environment variable is set.\n    if not os.environ.get(\"GOOGLE_APPLICATION_CREDENTIALS\", \"\"):\n        session.skip(\"Credentials must be set via environment variable.\")\n\n    # Use pre-release gRPC for system tests.\n    session.install(\"--pre\", \"grpcio\", \"-c\", constraints_path)\n\n    # Install all test dependencies, then install local packages in place.\n    session.install(\n        \"mock\", \"pytest\", \"psutil\", \"google-cloud-testutils\", \"-c\", constraints_path\n    )\n    if os.environ.get(\"GOOGLE_API_USE_CLIENT_CERTIFICATE\", \"\") == \"true\":\n        # mTLS test requires pyopenssl and latest google-cloud-storage\n        session.install(\"google-cloud-storage\", \"pyopenssl\")\n    else:\n        session.install(\"google-cloud-storage\", \"-c\", constraints_path)\n\n    # Data Catalog needed for the column ACL test with a real Policy Tag.\n    session.install(\"google-cloud-datacatalog\", \"-c\", constraints_path)\n\n    session.install(\"-e\", \".[all]\", \"-c\", constraints_path)\n    session.install(\"ipython\", \"-c\", constraints_path)\n\n    # Run py.test against the system tests.\n    session.run(\"py.test\", \"--quiet\", os.path.join(\"tests\", \"system\"), *session.posargs)\n\n\n@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)\ndef snippets(session):\n    \"\"\"Run the snippets test suite.\"\"\"\n\n    # Check the value of `RUN_SNIPPETS_TESTS` env var. It defaults to true.\n    if os.environ.get(\"RUN_SNIPPETS_TESTS\", \"true\") == \"false\":\n        session.skip(\"RUN_SNIPPETS_TESTS is set to false, skipping\")\n\n    constraints_path = str(\n        CURRENT_DIRECTORY / \"testing\" / f\"constraints-{session.python}.txt\"\n    )\n\n    # Install all test dependencies, then install local packages in place.\n    session.install(\"mock\", \"pytest\", \"google-cloud-testutils\", \"-c\", constraints_path)\n    session.install(\"google-cloud-storage\", \"-c\", constraints_path)\n    session.install(\"grpcio\", \"-c\", constraints_path)\n\n    session.install(\"-e\", \".[all]\", \"-c\", constraints_path)\n\n    # Run py.test against the snippets tests.\n    # Skip tests in samples/snippets, as those are run in a different session\n    # using the nox config from that directory.\n    session.run(\"py.test\", os.path.join(\"docs\", \"snippets.py\"), *session.posargs)\n    session.run(\n        \"py.test\",\n        \"samples\",\n        \"--ignore=samples/snippets\",\n        \"--ignore=samples/geography\",\n        *session.posargs,\n    )\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef cover(session):\n    \"\"\"Run the final coverage report.\n\n    This outputs the coverage report aggregating coverage from the unit\n    test runs (not system test runs), and then erases coverage data.\n    \"\"\"\n    session.install(\"coverage\", \"pytest-cov\")\n    session.run(\"coverage\", \"report\", \"--show-missing\", \"--fail-under=100\")\n    session.run(\"coverage\", \"erase\")\n\n\n@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)\ndef prerelease_deps(session):\n    \"\"\"Run all tests with prerelease versions of dependencies installed.\n\n    https://github.com/googleapis/python-bigquery/issues/95\n    \"\"\"\n    # PyArrow prerelease packages are published to an alternative PyPI host.\n    # https://arrow.apache.org/docs/python/install.html#installing-nightly-packages\n    session.install(\n        \"--extra-index-url\", \"https://pypi.fury.io/arrow-nightlies/\", \"--pre\", \"pyarrow\"\n    )\n    session.install(\n        \"--pre\",\n        \"google-api-core\",\n        \"google-cloud-bigquery-storage\",\n        \"google-cloud-core\",\n        \"google-resumable-media\",\n        \"grpcio\",\n        \"pandas\",\n    )\n    session.install(\n        \"freezegun\",\n        \"google-cloud-datacatalog\",\n        \"google-cloud-storage\",\n        \"google-cloud-testutils\",\n        \"IPython\",\n        \"mock\",\n        \"psutil\",\n        \"pytest\",\n        \"pytest-cov\",\n    )\n    session.install(\"-e\", \".[all]\")\n\n    # Print out prerelease package versions.\n    session.run(\"python\", \"-c\", \"import grpc; print(grpc.__version__)\")\n    session.run(\"python\", \"-c\", \"import pandas; print(pandas.__version__)\")\n    session.run(\"python\", \"-c\", \"import pyarrow; print(pyarrow.__version__)\")\n\n    # Run all tests, except a few samples tests which require extra dependencies.\n    session.run(\"py.test\", \"tests/unit\")\n    session.run(\"py.test\", \"tests/system\")\n    session.run(\"py.test\", \"samples/tests\")\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef lint(session):\n    \"\"\"Run linters.\n\n    Returns a failure if the linters find linting errors or sufficiently\n    serious code quality issues.\n    \"\"\"\n\n    session.install(\"flake8\", BLACK_VERSION)\n    session.install(\"-e\", \".\")\n    session.run(\"flake8\", os.path.join(\"google\", \"cloud\", \"bigquery\"))\n    session.run(\"flake8\", \"tests\")\n    session.run(\"flake8\", os.path.join(\"docs\", \"samples\"))\n    session.run(\"flake8\", os.path.join(\"docs\", \"snippets.py\"))\n    session.run(\"black\", \"--check\", *BLACK_PATHS)\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef lint_setup_py(session):\n    \"\"\"Verify that setup.py is valid (including RST check).\"\"\"\n\n    session.install(\"docutils\", \"Pygments\")\n    session.run(\"python\", \"setup.py\", \"check\", \"--restructuredtext\", \"--strict\")\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef blacken(session):\n    \"\"\"Run black.\n    Format code to uniform standard.\n    \"\"\"\n\n    session.install(BLACK_VERSION)\n    session.run(\"black\", *BLACK_PATHS)\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef docs(session):\n    \"\"\"Build the docs.\"\"\"\n\n    session.install(\"ipython\", \"recommonmark\", \"sphinx==4.0.1\", \"sphinx_rtd_theme\")\n    session.install(\"google-cloud-storage\")\n    session.install(\"-e\", \".[all]\")\n\n    shutil.rmtree(os.path.join(\"docs\", \"_build\"), ignore_errors=True)\n    session.run(\n        \"sphinx-build\",\n        \"-W\",  # warnings as errors\n        \"-T\",  # show full traceback on exception\n        \"-N\",  # no colors\n        \"-b\",\n        \"html\",\n        \"-d\",\n        os.path.join(\"docs\", \"_build\", \"doctrees\", \"\"),\n        os.path.join(\"docs\", \"\"),\n        os.path.join(\"docs\", \"_build\", \"html\", \"\"),\n    )\n\n\n@nox.session(python=DEFAULT_PYTHON_VERSION)\ndef docfx(session):\n    \"\"\"Build the docfx yaml files for this library.\"\"\"\n\n    session.install(\"-e\", \".\")\n    session.install(\n        \"sphinx==4.0.1\", \"alabaster\", \"recommonmark\", \"gcp-sphinx-docfx-yaml\"\n    )\n\n    shutil.rmtree(os.path.join(\"docs\", \"_build\"), ignore_errors=True)\n    session.run(\n        \"sphinx-build\",\n        \"-T\",  # show full traceback on exception\n        \"-N\",  # no colors\n        \"-D\",\n        (\n            \"extensions=sphinx.ext.autodoc,\"\n            \"sphinx.ext.autosummary,\"\n            \"docfx_yaml.extension,\"\n            \"sphinx.ext.intersphinx,\"\n            \"sphinx.ext.coverage,\"\n            \"sphinx.ext.napoleon,\"\n            \"sphinx.ext.todo,\"\n            \"sphinx.ext.viewcode,\"\n            \"recommonmark\"\n        ),\n        \"-b\",\n        \"html\",\n        \"-d\",\n        os.path.join(\"docs\", \"_build\", \"doctrees\", \"\"),\n        os.path.join(\"docs\", \"\"),\n        os.path.join(\"docs\", \"_build\", \"html\", \"\"),\n    )\n", "path": "noxfile.py"}]}