From 7acc4b9f7f0e8a1a6e02b1b2f4e29001bc9f303c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 23:18:54 +0000 Subject: [PATCH 1/2] Bump ruff from 0.5.4 to 0.6.4 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.5.4 to 0.6.4. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.5.4...0.6.4) --- updated-dependencies: - dependency-name: ruff dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- poetry.lock | 40 ++++++++++++++++++++-------------------- pyproject.toml | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/poetry.lock b/poetry.lock index 001346bea..a3a3323fa 100644 --- a/poetry.lock +++ b/poetry.lock @@ -641,29 +641,29 @@ files = [ [[package]] name = "ruff" -version = "0.5.4" +version = "0.6.4" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.5.4-py3-none-linux_armv6l.whl", hash = "sha256:82acef724fc639699b4d3177ed5cc14c2a5aacd92edd578a9e846d5b5ec18ddf"}, - {file = "ruff-0.5.4-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:da62e87637c8838b325e65beee485f71eb36202ce8e3cdbc24b9fcb8b99a37be"}, - {file = "ruff-0.5.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e98ad088edfe2f3b85a925ee96da652028f093d6b9b56b76fc242d8abb8e2059"}, - {file = "ruff-0.5.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4c55efbecc3152d614cfe6c2247a3054cfe358cefbf794f8c79c8575456efe19"}, - {file = "ruff-0.5.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f9b85eaa1f653abd0a70603b8b7008d9e00c9fa1bbd0bf40dad3f0c0bdd06793"}, - {file = "ruff-0.5.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0cf497a47751be8c883059c4613ba2f50dd06ec672692de2811f039432875278"}, - {file = "ruff-0.5.4-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:09c14ed6a72af9ccc8d2e313d7acf7037f0faff43cde4b507e66f14e812e37f7"}, - {file = "ruff-0.5.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:628f6b8f97b8bad2490240aa84f3e68f390e13fabc9af5c0d3b96b485921cd60"}, - {file = "ruff-0.5.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3520a00c0563d7a7a7c324ad7e2cde2355733dafa9592c671fb2e9e3cd8194c1"}, - {file = "ruff-0.5.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:93789f14ca2244fb91ed481456f6d0bb8af1f75a330e133b67d08f06ad85b516"}, - {file = "ruff-0.5.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:029454e2824eafa25b9df46882f7f7844d36fd8ce51c1b7f6d97e2615a57bbcc"}, - {file = "ruff-0.5.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:9492320eed573a13a0bc09a2957f17aa733fff9ce5bf00e66e6d4a88ec33813f"}, - {file = "ruff-0.5.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a6e1f62a92c645e2919b65c02e79d1f61e78a58eddaebca6c23659e7c7cb4ac7"}, - {file = "ruff-0.5.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:768fa9208df2bec4b2ce61dbc7c2ddd6b1be9fb48f1f8d3b78b3332c7d71c1ff"}, - {file = "ruff-0.5.4-py3-none-win32.whl", hash = "sha256:e1e7393e9c56128e870b233c82ceb42164966f25b30f68acbb24ed69ce9c3a4e"}, - {file = "ruff-0.5.4-py3-none-win_amd64.whl", hash = "sha256:58b54459221fd3f661a7329f177f091eb35cf7a603f01d9eb3eb11cc348d38c4"}, - {file = "ruff-0.5.4-py3-none-win_arm64.whl", hash = "sha256:bd53da65f1085fb5b307c38fd3c0829e76acf7b2a912d8d79cadcdb4875c1eb7"}, - {file = "ruff-0.5.4.tar.gz", hash = "sha256:2795726d5f71c4f4e70653273d1c23a8182f07dd8e48c12de5d867bfb7557eed"}, + {file = "ruff-0.6.4-py3-none-linux_armv6l.whl", hash = "sha256:c4b153fc152af51855458e79e835fb6b933032921756cec9af7d0ba2aa01a258"}, + {file = "ruff-0.6.4-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:bedff9e4f004dad5f7f76a9d39c4ca98af526c9b1695068198b3bda8c085ef60"}, + {file = "ruff-0.6.4-py3-none-macosx_11_0_arm64.whl", hash = "sha256:d02a4127a86de23002e694d7ff19f905c51e338c72d8e09b56bfb60e1681724f"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7862f42fc1a4aca1ea3ffe8a11f67819d183a5693b228f0bb3a531f5e40336fc"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eebe4ff1967c838a1a9618a5a59a3b0a00406f8d7eefee97c70411fefc353617"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:932063a03bac394866683e15710c25b8690ccdca1cf192b9a98260332ca93408"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:50e30b437cebef547bd5c3edf9ce81343e5dd7c737cb36ccb4fe83573f3d392e"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c44536df7b93a587de690e124b89bd47306fddd59398a0fb12afd6133c7b3818"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ea086601b22dc5e7693a78f3fcfc460cceabfdf3bdc36dc898792aba48fbad6"}, + {file = "ruff-0.6.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b52387d3289ccd227b62102c24714ed75fbba0b16ecc69a923a37e3b5e0aaaa"}, + {file = "ruff-0.6.4-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:0308610470fcc82969082fc83c76c0d362f562e2f0cdab0586516f03a4e06ec6"}, + {file = "ruff-0.6.4-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:803b96dea21795a6c9d5bfa9e96127cc9c31a1987802ca68f35e5c95aed3fc0d"}, + {file = "ruff-0.6.4-py3-none-musllinux_1_2_i686.whl", hash = "sha256:66dbfea86b663baab8fcae56c59f190caba9398df1488164e2df53e216248baa"}, + {file = "ruff-0.6.4-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:34d5efad480193c046c86608dbba2bccdc1c5fd11950fb271f8086e0c763a5d1"}, + {file = "ruff-0.6.4-py3-none-win32.whl", hash = "sha256:f0f8968feea5ce3777c0d8365653d5e91c40c31a81d95824ba61d871a11b8523"}, + {file = "ruff-0.6.4-py3-none-win_amd64.whl", hash = "sha256:549daccee5227282289390b0222d0fbee0275d1db6d514550d65420053021a58"}, + {file = "ruff-0.6.4-py3-none-win_arm64.whl", hash = "sha256:ac4b75e898ed189b3708c9ab3fc70b79a433219e1e87193b4f2b77251d058d14"}, + {file = "ruff-0.6.4.tar.gz", hash = "sha256:ac3b5bfbee99973f80aa1b7cbd1c9cbce200883bdd067300c22a6cc1c7fba212"}, ] [[package]] @@ -798,4 +798,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "5c8b3ee5a6e4fab0203e868b8fd85a7b3baa8be0f9c81da00648e8a5fd0641ec" +content-hash = "47d418b0ad57f239aaf79f8fc530c03ecd629fbb1758f0fd8dc97947884030a3" diff --git a/pyproject.toml b/pyproject.toml index e2ece68c6..8d297ce74 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ license = "AGPLv3+" python = "^3.11" [tool.poetry.group.dev.dependencies] -ruff = "^0.5.4" +ruff = "^0.6.4" safety = "*" shellcheck-py = "*" From dffdfcc7b84a3677c8dae9cc93cd0192a59acb2b Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Fri, 6 Sep 2024 19:27:27 -0400 Subject: [PATCH 2/2] Autofix removal of pytest fixture/marker parenthesis ruff has changed its defaults (see ) to better match what pytest intended, so let's just follow it. --- client/tests/conftest.py | 44 +++++++++++++-------------- client/tests/gui/base/test_dialogs.py | 2 +- client/tests/integration/conftest.py | 12 ++++---- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/client/tests/conftest.py b/client/tests/conftest.py index 39f8f1654..0a3d24973 100644 --- a/client/tests/conftest.py +++ b/client/tests/conftest.py @@ -52,7 +52,7 @@ TIME_KEYCLICK_ACTION = 5000 -@pytest.fixture() +@pytest.fixture def lang(request): """ Setup: Override $LANG as parameterized and configure locale accordingly. @@ -73,7 +73,7 @@ def lang(request): configure_locale_and_language() -@pytest.fixture() +@pytest.fixture def print_dialog(request, mocker): """ Fixture that returns a print dialog. Tests using this fixture must @@ -117,7 +117,7 @@ def _stub_export(mocker, status_string=None): return export -@pytest.fixture() +@pytest.fixture def export_wizard_multifile(mocker, homedir): mocker.patch("PyQt5.QtWidgets.QApplication.activeWindow", return_value=QMainWindow()) @@ -130,7 +130,7 @@ def export_wizard_multifile(mocker, homedir): ) -@pytest.fixture() +@pytest.fixture def export_wizard(mocker, homedir): mocker.patch("PyQt5.QtWidgets.QApplication.activeWindow", return_value=QMainWindow()) @@ -139,7 +139,7 @@ def export_wizard(mocker, homedir): return conversation.ExportWizard(export_device, "file123.jpg", ["/mock/path/to/file"]) -@pytest.fixture() +@pytest.fixture def export_transcript_wizard(mocker, homedir): mocker.patch("PyQt5.QtWidgets.QApplication.activeWindow", return_value=QMainWindow()) @@ -148,7 +148,7 @@ def export_transcript_wizard(mocker, homedir): return conversation.ExportWizard(export_device, "transcript.txt", ["/some/path/transcript.txt"]) -@pytest.fixture() +@pytest.fixture def i18n(): """ Set up locale/language/gettext functions. This enables the use of _(). @@ -156,7 +156,7 @@ def i18n(): configure_locale_and_language() -@pytest.fixture() +@pytest.fixture def homedir(i18n): """ Create a "homedir" for a client. @@ -180,7 +180,7 @@ def homedir(i18n): return tmpdir -@pytest.fixture() +@pytest.fixture def mock_export_locked(): """ Represents the following scenario: @@ -211,7 +211,7 @@ def get_status() -> ExportStatus: return device -@pytest.fixture() +@pytest.fixture def mock_export_unlocked(): """ Represents the following scenario: @@ -233,7 +233,7 @@ def mock_export_unlocked(): return device -@pytest.fixture() +@pytest.fixture def mock_export_no_usb_then_bad_passphrase(): """ Represents the following scenario: @@ -266,7 +266,7 @@ def get_status() -> ExportStatus: return device -@pytest.fixture() +@pytest.fixture def mock_export_fail_early(): """ Represents the following scenario: @@ -299,7 +299,7 @@ def get_status() -> ExportStatus: return device -@pytest.fixture() +@pytest.fixture def functional_test_app_started_context( vcr_api, homedir, reply_status_codes, session, config, qtbot ): @@ -323,7 +323,7 @@ def login_dialog_is_visible(): return (gui, controller) -@pytest.fixture() +@pytest.fixture def functional_test_logged_in_context(functional_test_app_started_context, qtbot): """ Returns a tuple containing the gui window and controller of a configured client after logging in @@ -348,7 +348,7 @@ def logged_in(): return (gui, controller) -@pytest.fixture() +@pytest.fixture def functional_test_offline_context(functional_test_logged_in_context, qtbot): """ Returns a tuple containing the gui window and controller of a configured client after making @@ -374,12 +374,12 @@ def check_login_button(): return (gui, controller) -@pytest.fixture() +@pytest.fixture def config(homedir) -> str: os.environ["SD_SUBMISSION_KEY_FPR"] = "65A1B5FF195B56353CC63DFFCC40EF1228271441" -@pytest.fixture() +@pytest.fixture def alembic_config(homedir): return _alembic_config(homedir) @@ -401,12 +401,12 @@ def _alembic_config(homedir): return alembic_path -@pytest.fixture() +@pytest.fixture def session_maker(homedir): return make_session_maker(homedir) -@pytest.fixture() +@pytest.fixture def session(session_maker): sess = session_maker Base.metadata.create_all(bind=sess.get_bind(), checkfirst=False) @@ -414,7 +414,7 @@ def session(session_maker): sess.close() -@pytest.fixture() +@pytest.fixture def reply_status_codes(session) -> None: for reply_send_status in ReplySendStatusCodes: reply_status = ReplySendStatus(reply_send_status.value) @@ -422,7 +422,7 @@ def reply_status_codes(session) -> None: session.commit() -@pytest.fixture() +@pytest.fixture def download_error_codes(session) -> None: for download_error_code in DownloadErrorCodes: download_error = DownloadError(download_error_code.name) @@ -430,7 +430,7 @@ def download_error_codes(session) -> None: session.commit() -@pytest.fixture() +@pytest.fixture def source(session) -> dict: args = {"uuid": str(uuid4()), "public_key": PUB_KEY} source = Source( @@ -473,7 +473,7 @@ def create_gpg_test_context(sdc_home): ) -@pytest.fixture() +@pytest.fixture def vcr_api(request): module_group = request.module.__name__.split(".")[1] library = vcr.VCR(cassette_library_dir=f"tests/{module_group}/data/") diff --git a/client/tests/gui/base/test_dialogs.py b/client/tests/gui/base/test_dialogs.py index 8e904b44d..a18d35316 100644 --- a/client/tests/gui/base/test_dialogs.py +++ b/client/tests/gui/base/test_dialogs.py @@ -6,7 +6,7 @@ from securedrop_client.gui.base import ModalDialog -@pytest.fixture() +@pytest.fixture def modal_dialog(mocker, homedir): mocker.patch("PyQt5.QtWidgets.QApplication.activeWindow", return_value=QMainWindow()) diff --git a/client/tests/integration/conftest.py b/client/tests/integration/conftest.py index eda333c58..ae7ad55d0 100644 --- a/client/tests/integration/conftest.py +++ b/client/tests/integration/conftest.py @@ -11,7 +11,7 @@ from tests import factory -@pytest.fixture() +@pytest.fixture def main_window(mocker, homedir): # Setup app = QApplication([]) @@ -63,7 +63,7 @@ def main_window(mocker, homedir): app.exit() -@pytest.fixture() +@pytest.fixture def main_window_no_key(mocker, homedir): # Setup app = QApplication([]) @@ -115,7 +115,7 @@ def main_window_no_key(mocker, homedir): app.exit() -@pytest.fixture() +@pytest.fixture def modal_dialog(mocker, homedir): app = QApplication([]) gui = Window() @@ -146,7 +146,7 @@ def modal_dialog(mocker, homedir): app.exit() -@pytest.fixture() +@pytest.fixture def mock_export(mocker): export = Export() @@ -164,7 +164,7 @@ def mock_export(mocker): return export -@pytest.fixture() +@pytest.fixture def print_dialog(mocker, homedir, mock_export): app = QApplication([]) gui = Window() @@ -198,7 +198,7 @@ def print_dialog(mocker, homedir, mock_export): app.exit() -@pytest.fixture() +@pytest.fixture def export_file_wizard(mocker, homedir, mock_export): app = QApplication([]) gui = Window()