From 24207674f36e900fd2aa51787cb70756413962c2 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 9 Apr 2023 19:57:41 +0200 Subject: deprecate mach_nix --- flake.lock | 197 +++++++++++++++++------- flake.nix | 23 +-- shell.nix | 1 - tools/sops-inventory/default.nix | 17 +- tools/sops-inventory/poetry.lock | 56 +++++++ tools/sops-inventory/pyproject.toml | 17 ++ tools/sops-inventory/setup.py | 11 -- tools/sops-inventory/sops_inventory/__main__.py | 4 +- 8 files changed, 229 insertions(+), 97 deletions(-) create mode 100644 tools/sops-inventory/poetry.lock create mode 100644 tools/sops-inventory/pyproject.toml delete mode 100644 tools/sops-inventory/setup.py diff --git a/flake.lock b/flake.lock index 97488fa3..eb62502f 100644 --- a/flake.lock +++ b/flake.lock @@ -25,27 +25,23 @@ }, "ca-util": { "inputs": { - "mach-nix": [ - "mach-nix" - ], + "flake-parts": "flake-parts_2", "nixpkgs": [ "nixpkgs" ], - "pypi-deps-db": [ - "pypi-deps-db" - ] + "pre-commit-hooks-nix": "pre-commit-hooks-nix_2" }, "locked": { - "lastModified": 1680609133, - "narHash": "sha256-1XpMskoVuRaQ0m+sezbsLXyrZjRNWNZTFbZyRN5R90w=", + "lastModified": 1681061268, + "narHash": "sha256-Da3NnXe1qYD7lmlsKyEeq/Z1TahmBc8VRtALu96v04A=", "owner": "gkleen", "repo": "ca", - "rev": "2fec64bb3e069eb97ab7569c4e2e8cd761452f34", + "rev": "6cd1e33a06da36fcba37cd8c4d6a7eed0f7673bd", "type": "gitlab" }, "original": { "owner": "gkleen", - "ref": "v2.0.3", + "ref": "v2.0.4", "repo": "ca", "type": "gitlab" } @@ -94,6 +90,22 @@ } }, "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1673956053, @@ -128,6 +140,24 @@ "type": "github" } }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1680392223, + "narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-registry": { "flake": false, "locked": { @@ -160,6 +190,21 @@ } }, "flake-utils_2": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { "locked": { "lastModified": 1676283394, "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", @@ -197,54 +242,49 @@ "type": "github" } }, - "home-manager": { + "gitignore_2": { "inputs": { "nixpkgs": [ + "ca-util", + "pre-commit-hooks-nix", "nixpkgs" - ], - "utils": [ - "flake-utils" ] }, "locked": { - "lastModified": 1673654363, - "narHash": "sha256-dBA0iqALyz2J6W02ggttJaIICs/ksku9ZFB5ffoJ7nA=", - "owner": "pasqui23", - "repo": "home-manager", - "rev": "860d9f96de3c02ca3d5121f1a4b6d457c48a3c80", + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", "type": "github" }, "original": { - "owner": "pasqui23", - "repo": "home-manager", - "rev": "860d9f96de3c02ca3d5121f1a4b6d457c48a3c80", + "owner": "hercules-ci", + "repo": "gitignore.nix", "type": "github" } }, - "mach-nix": { + "home-manager": { "inputs": { - "flake-utils": [ - "flake-utils" - ], "nixpkgs": [ "nixpkgs" ], - "pypi-deps-db": [ - "pypi-deps-db" + "utils": [ + "flake-utils" ] }, "locked": { - "lastModified": 1662635943, - "narHash": "sha256-1OBBlBzZ894or8eHZjyADOMnGH89pPUKYGVVS5rwW/0=", - "owner": "DavHau", - "repo": "mach-nix", - "rev": "65266b5cc867fec2cb6a25409dd7cd12251f6107", + "lastModified": 1673654363, + "narHash": "sha256-dBA0iqALyz2J6W02ggttJaIICs/ksku9ZFB5ffoJ7nA=", + "owner": "pasqui23", + "repo": "home-manager", + "rev": "860d9f96de3c02ca3d5121f1a4b6d457c48a3c80", "type": "github" }, "original": { - "owner": "DavHau", - "ref": "65266b5cc867fec2cb6a25409dd7cd12251f6107", - "repo": "mach-nix", + "owner": "pasqui23", + "repo": "home-manager", + "rev": "860d9f96de3c02ca3d5121f1a4b6d457c48a3c80", "type": "github" } }, @@ -303,6 +343,24 @@ "type": "github" } }, + "nixpkgs-lib_2": { + "locked": { + "dir": "lib", + "lastModified": 1680213900, + "narHash": "sha256-cIDr5WZIj3EkKyCgj/6j3HBH4Jj1W296z7HTcWj1aMA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e3652e0735fbec227f342712f180f4f21f0594f2", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs-stable": { "locked": { "lastModified": 1678614274, @@ -320,6 +378,22 @@ } }, "nixpkgs-stable_2": { + "locked": { + "lastModified": 1678872516, + "narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_3": { "locked": { "lastModified": 1669833724, "narHash": "sha256-/HEZNyGbnQecrgJnfE8d0WC5c1xuPSD2LUpB6YXlg4c=", @@ -336,6 +410,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1678898370, + "narHash": "sha256-xTICr1j+uat5hk9FyuPOFGxpWHdJRibwZC+ATi0RbtE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ac718d02867a84b42522a0ece52d841188208f2c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1677329548, "narHash": "sha256-ioEmHjeuCVQfJoR7X8jAXuVcEiZxh7A4bR/Jk2DFlmI=", @@ -400,20 +490,25 @@ "type": "github" } }, - "pypi-deps-db": { - "flake": false, + "pre-commit-hooks-nix_2": { + "inputs": { + "flake-compat": "flake-compat_2", + "flake-utils": "flake-utils_2", + "gitignore": "gitignore_2", + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable_2" + }, "locked": { - "lastModified": 1670518748, - "narHash": "sha256-pfUce0zlRI+tzxPgvRSKkusjxDCBVjCpkcDKWboHa+U=", - "owner": "DavHau", - "repo": "pypi-deps-db", - "rev": "e9571cac25d2f509e44fec9dc94a3703a40126ff", + "lastModified": 1680981441, + "narHash": "sha256-Tqr2mCVssUVp1ZXXMpgYs9+ZonaWrZGPGltJz94FYi4=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "2144d9ddcb550d6dce64a2b44facdc8c5ea2e28a", "type": "github" }, "original": { - "owner": "DavHau", - "ref": "e9571cac25d2f509e44fec9dc94a3703a40126ff", - "repo": "pypi-deps-db", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", "type": "github" } }, @@ -422,16 +517,14 @@ "backup-utils": "backup-utils", "ca-util": "ca-util", "deploy-rs": "deploy-rs", - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "flake-registry": "flake-registry", - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_3", "home-manager": "home-manager", - "mach-nix": "mach-nix", "nix-index-database": "nix-index-database", - "nixpkgs": "nixpkgs_2", - "nixpkgs-stable": "nixpkgs-stable_2", + "nixpkgs": "nixpkgs_3", + "nixpkgs-stable": "nixpkgs-stable_3", "nvfetcher": "nvfetcher", - "pypi-deps-db": "pypi-deps-db", "sops-nix": "sops-nix" } }, diff --git a/flake.nix b/flake.nix index 35934c64..ff2d5b99 100644 --- a/flake.nix +++ b/flake.nix @@ -88,34 +88,13 @@ }; }; - pypi-deps-db = { - type = "github"; - owner = "DavHau"; - repo = "pypi-deps-db"; - ref = "e9571cac25d2f509e44fec9dc94a3703a40126ff"; - flake = false; - }; - mach-nix = { - type = "github"; - owner = "DavHau"; - repo = "mach-nix"; - ref = "65266b5cc867fec2cb6a25409dd7cd12251f6107"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; - pypi-deps-db.follows = "pypi-deps-db"; - }; - }; - ca-util = { type = "gitlab"; owner = "gkleen"; repo = "ca"; - ref = "v2.0.3"; + ref = "v2.0.4"; inputs = { nixpkgs.follows = "nixpkgs"; - mach-nix.follows = "mach-nix"; - pypi-deps-db.follows = "pypi-deps-db"; }; }; backup-utils = { diff --git a/shell.nix b/shell.nix index 8ac83fb9..5bcb8180 100644 --- a/shell.nix +++ b/shell.nix @@ -16,5 +16,4 @@ in pkgs.mkShell { ca-util.packages.${system}.ca poetry ]); - } diff --git a/tools/sops-inventory/default.nix b/tools/sops-inventory/default.nix index 938d99ce..32972ba9 100644 --- a/tools/sops-inventory/default.nix +++ b/tools/sops-inventory/default.nix @@ -1,16 +1,13 @@ -{ system, self, mach-nix, ... }: +{ system, self, ... }: + let pkgs = self.legacyPackages.${system}; -in mach-nix.lib.${system}.buildPythonPackage { - pname = "sops-inventory"; - version = "0.0.0"; - - src = pkgs.lib.sourceByRegex ./. ["^setup\.py$" "^sops_inventory(/[^/]+.*)?$"]; +in +with pkgs.poetry2nix; +mkPoetryApplication { + projectDir = cleanPythonSources { src = ./.; }; - ignoreDataOutdated = true; - requirements = '' - pyyaml - ''; + nativeBuildInputs = with pkgs; [ makeWrapper ]; postInstall = '' wrapProgram $out/bin/sops-inventory \ diff --git a/tools/sops-inventory/poetry.lock b/tools/sops-inventory/poetry.lock new file mode 100644 index 00000000..93fa96de --- /dev/null +++ b/tools/sops-inventory/poetry.lock @@ -0,0 +1,56 @@ +# This file is automatically @generated by Poetry and should not be changed by hand. + +[[package]] +name = "pyyaml" +version = "6.0" +description = "YAML parser and emitter for Python" +category = "main" +optional = false +python-versions = ">=3.6" +files = [ + {file = "PyYAML-6.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53"}, + {file = "PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b"}, + {file = "PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"}, + {file = "PyYAML-6.0-cp310-cp310-win32.whl", hash = "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513"}, + {file = "PyYAML-6.0-cp310-cp310-win_amd64.whl", hash = "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a"}, + {file = "PyYAML-6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d4b0ba9512519522b118090257be113b9468d804b19d63c71dbcf4a48fa32358"}, + {file = "PyYAML-6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:81957921f441d50af23654aa6c5e5eaf9b06aba7f0a19c18a538dc7ef291c5a1"}, + {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:afa17f5bc4d1b10afd4466fd3a44dc0e245382deca5b3c353d8b757f9e3ecb8d"}, + {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dbad0e9d368bb989f4515da330b88a057617d16b6a8245084f1b05400f24609f"}, + {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:432557aa2c09802be39460360ddffd48156e30721f5e8d917f01d31694216782"}, + {file = "PyYAML-6.0-cp311-cp311-win32.whl", hash = "sha256:bfaef573a63ba8923503d27530362590ff4f576c626d86a9fed95822a8255fd7"}, + {file = "PyYAML-6.0-cp311-cp311-win_amd64.whl", hash = "sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf"}, + {file = "PyYAML-6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92"}, + {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4"}, + {file = "PyYAML-6.0-cp36-cp36m-win32.whl", hash = "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293"}, + {file = "PyYAML-6.0-cp36-cp36m-win_amd64.whl", hash = "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57"}, + {file = "PyYAML-6.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4"}, + {file = "PyYAML-6.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9"}, + {file = "PyYAML-6.0-cp37-cp37m-win32.whl", hash = "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737"}, + {file = "PyYAML-6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d"}, + {file = "PyYAML-6.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34"}, + {file = "PyYAML-6.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287"}, + {file = "PyYAML-6.0-cp38-cp38-win32.whl", hash = "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78"}, + {file = "PyYAML-6.0-cp38-cp38-win_amd64.whl", hash = "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07"}, + {file = "PyYAML-6.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b"}, + {file = "PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3"}, + {file = "PyYAML-6.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0"}, + {file = "PyYAML-6.0-cp39-cp39-win32.whl", hash = "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb"}, + {file = "PyYAML-6.0-cp39-cp39-win_amd64.whl", hash = "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c"}, + {file = "PyYAML-6.0.tar.gz", hash = "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"}, +] + +[metadata] +lock-version = "2.0" +python-versions = "^3.10" +content-hash = "9fc7d221b15352d2ee668151f2c2c9d2eb7b7c6eb4a5d4ddcabb94e71f6b9fb7" diff --git a/tools/sops-inventory/pyproject.toml b/tools/sops-inventory/pyproject.toml new file mode 100644 index 00000000..c78588fc --- /dev/null +++ b/tools/sops-inventory/pyproject.toml @@ -0,0 +1,17 @@ +[tool.poetry] +name = "sops_inventory" +version = "0.0.0" +description = "" +authors = ["Gregor Kleen "] + +[tool.poetry.dependencies] +python = "^3.10" +pyyaml = "^6.0" + + +[tool.poetry.scripts] +sops-inventory = 'sops_inventory.__main__:main' + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/tools/sops-inventory/setup.py b/tools/sops-inventory/setup.py deleted file mode 100644 index 3ea2a5d1..00000000 --- a/tools/sops-inventory/setup.py +++ /dev/null @@ -1,11 +0,0 @@ -from setuptools import setup - -setup( - name='sops-inventory', - packages=['sops_inventory'], - entry_points={ - 'console_scripts': [ - 'sops-inventory=sops_inventory.__main__:main' - ], - }, -) diff --git a/tools/sops-inventory/sops_inventory/__main__.py b/tools/sops-inventory/sops_inventory/__main__.py index aaddda8c..f43b7c2f 100644 --- a/tools/sops-inventory/sops_inventory/__main__.py +++ b/tools/sops-inventory/sops_inventory/__main__.py @@ -20,12 +20,14 @@ except ImportError: SOPS_TYPES = frozenset({'kms', 'gcp_kms', 'azure_kv', 'hc_vault', 'age', 'pgp'}) +BUFFER_SIZE = os.sysconf('SC_PAGESIZE') + def readnull(fh): buffer = b'' while True: - chunk = fh.read(4096) + chunk = fh.read(BUFFER_SIZE) buffer += chunk if not buffer: break -- cgit v1.2.3