From 0d360eb90f4931acd0033e35001852c743aad7f5 Mon Sep 17 00:00:00 2001 From: David Paul Graham Date: Sun, 1 Dec 2024 12:00:04 -0500 Subject: [PATCH] inline the .flake8 config file into setup.cfg and make cooresponding changes in tox and github actions commands --- .flake8 | 5 ----- .github/workflows/main.yml | 12 ++++++------ setup.cfg | 15 +++++++++------ tox.ini | 2 +- 4 files changed, 16 insertions(+), 18 deletions(-) delete mode 100644 .flake8 diff --git a/.flake8 b/.flake8 deleted file mode 100644 index ef305e59..00000000 --- a/.flake8 +++ /dev/null @@ -1,5 +0,0 @@ -[flake8] -per-file-ignores = - dj_rest_auth/tests/test_serializers.py:E501,F401 - dj_rest_auth/serializers.py:E501 - dj_rest_auth/jwt_auth.py:E501 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c11039ea..a0bcf601 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,13 +21,13 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 + pip install -r dj_rest_auth/tests/requirements.txt - name: Lint - run: flake8 dj_rest_auth/ --append-config ./.flake8 + run: flake8 dj_rest_auth/ build: runs-on: ubuntu-latest name: Build - needs: [lint] + needs: [ lint ] steps: - name: Checkout uses: actions/checkout@v4 @@ -48,11 +48,11 @@ jobs: test: runs-on: ubuntu-20.04 name: Test Python ${{ matrix.python-version }} + Django ~= ${{ matrix.django-version }} - needs: [build] + needs: [ build ] strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - django-version: ['4.2', '5.0'] + python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] + django-version: [ '4.2', '5.0' ] exclude: - python-version: '3.8' django-version: '5.0' diff --git a/setup.cfg b/setup.cfg index 8d915a7a..07562395 100644 --- a/setup.cfg +++ b/setup.cfg @@ -10,26 +10,29 @@ license_file = LICENSE max-line-length = 120 exclude = docs/*,demo/* ignore = F403 - +per-file-ignores = + dj_rest_auth/tests/test_serializers.py:E501,F401 + dj_rest_auth/serializers.py:E501 + dj_rest_auth/jwt_auth.py:E501 [coverage:run] -omit=*site-packages*,*distutils*,*migrations* +omit = *site-packages*,*distutils*,*migrations* [coverage:report] # Regexes for lines to exclude from consideration exclude_lines = - # Have to re-enable the standard pragma +# Have to re-enable the standard pragma pragma: no cover - # Don't complain about missing debug-only code: +# Don't complain about missing debug-only code: def __repr__ if self\.debug - # Don't complain if tests don't hit defensive assertion code: +# Don't complain if tests don't hit defensive assertion code: raise AssertionError raise NotImplementedError - # Don't complain if non-runnable code isn't run: +# Don't complain if non-runnable code isn't run: if 0: if __name__ == .__main__.: diff --git a/tox.ini b/tox.ini index 865799ab..ebf2bf78 100644 --- a/tox.ini +++ b/tox.ini @@ -38,6 +38,6 @@ deps = [testenv:flake8] commands = - flake8 {toxinidir}/dj_rest_auth --append-config={toxinidir}/.flake8 + flake8 {toxinidir}/dj_rest_auth deps = flake8==7.1.1