diff options
-rw-r--r-- | .github/workflows/lint.yml | 4 | ||||
-rw-r--r-- | .github/workflows/mypy.yml | 4 | ||||
-rw-r--r-- | noxfile.py | 7 | ||||
-rwxr-xr-x | setup.py | 15 |
4 files changed, 21 insertions, 9 deletions
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b23c6ab9..7ffd0f18 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,6 +23,6 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install python prerequisites - run: pip install -U --user pip setuptools setuptools-scm flake8 + run: pip install -U --user pip setuptools setuptools-scm nox - name: Lint - run: python -m flake8 . + run: python -m nox --non-interactive --session validate-${{ matrix.python-version }} -k flake8 diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index aa5d4b2b..26fbb90e 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -23,6 +23,6 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install python prerequisites - run: pip install -U --user pip setuptools setuptools-scm mypy + run: pip install -U --user pip setuptools setuptools-scm nox - name: MyPy - run: python -m mypy cmd2 + run: python -m nox --non-interactive --session validate-${{ matrix.python-version }} -k mypy # Run nox for mypy @@ -39,3 +39,10 @@ def tests(session, plugin): '--no-pty', '--append-cov', ) + + +@nox.session(python=['3.8', '3.9']) +@nox.parametrize('step', ['mypy', 'flake8']) +def validate(session, step): + session.install('invoke', './[validate]') + session.run('invoke', step) @@ -66,19 +66,24 @@ EXTRAS_REQUIRE = { ], # development only dependencies: install with 'pip install -e .[dev]' 'dev': [ - "pytest>=4.6", 'codecov', + 'doc8', + 'flake8', + 'invoke', + 'mypy==0.902', + 'nox', + "pytest>=4.6", 'pytest-cov', 'pytest-mock', - 'nox', - 'flake8', 'sphinx', 'sphinx-rtd-theme', 'sphinx-autobuild', - 'doc8', - 'invoke', 'twine>=1.11', ], + 'validate': [ + 'flake8', + 'mypy==0.902', + ], } PACKAGE_DATA = { |