From 84afa7f4603151aec3942d3a2b7d3be902c95644 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Apr 2021 18:12:01 +0000 Subject: [PATCH 1/2] Bump py from 1.8.0 to 1.10.0 Bumps [py](https://github.com/pytest-dev/py) from 1.8.0 to 1.10.0. - [Release notes](https://github.com/pytest-dev/py/releases) - [Changelog](https://github.com/pytest-dev/py/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/py/compare/1.8.0...1.10.0) Signed-off-by: dependabot[bot] --- Pipfile.lock | 159 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 102 insertions(+), 57 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index e52e7fc7..98185689 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "4caf17e3b7e2feb745dd546b274d2ed9f5665a27701560dc240cdff949b17e4b" + "sha256": "c47d24a3d37aa6cae0b34d0511c653dd1ac70b6588d60bb09af1125499fad273" }, "pipfile-spec": 6, "requires": { @@ -18,9 +18,9 @@ "default": { "ed25519": { "hashes": [ - "sha256:2991b94e1883d1313c956a1e3ced27b8a2fdae23ac40c0d9d0b103d5a70d1d2a" + "sha256:02053ee019ceef0df97294be2d4d5a8fc120fc86e81e08bec1245fc0f9403358" ], - "version": "==1.4" + "version": "==1.5" }, "nkeys": { "hashes": [ @@ -33,76 +33,105 @@ "develop": { "atomicwrites": { "hashes": [ - "sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4", - "sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6" + "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197", + "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a" ], - "version": "==1.3.0" + "version": "==1.4.0" }, "attrs": { "hashes": [ - "sha256:69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", - "sha256:f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399" + "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6", + "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700" ], - "version": "==19.1.0" + "version": "==20.3.0" }, "coverage": { "hashes": [ - "sha256:3684fabf6b87a369017756b551cef29e505cb155ddb892a7a29277b978da88b9", - "sha256:39e088da9b284f1bd17c750ac672103779f7954ce6125fd4382134ac8d152d74", - "sha256:3c205bc11cc4fcc57b761c2da73b9b72a59f8d5ca89979afb0c1c6f9e53c7390", - "sha256:465ce53a8c0f3a7950dfb836438442f833cf6663d407f37d8c52fe7b6e56d7e8", - "sha256:48020e343fc40f72a442c8a1334284620f81295256a6b6ca6d8aa1350c763bbe", - "sha256:5296fc86ab612ec12394565c500b412a43b328b3907c0d14358950d06fd83baf", - "sha256:5f61bed2f7d9b6a9ab935150a6b23d7f84b8055524e7be7715b6513f3328138e", - "sha256:68a43a9f9f83693ce0414d17e019daee7ab3f7113a70c79a3dd4c2f704e4d741", - "sha256:6b8033d47fe22506856fe450470ccb1d8ba1ffb8463494a15cfc96392a288c09", - "sha256:7ad7536066b28863e5835e8cfeaa794b7fe352d99a8cded9f43d1161be8e9fbd", - "sha256:7bacb89ccf4bedb30b277e96e4cc68cd1369ca6841bde7b005191b54d3dd1034", - "sha256:839dc7c36501254e14331bcb98b27002aa415e4af7ea039d9009409b9d2d5420", - "sha256:8f9a95b66969cdea53ec992ecea5406c5bd99c9221f539bca1e8406b200ae98c", - "sha256:932c03d2d565f75961ba1d3cec41ddde00e162c5b46d03f7423edcb807734eab", - "sha256:988529edadc49039d205e0aa6ce049c5ccda4acb2d6c3c5c550c17e8c02c05ba", - "sha256:998d7e73548fe395eeb294495a04d38942edb66d1fa61eb70418871bc621227e", - "sha256:9de60893fb447d1e797f6bf08fdf0dbcda0c1e34c1b06c92bd3a363c0ea8c609", - "sha256:9e80d45d0c7fcee54e22771db7f1b0b126fb4a6c0a2e5afa72f66827207ff2f2", - "sha256:a545a3dfe5082dc8e8c3eb7f8a2cf4f2870902ff1860bd99b6198cfd1f9d1f49", - "sha256:a5d8f29e5ec661143621a8f4de51adfb300d7a476224156a39a392254f70687b", - "sha256:aca06bfba4759bbdb09bf52ebb15ae20268ee1f6747417837926fae990ebc41d", - "sha256:bb23b7a6fd666e551a3094ab896a57809e010059540ad20acbeec03a154224ce", - "sha256:bfd1d0ae7e292105f29d7deaa9d8f2916ed8553ab9d5f39ec65bcf5deadff3f9", - "sha256:c62ca0a38958f541a73cf86acdab020c2091631c137bd359c4f5bddde7b75fd4", - "sha256:c709d8bda72cf4cd348ccec2a4881f2c5848fd72903c185f363d361b2737f773", - "sha256:c968a6aa7e0b56ecbd28531ddf439c2ec103610d3e2bf3b75b813304f8cb7723", - "sha256:df785d8cb80539d0b55fd47183264b7002077859028dfe3070cf6359bf8b2d9c", - "sha256:f406628ca51e0ae90ae76ea8398677a921b36f0bd71aab2099dfed08abd0322f", - "sha256:f46087bbd95ebae244a0eda01a618aff11ec7a069b15a3ef8f6b520db523dcf1", - "sha256:f8019c5279eb32360ca03e9fac40a12667715546eed5c5eb59eb381f2f501260", - "sha256:fc5f4d209733750afd2714e9109816a29500718b32dd9a5db01c0cb3a019b96a" + "sha256:004d1880bed2d97151facef49f08e255a20ceb6f9432df75f4eef018fdd5a78c", + "sha256:01d84219b5cdbfc8122223b39a954820929497a1cb1422824bb86b07b74594b6", + "sha256:040af6c32813fa3eae5305d53f18875bedd079960822ef8ec067a66dd8afcd45", + "sha256:06191eb60f8d8a5bc046f3799f8a07a2d7aefb9504b0209aff0b47298333302a", + "sha256:13034c4409db851670bc9acd836243aeee299949bd5673e11844befcb0149f03", + "sha256:13c4ee887eca0f4c5a247b75398d4114c37882658300e153113dafb1d76de529", + "sha256:184a47bbe0aa6400ed2d41d8e9ed868b8205046518c52464fde713ea06e3a74a", + "sha256:18ba8bbede96a2c3dde7b868de9dcbd55670690af0988713f0603f037848418a", + "sha256:1aa846f56c3d49205c952d8318e76ccc2ae23303351d9270ab220004c580cfe2", + "sha256:217658ec7187497e3f3ebd901afdca1af062b42cfe3e0dafea4cced3983739f6", + "sha256:24d4a7de75446be83244eabbff746d66b9240ae020ced65d060815fac3423759", + "sha256:2910f4d36a6a9b4214bb7038d537f015346f413a975d57ca6b43bf23d6563b53", + "sha256:2949cad1c5208b8298d5686d5a85b66aae46d73eec2c3e08c817dd3513e5848a", + "sha256:2a3859cb82dcbda1cfd3e6f71c27081d18aa251d20a17d87d26d4cd216fb0af4", + "sha256:2cafbbb3af0733db200c9b5f798d18953b1a304d3f86a938367de1567f4b5bff", + "sha256:2e0d881ad471768bf6e6c2bf905d183543f10098e3b3640fc029509530091502", + "sha256:30c77c1dc9f253283e34c27935fded5015f7d1abe83bc7821680ac444eaf7793", + "sha256:3487286bc29a5aa4b93a072e9592f22254291ce96a9fbc5251f566b6b7343cdb", + "sha256:372da284cfd642d8e08ef606917846fa2ee350f64994bebfbd3afb0040436905", + "sha256:41179b8a845742d1eb60449bdb2992196e211341818565abded11cfa90efb821", + "sha256:44d654437b8ddd9eee7d1eaee28b7219bec228520ff809af170488fd2fed3e2b", + "sha256:4a7697d8cb0f27399b0e393c0b90f0f1e40c82023ea4d45d22bce7032a5d7b81", + "sha256:51cb9476a3987c8967ebab3f0fe144819781fca264f57f89760037a2ea191cb0", + "sha256:52596d3d0e8bdf3af43db3e9ba8dcdaac724ba7b5ca3f6358529d56f7a166f8b", + "sha256:53194af30d5bad77fcba80e23a1441c71abfb3e01192034f8246e0d8f99528f3", + "sha256:5fec2d43a2cc6965edc0bb9e83e1e4b557f76f843a77a2496cbe719583ce8184", + "sha256:6c90e11318f0d3c436a42409f2749ee1a115cd8b067d7f14c148f1ce5574d701", + "sha256:74d881fc777ebb11c63736622b60cb9e4aee5cace591ce274fb69e582a12a61a", + "sha256:7501140f755b725495941b43347ba8a2777407fc7f250d4f5a7d2a1050ba8e82", + "sha256:796c9c3c79747146ebd278dbe1e5c5c05dd6b10cc3bcb8389dfdf844f3ead638", + "sha256:869a64f53488f40fa5b5b9dcb9e9b2962a66a87dab37790f3fcfb5144b996ef5", + "sha256:8963a499849a1fc54b35b1c9f162f4108017b2e6db2c46c1bed93a72262ed083", + "sha256:8d0a0725ad7c1a0bcd8d1b437e191107d457e2ec1084b9f190630a4fb1af78e6", + "sha256:900fbf7759501bc7807fd6638c947d7a831fc9fdf742dc10f02956ff7220fa90", + "sha256:92b017ce34b68a7d67bd6d117e6d443a9bf63a2ecf8567bb3d8c6c7bc5014465", + "sha256:970284a88b99673ccb2e4e334cfb38a10aab7cd44f7457564d11898a74b62d0a", + "sha256:972c85d205b51e30e59525694670de6a8a89691186012535f9d7dbaa230e42c3", + "sha256:9a1ef3b66e38ef8618ce5fdc7bea3d9f45f3624e2a66295eea5e57966c85909e", + "sha256:af0e781009aaf59e25c5a678122391cb0f345ac0ec272c7961dc5455e1c40066", + "sha256:b6d534e4b2ab35c9f93f46229363e17f63c53ad01330df9f2d6bd1187e5eaacf", + "sha256:b7895207b4c843c76a25ab8c1e866261bcfe27bfaa20c192de5190121770672b", + "sha256:c0891a6a97b09c1f3e073a890514d5012eb256845c451bd48f7968ef939bf4ae", + "sha256:c2723d347ab06e7ddad1a58b2a821218239249a9e4365eaff6649d31180c1669", + "sha256:d1f8bf7b90ba55699b3a5e44930e93ff0189aa27186e96071fac7dd0d06a1873", + "sha256:d1f9ce122f83b2305592c11d64f181b87153fc2c2bbd3bb4a3dde8303cfb1a6b", + "sha256:d314ed732c25d29775e84a960c3c60808b682c08d86602ec2c3008e1202e3bb6", + "sha256:d636598c8305e1f90b439dbf4f66437de4a5e3c31fdf47ad29542478c8508bbb", + "sha256:deee1077aae10d8fa88cb02c845cfba9b62c55e1183f52f6ae6a2df6a2187160", + "sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c", + "sha256:f030f8873312a16414c0d8e1a1ddff2d3235655a2174e3648b4fa66b3f2f1079", + "sha256:f0b278ce10936db1a37e6954e15a3730bea96a0997c26d7fee88e6c396c2086d", + "sha256:f11642dddbb0253cc8853254301b51390ba0081750a8ac03f20ea8103f0c56b6" ], - "index": "pypi", - "version": "==4.5.3" + "version": "==5.5" + }, + "importlib-metadata": { + "hashes": [ + "sha256:19192b88d959336bfa6bdaaaef99aeafec179eca19c47c804e555703ee5f07ef", + "sha256:2e881981c9748d7282b374b68e759c87745c25427b67ecf0cc67fb6637a1bff9" + ], + "markers": "python_version < '3.8'", + "version": "==4.0.0" }, "more-itertools": { "hashes": [ - "sha256:2112d2ca570bb7c3e53ea1a35cd5df42bb0fd10c45f0fb97178679c3c03d64c7", - "sha256:c3e4748ba1aad8dba30a4886b0b1a2004f9a863837b8654e7059eebf727afa5a" + "sha256:5652a9ac72209ed7df8d9c15daf4e1aa0e3d2ccd3c87f8265a0673cd9cbc9ced", + "sha256:c5d6da9ca3ff65220c3bfd2a8db06d698f05d4d2b9be57e1deb2be5a45019713" ], "markers": "python_version > '2.7'", - "version": "==7.0.0" + "version": "==8.7.0" }, "pluggy": { "hashes": [ - "sha256:25a1bc1d148c9a640211872b4ff859878d422bccb59c9965e04eed468a0aa180", - "sha256:964cedd2b27c492fbf0b7f58b3284a09cf7f99b0f715941fb24a439b3af1bd1a" + "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0", + "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d" ], - "version": "==0.11.0" + "version": "==0.13.1" }, "py": { "hashes": [ - "sha256:64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa", - "sha256:dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53" + "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3", + "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a" ], - "version": "==1.8.0" + "index": "pypi", + "version": "==1.10.0" }, "pytest": { "hashes": [ @@ -122,17 +151,26 @@ }, "six": { "hashes": [ - "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", - "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" + "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", + "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], - "version": "==1.12.0" + "version": "==1.15.0" + }, + "typing-extensions": { + "hashes": [ + "sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918", + "sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c", + "sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f" + ], + "markers": "python_version < '3.8'", + "version": "==3.7.4.3" }, "wcwidth": { "hashes": [ - "sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e", - "sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c" + "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784", + "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83" ], - "version": "==0.1.7" + "version": "==0.2.5" }, "yapf": { "hashes": [ @@ -141,6 +179,13 @@ ], "index": "pypi", "version": "==0.27.0" + }, + "zipp": { + "hashes": [ + "sha256:3607921face881ba3e026887d8150cca609d517579abe052ac81fc5aeffdbd76", + "sha256:51cb66cc54621609dd593d1787f286ee42a5c0adbb4b29abea5a63edc3e03098" + ], + "version": "==3.4.1" } } } From 83b5b6a63f65b3c97b2af6cb3da59050a1b69bce Mon Sep 17 00:00:00 2001 From: Waldemar Quevedo Date: Mon, 12 Jul 2021 15:06:48 -0700 Subject: [PATCH 2/2] yapf: format fixes Signed-off-by: Waldemar Quevedo --- nats/aio/client.py | 101 +++++++++++++++++++++++---------------------- nats/aio/nuid.py | 1 + tests/utils.py | 24 +++++------ 3 files changed, 64 insertions(+), 62 deletions(-) diff --git a/nats/aio/client.py b/nats/aio/client.py index 5701283b..dec8b10a 100644 --- a/nats/aio/client.py +++ b/nats/aio/client.py @@ -71,14 +71,14 @@ class Subscription: def __init__( - self, - subject='', - queue='', - future=None, - max_msgs=0, - is_async=False, - cb=None, - coro=None + self, + subject='', + queue='', + future=None, + max_msgs=0, + is_async=False, + cb=None, + coro=None ): self.subject = subject self.queue = queue @@ -119,6 +119,7 @@ class Srv: """ Srv is a helper data structure to hold state of a server. """ + def __init__(self, uri): self.uri = uri self.reconnects = 0 @@ -228,38 +229,38 @@ def __init__(self): } async def connect( - self, - servers=["nats://127.0.0.1:4222"], - io_loop=None, - loop=None, - error_cb=None, - disconnected_cb=None, - closed_cb=None, - discovered_server_cb=None, - reconnected_cb=None, - name=None, - pedantic=False, - verbose=False, - allow_reconnect=True, - connect_timeout=DEFAULT_CONNECT_TIMEOUT, - reconnect_time_wait=DEFAULT_RECONNECT_TIME_WAIT, - max_reconnect_attempts=DEFAULT_MAX_RECONNECT_ATTEMPTS, - ping_interval=DEFAULT_PING_INTERVAL, - max_outstanding_pings=DEFAULT_MAX_OUTSTANDING_PINGS, - dont_randomize=False, - flusher_queue_size=DEFAULT_MAX_FLUSHER_QUEUE_SIZE, - pending_size=DEFAULT_PENDING_SIZE, - no_echo=False, - tls=None, - tls_hostname=None, - user=None, - password=None, - token=None, - drain_timeout=DEFAULT_DRAIN_TIMEOUT, - signature_cb=None, - user_jwt_cb=None, - user_credentials=None, - nkeys_seed=None, + self, + servers=["nats://127.0.0.1:4222"], + io_loop=None, + loop=None, + error_cb=None, + disconnected_cb=None, + closed_cb=None, + discovered_server_cb=None, + reconnected_cb=None, + name=None, + pedantic=False, + verbose=False, + allow_reconnect=True, + connect_timeout=DEFAULT_CONNECT_TIMEOUT, + reconnect_time_wait=DEFAULT_RECONNECT_TIME_WAIT, + max_reconnect_attempts=DEFAULT_MAX_RECONNECT_ATTEMPTS, + ping_interval=DEFAULT_PING_INTERVAL, + max_outstanding_pings=DEFAULT_MAX_OUTSTANDING_PINGS, + dont_randomize=False, + flusher_queue_size=DEFAULT_MAX_FLUSHER_QUEUE_SIZE, + pending_size=DEFAULT_PENDING_SIZE, + no_echo=False, + tls=None, + tls_hostname=None, + user=None, + password=None, + token=None, + drain_timeout=DEFAULT_DRAIN_TIMEOUT, + signature_cb=None, + user_jwt_cb=None, + user_credentials=None, + nkeys_seed=None, ): for cb in [error_cb, disconnected_cb, closed_cb, reconnected_cb, discovered_server_cb]: @@ -675,15 +676,15 @@ async def _publish(self, subject, reply, payload, payload_size): await self._flush_pending() async def subscribe( - self, - subject, - queue="", - cb=None, - future=None, - max_msgs=0, - is_async=False, - pending_msgs_limit=DEFAULT_SUB_PENDING_MSGS_LIMIT, - pending_bytes_limit=DEFAULT_SUB_PENDING_BYTES_LIMIT, + self, + subject, + queue="", + cb=None, + future=None, + max_msgs=0, + is_async=False, + pending_msgs_limit=DEFAULT_SUB_PENDING_MSGS_LIMIT, + pending_bytes_limit=DEFAULT_SUB_PENDING_BYTES_LIMIT, ): """ Takes a subject string and optional queue string to send a SUB cmd, @@ -851,7 +852,7 @@ async def _subscribe(self, sub, ssid): await self._flush_pending() async def request( - self, subject, payload, timeout=0.5, expected=1, cb=None + self, subject, payload, timeout=0.5, expected=1, cb=None ): """ Implements the request/response pattern via pub/sub diff --git a/nats/aio/nuid.py b/nats/aio/nuid.py index 38125cf8..b6a9b421 100644 --- a/nats/aio/nuid.py +++ b/nats/aio/nuid.py @@ -31,6 +31,7 @@ class NUID: NUID is an implementation of the approach for fast generation of unique identifiers used for inboxes in NATS. """ + def __init__(self): self._srand = SystemRandom() self._prand = Random(self._srand.randint(0, MaxInt)) diff --git a/tests/utils.py b/tests/utils.py index 020c2b43..3cf77b5b 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -17,18 +17,18 @@ class Gnatsd: def __init__( - self, - port=4222, - user="", - password="", - token="", - timeout=0, - http_port=8222, - debug=False, - tls=False, - cluster_listen=None, - routes=[], - config_file=None, + self, + port=4222, + user="", + password="", + token="", + timeout=0, + http_port=8222, + debug=False, + tls=False, + cluster_listen=None, + routes=[], + config_file=None, ): self.port = port self.user = user