Skip to content

Commit 0fbe12d

Browse files
authored
deps: add "extra" for IPython, exclude bad IPython release (#1151)
* deps: add "extra" for IPython, exclude bad IPython release * skip magics tests when IPython not installed * sort importorskips * add 3.10 prerelease session * add continuous session
1 parent 358f91e commit 0fbe12d

File tree

10 files changed

+37
-21
lines changed

10 files changed

+37
-21
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Only run this nox session.
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "prerelease_deps-3.10"
7+
}

.kokoro/continuous/prerelease-deps-3.8.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
# Only run this nox session.
44
env_vars: {
55
key: "NOX_SESSION"
6-
value: "prerelease_deps"
6+
value: "prerelease_deps-3.8"
77
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Only run this nox session.
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "prerelease_deps-3.10"
7+
}

noxfile.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ def default(session, install_extras=True):
7979
install_target = "."
8080
session.install("-e", install_target, "-c", constraints_path)
8181

82-
session.install("ipython", "-c", constraints_path)
83-
8482
# Run py.test against the unit tests.
8583
session.run(
8684
"py.test",
@@ -119,7 +117,6 @@ def unit_noextras(session):
119117
def mypy(session):
120118
"""Run type checks with mypy."""
121119
session.install("-e", ".[all]")
122-
session.install("ipython")
123120
session.install(MYPY_VERSION)
124121

125122
# Just install the dependencies' type info directly, since "mypy --install-types"
@@ -138,7 +135,6 @@ def pytype(session):
138135
# https://github.com/googleapis/python-bigquery/issues/655
139136
session.install("attrs==20.3.0")
140137
session.install("-e", ".[all]")
141-
session.install("ipython")
142138
session.install(PYTYPE_VERSION)
143139
session.run("pytype")
144140

@@ -180,7 +176,6 @@ def system(session):
180176
else:
181177
extras = "[all]"
182178
session.install("-e", f".{extras}", "-c", constraints_path)
183-
session.install("ipython", "-c", constraints_path)
184179

185180
# Run py.test against the system tests.
186181
session.run("py.test", "--quiet", os.path.join("tests", "system"), *session.posargs)
@@ -355,7 +350,7 @@ def blacken(session):
355350
def docs(session):
356351
"""Build the docs."""
357352

358-
session.install("ipython", "recommonmark", "sphinx==4.0.1", "sphinx_rtd_theme")
353+
session.install("recommonmark", "sphinx==4.0.1", "sphinx_rtd_theme")
359354
session.install("google-cloud-storage")
360355
session.install("-e", ".[all]")
361356

setup.py

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"geopandas": ["geopandas>=0.9.0, <1.0dev", "Shapely>=1.6.0, <2.0dev"],
6262
"pandas": ["pandas>=0.24.2"] + pyarrow_dep,
6363
"bignumeric_type": pyarrow_dep,
64+
"ipython": ["ipython>=7.0.1,!=8.1.0"],
6465
"tqdm": ["tqdm >= 4.7.4, <5.0.0dev"],
6566
"opentelemetry": [
6667
"opentelemetry-api >= 1.1.0",

testing/constraints-3.6.txt

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ google-cloud-bigquery-storage==2.0.0
1111
google-cloud-core==1.4.1
1212
google-resumable-media==0.6.0
1313
grpcio==1.38.1
14+
ipython==7.0.1
1415
opentelemetry-api==1.1.0
1516
opentelemetry-instrumentation==0.20b0
1617
opentelemetry-sdk==1.1.0

tests/unit/line_arg_parser/test_lexer.py

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
import pytest
1616

17+
IPython = pytest.importorskip("IPython")
18+
1719

1820
@pytest.fixture(scope="session")
1921
def lexer_class():

tests/unit/line_arg_parser/test_parser.py

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
import pytest
1616

17+
IPython = pytest.importorskip("IPython")
18+
1719

1820
@pytest.fixture(scope="session")
1921
def parser_class():

tests/unit/line_arg_parser/test_visitors.py

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
import pytest
1616

17+
IPython = pytest.importorskip("IPython")
18+
1719

1820
@pytest.fixture
1921
def base_visitor():

tests/unit/test_magics.py

+13-14
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,30 @@
1717
from concurrent import futures
1818
import warnings
1919

20-
import mock
21-
import pytest
22-
23-
try:
24-
import pandas
25-
except ImportError: # pragma: NO COVER
26-
pandas = None
27-
2820
from google.api_core import exceptions
2921
import google.auth.credentials
22+
import mock
23+
import pytest
24+
from tests.unit.helpers import make_connection
25+
from test_utils.imports import maybe_fail_import
3026

3127
from google.cloud import bigquery
3228
from google.cloud.bigquery import job
3329
from google.cloud.bigquery import table
34-
from google.cloud.bigquery.magics import magics
3530
from google.cloud.bigquery.retry import DEFAULT_TIMEOUT
36-
from tests.unit.helpers import make_connection
37-
from test_utils.imports import maybe_fail_import
3831

3932

33+
try:
34+
from google.cloud.bigquery.magics import magics
35+
except ImportError:
36+
magics = None
37+
38+
bigquery_storage = pytest.importorskip("google.cloud.bigquery_storage")
4039
IPython = pytest.importorskip("IPython")
41-
io = pytest.importorskip("IPython.utils.io")
42-
tools = pytest.importorskip("IPython.testing.tools")
4340
interactiveshell = pytest.importorskip("IPython.terminal.interactiveshell")
44-
bigquery_storage = pytest.importorskip("google.cloud.bigquery_storage")
41+
tools = pytest.importorskip("IPython.testing.tools")
42+
io = pytest.importorskip("IPython.utils.io")
43+
pandas = pytest.importorskip("pandas")
4544

4645

4746
@pytest.fixture(scope="session")

0 commit comments

Comments
 (0)