diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f348d5d..e7a844d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/asottile/yesqa @@ -8,20 +8,20 @@ repos: hooks: - id: yesqa - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.15.2 hooks: - id: pyupgrade args: ["--py38-plus"] - repo: https://github.com/ambv/black - rev: 23.11.0 + rev: 24.4.2 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-added-large-files - id: check-ast @@ -41,16 +41,16 @@ repos: - id: requirements-txt-fixer - id: trailing-whitespace - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.3.0 hooks: - id: codespell exclude_types: [json] - repo: https://github.com/marco-c/taskcluster_yml_validator - rev: v0.0.10 + rev: v0.0.11 hooks: - id: taskcluster_yml - - repo: https://github.com/MozillaSecurity/orion - rev: v0.0.7 + - repo: https://github.com/MozillaSecurity/orion-ci + rev: v0.0.8 hooks: - id: orion_ci - repo: meta diff --git a/src/ffpuppet/__init__.py b/src/ffpuppet/__init__.py index c720d09..b6ede3e 100644 --- a/src/ffpuppet/__init__.py +++ b/src/ffpuppet/__init__.py @@ -1,7 +1,7 @@ -"""FFPuppet module""" # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +"""FFPuppet module""" from .core import Debugger, FFPuppet, Reason from .exceptions import ( diff --git a/src/ffpuppet/__main__.py b/src/ffpuppet/__main__.py index e92f6aa..a0733c4 100644 --- a/src/ffpuppet/__main__.py +++ b/src/ffpuppet/__main__.py @@ -1,7 +1,7 @@ -"""FFPuppet module main""" # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +"""FFPuppet module main""" from .main import main diff --git a/src/ffpuppet/core.py b/src/ffpuppet/core.py index af3929a..997c8b4 100644 --- a/src/ffpuppet/core.py +++ b/src/ffpuppet/core.py @@ -776,7 +776,9 @@ def launch( stdout=self._logs.get_fp("stdout"), ) self._proc_tree = ProcessTree(proc) - if memory_limit and is_windows: + if ( + memory_limit and is_windows + ): # pylint: disable=possibly-used-before-assignment LOG.debug("configuring job object") # pylint: disable=no-member,protected-access config_job_object( diff --git a/src/ffpuppet/job_object.py b/src/ffpuppet/job_object.py index b7f4a8f..acfc844 100644 --- a/src/ffpuppet/job_object.py +++ b/src/ffpuppet/job_object.py @@ -15,7 +15,7 @@ THREAD_SUSPEND_RESUME = 0x0002 -__all__ = ("config_job_object",) +__all__ = ("config_job_object", "resume_suspended_process") __author__ = "Jesse Schwartzentruber" LOG = getLogger(__name__) diff --git a/src/ffpuppet/test_job_object.py b/src/ffpuppet/test_job_object.py index 9383440..b458af5 100644 --- a/src/ffpuppet/test_job_object.py +++ b/src/ffpuppet/test_job_object.py @@ -20,7 +20,7 @@ def test_job_object_01(): """test config_job_object() set limit higher than usage""" with Popen([executable, "-c", "input()"], stdin=PIPE, stderr=PIPE) as proc: - # pylint: disable=no-member,protected-access + # pylint: disable=no-member,protected-access,possibly-used-before-assignment config_job_object(proc._handle, 1024 * 1024 * 1024) proc.communicate(input=b"a", timeout=10) assert proc.wait(10) == 0 @@ -33,7 +33,7 @@ def test_job_object_02(): stdin=PIPE, stderr=PIPE, ) as proc: - # pylint: disable=no-member,protected-access + # pylint: disable=no-member,protected-access,possibly-used-before-assignment config_job_object(proc._handle, 32 * 1024 * 1024) _, err = proc.communicate(input=b"a", timeout=10) assert proc.wait(10) == 1 @@ -53,12 +53,13 @@ def test_thread_resume(): "run([sys.executable, '-c', " "\"input(); a = ['A' * 1024 * 1024 for _ in range(50)]\"], check=True)", ], + # pylint: disable=possibly-used-before-assignment creationflags=CREATE_SUSPENDED, stdin=PIPE, stderr=PIPE, ) as proc: sleep(0.1) - # pylint: disable=no-member,protected-access + # pylint: disable=no-member,protected-access,possibly-used-before-assignment config_job_object(proc._handle, 32 * 1024 * 1024) resume_suspended_process(proc.pid) _, err = proc.communicate(input=b"a", timeout=10) diff --git a/tox.ini b/tox.ini index 5abdcff..b9d108c 100644 --- a/tox.ini +++ b/tox.ini @@ -41,14 +41,14 @@ skip_install = true commands = mypy --install-types --non-interactive {posargs} deps = - mypy==v1.7.1 + mypy==v1.10.0 usedevelop = true [testenv:pylint] commands = pylint -j 0 {posargs} deps = - pylint==3.0.2 + pylint==3.2.3 pytest-mock usedevelop = true