From 9ded089b76d4afa72901dfdd6ad6a340201ffcb8 Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Fri, 3 Nov 2023 14:07:35 +0000 Subject: [PATCH 1/3] Update depencies --- poetry.lock | 52 +++++++++++++++++++++++++------------------------- pyproject.toml | 6 +++--- src/fib.zig | 11 +++++++---- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/poetry.lock b/poetry.lock index 1f94d53..b44d180 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2,13 +2,13 @@ [[package]] name = "annotated-types" -version = "0.5.0" +version = "0.6.0" description = "Reusable constraint types to use with typing.Annotated" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "annotated_types-0.5.0-py3-none-any.whl", hash = "sha256:58da39888f92c276ad970249761ebea80ba544b77acddaa1a4d6cf78287d45fd"}, - {file = "annotated_types-0.5.0.tar.gz", hash = "sha256:47cdc3490d9ac1506ce92c7aaa76c579dc3509ff11e098fc867e5130ab7be802"}, + {file = "annotated_types-0.6.0-py3-none-any.whl", hash = "sha256:0641064de18ba7a25dee8f96403ebc39113d0cb953a01429249d5c7564666a43"}, + {file = "annotated_types-0.6.0.tar.gz", hash = "sha256:563339e807e53ffd9c267e99fc6d9ea23eb8443c08f112651963e24e22f84a5d"}, ] [[package]] @@ -309,28 +309,28 @@ testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "no [[package]] name = "ruff" -version = "0.0.292" +version = "0.1.3" description = "An extremely fast Python linter, written in Rust." optional = false python-versions = ">=3.7" files = [ - {file = "ruff-0.0.292-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:02f29db018c9d474270c704e6c6b13b18ed0ecac82761e4fcf0faa3728430c96"}, - {file = "ruff-0.0.292-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:69654e564342f507edfa09ee6897883ca76e331d4bbc3676d8a8403838e9fade"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c3c91859a9b845c33778f11902e7b26440d64b9d5110edd4e4fa1726c41e0a4"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f4476f1243af2d8c29da5f235c13dca52177117935e1f9393f9d90f9833f69e4"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:be8eb50eaf8648070b8e58ece8e69c9322d34afe367eec4210fdee9a555e4ca7"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:9889bac18a0c07018aac75ef6c1e6511d8411724d67cb879103b01758e110a81"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6bdfabd4334684a4418b99b3118793f2c13bb67bf1540a769d7816410402a205"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:aa7c77c53bfcd75dbcd4d1f42d6cabf2485d2e1ee0678da850f08e1ab13081a8"}, - {file = "ruff-0.0.292-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e087b24d0d849c5c81516ec740bf4fd48bf363cfb104545464e0fca749b6af9"}, - {file = "ruff-0.0.292-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:f160b5ec26be32362d0774964e218f3fcf0a7da299f7e220ef45ae9e3e67101a"}, - {file = "ruff-0.0.292-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:ac153eee6dd4444501c4bb92bff866491d4bfb01ce26dd2fff7ca472c8df9ad0"}, - {file = "ruff-0.0.292-py3-none-musllinux_1_2_i686.whl", hash = "sha256:87616771e72820800b8faea82edd858324b29bb99a920d6aa3d3949dd3f88fb0"}, - {file = "ruff-0.0.292-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:b76deb3bdbea2ef97db286cf953488745dd6424c122d275f05836c53f62d4016"}, - {file = "ruff-0.0.292-py3-none-win32.whl", hash = "sha256:e854b05408f7a8033a027e4b1c7f9889563dd2aca545d13d06711e5c39c3d003"}, - {file = "ruff-0.0.292-py3-none-win_amd64.whl", hash = "sha256:f27282bedfd04d4c3492e5c3398360c9d86a295be00eccc63914438b4ac8a83c"}, - {file = "ruff-0.0.292-py3-none-win_arm64.whl", hash = "sha256:7f67a69c8f12fbc8daf6ae6d36705037bde315abf8b82b6e1f4c9e74eb750f68"}, - {file = "ruff-0.0.292.tar.gz", hash = "sha256:1093449e37dd1e9b813798f6ad70932b57cf614e5c2b5c51005bf67d55db33ac"}, + {file = "ruff-0.1.3-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:b46d43d51f7061652eeadb426a9e3caa1e0002470229ab2fc19de8a7b0766901"}, + {file = "ruff-0.1.3-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:b8afeb9abd26b4029c72adc9921b8363374f4e7edb78385ffaa80278313a15f9"}, + {file = "ruff-0.1.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca3cf365bf32e9ba7e6db3f48a4d3e2c446cd19ebee04f05338bc3910114528b"}, + {file = "ruff-0.1.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4874c165f96c14a00590dcc727a04dca0cfd110334c24b039458c06cf78a672e"}, + {file = "ruff-0.1.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eec2dd31eed114e48ea42dbffc443e9b7221976554a504767ceaee3dd38edeb8"}, + {file = "ruff-0.1.3-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:dc3ec4edb3b73f21b4aa51337e16674c752f1d76a4a543af56d7d04e97769613"}, + {file = "ruff-0.1.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2e3de9ed2e39160800281848ff4670e1698037ca039bda7b9274f849258d26ce"}, + {file = "ruff-0.1.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1c595193881922cc0556a90f3af99b1c5681f0c552e7a2a189956141d8666fe8"}, + {file = "ruff-0.1.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f75e670d529aa2288cd00fc0e9b9287603d95e1536d7a7e0cafe00f75e0dd9d"}, + {file = "ruff-0.1.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:76dd49f6cd945d82d9d4a9a6622c54a994689d8d7b22fa1322983389b4892e20"}, + {file = "ruff-0.1.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:918b454bc4f8874a616f0d725590277c42949431ceb303950e87fef7a7d94cb3"}, + {file = "ruff-0.1.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:d8859605e729cd5e53aa38275568dbbdb4fe882d2ea2714c5453b678dca83784"}, + {file = "ruff-0.1.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:0b6c55f5ef8d9dd05b230bb6ab80bc4381ecb60ae56db0330f660ea240cb0d4a"}, + {file = "ruff-0.1.3-py3-none-win32.whl", hash = "sha256:3e7afcbdcfbe3399c34e0f6370c30f6e529193c731b885316c5a09c9e4317eef"}, + {file = "ruff-0.1.3-py3-none-win_amd64.whl", hash = "sha256:7a18df6638cec4a5bd75350639b2bb2a2366e01222825562c7346674bdceb7ea"}, + {file = "ruff-0.1.3-py3-none-win_arm64.whl", hash = "sha256:12fd53696c83a194a2db7f9a46337ce06445fb9aa7d25ea6f293cf75b21aca9f"}, + {file = "ruff-0.1.3.tar.gz", hash = "sha256:3ba6145369a151401d5db79f0a47d50e470384d0d89d0d6f7fab0b589ad07c34"}, ] [[package]] @@ -362,13 +362,13 @@ files = [ [[package]] name = "ziggy-pydust" -version = "0.13.4" +version = "0.19.0" description = "" optional = false python-versions = ">=3.11,<4.0" files = [ - {file = "ziggy_pydust-0.13.4-py3-none-any.whl", hash = "sha256:35216d27f753021497da8a6ac6df5acf6fd9e2bdecee0b4573c7c8897edeb33a"}, - {file = "ziggy_pydust-0.13.4.tar.gz", hash = "sha256:41246ac67c3ab3416635498ec33cd2b34ffa319f20f85feb7d9b177e6808deab"}, + {file = "ziggy_pydust-0.19.0-py3-none-any.whl", hash = "sha256:ec0322c676ba88c207d0d18c876a75c2d79ef13a6724d080629ee4f0d0eb65c2"}, + {file = "ziggy_pydust-0.19.0.tar.gz", hash = "sha256:07922d92239d74713a1f8e954b7ae0bf1dc2c100f420d6ef025091745f26f00b"}, ] [package.dependencies] @@ -396,4 +396,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "baadd8fe1781499776d4faa7e2901ccc5136fb3ccac6cbb39ca530b76dec8128" +content-hash = "8c2aa47c264d19eafbfb92482fd24f90bf477f154ecbba9a9d67c5eae2baf1bc" diff --git a/pyproject.toml b/pyproject.toml index 91d9c42..141d5c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["poetry-core", "ziggy-pydust==0.13.4"] +requires = ["poetry-core", "ziggy-pydust==0.19.0"] build-backend = "poetry.core.masonry.api" [tool.poetry] @@ -22,9 +22,9 @@ script = "build.py" python = "^3.11" [tool.poetry.group.dev.dependencies] -ziggy-pydust = "0.13.4" +ziggy-pydust = "0.19.0" pytest = "^7.4.0" -ruff = "^0.0.292" +ruff = "^0.1.3" black = "^23.7.0" [tool.black] diff --git a/src/fib.zig b/src/fib.zig index 3fde4f7..b14ee6c 100644 --- a/src/fib.zig +++ b/src/fib.zig @@ -44,8 +44,8 @@ pub const Fibonacci = py.class(struct { first_n: u64, - pub fn __new__(args: struct { first_n: u64 }) !Self { - return .{ .first_n = args.first_n }; + pub fn __init__(self: *Self, args: struct { first_n: u64 }) !void { + self.first_n = args.first_n; } // Get an iterator over the first `self.first_n` Fibonacci numbers. @@ -64,8 +64,11 @@ pub const FibonacciIterator = py.class(struct { next: u64, stop: u64, - pub fn __new__(args: struct { i: u64, ith: u64, next: u64, stop: u64 }) !Self { - return .{ .i = args.i, .ith = args.ith, .next = args.next, .stop = args.stop }; + pub fn __init__(self: *Self, args: struct { i: u64, ith: u64, next: u64, stop: u64 }) !void { + self.i = args.i; + self.ith = args.ith; + self.next = args.next; + self.stop = args.stop; } pub fn __next__(self: *Self) !?u64 { From 161504dda704492201824bce70ae5f8869ce484f Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Fri, 3 Nov 2023 14:08:59 +0000 Subject: [PATCH 2/3] less --- src/fib.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fib.zig b/src/fib.zig index b14ee6c..aafd542 100644 --- a/src/fib.zig +++ b/src/fib.zig @@ -44,7 +44,7 @@ pub const Fibonacci = py.class(struct { first_n: u64, - pub fn __init__(self: *Self, args: struct { first_n: u64 }) !void { + pub fn __init__(self: *Self, args: struct { first_n: u64 }) void { self.first_n = args.first_n; } @@ -64,7 +64,7 @@ pub const FibonacciIterator = py.class(struct { next: u64, stop: u64, - pub fn __init__(self: *Self, args: struct { i: u64, ith: u64, next: u64, stop: u64 }) !void { + pub fn __init__(self: *Self, args: struct { i: u64, ith: u64, next: u64, stop: u64 }) void { self.i = args.i; self.ith = args.ith; self.next = args.next; From 6ae36806541bda497bc2311976c0ef7dcb3fb0c3 Mon Sep 17 00:00:00 2001 From: Robert Kruszewski Date: Fri, 3 Nov 2023 14:11:28 +0000 Subject: [PATCH 3/3] deps --- fibonacci/_lib.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fibonacci/_lib.pyi b/fibonacci/_lib.pyi index 9501714..072c247 100644 --- a/fibonacci/_lib.pyi +++ b/fibonacci/_lib.pyi @@ -9,7 +9,7 @@ class Fibonacci: A class that computes the Fibonacci numbers. """ - def __init__(first_n, /): + def __init__(self, first_n, /): pass def __iter__(self, /): """ @@ -22,7 +22,7 @@ class FibonacciIterator: An iterator that computes the Fibonacci numbers. """ - def __init__(i, ith, next, stop, /): + def __init__(self, i, ith, next, stop, /): pass def __next__(self, /): """