Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 38122d4

Browse files
authored
Replace nox-automation with nox (#653)
upgrade to the latest nox rename nox.py to noxfile.py make noxfile.py explicit
1 parent 284deb1 commit 38122d4

4 files changed

Lines changed: 13 additions & 32 deletions

File tree

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ jobs:
4040
- run:
4141
name: Run tests - opencensus
4242
command: |
43-
nox -f nox.py
43+
pip install --upgrade nox
44+
nox -f noxfile.py
4445
- deploy:
4546
name: Push to PyPI (if this is a release tag).
4647
command: scripts/twine_upload.sh

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ python:
33
- '3.6'
44

55
install:
6-
- pip install nox-automation==0.19.1
6+
- pip install --upgrade nox
77

88
script:
9-
- nox -f nox.py -s docs
9+
- nox -f noxfile.py -s docs
1010
- touch docs/.nojekyll
1111

1212
branches:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ git remote add fork https://github.com/YOUR_GITHUB_USERNAME/opencensus-python.
3737
Run tests:
3838

3939
```sh
40-
$ pip install nox-automation # Only first time.
40+
$ pip install nox # Only first time.
4141
$ nox
4242
```
4343

nox.py renamed to noxfile.py

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,10 @@ def _install_test_dependencies(session):
5454
session.install('unittest2')
5555

5656

57-
@nox.session
58-
@nox.parametrize('py', ['2.7', '3.4', '3.5', '3.6'])
59-
def unit(session, py):
57+
@nox.session(python=['2.7', '3.4', '3.5', '3.6'])
58+
def unit(session):
6059
"""Run the unit test suite."""
6160

62-
# Run unit tests against all supported versions of Python.
63-
session.interpreter = 'python{}'.format(py)
64-
6561
# Install test dependencies.
6662
_install_test_dependencies(session)
6763

@@ -86,21 +82,14 @@ def unit(session, py):
8682
)
8783

8884

89-
@nox.session
90-
@nox.parametrize('py', ['2.7', '3.6'])
91-
def system(session, py):
85+
@nox.session(python=['2.7', '3.6'])
86+
def system(session):
9287
"""Run the system test suite."""
9388

9489
# Sanity check: Only run system tests if the environment variable is set.
9590
if not os.environ.get('GOOGLE_APPLICATION_CREDENTIALS', ''):
9691
session.skip('Credentials must be set via environment variable.')
9792

98-
# Run the system tests against latest Python 2 and Python 3 only.
99-
session.interpreter = 'python{}'.format(py)
100-
101-
# Set the virtualenv dirname.
102-
session.virtualenv_dirname = 'sys-' + py
103-
10493
# Install test dependencies.
10594
_install_test_dependencies(session)
10695

@@ -116,13 +105,12 @@ def system(session, py):
116105
)
117106

118107

119-
@nox.session
108+
@nox.session(python='3.6')
120109
def lint(session):
121110
"""Run flake8.
122111
Returns a failure if flake8 finds linting errors or sufficiently
123112
serious code quality issues.
124113
"""
125-
session.interpreter = 'python3.6'
126114
session.install('flake8')
127115

128116
# Install dev packages.
@@ -138,37 +126,29 @@ def lint(session):
138126
)
139127

140128

141-
@nox.session
129+
@nox.session(python='3.6')
142130
def lint_setup_py(session):
143131
"""Verify that setup.py is valid (including RST check)."""
144-
session.interpreter = 'python3.6'
145132
session.install('docutils', 'pygments')
146133
session.run(
147134
'python', 'setup.py', 'check', '--restructuredtext', '--strict')
148135

149136

150-
@nox.session
137+
@nox.session(python='3.6')
151138
def cover(session):
152139
"""Run the final coverage report.
153140
This outputs the coverage report aggregating coverage from the unit
154141
test runs (not system test runs), and then erases coverage data.
155142
"""
156-
session.interpreter = 'python3.6'
157143
session.install('coverage', 'pytest-cov')
158144
session.run('coverage', 'report', '--show-missing', '--fail-under=100')
159145
session.run('coverage', 'erase')
160146

161147

162-
@nox.session
148+
@nox.session(python='3.6')
163149
def docs(session):
164150
"""Build the docs."""
165151

166-
# Build docs against the latest version of Python, because we can.
167-
session.interpreter = 'python3.6'
168-
169-
# Set the virtualenv dirname.
170-
session.virtualenv_dirname = 'docs'
171-
172152
# Install Sphinx and also all of the google-cloud-* packages.
173153
session.chdir(os.path.realpath(os.path.dirname(__file__)))
174154
session.install('-r', os.path.join('docs', 'requirements.txt'))

0 commit comments

Comments
 (0)