Skip to content

Commit

Permalink
Use flake8 directly instead of unmaintained pytest plugin
Browse files Browse the repository at this point in the history
The plugin isn't compatible to newer flake8 versions but doesn't seem to
be maintained. So just directly call flake8.
  • Loading branch information
tobiasbrunner committed Oct 3, 2023
1 parent e7fb35b commit b6a3798
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
8 changes: 8 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[flake8]
extend-exclude =
*/migrations/*
*/settings/*
*/tests/*
per-file-ignores =
__init__.py:F401,F403
max-line-length = 109
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
pip install -r requirements-tests.txt
- name: Run unit tests
run: ./runtests.py --no-cov --no-vici
- name: Run flake8
run: flake8 strongMan/

docker:
runs-on: ubuntu-latest
Expand Down
8 changes: 1 addition & 7 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
[pytest]
addopts = --tb=short --flake8
addopts = --tb=short
filterwarnings =
error
ignore:SelectableGroups dict interface is deprecated::flake8
ignore:'cgi' is deprecated and slated for removal in Python 3.13:DeprecationWarning
flake8-ignore =
*/migrations/* ALL
*/tests/* ALL
__init__.py F401 F403
flake8-max-line-length = 109
2 changes: 1 addition & 1 deletion requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-r requirements.txt
flake8
pytest==7.4.2
pytest-django==4.1.0
pytest-flake8==1.0.7
coverage==5.3.1
2 changes: 1 addition & 1 deletion strongMan/apps/connections/forms/ConnectionForms.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def get_models(cls):
def subclass(self, connection):
typ = type(connection)
for model, form_name in self.get_models():
if type(model) == typ:
if type(model) is typ:
form_class = getattr(sys.modules[__name__], form_name)
return form_class()
return self
Expand Down
2 changes: 1 addition & 1 deletion strongMan/apps/server_connections/forms/ConnectionForms.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_models(cls):
def subclass(self, connection):
typ = type(connection)
for model, form_name in self.get_models():
if type(model) == typ:
if type(model) is typ:
form_class = getattr(sys.modules[__name__], form_name)
return form_class()
return self
Expand Down
2 changes: 1 addition & 1 deletion strongMan/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "strongMan.settings.local")

application = Cling(get_wsgi_application())
application = Cling(get_wsgi_application())

0 comments on commit b6a3798

Please sign in to comment.