From ec3c48f87dbf7003aba9d781c2c1d2901a02394d Mon Sep 17 00:00:00 2001 From: Pablo Silva Date: Sat, 26 Oct 2024 20:51:07 +0100 Subject: [PATCH] Fix flake8 warnings --- poetry.lock | 30 ++++++++++++++--------------- pyproject.toml | 2 +- src/blog/tests.py | 3 --- src/core/tests/test_exhibits_api.py | 8 +++----- src/core/views/views.py | 2 +- src/tests/home_tests.py | 2 -- src/users/admin.py | 1 - 7 files changed, 20 insertions(+), 28 deletions(-) delete mode 100644 src/blog/tests.py diff --git a/poetry.lock b/poetry.lock index 9b2e79a1..5ee76e58 100644 --- a/poetry.lock +++ b/poetry.lock @@ -560,19 +560,19 @@ typing-extensions = "*" [[package]] name = "flake8" -version = "5.0.4" +version = "7.1.1" description = "the modular source code checker: pep8 pyflakes and co" optional = false -python-versions = ">=3.6.1" +python-versions = ">=3.8.1" files = [ - {file = "flake8-5.0.4-py2.py3-none-any.whl", hash = "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248"}, - {file = "flake8-5.0.4.tar.gz", hash = "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db"}, + {file = "flake8-7.1.1-py2.py3-none-any.whl", hash = "sha256:597477df7860daa5aa0fdd84bf5208a043ab96b8e96ab708770ae0364dd03213"}, + {file = "flake8-7.1.1.tar.gz", hash = "sha256:049d058491e228e03e67b390f311bbf88fce2dbaa8fa673e7aea87b7198b8d38"}, ] [package.dependencies] mccabe = ">=0.7.0,<0.8.0" -pycodestyle = ">=2.9.0,<2.10.0" -pyflakes = ">=2.5.0,<2.6.0" +pycodestyle = ">=2.12.0,<2.13.0" +pyflakes = ">=3.2.0,<3.3.0" [[package]] name = "gevent" @@ -1163,13 +1163,13 @@ files = [ [[package]] name = "pycodestyle" -version = "2.9.1" +version = "2.12.1" description = "Python style guide checker" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "pycodestyle-2.9.1-py2.py3-none-any.whl", hash = "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b"}, - {file = "pycodestyle-2.9.1.tar.gz", hash = "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785"}, + {file = "pycodestyle-2.12.1-py2.py3-none-any.whl", hash = "sha256:46f0fb92069a7c28ab7bb558f05bfc0110dac69a0cd23c61ea0040283a9d78b3"}, + {file = "pycodestyle-2.12.1.tar.gz", hash = "sha256:6838eae08bbce4f6accd5d5572075c63626a15ee3e6f842df996bf62f6d73521"}, ] [[package]] @@ -1202,13 +1202,13 @@ dev = ["black", "build", "flake8", "flake8-black", "isort", "jupyter-console", " [[package]] name = "pyflakes" -version = "2.5.0" +version = "3.2.0" description = "passive checker of Python programs" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "pyflakes-2.5.0-py2.py3-none-any.whl", hash = "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2"}, - {file = "pyflakes-2.5.0.tar.gz", hash = "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3"}, + {file = "pyflakes-3.2.0-py2.py3-none-any.whl", hash = "sha256:84b5be138a2dfbb40689ca07e2152deb896a65c3a3e24c251c5c62489568074a"}, + {file = "pyflakes-3.2.0.tar.gz", hash = "sha256:1c61603ff154621fb2a9172037d84dca3500def8c8b630657d1701f026f8af3f"}, ] [[package]] @@ -1764,4 +1764,4 @@ testing = ["coverage[toml]", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = "^3.13" -content-hash = "ded2739ebdae9deb42ce1318d41f22f4e3f6064c3eb0ecb8690c926d7b4b62f2" +content-hash = "8b9145884ec01ef92cf48e589d680facf135adbedd5ce9604986f5f32fde1d1a" diff --git a/pyproject.toml b/pyproject.toml index 73acaf9f..007f3750 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ django-htmx = "^1.18.0" playwright = "^1.41.2" pytest = "^7.2.0" pytest-xdist = "^3.0.2" -flake8 = "^5.0.4" +flake8 = "^7.1.1" black = "^22.10.0" isort = "^5.10.1" pytest-django = "^4.5.2" diff --git a/src/blog/tests.py b/src/blog/tests.py deleted file mode 100644 index 7ce503c2..00000000 --- a/src/blog/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/src/core/tests/test_exhibits_api.py b/src/core/tests/test_exhibits_api.py index e81e9d38..7f0f9114 100644 --- a/src/core/tests/test_exhibits_api.py +++ b/src/core/tests/test_exhibits_api.py @@ -38,12 +38,10 @@ def test_api_exhibit_lists_multiple_exhibits(self): for i in range(0, settings.PAGE_SIZE + 1): marker = Marker.objects.create(owner=self.profile, source=fake_file) obj = Object.objects.create(owner=self.profile, source=fake_file) - artwork = Artwork.objects.create( - author=self.profile, augmented=obj, marker=marker - ) # noqa F841 - exhibit = Exhibit.objects.create( + Artwork.objects.create(author=self.profile, augmented=obj, marker=marker) + Exhibit.objects.create( owner=self.profile, name=f"name_{i}", slug=f"slug_{i}" - ) # noqa F841 + ) response = self.client.get("/api/v1/exhibits/") self.assertEqual(response.status_code, 200) diff --git a/src/core/views/views.py b/src/core/views/views.py index 66eb3cab..7b7d2767 100644 --- a/src/core/views/views.py +++ b/src/core/views/views.py @@ -2,7 +2,7 @@ from core.helpers import handle_upload_image from core.models import Artwork, Exhibit, Marker, Object from django.core.paginator import Paginator -from django.http import HttpResponse, HttpResponseRedirect +from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, redirect, render from django.urls import reverse from django.views.decorators.cache import cache_page diff --git a/src/tests/home_tests.py b/src/tests/home_tests.py index 6e6d5d6f..d325b977 100644 --- a/src/tests/home_tests.py +++ b/src/tests/home_tests.py @@ -1,5 +1,3 @@ -import re - from playwright.sync_api import Page, expect diff --git a/src/users/admin.py b/src/users/admin.py index 189d1f8e..ed3b70ac 100644 --- a/src/users/admin.py +++ b/src/users/admin.py @@ -1,7 +1,6 @@ from typing import Any from django.contrib import admin -from django.contrib.admin.filters import ListFilter from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.db.models import Count, Q