diff options
| author | Eric Lin <anselor@gmail.com> | 2021-06-10 11:38:43 -0400 |
|---|---|---|
| committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2021-06-14 11:28:25 -0400 |
| commit | bf1f8ebf09a14b039c7d8b5a5fd790daedcce2a4 (patch) | |
| tree | 1f15edc8818647def4c6f1b37ffbae866b5df865 | |
| parent | b94d04a9d82258c4b25584de97c707c0e3804f5b (diff) | |
| download | cmd2-git-bf1f8ebf09a14b039c7d8b5a5fd790daedcce2a4.tar.gz | |
Change mypy and lint github steps to use nox/invoke to make CI validation configuration/commands match developer local commands.
| -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 = { |
