From 21393b4ab43c7e9c75b769c767497424d0027717 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Tue, 17 Jan 2023 10:03:25 -0800 Subject: [PATCH] Use tox to run linters too --- .github/workflows/lint.yml | 37 ------------------------------------- setup.cfg | 28 +++++++++++++++++++++------- 2 files changed, 21 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/lint.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index af4b6b5..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Python lint - -on: - push: - pull_request: - schedule: - - cron: '3 19 * * SUN' - -jobs: - build: - - name: Python linting - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: "3.11" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install --upgrade pylint black mypy voluptuous-stubs types-maxminddb - - - name: Install - run: python setup.py install - - - name: Run mypy - run: mypy maxminddb tests - - - name: Run Pylint - run: pylint maxminddb - - - name: Run Black - run: black --check --diff . diff --git a/setup.cfg b/setup.cfg index 40c30ac..a3fe21d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,6 +2,7 @@ build_html = build_sphinx -b html --build-dir docs [flake8] +extend-ignore = E203 # black uses 88 : ¯\_(ツ)_/¯ max-line-length = 88 @@ -9,19 +10,32 @@ max-line-length = 88 universal = 1 [tox:tox] -envlist = py36, py37, py38, py39, mypy +envlist = {py37,py38,py39,py310}-test,py310-{black,lint,flake8,mypy} [gh-actions] python = 3.7: py37 3.8: py38 3.9: py39 - "3.10": py310 - 3.11: py311, mypy + "3.10": py310,black,lint,flake8,mypy - -[testenv] -deps = - pytest +[testenv:{py37,py38,py39,py310}-test] +deps = pytest commands = pytest tests passenv = * + +[testenv:py310-black] +deps = black +commands = black --check --diff . + +[testenv:py310-lint] +deps = pylint +commands = pylint maxminddb + +[testenv:py310-flake8] +deps = flake8 +commands = flake8 maxminddb + +[testenv:py310-mypy] +deps = mypy +commands = mypy maxminddb tests