Skip to content

Commit

Permalink
Nox: use inplace installs (#5865)
Browse files Browse the repository at this point in the history
  • Loading branch information
tseaver authored Aug 30, 2018
1 parent fa27f5d commit 2dd7795
Show file tree
Hide file tree
Showing 19 changed files with 161 additions and 102 deletions.
32 changes: 16 additions & 16 deletions bigquery/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def default(session):
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest', 'pytest-cov')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)

# Pyarrow does not support Python 3.7
if session.interpreter == 'python3.7':
Expand Down Expand Up @@ -97,13 +99,12 @@ def system(session, py):
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest', *LOCAL_DEPS)
session.install(
os.path.join('..', 'storage'),
os.path.join('..', 'test_utils'),
)
# Install all test dependencies, then install local packages in place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', os.path.join('..', 'storage'))
session.install('-e', os.path.join('..', 'test_utils'))
session.install('-e', '.[pandas]')

# IPython does not support Python 2 after version 5.x
Expand Down Expand Up @@ -136,13 +137,12 @@ def snippets(session, py):
# Set the virtualenv dirname.
session.virtualenv_dirname = 'snip-' + py

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest', *LOCAL_DEPS)
session.install(
os.path.join('..', 'storage'),
os.path.join('..', 'test_utils'),
)
# Install all test dependencies, then install local packages in place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', os.path.join('..', 'storage'))
session.install('-e', os.path.join('..', 'test_utils'))
session.install('-e', '.[pandas, pyarrow]')

# Run py.test against the system tests.
Expand Down
12 changes: 8 additions & 4 deletions bigtable/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ def default(session):
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest', 'pytest-cov')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down Expand Up @@ -86,8 +88,10 @@ def system(session, py):

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest', *LOCAL_DEPS)
session.install('../test_utils/')
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '../test_utils/')
session.install('-e', '.')

# Run py.test against the system tests.
Expand Down
12 changes: 8 additions & 4 deletions container/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ def default(session):
Python corresponding to the ``nox`` binary on the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest', 'pytest-cov')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down Expand Up @@ -83,8 +85,10 @@ def system(session, py):
# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest')
session.install('../test_utils/')
session.install('.')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '../test_utils/')
session.install('-e', '.')

# Run py.test against the system tests.
session.run('py.test', '--quiet', 'tests/system/')
Expand Down
5 changes: 3 additions & 2 deletions core/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ def default(session):
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
# Install all test dependencies, then install local packages in-place.
session.install(
'mock',
'pytest',
'pytest-cov',
'grpcio >= 1.0.2',
*LOCAL_DEPS
)
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down
25 changes: 15 additions & 10 deletions datastore/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def default(session):
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest', 'pytest-cov')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down Expand Up @@ -85,11 +87,12 @@ def system(session, py):
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest', *LOCAL_DEPS)
session.install('../test_utils/')
session.install('.')
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '../test_utils/')
session.install('-e', '.')

# Run py.test against the system tests.
session.run('py.test', '--quiet', 'tests/system', *session.posargs)
Expand All @@ -111,9 +114,11 @@ def doctests(session):

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest', 'sphinx', *LOCAL_DEPS)
session.install('../test_utils/')
session.install('.')
session.install('mock', 'pytest', 'sphinx')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '../test_utils/')
session.install('-e', '.')

# Run py.test against the system tests.
session.run('py.test', '--quiet', 'tests/doctests.py')
Expand Down
6 changes: 4 additions & 2 deletions dns/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def default(session):
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest', 'pytest-cov')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down
17 changes: 10 additions & 7 deletions error_reporting/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ def default(session):
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest', 'pytest-cov')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down Expand Up @@ -111,11 +113,12 @@ def system(session, py):
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest', *LOCAL_DEPS)
session.install('../test_utils/')
session.install('.')
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '../test_utils/')
session.install('-e', '.')

# Run py.test against the system tests.
session.run('py.test', '-vvv', 'tests/system', *session.posargs)
Expand Down
17 changes: 10 additions & 7 deletions firestore/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ def default(session):
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest', 'pytest-cov')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down Expand Up @@ -86,11 +88,12 @@ def system(session, py):
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest', *LOCAL_DEPS)
session.install(os.path.join('..', 'test_utils'))
session.install('.')
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', os.path.join('..', 'test_utils'))
session.install('-e', '.')

# Run py.test against the system tests.
session.run(
Expand Down
18 changes: 11 additions & 7 deletions language/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def default(session):
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest', 'pytest-cov')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down Expand Up @@ -84,11 +86,13 @@ def system(session, py):
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest', *LOCAL_DEPS)
session.install('../storage/', '../test_utils/')
session.install('.')
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '../storage/')
session.install('-e', '../test_utils/')
session.install('-e', '.')

# Run py.test against the system tests.
session.run('py.test', '--quiet', 'tests/system/')
Expand Down
19 changes: 14 additions & 5 deletions logging/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ def default(session, django_dep=('django',)):
else:
deps += django_dep

deps += LOCAL_DEPS
session.install(*deps)
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down Expand Up @@ -114,10 +115,18 @@ def system(session, py):

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest', *LOCAL_DEPS)
session.install('../test_utils/', '../bigquery/', '../pubsub/',
'../storage/')
session.install('.')
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
systest_deps = [
'../bigquery/',
'../pubsub/',
'../storage/',
'../test_utils/',
]
for systest_dep in systest_deps:
session.install('-e', systest_dep)
session.install('-e', '.')

# Run py.test against the system tests.
session.run(
Expand Down
17 changes: 10 additions & 7 deletions pubsub/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def default(session):
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest', 'pytest-cov')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down Expand Up @@ -84,11 +86,12 @@ def system(session, py):
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest', *LOCAL_DEPS)
session.install('../test_utils/')
session.install('.')
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '../test_utils/')
session.install('-e', '.')

# Run py.test against the system tests.
session.run(
Expand Down
6 changes: 4 additions & 2 deletions redis/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def default(session):
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest', 'pytest-cov')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down
6 changes: 4 additions & 2 deletions resource_manager/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def default(session):
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest', 'pytest-cov')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down
15 changes: 9 additions & 6 deletions spanner/nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def default(session):
Python corresponding to the ``nox`` binary the ``PATH`` can
run the tests.
"""
# Install all test dependencies, then install this package in-place.
session.install('mock', 'pytest', 'pytest-cov', *LOCAL_DEPS)
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest', 'pytest-cov')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '.')

# Run py.test against the unit tests.
Expand Down Expand Up @@ -89,10 +91,11 @@ def system_common(session):
# Use pre-release gRPC for system tests.
session.install('--pre', 'grpcio')

# Install all test dependencies, then install this package into the
# virtualenv's dist-packages.
session.install('mock', 'pytest', *LOCAL_DEPS)
session.install('../test_utils/')
# Install all test dependencies, then install local packages in-place.
session.install('mock', 'pytest')
for local_dep in LOCAL_DEPS:
session.install('-e', local_dep)
session.install('-e', '../test_utils/')
session.install('-e', '.')

# Run py.test against the system tests.
Expand Down
Loading

0 comments on commit 2dd7795

Please sign in to comment.