Skip to content

Commit

Permalink
Merge pull request #730 from crim-ca/update-pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
fmigneault authored Oct 9, 2024
2 parents 2995aeb + f61e4bc commit d4ffd34
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 8 deletions.
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ disable=C0111,missing-docstring,
R0912,too-many-branches,
R0914,too-many-locals,
R0915,too-many-statements,
R0917,too-many-positional-arguments,
R1705,no-else-return,
R1710,inconsistent-return-statements,
R1711,useless-return,
Expand Down
7 changes: 5 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ pytest-server-fixtures
pytest-rerunfailures
pydocstyle
# FIXME: pylint-quotes failing with pylint==3 (https://github.com/edaniszewski/pylint-quotes/issues/29)
pylint>=2.15.4,<3
# FIXME: use temporary unofficial version working with pylint>3 (https://github.com/edaniszewski/pylint-quotes/pull/30)
# pylint>=2.15.4,<3
# pylint_quotes
pylint>=3,<4
pylint_quotes @ git+https://github.com/marekhanus/[email protected]
pylint-per-file-ignores
pylint_quotes
responses
safety
stopit
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_docker_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def wps_execute(self, version, accept, url=None):
status_url = resp.json["location"]
job_id = resp.json["jobID"]
assert status_url
assert job_id
assert job_id # pylint: disable=E0606

if accept == ContentType.APP_XML:
wps_out_url = self.settings["weaver.wps_output_url"]
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1239,7 +1239,7 @@ def mocked_dismiss_process():
yield # for direct use by context or decorator
finally:
# used by ExitStack context, which would handle the exception appropriately
return mock_celery_revoke # noqa: B012 # pylint: disable=W0150,lost-exception
return mock_celery_revoke # noqa: B012 # pylint: disable=W0134,W0150,lost-exception


def mocked_process_job_runner(job_task_id="mocked-job-id"):
Expand Down
3 changes: 3 additions & 0 deletions tests/wps_restapi/test_colander_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
Tests for :mod:`weaver.wps_restapi.colander_extras` operations applied on :mod:`weaver.wps_restapi.swagger_definitions`
objects.
"""

# pylint: disable=E0241,duplicate-bases

import copy
import inspect
import json
Expand Down
4 changes: 2 additions & 2 deletions tests/wps_restapi/test_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def test_get_jobs_valid_grouping_by_process(self):
else:
cat = categories["process"]
pytest.fail(f"Unknown job grouping 'process' value: {cat}")
self.assert_equal_with_jobs_diffs(grouped_jobs["jobs"], expect) # noqa
self.assert_equal_with_jobs_diffs(grouped_jobs["jobs"], expect) # noqa # pylint: disable=E0606

def template_get_jobs_valid_grouping_by_service_provider(self, service_or_provider):
path = get_path_kvp(sd.jobs_service.path, detail="false", groups=service_or_provider)
Expand Down Expand Up @@ -412,7 +412,7 @@ def template_get_jobs_valid_grouping_by_service_provider(self, service_or_provid
else:
cat = categories[service_or_provider]
pytest.fail(f"Unknown job grouping 'service' value: {cat}")
self.assert_equal_with_jobs_diffs(grouped_jobs["jobs"], expect) # noqa
self.assert_equal_with_jobs_diffs(grouped_jobs["jobs"], expect) # noqa # pylint: disable=E0606

def test_get_jobs_valid_grouping_by_service(self):
self.template_get_jobs_valid_grouping_by_service_provider("service")
Expand Down
3 changes: 1 addition & 2 deletions weaver/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3210,8 +3210,7 @@ def _list_refs(_url, _data=None):
if not _ref.endswith("/"):
yield _ref
else:
for _sub_ref in _list_refs(_ref):
yield _sub_ref
yield from _list_refs(_ref)

files = list(_list_refs(base_url, html_data))
return fetch_files_url(
Expand Down
3 changes: 3 additions & 0 deletions weaver/wps_restapi/colander_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
of generated OpenAPI model definitions. If not explicitly provided, the
value of ``title`` **WILL** default to the name of the schema node class.
"""

# pylint: disable=E0241,duplicate-bases

import copy
import inspect
import re
Expand Down
3 changes: 3 additions & 0 deletions weaver/wps_restapi/swagger_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
The definitions are also employed to generate the `OpenAPI` definitions reported in the documentation published
on `Weaver`'s `ReadTheDocs` page.
"""

# pylint: disable=C0103,invalid-name
# pylint: disable=E0241,duplicate-bases

import datetime
import inspect
import os
Expand Down

0 comments on commit d4ffd34

Please sign in to comment.