From b82b350b38147ac7ddf6ec41027ebe07dc15f913 Mon Sep 17 00:00:00 2001 From: arvidn Date: Mon, 3 Jul 2023 14:11:16 +0200 Subject: [PATCH] Updated numerous repo addresses & revs of pre-commit-hooks. on behalf of @xavier2k6 --- .pre-commit-config.yaml | 18 ++++++++-------- bindings/python/setup.py | 1 - pyproject.toml | 44 ++++++++++++++++++++-------------------- tools/vmstat.py | 5 ----- 4 files changed, 31 insertions(+), 37 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8fef8dd7742..2505ddb9b23 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: #- id: trailing-whitespace #- id: end-of-file-fixer @@ -32,12 +32,12 @@ repos: - id: check-symlinks - id: check-toml - repo: https://github.com/pappasam/toml-sort - rev: v0.20.1 + rev: v0.23.1 hooks: - id: toml-sort args: [--all, --in-place] - repo: https://github.com/pre-commit/pygrep-hooks - rev: v1.9.0 + rev: v1.10.0 hooks: - id: rst-directive-colons - id: rst-inline-touching-normal @@ -71,8 +71,8 @@ repos: tools/run_benchmark.py| tools/update_copyright.py )$ -- repo: https://github.com/myint/autoflake - rev: v1.7.6 +- repo: https://github.com/PyCQA/autoflake + rev: v2.1.1 hooks: - id: autoflake args: [--in-place, --remove-unused-variables, --remove-all-unused-imports, --remove-duplicate-keys] @@ -85,8 +85,8 @@ repos: tools/gen_convenience_header.py| tools/libtorrent_lldb.py ) -- repo: https://github.com/python/black - rev: 22.10.0 +- repo: https://github.com/psf/black + rev: 23.3.0 hooks: - id: black # Avoiding PR bloat @@ -132,7 +132,7 @@ repos: name: black (pyi) types: [pyi] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.982 + rev: v1.3.0 hooks: - id: mypy # Avoiding PR bloat @@ -171,7 +171,7 @@ repos: tools/update_copyright.py )$ - repo: https://github.com/PyCQA/flake8 - rev: 5.0.4 + rev: 6.0.0 hooks: - id: flake8 exclude: | diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 3653b9ae38a..0eb07c2b5c6 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -174,7 +174,6 @@ def write_b2_python_config( class LibtorrentBuildExt(build_ext_lib.build_ext): - CONFIG_MODE_DISTUTILS = "distutils" CONFIG_MODE_B2 = "b2" CONFIG_MODES = (CONFIG_MODE_DISTUTILS, CONFIG_MODE_B2) diff --git a/pyproject.toml b/pyproject.toml index ffae80da36b..a3b0b8c6955 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,36 +6,36 @@ skip = "{pp*,}" [tool.cibuildwheel.macos] before-all = [ - "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", - "brew install openssl", + "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", + "brew install openssl" ] test-command = [ - "cd {project}/bindings/python", - "python test.py", + "cd {project}/bindings/python", + "python test.py" ] [tool.cibuildwheel.macos.environment] BOOST_BUILD_PATH = "/tmp/boost/tools/build" BOOST_ROOT = "/tmp/boost" BOOST_VERSION = "1.81.0" -MACOSX_DEPLOYMENT_TARGET = "10.9" # required for full C++11 support +MACOSX_DEPLOYMENT_TARGET = "10.9" # required for full C++11 support PATH = "/tmp/boost:$PATH" [[tool.cibuildwheel.overrides]] before-all = [ - "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", - "yum install -y glibc-static", # needed for libutil.a and libdl.a - "./tools/cibuildwheel/setup_ccache_on_manylinux.sh", - "./tools/cibuildwheel/setup_openssl.sh", + "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", + "./tools/cibuildwheel/setup_ccache_on_manylinux.sh", + "./tools/cibuildwheel/setup_openssl.sh", + "yum install -y glibc-static" # needed for libutil.a and libdl.a ] before-test = "ccache -s" select = "*-manylinux_*" test-command = [ - "cd {project}/bindings/python", - "python test.py", + "cd {project}/bindings/python", + "python test.py" ] -[tool.cibuildwheel.overrides.environment] # sub-table of previous block! +[tool.cibuildwheel.overrides.environment] # sub-table of previous block! BOOST_BUILD_PATH = "/tmp/boost/tools/build" BOOST_ROOT = "/tmp/boost" BOOST_VERSION = "1.81.0" @@ -43,18 +43,18 @@ PATH = "/usr/local/ccache/bin:/tmp/boost:$PATH" [[tool.cibuildwheel.overrides]] before-all = [ - "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", - "apk add ccache openssl-dev openssl-libs-static", - "./tools/cibuildwheel/setup_openssl.sh", + "./tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT", + "./tools/cibuildwheel/setup_openssl.sh", + "apk add ccache openssl-dev openssl-libs-static" ] before-test = "ccache -s" select = "*-musllinux_*" test-command = [ - "cd {project}/bindings/python", - "python test.py", + "cd {project}/bindings/python", + "python test.py" ] -[tool.cibuildwheel.overrides.environment] # sub-table of previous block! +[tool.cibuildwheel.overrides.environment] # sub-table of previous block! BOOST_BUILD_PATH = "/tmp/boost/tools/build" BOOST_ROOT = "/tmp/boost" BOOST_VERSION = "1.81.0" @@ -62,15 +62,15 @@ PATH = "/usr/lib/ccache/bin:/tmp/boost:$PATH" [[tool.cibuildwheel.overrides]] before-all = [ - "bash -c './tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT'", - "bash -c 'choco install --no-progress --x86 openssl'", # choco only allows EITHER 32 OR 64-bit version of a package + "bash -c './tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT'", + "bash -c 'choco install --no-progress --x86 openssl'" # choco only allows EITHER 32 OR 64-bit version of a package ] select = "*-win32" [[tool.cibuildwheel.overrides]] before-all = [ - "bash -c './tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT'", - "bash -c 'choco install --no-progress openssl'", # choco only allows EITHER 32 OR 64-bit version of a package + "bash -c './tools/cibuildwheel/setup_boost.sh $BOOST_VERSION $BOOST_ROOT'", + "bash -c 'choco install --no-progress openssl'" # choco only allows EITHER 32 OR 64-bit version of a package ] select = "*-win_amd64" diff --git a/tools/vmstat.py b/tools/vmstat.py index 75796fddac1..13ec91654c0 100644 --- a/tools/vmstat.py +++ b/tools/vmstat.py @@ -174,7 +174,6 @@ def add_counter(key: str, val: float) -> None: val = val / time_delta output[key] = [val] else: - if m.cumulative: raw_val = val val = (val - output[key + "-raw"][-1]) / time_delta @@ -209,7 +208,6 @@ def add_counter(key: str, val: float) -> None: # Locked: 0 kB else: - import psutil def capture_sample( @@ -231,7 +229,6 @@ def capture_sample( output["time"].append(timestamp) for key in dir(mem): - if key not in metrics: if not key.startswith("_") and key not in [ "pagefile", @@ -259,7 +256,6 @@ def capture_sample( output[key].append(val) for key in dir(io_cnt): - if key not in metrics: if not key.startswith("_") and key not in [ "pagefile", @@ -286,7 +282,6 @@ def capture_sample( def print_output_to_file(out: Dict[str, List[int]], filename: str) -> List[str]: - if out == {}: return []