Skip to content

Commit ff64eff

Browse files
committed
Swap out tox for nox
1 parent bc50e37 commit ff64eff

File tree

9 files changed

+246
-106
lines changed

9 files changed

+246
-106
lines changed

.appveyor.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ environment:
77
- PYTHON: "C:\\Miniconda36-x64"
88
PYTHON_VERSION: "3.6.x"
99
PYTHON_ARCH: "64"
10-
TOXENV: "py36"
10+
NOXSESSION: "tests-3.6"
1111

1212
- PYTHON: "C:\\Miniconda37-x64"
1313
PYTHON_VERSION: "3.7.x"
1414
PYTHON_ARCH: "64"
15-
TOXENV: "py37"
15+
NOXSESSION: "tests-3.7"
1616

1717
init:
1818
- "%PYTHON%/python -V"
@@ -30,10 +30,10 @@ install:
3030
# Update conda stuff to make sure pip, setuptools, wheel etc are up to date
3131
- "conda update --all -y"
3232

33-
# Install tox
34-
- "python -m pip install --upgrade tox"
33+
# Install nox
34+
- "python -m pip install --upgrade nox"
3535

3636

3737

3838
test_script:
39-
- "tox -e %TOXENV%"
39+
- "nox --non-interactive --session %NOXSESSION%"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ cmd2.egg-info
77
.cache
88
*.pyc
99
.tox
10+
.nox
1011
.pytest_cache
1112

1213
# Code Coverage

.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@ matrix:
44
include:
55
- os: linux
66
python: 3.5
7-
env: TOXENV=py35
7+
env: NOXSESSION=tests-3.5
88
- os: linux
99
python: 3.6
10-
env: TOXENV=py36
10+
env: NOXSESSION=tests-3.6
1111
- os: linux
1212
python: 3.7
1313
dist: xenial
14-
env: TOXENV=py37
14+
env: NOXSESSION=tests-3.7
1515
- os: linux
1616
python: 3.8
1717
dist: xenial
18-
env: TOXENV=py38
18+
env: NOXSESSION=tests-3.8
1919
- os: linux
2020
python: 3.9-dev
2121
dist: xenial
22-
env: TOXENV=py39
22+
env: NOXSESSION=tests-3.9
2323
- os: linux
2424
python: 3.7
25-
env: TOXENV=docs
25+
env: NOXSESSION=docs
2626
# # Warning: Don't try to use code coverage analysis with pypy as it is insanely slow
2727
# - os: linux
2828
# python: pypy3
@@ -35,7 +35,7 @@ matrix:
3535
# - BREW_INSTALL=python3
3636

3737
install:
38-
- pip install flake8 tox
38+
- pip install flake8 nox
3939
# - |
4040
# if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
4141
# if [[ -n "$BREW_INSTALL" ]]; then
@@ -47,9 +47,9 @@ install:
4747
before_script:
4848
# stop the build if there are Python syntax errors or undefined names
4949
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
50-
if [[ $TOXENV == py38 ]]; then
50+
if [[ $NOXSESSION == tests-3.8 ]]; then
5151
flake8 . --count --ignore=E252,W503 --max-complexity=26 --max-line-length=127 --show-source --statistics ;
5252
fi
5353

5454
script:
55-
- tox
55+
- echo "$NOXSESSION"; nox --non-interactive --session "$NOXSESSION"

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include LICENSE README.md CHANGELOG.md CONTRIBUTING.md tox.ini Pipfile
1+
include LICENSE README.md CHANGELOG.md CONTRIBUTING.md tox.ini noxfile.py Pipfile
22
recursive-include examples *
33
recursive-include tests *
44
recursive-include docs *

azure-pipelines.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ jobs:
1616
matrix:
1717
Python35:
1818
python.version: '3.5'
19-
TOXENV: 'py35'
19+
NOXSESSION: 'tests-3.5'
2020
Python36:
2121
python.version: '3.6'
22-
TOXENV: 'py36'
22+
NOXSESSION: 'tests-3.6'
2323
Python37:
2424
python.version: '3.7'
25-
TOXENV: 'py37'
25+
NOXSESSION: 'tests-3.7'
2626
Python38:
2727
python.version: '3.8'
28-
TOXENV: 'py38'
28+
NOXSESSION: 'tests-3.8'
2929
# Increase the maxParallel value to simultaneously run the job for all versions in the matrix (max 10 for free open-source)
3030
maxParallel: 4
3131

@@ -38,15 +38,15 @@ jobs:
3838

