Skip to content

Commit f8970fd

Browse files
author
Jon Wayne Parrott
committed
Merge pull request GoogleCloudPlatform#35 from GoogleCloudPlatform/pytest-refactor-noxify
Adding a global nox lint session.
2 parents 4e7a1f6 + 2442354 commit f8970fd

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

.travis.yml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,4 @@ before_install:
99
install:
1010
- pip install nox-automation tox
1111
script:
12-
- nox --session reqcheck
13-
- cd $TRAVIS_BUILD_DIR/1-hello-world && tox
14-
- cp $TRAVIS_BUILD_DIR/config.py $TRAVIS_BUILD_DIR/2-structured-data && cd $TRAVIS_BUILD_DIR/2-structured-data
15-
&& tox -e lint
16-
- cp $TRAVIS_BUILD_DIR/config.py $TRAVIS_BUILD_DIR/3-binary-data && cd $TRAVIS_BUILD_DIR/3-binary-data
17-
&& tox -e lint
18-
- cp $TRAVIS_BUILD_DIR/config.py $TRAVIS_BUILD_DIR/4-auth && cd $TRAVIS_BUILD_DIR/4-auth
19-
&& tox -e lint
20-
- cp $TRAVIS_BUILD_DIR/config.py $TRAVIS_BUILD_DIR/5-logging && cd $TRAVIS_BUILD_DIR/5-logging
21-
&& tox -e lint
22-
- cp $TRAVIS_BUILD_DIR/config.py $TRAVIS_BUILD_DIR/6-pubsub && cd $TRAVIS_BUILD_DIR/6-pubsub
23-
&& tox -e lint
24-
- cp $TRAVIS_BUILD_DIR/config.py $TRAVIS_BUILD_DIR/7-gce && cd $TRAVIS_BUILD_DIR/7-gce
25-
&& tox -e lint
26-
after_script:
27-
- kill $DATASTORE_EMULATOR
12+
- nox --session reqcheck lint

nox.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@
77
def session_reqcheck(session):
88
session.install(REPO_TOOLS_REQ)
99

10-
for reqfile in glob('**/requirements.txt'):
11-
session.run('gcprepotools', 'check-requirements', reqfile)
10+
if 'update' in session.posargs:
11+
command = 'update-requirements'
12+
else:
13+
command = 'check-requirements'
1214

15+
for reqfile in glob('**/requirements.txt'):
16+
session.run('gcprepotools', command, reqfile)
1317

14-
def session_requpdate(session):
15-
session.install(REPO_TOOLS_REQ)
1618

17-
for reqfile in glob('**/requirements.txt'):
18-
session.run('gcprepotools', 'update-requirements', reqfile)
19+
def session_lint(session):
20+
session.install('flake8', 'flake8-import-order')
21+
session.run(
22+
'flake8', '--exclude=env,.nox,._config.py',
23+
'--import-order-style=google', '.')

0 commit comments

Comments
 (0)