3939
# Install dependencies - install specific PyPI packages with pip, including cmd2 dependencies
4040
- script: |
41-
python -m pip install --upgrade pip && pip3 install --upgrade setuptools tox
41+
python -m pip install --upgrade pip && pip3 install --upgrade setuptools nox
4242
displayName: 'Upgrade pip and setuptools'
4343
continueOnError: false
4444
4545
# TODO: Consider adding a lint test to use pycodestyle, flake8, or pylint, to check code style conventions
4646
4747
# Test - test with pytest, collect coverage metrics with pytest-cov, and publish these metrics to codecov.io
4848
- script: |
49-
tox -e $(TOXENV)
49+
nox --non-interactive --session $(NOXSESSION)
5050
displayName: 'Run tests and code coverage'
5151
continueOnError: false
5252

noxfile.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import nox
2+
3+
4+
@nox.session(python=['3.7'])
5+
def docs(session):
6+
session.install('sphinx', 'sphinx-rtd-theme', '.')
7+
session.chdir('docs')
8+
tmpdir = session.create_tmp()
9+
10+
session.run('sphinx-build', '-a', '-W', '-T', '-b', 'html',
11+
'-d', '{}/doctrees'.format(tmpdir), '.', '{}/html'.format(tmpdir))
12+
13+
14+
@nox.session(python=['3.5', '3.6', '3.7', '3.8', '3.9'])
15+
def tests(session):
16+
session.install('invoke', './[test]')
17+
session.run('invoke', 'pytest', '--junit', '--no-pty')
18+
session.run('codecov')

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
exclude = .git,.idea,.pytest_cache,.tox,.venv,.vscode,build,cmd2.egg-info,dist,htmlcov,__pycache__,*.egg
2+
exclude = .git,.idea,.pytest_cache,.tox,.nox,.venv,.vscode,build,cmd2.egg-info,dist,htmlcov,__pycache__,*.egg
33
max-line-length = 127
44
max-complexity = 26
55

@@ -12,6 +12,6 @@ force_grid_wrap = 0
1212
use_parentheses = true
1313

1414
[doc8]
15-
ignore-path=docs/_build,.git,.idea,.pytest_cache,.tox,.venv,.vscode,build,cmd2,examples,tests,cmd2.egg-info,dist,htmlcov,__pycache__,*.egg
15+
ignore-path=docs/_build,.git,.idea,.pytest_cache,.tox,.nox,.venv,.vscode,build,cmd2,examples,tests,cmd2.egg-info,dist,htmlcov,__pycache__,*.egg
1616
max-line-length=117
1717
verbose=0

setup.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,30 @@
3333

3434
SETUP_REQUIRES = ['setuptools_scm >= 3.0']
3535

36-
INSTALL_REQUIRES = ['attrs >= 16.3.0', 'colorama >= 0.3.7', 'pyperclip >= 1.6', 'setuptools >= 34.4', 'wcwidth >= 0.1.7']
36+
INSTALL_REQUIRES = [
37+
'attrs >= 16.3.0',
38+
'colorama >= 0.3.7',
39+
'pyperclip >= 1.6',
40+
'setuptools >= 34.4',
41+
'wcwidth >= 0.1.7',
42+
]
3743

3844
EXTRAS_REQUIRE = {
3945
# Windows also requires pyreadline to ensure tab completion works
4046
":sys_platform=='win32'": ['pyreadline'],
4147
# Extra dependencies for running unit tests
42-
'test': ["gnureadline; sys_platform=='darwin'", # include gnureadline on macOS to ensure it is available in tox env
43-
"mock ; python_version<'3.6'", # for python 3.5 we need the third party mock module
44-
'codecov', 'coverage', 'pytest', 'pytest-cov', 'pytest-mock'],
48+
'test': [
49+
"gnureadline; sys_platform=='darwin'", # include gnureadline on macOS to ensure it is available in tox env
50+
"mock ; python_version<'3.6'", # for python 3.5 we need the third party mock module
51+
'codecov',
52+
'coverage',
53+
'pytest',
54+
'pytest-cov',
55+
'pytest-mock',
56+
],
4557
# development only dependencies: install with 'pip install -e .[dev]'
4658
'dev': ["mock ; python_version<'3.6'", # for python 3.5 we need the third party mock module
47-
'pytest', 'codecov', 'pytest-cov', 'pytest-mock', 'tox', 'flake8',
59+
'pytest', 'codecov', 'pytest-cov', 'pytest-mock', 'tox', 'nox', 'flake8',
4860
'sphinx', 'sphinx-rtd-theme', 'sphinx-autobuild', 'doc8',
4961
'invoke', 'twine>=1.11',
5062
]

0 commit comments

Comments
 (0)