From 020ef8338b8dfd24b73fab3ca91fbb8db5f98ec3 Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Fri, 14 Feb 2025 09:27:43 -0500 Subject: [PATCH 01/12] Upgrade cel-python to 0.2.0 Ref: https://github.com/cloud-custodian/cel-python/releases/tag/v0.2 Relates to #180. --- Pipfile | 2 +- Pipfile.lock | 33 ++++++++++++++++++++++++++++----- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index d4bc551..f614830 100644 --- a/Pipfile +++ b/Pipfile @@ -4,8 +4,8 @@ verify_ssl = true name = "pypi" [packages] -cel-python = "==0.1.5" protobuf = "==5.*" +cel-python = "*" [dev-packages] pytest = "*" diff --git a/Pipfile.lock b/Pipfile.lock index eda7cf1..f48356f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "ae59b4cba9b954ec5c1f7b7b7a3afd8c7414a796511e1eaa274a50e8885bc586" + "sha256": "f21477ced5cd4bfd9be57c3c020b9c8a3884912555ed8ffd667427bcf722e12a" }, "pipfile-spec": 6, "requires": { @@ -26,12 +26,12 @@ }, "cel-python": { "hashes": [ - "sha256:ac81fab8ba08b633700a45d84905be2863529c6a32935c9da7ef53fc06844f1a", - "sha256:d3911bb046bc3ed12792bd88ab453f72d98c66923b72a2fa016bcdffd96e2f98" + "sha256:478ff73def7b39d51e6982f95d937a57c2b088c491c578fe5cecdbd79f476f60", + "sha256:75de72a5cf223ec690b236f0cc24da267219e667bd3e7f8f4f20595fcc1c0c0f" ], "index": "pypi", - "markers": "python_version >= '3.7' and python_version < '4'", - "version": "==0.1.5" + "markers": "python_version >= '3.8' and python_version < '4.0'", + "version": "==0.2.0" }, "certifi": { "hashes": [ @@ -155,6 +155,13 @@ "markers": "python_version >= '3.7'", "version": "==1.0.1" }, + "lark": { + "hashes": [ + "sha256:7da76fcfddadabbbbfd949bbae221efd33938451d90b1fefbbc423c3cccf48ef", + "sha256:ed1d891cbcf5151ead1c1d14663bf542443e579e63a76ae175b01b899bd854ca" + ], + "version": "==0.12.0" + }, "lark-parser": { "hashes": [ "sha256:0eaf30cb5ba787fe404d73a7d6e61df97b21d5a63ac26c5008c78a494373c675", @@ -263,6 +270,22 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2'", "version": "==1.17.0" }, + "types-python-dateutil": { + "hashes": [ + "sha256:18f493414c26ffba692a72369fea7a154c502646301ebfe3d56a04b3767284cb", + "sha256:e248a4bc70a486d3e3ec84d0dc30eec3a5f979d6e7ee4123ae043eedbb987f53" + ], + "markers": "python_version >= '3.8'", + "version": "==2.9.0.20241206" + }, + "types-pyyaml": { + "hashes": [ + "sha256:7f07622dbd34bb9c8b264fe860a17e0efcad00d50b5f27e93984909d9363498c", + "sha256:fa4d32565219b68e6dee5f67534c722e53c00d1cfc09c435ef04d7353e1e96e6" + ], + "markers": "python_version >= '3.8'", + "version": "==6.0.12.20241230" + }, "urllib3": { "hashes": [ "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df", From dc76568dc95ea3c7531484762c10402c81ec9bbe Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Fri, 14 Feb 2025 09:31:48 -0500 Subject: [PATCH 02/12] Regenerate Pipfile.lock with `pipenv lock --dev` Why does nothing else detect the extra deps? --- Pipfile.lock | 183 ++++++--------------------------------------------- 1 file changed, 19 insertions(+), 164 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index f48356f..e937150 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -16,14 +16,6 @@ ] }, "default": { - "babel": { - "hashes": [ - "sha256:368b5b98b37c06b7daf6696391c3240c938b37767d4584413e8438c5c435fa8b", - "sha256:d1f3554ca26605fe173f3de0c65f750f5a42f924499bf134de6423582298e316" - ], - "markers": "python_version >= '3.8'", - "version": "==2.16.0" - }, "cel-python": { "hashes": [ "sha256:478ff73def7b39d51e6982f95d937a57c2b088c491c578fe5cecdbd79f476f60", @@ -33,120 +25,6 @@ "markers": "python_version >= '3.8' and python_version < '4.0'", "version": "==0.2.0" }, - "certifi": { - "hashes": [ - "sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56", - "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db" - ], - "markers": "python_version >= '3.6'", - "version": "==2024.12.14" - }, - "charset-normalizer": { - "hashes": [ - "sha256:0167ddc8ab6508fe81860a57dd472b2ef4060e8d378f0cc555707126830f2537", - "sha256:01732659ba9b5b873fc117534143e4feefecf3b2078b0a6a2e925271bb6f4cfa", - "sha256:01ad647cdd609225c5350561d084b42ddf732f4eeefe6e678765636791e78b9a", - "sha256:04432ad9479fa40ec0f387795ddad4437a2b50417c69fa275e212933519ff294", - "sha256:0907f11d019260cdc3f94fbdb23ff9125f6b5d1039b76003b5b0ac9d6a6c9d5b", - "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd", - "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601", - "sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd", - "sha256:0af291f4fe114be0280cdd29d533696a77b5b49cfde5467176ecab32353395c4", - "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d", - "sha256:1a2bc9f351a75ef49d664206d51f8e5ede9da246602dc2d2726837620ea034b2", - "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313", - "sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd", - "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa", - "sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8", - "sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1", - "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2", - "sha256:2a75d49014d118e4198bcee5ee0a6f25856b29b12dbf7cd012791f8a6cc5c496", - "sha256:2bdfe3ac2e1bbe5b59a1a63721eb3b95fc9b6817ae4a46debbb4e11f6232428d", - "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b", - "sha256:2fb9bd477fdea8684f78791a6de97a953c51831ee2981f8e4f583ff3b9d9687e", - "sha256:311f30128d7d333eebd7896965bfcfbd0065f1716ec92bd5638d7748eb6f936a", - "sha256:329ce159e82018d646c7ac45b01a430369d526569ec08516081727a20e9e4af4", - "sha256:345b0426edd4e18138d6528aed636de7a9ed169b4aaf9d61a8c19e39d26838ca", - "sha256:363e2f92b0f0174b2f8238240a1a30142e3db7b957a5dd5689b0e75fb717cc78", - "sha256:3a3bd0dcd373514dcec91c411ddb9632c0d7d92aed7093b8c3bbb6d69ca74408", - "sha256:3bed14e9c89dcb10e8f3a29f9ccac4955aebe93c71ae803af79265c9ca5644c5", - "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3", - "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f", - "sha256:4532bff1b8421fd0a320463030c7520f56a79c9024a4e88f01c537316019005a", - "sha256:49402233c892a461407c512a19435d1ce275543138294f7ef013f0b63d5d3765", - "sha256:4c0907b1928a36d5a998d72d64d8eaa7244989f7aaaf947500d3a800c83a3fd6", - "sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146", - "sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6", - "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9", - "sha256:619a609aa74ae43d90ed2e89bdd784765de0a25ca761b93e196d938b8fd1dbbd", - "sha256:6e27f48bcd0957c6d4cb9d6fa6b61d192d0b13d5ef563e5f2ae35feafc0d179c", - "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f", - "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545", - "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176", - "sha256:75832c08354f595c760a804588b9357d34ec00ba1c940c15e31e96d902093770", - "sha256:7709f51f5f7c853f0fb938bcd3bc59cdfdc5203635ffd18bf354f6967ea0f824", - "sha256:78baa6d91634dfb69ec52a463534bc0df05dbd546209b79a3880a34487f4b84f", - "sha256:7974a0b5ecd505609e3b19742b60cee7aa2aa2fb3151bc917e6e2646d7667dcf", - "sha256:7a4f97a081603d2050bfaffdefa5b02a9ec823f8348a572e39032caa8404a487", - "sha256:7b1bef6280950ee6c177b326508f86cad7ad4dff12454483b51d8b7d673a2c5d", - "sha256:7d053096f67cd1241601111b698f5cad775f97ab25d81567d3f59219b5f1adbd", - "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b", - "sha256:807f52c1f798eef6cf26beb819eeb8819b1622ddfeef9d0977a8502d4db6d534", - "sha256:80ed5e856eb7f30115aaf94e4a08114ccc8813e6ed1b5efa74f9f82e8509858f", - "sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b", - "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9", - "sha256:89149166622f4db9b4b6a449256291dc87a99ee53151c74cbd82a53c8c2f6ccd", - "sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125", - "sha256:8c60ca7339acd497a55b0ea5d506b2a2612afb2826560416f6894e8b5770d4a9", - "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de", - "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11", - "sha256:97f68b8d6831127e4787ad15e6757232e14e12060bec17091b85eb1486b91d8d", - "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35", - "sha256:9f0b8b1c6d84c8034a44893aba5e767bf9c7a211e313a9605d9c617d7083829f", - "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda", - "sha256:ab36c8eb7e454e34e60eb55ca5d241a5d18b2c6244f6827a30e451c42410b5f7", - "sha256:b010a7a4fd316c3c484d482922d13044979e78d1861f0e0650423144c616a46a", - "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971", - "sha256:b7b2d86dd06bfc2ade3312a83a5c364c7ec2e3498f8734282c6c3d4b07b346b8", - "sha256:b97e690a2118911e39b4042088092771b4ae3fc3aa86518f84b8cf6888dbdb41", - "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d", - "sha256:c0429126cf75e16c4f0ad00ee0eae4242dc652290f940152ca8c75c3a4b6ee8f", - "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757", - "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a", - "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886", - "sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77", - "sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76", - "sha256:d973f03c0cb71c5ed99037b870f2be986c3c05e63622c017ea9816881d2dd247", - "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85", - "sha256:d9c3cdf5390dcd29aa8056d13e8e99526cda0305acc038b96b30352aff5ff2bb", - "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7", - "sha256:dccbe65bd2f7f7ec22c4ff99ed56faa1e9f785482b9bbd7c717e26fd723a1d1e", - "sha256:dd78cfcda14a1ef52584dbb008f7ac81c1328c0f58184bf9a84c49c605002da6", - "sha256:e218488cd232553829be0664c2292d3af2eeeb94b32bea483cf79ac6a694e037", - "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1", - "sha256:ea0d8d539afa5eb2728aa1932a988a9a7af94f18582ffae4bc10b3fbdad0626e", - "sha256:eab677309cdb30d047996b36d34caeda1dc91149e4fdca0b1a039b3f79d9a807", - "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407", - "sha256:ecddf25bee22fe4fe3737a399d0d177d72bc22be6913acfab364b40bce1ba83c", - "sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12", - "sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3", - "sha256:f30bf9fd9be89ecb2360c7d94a711f00c09b976258846efe40db3d05828e8089", - "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd", - "sha256:fc54db6c8593ef7d4b2a331b58653356cf04f67c960f584edb7c3d8c97e8f39e", - "sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00", - "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616" - ], - "markers": "python_version >= '3.7'", - "version": "==3.4.1" - }, - "idna": { - "hashes": [ - "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", - "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3" - ], - "markers": "python_version >= '3.6'", - "version": "==3.10" - }, "jmespath": { "hashes": [ "sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980", @@ -162,13 +40,6 @@ ], "version": "==0.12.0" }, - "lark-parser": { - "hashes": [ - "sha256:0eaf30cb5ba787fe404d73a7d6e61df97b21d5a63ac26c5008c78a494373c675", - "sha256:15967db1f1214013dca65b1180745047b9be457d73da224fcda3d9dd4e96a138" - ], - "version": "==0.12.0" - }, "protobuf": { "hashes": [ "sha256:0a18ed4a24198528f2333802eb075e59dea9d679ab7a6c5efb017a59004d849f", @@ -254,14 +125,6 @@ "markers": "python_version >= '3.8'", "version": "==6.0.2" }, - "requests": { - "hashes": [ - "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", - "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6" - ], - "markers": "python_version >= '3.8'", - "version": "==2.32.3" - }, "six": { "hashes": [ "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", @@ -285,14 +148,6 @@ ], "markers": "python_version >= '3.8'", "version": "==6.0.12.20241230" - }, - "urllib3": { - "hashes": [ - "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df", - "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d" - ], - "markers": "python_version >= '3.9'", - "version": "==2.3.0" } }, "develop": { @@ -387,28 +242,28 @@ }, "ruff": { "hashes": [ - "sha256:11417521d6f2d121fda376f0d2169fb529976c544d653d1d6044f4c5562516ee", - "sha256:11aecd7a633932875ab3cb05a484c99970b9d52606ce9ea912b690b02653d56c", - "sha256:134f958d52aa6fdec3b294b8ebe2320a950d10c041473c4316d2e7d7c2544723", - "sha256:18a29f1a005bddb229e580795627d297dfa99f16b30c7039e73278cf6b5f9fa9", - "sha256:2c746d7d1df64f31d90503ece5cc34d7007c06751a7a3bbeee10e5f2463d52d2", - "sha256:2e36c61145e70febcb78483903c43444c6b9d40f6d2f800b5552fec6e4a7bb9a", - "sha256:2f71d09aeba026c922aa7aa19a08d7bd27c867aedb2f74285a2639644c1c12f5", - "sha256:38840dbcef63948657fa7605ca363194d2fe8c26ce8f9ae12eee7f098c85ac8a", - "sha256:3d28532d73b1f3f627ba88e1456f50748b37f3a345d2be76e4c653bec6c3e393", - "sha256:4f7cb2a01da08244c50b20ccfaeb5972e4228c3c3a1989d3ece2bc4b1f996001", - "sha256:5b9d71c3879eb32de700f2f6fac3d46566f644a91d3130119a6378f9312a38e1", - "sha256:78cc6067f6d80b6745b67498fb84e87d32c6fc34992b52bffefbdae3442967d6", - "sha256:96d5c76358419bc63a671caac70c18732d4fd0341646ecd01641ddda5c39ca0b", - "sha256:d466d2abc05f39018d53f681fa1c0ffe9570e6d73cde1b65d23bb557c846f442", - "sha256:d56ba06da53536b575fbd2b56517f6f95774ff7be0f62c80b9e67430391eeb36", - "sha256:de92170dfa50c32a2b8206a647949590e752aca8100a0f6b8cefa02ae29dce80", - "sha256:deb8304636ed394211f3a6d46c0e7d9535b016f53adaa8340139859b2359a070", - "sha256:df455000bf59e62b3e8c7ba5ed88a4a2bc64896f900f311dc23ff2dc38156440" + "sha256:03482d5c09d90d4ee3f40d97578423698ad895c87314c4de39ed2af945633caa", + "sha256:0e2bb706a2be7ddfea4a4af918562fdc1bcb16df255e5fa595bbd800ce322a5a", + "sha256:194d8402bceef1b31164909540a597e0d913c0e4952015a5b40e28c146121b5d", + "sha256:19f505b643228b417c1111a2a536424ddde0db4ef9023b9e04a46ed8a1cb4656", + "sha256:1de4367cca3dac99bcbd15c161404e849bb0bfd543664db39232648dc00112dc", + "sha256:2f218f356dd2d995839f1941322ff021c72a492c470f0b26a34f844c29cdf5ba", + "sha256:4a091729086dffa4bd070aa5dab7e39cc6b9d62eb2bef8f3d91172d30d599666", + "sha256:589d1d9f25b5754ff230dce914a174a7c951a85a4e9270613a2b74231fdac2f5", + "sha256:5dc1edd1775270e6aa2386119aea692039781429f0be1e0949ea5884e011aa8e", + "sha256:5e2d9126161d0357e5c8f30b0bd6168d2c3872372f14481136d13de9937f79b6", + "sha256:68660eab1a8e65babb5229a1f97b46e3120923757a68b5413d8561f8a85d4897", + "sha256:81761592f72b620ec8fa1068a6fd00e98a5ebee342a3642efd84454f3031dca9", + "sha256:ac3ee4d7c2c92ddfdaedf0bf31b2b176fa7aa8950efc454628d477394d35638b", + "sha256:b109c0ad2ececf42e75fa99dc4043ff72a357436bb171900714a9ea581ddef83", + "sha256:b908ff4df65dad7b251c9968a2e4560836d8f5487c2f0cc238321ed951ea0504", + "sha256:c4cae6c4cc7b9b4017c71114115db0445b00a16de3bcde0946273e8392856f08", + "sha256:d1bbc6808bf7b15796cef0815e1dfb796fbd383e7dbd4334709642649625e7c5", + "sha256:dc61dd5131742e21103fbbdcad683a8813be0e3c204472d520d9a5021ca8b217" ], "index": "pypi", "markers": "python_version >= '3.7'", - "version": "==0.9.5" + "version": "==0.9.6" }, "tomli": { "hashes": [ From 0767933a15ac0955c9607680573fcf669ca5575c Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Fri, 14 Feb 2025 09:37:38 -0500 Subject: [PATCH 03/12] Revert "Regenerate Pipfile.lock with `pipenv lock --dev`" This reverts commit dc76568dc95ea3c7531484762c10402c81ec9bbe. --- Pipfile.lock | 183 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 164 insertions(+), 19 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index e937150..f48356f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -16,6 +16,14 @@ ] }, "default": { + "babel": { + "hashes": [ + "sha256:368b5b98b37c06b7daf6696391c3240c938b37767d4584413e8438c5c435fa8b", + "sha256:d1f3554ca26605fe173f3de0c65f750f5a42f924499bf134de6423582298e316" + ], + "markers": "python_version >= '3.8'", + "version": "==2.16.0" + }, "cel-python": { "hashes": [ "sha256:478ff73def7b39d51e6982f95d937a57c2b088c491c578fe5cecdbd79f476f60", @@ -25,6 +33,120 @@ "markers": "python_version >= '3.8' and python_version < '4.0'", "version": "==0.2.0" }, + "certifi": { + "hashes": [ + "sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56", + "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db" + ], + "markers": "python_version >= '3.6'", + "version": "==2024.12.14" + }, + "charset-normalizer": { + "hashes": [ + "sha256:0167ddc8ab6508fe81860a57dd472b2ef4060e8d378f0cc555707126830f2537", + "sha256:01732659ba9b5b873fc117534143e4feefecf3b2078b0a6a2e925271bb6f4cfa", + "sha256:01ad647cdd609225c5350561d084b42ddf732f4eeefe6e678765636791e78b9a", + "sha256:04432ad9479fa40ec0f387795ddad4437a2b50417c69fa275e212933519ff294", + "sha256:0907f11d019260cdc3f94fbdb23ff9125f6b5d1039b76003b5b0ac9d6a6c9d5b", + "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd", + "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601", + "sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd", + "sha256:0af291f4fe114be0280cdd29d533696a77b5b49cfde5467176ecab32353395c4", + "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d", + "sha256:1a2bc9f351a75ef49d664206d51f8e5ede9da246602dc2d2726837620ea034b2", + "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313", + "sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd", + "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa", + "sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8", + "sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1", + "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2", + "sha256:2a75d49014d118e4198bcee5ee0a6f25856b29b12dbf7cd012791f8a6cc5c496", + "sha256:2bdfe3ac2e1bbe5b59a1a63721eb3b95fc9b6817ae4a46debbb4e11f6232428d", + "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b", + "sha256:2fb9bd477fdea8684f78791a6de97a953c51831ee2981f8e4f583ff3b9d9687e", + "sha256:311f30128d7d333eebd7896965bfcfbd0065f1716ec92bd5638d7748eb6f936a", + "sha256:329ce159e82018d646c7ac45b01a430369d526569ec08516081727a20e9e4af4", + "sha256:345b0426edd4e18138d6528aed636de7a9ed169b4aaf9d61a8c19e39d26838ca", + "sha256:363e2f92b0f0174b2f8238240a1a30142e3db7b957a5dd5689b0e75fb717cc78", + "sha256:3a3bd0dcd373514dcec91c411ddb9632c0d7d92aed7093b8c3bbb6d69ca74408", + "sha256:3bed14e9c89dcb10e8f3a29f9ccac4955aebe93c71ae803af79265c9ca5644c5", + "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3", + "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f", + "sha256:4532bff1b8421fd0a320463030c7520f56a79c9024a4e88f01c537316019005a", + "sha256:49402233c892a461407c512a19435d1ce275543138294f7ef013f0b63d5d3765", + "sha256:4c0907b1928a36d5a998d72d64d8eaa7244989f7aaaf947500d3a800c83a3fd6", + "sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146", + "sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6", + "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9", + "sha256:619a609aa74ae43d90ed2e89bdd784765de0a25ca761b93e196d938b8fd1dbbd", + "sha256:6e27f48bcd0957c6d4cb9d6fa6b61d192d0b13d5ef563e5f2ae35feafc0d179c", + "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f", + "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545", + "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176", + "sha256:75832c08354f595c760a804588b9357d34ec00ba1c940c15e31e96d902093770", + "sha256:7709f51f5f7c853f0fb938bcd3bc59cdfdc5203635ffd18bf354f6967ea0f824", + "sha256:78baa6d91634dfb69ec52a463534bc0df05dbd546209b79a3880a34487f4b84f", + "sha256:7974a0b5ecd505609e3b19742b60cee7aa2aa2fb3151bc917e6e2646d7667dcf", + "sha256:7a4f97a081603d2050bfaffdefa5b02a9ec823f8348a572e39032caa8404a487", + "sha256:7b1bef6280950ee6c177b326508f86cad7ad4dff12454483b51d8b7d673a2c5d", + "sha256:7d053096f67cd1241601111b698f5cad775f97ab25d81567d3f59219b5f1adbd", + "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b", + "sha256:807f52c1f798eef6cf26beb819eeb8819b1622ddfeef9d0977a8502d4db6d534", + "sha256:80ed5e856eb7f30115aaf94e4a08114ccc8813e6ed1b5efa74f9f82e8509858f", + "sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b", + "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9", + "sha256:89149166622f4db9b4b6a449256291dc87a99ee53151c74cbd82a53c8c2f6ccd", + "sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125", + "sha256:8c60ca7339acd497a55b0ea5d506b2a2612afb2826560416f6894e8b5770d4a9", + "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de", + "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11", + "sha256:97f68b8d6831127e4787ad15e6757232e14e12060bec17091b85eb1486b91d8d", + "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35", + "sha256:9f0b8b1c6d84c8034a44893aba5e767bf9c7a211e313a9605d9c617d7083829f", + "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda", + "sha256:ab36c8eb7e454e34e60eb55ca5d241a5d18b2c6244f6827a30e451c42410b5f7", + "sha256:b010a7a4fd316c3c484d482922d13044979e78d1861f0e0650423144c616a46a", + "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971", + "sha256:b7b2d86dd06bfc2ade3312a83a5c364c7ec2e3498f8734282c6c3d4b07b346b8", + "sha256:b97e690a2118911e39b4042088092771b4ae3fc3aa86518f84b8cf6888dbdb41", + "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d", + "sha256:c0429126cf75e16c4f0ad00ee0eae4242dc652290f940152ca8c75c3a4b6ee8f", + "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757", + "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a", + "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886", + "sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77", + "sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76", + "sha256:d973f03c0cb71c5ed99037b870f2be986c3c05e63622c017ea9816881d2dd247", + "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85", + "sha256:d9c3cdf5390dcd29aa8056d13e8e99526cda0305acc038b96b30352aff5ff2bb", + "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7", + "sha256:dccbe65bd2f7f7ec22c4ff99ed56faa1e9f785482b9bbd7c717e26fd723a1d1e", + "sha256:dd78cfcda14a1ef52584dbb008f7ac81c1328c0f58184bf9a84c49c605002da6", + "sha256:e218488cd232553829be0664c2292d3af2eeeb94b32bea483cf79ac6a694e037", + "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1", + "sha256:ea0d8d539afa5eb2728aa1932a988a9a7af94f18582ffae4bc10b3fbdad0626e", + "sha256:eab677309cdb30d047996b36d34caeda1dc91149e4fdca0b1a039b3f79d9a807", + "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407", + "sha256:ecddf25bee22fe4fe3737a399d0d177d72bc22be6913acfab364b40bce1ba83c", + "sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12", + "sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3", + "sha256:f30bf9fd9be89ecb2360c7d94a711f00c09b976258846efe40db3d05828e8089", + "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd", + "sha256:fc54db6c8593ef7d4b2a331b58653356cf04f67c960f584edb7c3d8c97e8f39e", + "sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00", + "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616" + ], + "markers": "python_version >= '3.7'", + "version": "==3.4.1" + }, + "idna": { + "hashes": [ + "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", + "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3" + ], + "markers": "python_version >= '3.6'", + "version": "==3.10" + }, "jmespath": { "hashes": [ "sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980", @@ -40,6 +162,13 @@ ], "version": "==0.12.0" }, + "lark-parser": { + "hashes": [ + "sha256:0eaf30cb5ba787fe404d73a7d6e61df97b21d5a63ac26c5008c78a494373c675", + "sha256:15967db1f1214013dca65b1180745047b9be457d73da224fcda3d9dd4e96a138" + ], + "version": "==0.12.0" + }, "protobuf": { "hashes": [ "sha256:0a18ed4a24198528f2333802eb075e59dea9d679ab7a6c5efb017a59004d849f", @@ -125,6 +254,14 @@ "markers": "python_version >= '3.8'", "version": "==6.0.2" }, + "requests": { + "hashes": [ + "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", + "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6" + ], + "markers": "python_version >= '3.8'", + "version": "==2.32.3" + }, "six": { "hashes": [ "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", @@ -148,6 +285,14 @@ ], "markers": "python_version >= '3.8'", "version": "==6.0.12.20241230" + }, + "urllib3": { + "hashes": [ + "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df", + "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d" + ], + "markers": "python_version >= '3.9'", + "version": "==2.3.0" } }, "develop": { @@ -242,28 +387,28 @@ }, "ruff": { "hashes": [ - "sha256:03482d5c09d90d4ee3f40d97578423698ad895c87314c4de39ed2af945633caa", - "sha256:0e2bb706a2be7ddfea4a4af918562fdc1bcb16df255e5fa595bbd800ce322a5a", - "sha256:194d8402bceef1b31164909540a597e0d913c0e4952015a5b40e28c146121b5d", - "sha256:19f505b643228b417c1111a2a536424ddde0db4ef9023b9e04a46ed8a1cb4656", - "sha256:1de4367cca3dac99bcbd15c161404e849bb0bfd543664db39232648dc00112dc", - "sha256:2f218f356dd2d995839f1941322ff021c72a492c470f0b26a34f844c29cdf5ba", - "sha256:4a091729086dffa4bd070aa5dab7e39cc6b9d62eb2bef8f3d91172d30d599666", - "sha256:589d1d9f25b5754ff230dce914a174a7c951a85a4e9270613a2b74231fdac2f5", - "sha256:5dc1edd1775270e6aa2386119aea692039781429f0be1e0949ea5884e011aa8e", - "sha256:5e2d9126161d0357e5c8f30b0bd6168d2c3872372f14481136d13de9937f79b6", - "sha256:68660eab1a8e65babb5229a1f97b46e3120923757a68b5413d8561f8a85d4897", - "sha256:81761592f72b620ec8fa1068a6fd00e98a5ebee342a3642efd84454f3031dca9", - "sha256:ac3ee4d7c2c92ddfdaedf0bf31b2b176fa7aa8950efc454628d477394d35638b", - "sha256:b109c0ad2ececf42e75fa99dc4043ff72a357436bb171900714a9ea581ddef83", - "sha256:b908ff4df65dad7b251c9968a2e4560836d8f5487c2f0cc238321ed951ea0504", - "sha256:c4cae6c4cc7b9b4017c71114115db0445b00a16de3bcde0946273e8392856f08", - "sha256:d1bbc6808bf7b15796cef0815e1dfb796fbd383e7dbd4334709642649625e7c5", - "sha256:dc61dd5131742e21103fbbdcad683a8813be0e3c204472d520d9a5021ca8b217" + "sha256:11417521d6f2d121fda376f0d2169fb529976c544d653d1d6044f4c5562516ee", + "sha256:11aecd7a633932875ab3cb05a484c99970b9d52606ce9ea912b690b02653d56c", + "sha256:134f958d52aa6fdec3b294b8ebe2320a950d10c041473c4316d2e7d7c2544723", + "sha256:18a29f1a005bddb229e580795627d297dfa99f16b30c7039e73278cf6b5f9fa9", + "sha256:2c746d7d1df64f31d90503ece5cc34d7007c06751a7a3bbeee10e5f2463d52d2", + "sha256:2e36c61145e70febcb78483903c43444c6b9d40f6d2f800b5552fec6e4a7bb9a", + "sha256:2f71d09aeba026c922aa7aa19a08d7bd27c867aedb2f74285a2639644c1c12f5", + "sha256:38840dbcef63948657fa7605ca363194d2fe8c26ce8f9ae12eee7f098c85ac8a", + "sha256:3d28532d73b1f3f627ba88e1456f50748b37f3a345d2be76e4c653bec6c3e393", + "sha256:4f7cb2a01da08244c50b20ccfaeb5972e4228c3c3a1989d3ece2bc4b1f996001", + "sha256:5b9d71c3879eb32de700f2f6fac3d46566f644a91d3130119a6378f9312a38e1", + "sha256:78cc6067f6d80b6745b67498fb84e87d32c6fc34992b52bffefbdae3442967d6", + "sha256:96d5c76358419bc63a671caac70c18732d4fd0341646ecd01641ddda5c39ca0b", + "sha256:d466d2abc05f39018d53f681fa1c0ffe9570e6d73cde1b65d23bb557c846f442", + "sha256:d56ba06da53536b575fbd2b56517f6f95774ff7be0f62c80b9e67430391eeb36", + "sha256:de92170dfa50c32a2b8206a647949590e752aca8100a0f6b8cefa02ae29dce80", + "sha256:deb8304636ed394211f3a6d46c0e7d9535b016f53adaa8340139859b2359a070", + "sha256:df455000bf59e62b3e8c7ba5ed88a4a2bc64896f900f311dc23ff2dc38156440" ], "index": "pypi", "markers": "python_version >= '3.7'", - "version": "==0.9.6" + "version": "==0.9.5" }, "tomli": { "hashes": [ From 265a4dbbea54ad220dcbb6b42f29b8554a5430cd Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Fri, 14 Feb 2025 09:49:01 -0500 Subject: [PATCH 04/12] Reapply "Regenerate Pipfile.lock with `pipenv lock --dev`" This reverts commit 0767933a15ac0955c9607680573fcf669ca5575c. --- Pipfile.lock | 183 ++++++--------------------------------------------- 1 file changed, 19 insertions(+), 164 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index f48356f..e937150 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -16,14 +16,6 @@ ] }, "default": { - "babel": { - "hashes": [ - "sha256:368b5b98b37c06b7daf6696391c3240c938b37767d4584413e8438c5c435fa8b", - "sha256:d1f3554ca26605fe173f3de0c65f750f5a42f924499bf134de6423582298e316" - ], - "markers": "python_version >= '3.8'", - "version": "==2.16.0" - }, "cel-python": { "hashes": [ "sha256:478ff73def7b39d51e6982f95d937a57c2b088c491c578fe5cecdbd79f476f60", @@ -33,120 +25,6 @@ "markers": "python_version >= '3.8' and python_version < '4.0'", "version": "==0.2.0" }, - "certifi": { - "hashes": [ - "sha256:1275f7a45be9464efc1173084eaa30f866fe2e47d389406136d332ed4967ec56", - "sha256:b650d30f370c2b724812bee08008be0c4163b163ddaec3f2546c1caf65f191db" - ], - "markers": "python_version >= '3.6'", - "version": "==2024.12.14" - }, - "charset-normalizer": { - "hashes": [ - "sha256:0167ddc8ab6508fe81860a57dd472b2ef4060e8d378f0cc555707126830f2537", - "sha256:01732659ba9b5b873fc117534143e4feefecf3b2078b0a6a2e925271bb6f4cfa", - "sha256:01ad647cdd609225c5350561d084b42ddf732f4eeefe6e678765636791e78b9a", - "sha256:04432ad9479fa40ec0f387795ddad4437a2b50417c69fa275e212933519ff294", - "sha256:0907f11d019260cdc3f94fbdb23ff9125f6b5d1039b76003b5b0ac9d6a6c9d5b", - "sha256:0924e81d3d5e70f8126529951dac65c1010cdf117bb75eb02dd12339b57749dd", - "sha256:09b26ae6b1abf0d27570633b2b078a2a20419c99d66fb2823173d73f188ce601", - "sha256:09b5e6733cbd160dcc09589227187e242a30a49ca5cefa5a7edd3f9d19ed53fd", - "sha256:0af291f4fe114be0280cdd29d533696a77b5b49cfde5467176ecab32353395c4", - "sha256:0f55e69f030f7163dffe9fd0752b32f070566451afe180f99dbeeb81f511ad8d", - "sha256:1a2bc9f351a75ef49d664206d51f8e5ede9da246602dc2d2726837620ea034b2", - "sha256:22e14b5d70560b8dd51ec22863f370d1e595ac3d024cb8ad7d308b4cd95f8313", - "sha256:234ac59ea147c59ee4da87a0c0f098e9c8d169f4dc2a159ef720f1a61bbe27cd", - "sha256:2369eea1ee4a7610a860d88f268eb39b95cb588acd7235e02fd5a5601773d4fa", - "sha256:237bdbe6159cff53b4f24f397d43c6336c6b0b42affbe857970cefbb620911c8", - "sha256:28bf57629c75e810b6ae989f03c0828d64d6b26a5e205535585f96093e405ed1", - "sha256:2967f74ad52c3b98de4c3b32e1a44e32975e008a9cd2a8cc8966d6a5218c5cb2", - "sha256:2a75d49014d118e4198bcee5ee0a6f25856b29b12dbf7cd012791f8a6cc5c496", - "sha256:2bdfe3ac2e1bbe5b59a1a63721eb3b95fc9b6817ae4a46debbb4e11f6232428d", - "sha256:2d074908e1aecee37a7635990b2c6d504cd4766c7bc9fc86d63f9c09af3fa11b", - "sha256:2fb9bd477fdea8684f78791a6de97a953c51831ee2981f8e4f583ff3b9d9687e", - "sha256:311f30128d7d333eebd7896965bfcfbd0065f1716ec92bd5638d7748eb6f936a", - "sha256:329ce159e82018d646c7ac45b01a430369d526569ec08516081727a20e9e4af4", - "sha256:345b0426edd4e18138d6528aed636de7a9ed169b4aaf9d61a8c19e39d26838ca", - "sha256:363e2f92b0f0174b2f8238240a1a30142e3db7b957a5dd5689b0e75fb717cc78", - "sha256:3a3bd0dcd373514dcec91c411ddb9632c0d7d92aed7093b8c3bbb6d69ca74408", - "sha256:3bed14e9c89dcb10e8f3a29f9ccac4955aebe93c71ae803af79265c9ca5644c5", - "sha256:44251f18cd68a75b56585dd00dae26183e102cd5e0f9f1466e6df5da2ed64ea3", - "sha256:44ecbf16649486d4aebafeaa7ec4c9fed8b88101f4dd612dcaf65d5e815f837f", - "sha256:4532bff1b8421fd0a320463030c7520f56a79c9024a4e88f01c537316019005a", - "sha256:49402233c892a461407c512a19435d1ce275543138294f7ef013f0b63d5d3765", - "sha256:4c0907b1928a36d5a998d72d64d8eaa7244989f7aaaf947500d3a800c83a3fd6", - "sha256:4d86f7aff21ee58f26dcf5ae81a9addbd914115cdebcbb2217e4f0ed8982e146", - "sha256:5777ee0881f9499ed0f71cc82cf873d9a0ca8af166dfa0af8ec4e675b7df48e6", - "sha256:5df196eb874dae23dcfb968c83d4f8fdccb333330fe1fc278ac5ceeb101003a9", - "sha256:619a609aa74ae43d90ed2e89bdd784765de0a25ca761b93e196d938b8fd1dbbd", - "sha256:6e27f48bcd0957c6d4cb9d6fa6b61d192d0b13d5ef563e5f2ae35feafc0d179c", - "sha256:6ff8a4a60c227ad87030d76e99cd1698345d4491638dfa6673027c48b3cd395f", - "sha256:73d94b58ec7fecbc7366247d3b0b10a21681004153238750bb67bd9012414545", - "sha256:7461baadb4dc00fd9e0acbe254e3d7d2112e7f92ced2adc96e54ef6501c5f176", - "sha256:75832c08354f595c760a804588b9357d34ec00ba1c940c15e31e96d902093770", - "sha256:7709f51f5f7c853f0fb938bcd3bc59cdfdc5203635ffd18bf354f6967ea0f824", - "sha256:78baa6d91634dfb69ec52a463534bc0df05dbd546209b79a3880a34487f4b84f", - "sha256:7974a0b5ecd505609e3b19742b60cee7aa2aa2fb3151bc917e6e2646d7667dcf", - "sha256:7a4f97a081603d2050bfaffdefa5b02a9ec823f8348a572e39032caa8404a487", - "sha256:7b1bef6280950ee6c177b326508f86cad7ad4dff12454483b51d8b7d673a2c5d", - "sha256:7d053096f67cd1241601111b698f5cad775f97ab25d81567d3f59219b5f1adbd", - "sha256:804a4d582ba6e5b747c625bf1255e6b1507465494a40a2130978bda7b932c90b", - "sha256:807f52c1f798eef6cf26beb819eeb8819b1622ddfeef9d0977a8502d4db6d534", - "sha256:80ed5e856eb7f30115aaf94e4a08114ccc8813e6ed1b5efa74f9f82e8509858f", - "sha256:8417cb1f36cc0bc7eaba8ccb0e04d55f0ee52df06df3ad55259b9a323555fc8b", - "sha256:8436c508b408b82d87dc5f62496973a1805cd46727c34440b0d29d8a2f50a6c9", - "sha256:89149166622f4db9b4b6a449256291dc87a99ee53151c74cbd82a53c8c2f6ccd", - "sha256:8bfa33f4f2672964266e940dd22a195989ba31669bd84629f05fab3ef4e2d125", - "sha256:8c60ca7339acd497a55b0ea5d506b2a2612afb2826560416f6894e8b5770d4a9", - "sha256:91b36a978b5ae0ee86c394f5a54d6ef44db1de0815eb43de826d41d21e4af3de", - "sha256:955f8851919303c92343d2f66165294848d57e9bba6cf6e3625485a70a038d11", - "sha256:97f68b8d6831127e4787ad15e6757232e14e12060bec17091b85eb1486b91d8d", - "sha256:9b23ca7ef998bc739bf6ffc077c2116917eabcc901f88da1b9856b210ef63f35", - "sha256:9f0b8b1c6d84c8034a44893aba5e767bf9c7a211e313a9605d9c617d7083829f", - "sha256:aabfa34badd18f1da5ec1bc2715cadc8dca465868a4e73a0173466b688f29dda", - "sha256:ab36c8eb7e454e34e60eb55ca5d241a5d18b2c6244f6827a30e451c42410b5f7", - "sha256:b010a7a4fd316c3c484d482922d13044979e78d1861f0e0650423144c616a46a", - "sha256:b1ac5992a838106edb89654e0aebfc24f5848ae2547d22c2c3f66454daa11971", - "sha256:b7b2d86dd06bfc2ade3312a83a5c364c7ec2e3498f8734282c6c3d4b07b346b8", - "sha256:b97e690a2118911e39b4042088092771b4ae3fc3aa86518f84b8cf6888dbdb41", - "sha256:bc2722592d8998c870fa4e290c2eec2c1569b87fe58618e67d38b4665dfa680d", - "sha256:c0429126cf75e16c4f0ad00ee0eae4242dc652290f940152ca8c75c3a4b6ee8f", - "sha256:c30197aa96e8eed02200a83fba2657b4c3acd0f0aa4bdc9f6c1af8e8962e0757", - "sha256:c4c3e6da02df6fa1410a7680bd3f63d4f710232d3139089536310d027950696a", - "sha256:c75cb2a3e389853835e84a2d8fb2b81a10645b503eca9bcb98df6b5a43eb8886", - "sha256:c96836c97b1238e9c9e3fe90844c947d5afbf4f4c92762679acfe19927d81d77", - "sha256:d7f50a1f8c450f3925cb367d011448c39239bb3eb4117c36a6d354794de4ce76", - "sha256:d973f03c0cb71c5ed99037b870f2be986c3c05e63622c017ea9816881d2dd247", - "sha256:d98b1668f06378c6dbefec3b92299716b931cd4e6061f3c875a71ced1780ab85", - "sha256:d9c3cdf5390dcd29aa8056d13e8e99526cda0305acc038b96b30352aff5ff2bb", - "sha256:dad3e487649f498dd991eeb901125411559b22e8d7ab25d3aeb1af367df5efd7", - "sha256:dccbe65bd2f7f7ec22c4ff99ed56faa1e9f785482b9bbd7c717e26fd723a1d1e", - "sha256:dd78cfcda14a1ef52584dbb008f7ac81c1328c0f58184bf9a84c49c605002da6", - "sha256:e218488cd232553829be0664c2292d3af2eeeb94b32bea483cf79ac6a694e037", - "sha256:e358e64305fe12299a08e08978f51fc21fac060dcfcddd95453eabe5b93ed0e1", - "sha256:ea0d8d539afa5eb2728aa1932a988a9a7af94f18582ffae4bc10b3fbdad0626e", - "sha256:eab677309cdb30d047996b36d34caeda1dc91149e4fdca0b1a039b3f79d9a807", - "sha256:eb8178fe3dba6450a3e024e95ac49ed3400e506fd4e9e5c32d30adda88cbd407", - "sha256:ecddf25bee22fe4fe3737a399d0d177d72bc22be6913acfab364b40bce1ba83c", - "sha256:eea6ee1db730b3483adf394ea72f808b6e18cf3cb6454b4d86e04fa8c4327a12", - "sha256:f08ff5e948271dc7e18a35641d2f11a4cd8dfd5634f55228b691e62b37125eb3", - "sha256:f30bf9fd9be89ecb2360c7d94a711f00c09b976258846efe40db3d05828e8089", - "sha256:fa88b843d6e211393a37219e6a1c1df99d35e8fd90446f1118f4216e307e48cd", - "sha256:fc54db6c8593ef7d4b2a331b58653356cf04f67c960f584edb7c3d8c97e8f39e", - "sha256:fd4ec41f914fa74ad1b8304bbc634b3de73d2a0889bd32076342a573e0779e00", - "sha256:ffc9202a29ab3920fa812879e95a9e78b2465fd10be7fcbd042899695d75e616" - ], - "markers": "python_version >= '3.7'", - "version": "==3.4.1" - }, - "idna": { - "hashes": [ - "sha256:12f65c9b470abda6dc35cf8e63cc574b1c52b11df2c86030af0ac09b01b13ea9", - "sha256:946d195a0d259cbba61165e88e65941f16e9b36ea6ddb97f00452bae8b1287d3" - ], - "markers": "python_version >= '3.6'", - "version": "==3.10" - }, "jmespath": { "hashes": [ "sha256:02e2e4cc71b5bcab88332eebf907519190dd9e6e82107fa7f83b1003a6252980", @@ -162,13 +40,6 @@ ], "version": "==0.12.0" }, - "lark-parser": { - "hashes": [ - "sha256:0eaf30cb5ba787fe404d73a7d6e61df97b21d5a63ac26c5008c78a494373c675", - "sha256:15967db1f1214013dca65b1180745047b9be457d73da224fcda3d9dd4e96a138" - ], - "version": "==0.12.0" - }, "protobuf": { "hashes": [ "sha256:0a18ed4a24198528f2333802eb075e59dea9d679ab7a6c5efb017a59004d849f", @@ -254,14 +125,6 @@ "markers": "python_version >= '3.8'", "version": "==6.0.2" }, - "requests": { - "hashes": [ - "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760", - "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6" - ], - "markers": "python_version >= '3.8'", - "version": "==2.32.3" - }, "six": { "hashes": [ "sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274", @@ -285,14 +148,6 @@ ], "markers": "python_version >= '3.8'", "version": "==6.0.12.20241230" - }, - "urllib3": { - "hashes": [ - "sha256:1cee9ad369867bfdbbb48b7dd50374c0967a0bb7710050facf0dd6911440e3df", - "sha256:f8c5449b3cf0861679ce7e0503c7b44b5ec981bec0d1d3795a07f1ba96f0204d" - ], - "markers": "python_version >= '3.9'", - "version": "==2.3.0" } }, "develop": { @@ -387,28 +242,28 @@ }, "ruff": { "hashes": [ - "sha256:11417521d6f2d121fda376f0d2169fb529976c544d653d1d6044f4c5562516ee", - "sha256:11aecd7a633932875ab3cb05a484c99970b9d52606ce9ea912b690b02653d56c", - "sha256:134f958d52aa6fdec3b294b8ebe2320a950d10c041473c4316d2e7d7c2544723", - "sha256:18a29f1a005bddb229e580795627d297dfa99f16b30c7039e73278cf6b5f9fa9", - "sha256:2c746d7d1df64f31d90503ece5cc34d7007c06751a7a3bbeee10e5f2463d52d2", - "sha256:2e36c61145e70febcb78483903c43444c6b9d40f6d2f800b5552fec6e4a7bb9a", - "sha256:2f71d09aeba026c922aa7aa19a08d7bd27c867aedb2f74285a2639644c1c12f5", - "sha256:38840dbcef63948657fa7605ca363194d2fe8c26ce8f9ae12eee7f098c85ac8a", - "sha256:3d28532d73b1f3f627ba88e1456f50748b37f3a345d2be76e4c653bec6c3e393", - "sha256:4f7cb2a01da08244c50b20ccfaeb5972e4228c3c3a1989d3ece2bc4b1f996001", - "sha256:5b9d71c3879eb32de700f2f6fac3d46566f644a91d3130119a6378f9312a38e1", - "sha256:78cc6067f6d80b6745b67498fb84e87d32c6fc34992b52bffefbdae3442967d6", - "sha256:96d5c76358419bc63a671caac70c18732d4fd0341646ecd01641ddda5c39ca0b", - "sha256:d466d2abc05f39018d53f681fa1c0ffe9570e6d73cde1b65d23bb557c846f442", - "sha256:d56ba06da53536b575fbd2b56517f6f95774ff7be0f62c80b9e67430391eeb36", - "sha256:de92170dfa50c32a2b8206a647949590e752aca8100a0f6b8cefa02ae29dce80", - "sha256:deb8304636ed394211f3a6d46c0e7d9535b016f53adaa8340139859b2359a070", - "sha256:df455000bf59e62b3e8c7ba5ed88a4a2bc64896f900f311dc23ff2dc38156440" + "sha256:03482d5c09d90d4ee3f40d97578423698ad895c87314c4de39ed2af945633caa", + "sha256:0e2bb706a2be7ddfea4a4af918562fdc1bcb16df255e5fa595bbd800ce322a5a", + "sha256:194d8402bceef1b31164909540a597e0d913c0e4952015a5b40e28c146121b5d", + "sha256:19f505b643228b417c1111a2a536424ddde0db4ef9023b9e04a46ed8a1cb4656", + "sha256:1de4367cca3dac99bcbd15c161404e849bb0bfd543664db39232648dc00112dc", + "sha256:2f218f356dd2d995839f1941322ff021c72a492c470f0b26a34f844c29cdf5ba", + "sha256:4a091729086dffa4bd070aa5dab7e39cc6b9d62eb2bef8f3d91172d30d599666", + "sha256:589d1d9f25b5754ff230dce914a174a7c951a85a4e9270613a2b74231fdac2f5", + "sha256:5dc1edd1775270e6aa2386119aea692039781429f0be1e0949ea5884e011aa8e", + "sha256:5e2d9126161d0357e5c8f30b0bd6168d2c3872372f14481136d13de9937f79b6", + "sha256:68660eab1a8e65babb5229a1f97b46e3120923757a68b5413d8561f8a85d4897", + "sha256:81761592f72b620ec8fa1068a6fd00e98a5ebee342a3642efd84454f3031dca9", + "sha256:ac3ee4d7c2c92ddfdaedf0bf31b2b176fa7aa8950efc454628d477394d35638b", + "sha256:b109c0ad2ececf42e75fa99dc4043ff72a357436bb171900714a9ea581ddef83", + "sha256:b908ff4df65dad7b251c9968a2e4560836d8f5487c2f0cc238321ed951ea0504", + "sha256:c4cae6c4cc7b9b4017c71114115db0445b00a16de3bcde0946273e8392856f08", + "sha256:d1bbc6808bf7b15796cef0815e1dfb796fbd383e7dbd4334709642649625e7c5", + "sha256:dc61dd5131742e21103fbbdcad683a8813be0e3c204472d520d9a5021ca8b217" ], "index": "pypi", "markers": "python_version >= '3.7'", - "version": "==0.9.5" + "version": "==0.9.6" }, "tomli": { "hashes": [ From 59df391258e4ee6155f862f111c6eee4a97b74ff Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Fri, 14 Feb 2025 10:28:01 -0500 Subject: [PATCH 05/12] Remove dead code --- protovalidate/internal/field_path.py | 36 ---------------------------- 1 file changed, 36 deletions(-) delete mode 100644 protovalidate/internal/field_path.py diff --git a/protovalidate/internal/field_path.py b/protovalidate/internal/field_path.py deleted file mode 100644 index 5a10d03..0000000 --- a/protovalidate/internal/field_path.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2023 Buf Technologies, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from buf.validate import validate_pb2 # type: ignore -from protovalidate.internal import string_format - - -def string(path: validate_pb2.FieldPath) -> str: - result: list[str] = [] - for element in path.elements: - if len(result) > 0: - result.append(".") - subscript_case = element.WhichOneof("subscript") - if subscript_case is not None: - result.extend( - ( - element.field_name, - "[", - string_format.format_value(getattr(element, subscript_case)), - "]", - ) - ) - else: - result.append(element.field_name) - return "".join(result) From 9e83b458ba50ac6cf10c5c15bd07f931cc7c1be0 Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Fri, 14 Feb 2025 12:58:25 -0500 Subject: [PATCH 06/12] First pass at types update The rest is just string_format, which does not appear to be flexed by conformance. --- protovalidate/internal/constraints.py | 6 +++--- protovalidate/internal/extra_func.py | 10 +++++----- protovalidate/internal/string_format.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/protovalidate/internal/constraints.py b/protovalidate/internal/constraints.py index 0ec15f9..3442297 100644 --- a/protovalidate/internal/constraints.py +++ b/protovalidate/internal/constraints.py @@ -36,14 +36,14 @@ def make_duration(msg: message.Message) -> celtypes.DurationType: def make_timestamp(msg: message.Message) -> celtypes.TimestampType: - return make_duration(msg) + celtypes.TimestampType(1970, 1, 1) + return celtypes.TimestampType(1970, 1, 1) + make_duration(msg) def unwrap(msg: message.Message) -> celtypes.Value: return _field_to_cel(msg, msg.DESCRIPTOR.fields_by_name["value"]) -_MSG_TYPE_URL_TO_CTOR = { +_MSG_TYPE_URL_TO_CTOR: dict[str, typing.Callable[..., celtypes.Value]] = { "google.protobuf.Duration": make_duration, "google.protobuf.Timestamp": make_timestamp, "google.protobuf.StringValue": unwrap, @@ -89,7 +89,7 @@ def _msg_to_cel(msg: message.Message) -> celtypes.Value: return MessageType(msg) -_TYPE_TO_CTOR = { +_TYPE_TO_CTOR: dict[str, typing.Callable[..., celtypes.Value]] = { descriptor.FieldDescriptor.TYPE_MESSAGE: _msg_to_cel, descriptor.FieldDescriptor.TYPE_GROUP: _msg_to_cel, descriptor.FieldDescriptor.TYPE_ENUM: celtypes.IntType, diff --git a/protovalidate/internal/extra_func.py b/protovalidate/internal/extra_func.py index d32a525..3975358 100644 --- a/protovalidate/internal/extra_func.py +++ b/protovalidate/internal/extra_func.py @@ -143,11 +143,11 @@ def is_ip_prefix(val: celtypes.Value, *args) -> celpy.Result: raise celpy.CELEvalError(msg) try: if version is None: - ip_network(val, strict=strict) + ip_network(val, strict=bool(strict)) elif version == 4: - IPv4Network(val, strict=strict) + IPv4Network(val, strict=bool(strict)) elif version == 6: - IPv6Network(val, strict=strict) + IPv6Network(val, strict=bool(strict)) else: msg = "invalid argument, expected 4 or 6" raise celpy.CELEvalError(msg) @@ -164,7 +164,7 @@ def is_email(string: celtypes.Value) -> celpy.Result: def is_uri(string: celtypes.Value) -> celpy.Result: - url = urlparse.urlparse(string) + url = urlparse.urlparse(str(string)) # urlparse correctly reads the scheme from URNs but parses everything # after (except the query string) as the path. if url.scheme == "urn": @@ -182,7 +182,7 @@ def is_uri(string: celtypes.Value) -> celpy.Result: def is_uri_ref(string: celtypes.Value) -> celpy.Result: - url = urlparse.urlparse(string) + url = urlparse.urlparse(str(string)) if not all([url.scheme, url.path]) and url.fragment: return celtypes.BoolType(False) return celtypes.BoolType(True) diff --git a/protovalidate/internal/string_format.py b/protovalidate/internal/string_format.py index 6604029..1c4213f 100644 --- a/protovalidate/internal/string_format.py +++ b/protovalidate/internal/string_format.py @@ -42,9 +42,9 @@ def __init__(self, locale: str): def format(self, fmt: celtypes.Value, args: celtypes.Value) -> celpy.Result: if not isinstance(fmt, celtypes.StringType): - return celpy.native_to_cel(celpy.new_error("format() requires a string as the first argument")) + return celpy.CELEvalError("format() requires a string as the first argument") if not isinstance(args, celtypes.ListType): - return celpy.native_to_cel(celpy.new_error("format() requires a list as the second argument")) + return celpy.CELEvalError("format() requires a list as the second argument") # printf style formatting i = 0 j = 0 From 4cb19ec1f9ea98e46f1d9b673abc0ef6f571f325 Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Fri, 14 Feb 2025 14:15:35 -0500 Subject: [PATCH 07/12] Pin directly to 0.2.* --- Pipfile | 2 +- Pipfile.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Pipfile b/Pipfile index f614830..bb4bfec 100644 --- a/Pipfile +++ b/Pipfile @@ -4,8 +4,8 @@ verify_ssl = true name = "pypi" [packages] +cel-python = "==0.2.*" protobuf = "==5.*" -cel-python = "*" [dev-packages] pytest = "*" diff --git a/Pipfile.lock b/Pipfile.lock index e937150..06e1f64 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "f21477ced5cd4bfd9be57c3c020b9c8a3884912555ed8ffd667427bcf722e12a" + "sha256": "d2061d519b31b0d2e3d0b63d41022ebbdb6194c232ace3cd53f9c420de00d17e" }, "pipfile-spec": 6, "requires": { From 3071c6d300cea227500e8d9f4fbc6790699f7bd1 Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Tue, 18 Feb 2025 10:03:30 -0500 Subject: [PATCH 08/12] Simplify format to just pass conformance tests It would seem that the conformance tests do not flex the formatting that we appear to support here, or just don't check for it? --- protovalidate/internal/string_format.py | 145 +----------------------- 1 file changed, 2 insertions(+), 143 deletions(-) diff --git a/protovalidate/internal/string_format.py b/protovalidate/internal/string_format.py index 1c4213f..df362f6 100644 --- a/protovalidate/internal/string_format.py +++ b/protovalidate/internal/string_format.py @@ -15,24 +15,6 @@ import celpy # type: ignore from celpy import celtypes # type: ignore -QUOTE_TRANS = str.maketrans( - { - "\a": r"\a", - "\b": r"\b", - "\f": r"\f", - "\n": r"\n", - "\r": r"\r", - "\t": r"\t", - "\v": r"\v", - "\\": r"\\", - '"': r"\"", - } -) - - -def quote(s: str) -> str: - return '"' + s.translate(QUOTE_TRANS) + '"' - class StringFormat: """An implementation of string.format() in CEL.""" @@ -40,134 +22,11 @@ class StringFormat: def __init__(self, locale: str): self.locale = locale - def format(self, fmt: celtypes.Value, args: celtypes.Value) -> celpy.Result: + def format(self, fmt: celtypes.Value, _: celtypes.Value) -> celpy.Result: if not isinstance(fmt, celtypes.StringType): return celpy.CELEvalError("format() requires a string as the first argument") - if not isinstance(args, celtypes.ListType): - return celpy.CELEvalError("format() requires a list as the second argument") - # printf style formatting - i = 0 - j = 0 - result = "" - while i < len(fmt): - if fmt[i] != "%": - result += fmt[i] - i += 1 - continue - - if i + 1 < len(fmt) and fmt[i + 1] == "%": - result += "%" - i += 2 - continue - if j >= len(args): - return celpy.CELEvalError("format() not enough arguments for format string") - arg = args[j] - j += 1 - i += 1 - if i >= len(fmt): - return celpy.CELEvalError("format() incomplete format specifier") - precision = 6 - if fmt[i] == ".": - i += 1 - precision = 0 - while i < len(fmt) and fmt[i].isdigit(): - precision = precision * 10 + int(fmt[i]) - i += 1 - if i >= len(fmt): - return celpy.CELEvalError("format() incomplete format specifier") - if fmt[i] == "f": - result += self.format_float(arg, precision) - if fmt[i] == "e": - result += self.format_exponential(arg, precision) - elif fmt[i] == "d": - result += self.format_int(arg) - elif fmt[i] == "s": - result += self.format_string(arg) - elif fmt[i] == "x": - result += self.format_hex(arg) - elif fmt[i] == "X": - result += self.format_hex(arg).upper() - elif fmt[i] == "o": - result += self.format_oct(arg) - elif fmt[i] == "b": - result += self.format_bin(arg) - else: - return celpy.CELEvalError("format() unknown format specifier: " + fmt[i]) - i += 1 - if j < len(args): - return celpy.CELEvalError("format() too many arguments for format string") - return celtypes.StringType(result) - - def format_float(self, arg: celtypes.Value, precision: int) -> celpy.Result: - if isinstance(arg, celtypes.DoubleType): - return celtypes.StringType(f"{arg:.{precision}f}") - return self.format_int(arg) - - def format_exponential(self, arg: celtypes.Value, precision: int) -> celpy.Result: - if isinstance(arg, celtypes.DoubleType): - return celtypes.StringType(f"{arg:.{precision}e}") - return self.format_int(arg) - - def format_int(self, arg: celtypes.Value) -> celpy.Result: - if isinstance(arg, celtypes.IntType): - return celtypes.StringType(arg) - if isinstance(arg, celtypes.UintType): - return celtypes.StringType(arg) - return celpy.CELEvalError("format_int() requires an integer argument") - - def format_hex(self, arg: celtypes.Value) -> celpy.Result: - if isinstance(arg, celtypes.IntType): - return celtypes.StringType(f"{arg:x}") - if isinstance(arg, celtypes.UintType): - return celtypes.StringType(f"{arg:x}") - if isinstance(arg, celtypes.BytesType): - return celtypes.StringType(arg.hex()) - if isinstance(arg, celtypes.StringType): - return celtypes.StringType(arg.encode("utf-8").hex()) - return celpy.CELEvalError("format_hex() requires an integer, string, or binary argument") - - def format_oct(self, arg: celtypes.Value) -> celpy.Result: - if isinstance(arg, celtypes.IntType): - return celtypes.StringType(f"{arg:o}") - if isinstance(arg, celtypes.UintType): - return celtypes.StringType(f"{arg:o}") - return celpy.CELEvalError("format_oct() requires an integer argument") - - def format_bin(self, arg: celtypes.Value) -> celpy.Result: - if isinstance(arg, celtypes.IntType): - return celtypes.StringType(f"{arg:b}") - if isinstance(arg, celtypes.UintType): - return celtypes.StringType(f"{arg:b}") - if isinstance(arg, celtypes.BoolType): - return celtypes.StringType(f"{arg:b}") - return celpy.CELEvalError("format_bin() requires an integer argument") - - def format_string(self, arg: celtypes.Value) -> celpy.Result: - if isinstance(arg, celtypes.StringType): - return arg - if isinstance(arg, celtypes.BytesType): - return celtypes.StringType(arg.hex()) - if isinstance(arg, celtypes.ListType): - return self.format_list(arg) - return celtypes.StringType(arg) - - def format_value(self, arg: celtypes.Value) -> celpy.Result: - if isinstance(arg, (celtypes.StringType, str)): - return celtypes.StringType(quote(arg)) - if isinstance(arg, celtypes.UintType): - return celtypes.StringType(arg) - return self.format_string(arg) - - def format_list(self, arg: celtypes.ListType) -> celpy.Result: - result = "[" - for i in range(len(arg)): - if i > 0: - result += ", " - result += self.format_value(arg[i]) - result += "]" - return celtypes.StringType(result) + return celtypes.StringType(fmt) _default_format = StringFormat("en_US") format = _default_format.format # noqa: A001 -format_value = _default_format.format_value From b056ff051f09163d1cbd2153bc9fde9bebf7af26 Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Tue, 18 Feb 2025 10:17:53 -0500 Subject: [PATCH 09/12] Revert "Simplify format to just pass conformance tests" This reverts commit 3071c6d300cea227500e8d9f4fbc6790699f7bd1. --- protovalidate/internal/string_format.py | 145 +++++++++++++++++++++++- 1 file changed, 143 insertions(+), 2 deletions(-) diff --git a/protovalidate/internal/string_format.py b/protovalidate/internal/string_format.py index df362f6..1c4213f 100644 --- a/protovalidate/internal/string_format.py +++ b/protovalidate/internal/string_format.py @@ -15,6 +15,24 @@ import celpy # type: ignore from celpy import celtypes # type: ignore +QUOTE_TRANS = str.maketrans( + { + "\a": r"\a", + "\b": r"\b", + "\f": r"\f", + "\n": r"\n", + "\r": r"\r", + "\t": r"\t", + "\v": r"\v", + "\\": r"\\", + '"': r"\"", + } +) + + +def quote(s: str) -> str: + return '"' + s.translate(QUOTE_TRANS) + '"' + class StringFormat: """An implementation of string.format() in CEL.""" @@ -22,11 +40,134 @@ class StringFormat: def __init__(self, locale: str): self.locale = locale - def format(self, fmt: celtypes.Value, _: celtypes.Value) -> celpy.Result: + def format(self, fmt: celtypes.Value, args: celtypes.Value) -> celpy.Result: if not isinstance(fmt, celtypes.StringType): return celpy.CELEvalError("format() requires a string as the first argument") - return celtypes.StringType(fmt) + if not isinstance(args, celtypes.ListType): + return celpy.CELEvalError("format() requires a list as the second argument") + # printf style formatting + i = 0 + j = 0 + result = "" + while i < len(fmt): + if fmt[i] != "%": + result += fmt[i] + i += 1 + continue + + if i + 1 < len(fmt) and fmt[i + 1] == "%": + result += "%" + i += 2 + continue + if j >= len(args): + return celpy.CELEvalError("format() not enough arguments for format string") + arg = args[j] + j += 1 + i += 1 + if i >= len(fmt): + return celpy.CELEvalError("format() incomplete format specifier") + precision = 6 + if fmt[i] == ".": + i += 1 + precision = 0 + while i < len(fmt) and fmt[i].isdigit(): + precision = precision * 10 + int(fmt[i]) + i += 1 + if i >= len(fmt): + return celpy.CELEvalError("format() incomplete format specifier") + if fmt[i] == "f": + result += self.format_float(arg, precision) + if fmt[i] == "e": + result += self.format_exponential(arg, precision) + elif fmt[i] == "d": + result += self.format_int(arg) + elif fmt[i] == "s": + result += self.format_string(arg) + elif fmt[i] == "x": + result += self.format_hex(arg) + elif fmt[i] == "X": + result += self.format_hex(arg).upper() + elif fmt[i] == "o": + result += self.format_oct(arg) + elif fmt[i] == "b": + result += self.format_bin(arg) + else: + return celpy.CELEvalError("format() unknown format specifier: " + fmt[i]) + i += 1 + if j < len(args): + return celpy.CELEvalError("format() too many arguments for format string") + return celtypes.StringType(result) + + def format_float(self, arg: celtypes.Value, precision: int) -> celpy.Result: + if isinstance(arg, celtypes.DoubleType): + return celtypes.StringType(f"{arg:.{precision}f}") + return self.format_int(arg) + + def format_exponential(self, arg: celtypes.Value, precision: int) -> celpy.Result: + if isinstance(arg, celtypes.DoubleType): + return celtypes.StringType(f"{arg:.{precision}e}") + return self.format_int(arg) + + def format_int(self, arg: celtypes.Value) -> celpy.Result: + if isinstance(arg, celtypes.IntType): + return celtypes.StringType(arg) + if isinstance(arg, celtypes.UintType): + return celtypes.StringType(arg) + return celpy.CELEvalError("format_int() requires an integer argument") + + def format_hex(self, arg: celtypes.Value) -> celpy.Result: + if isinstance(arg, celtypes.IntType): + return celtypes.StringType(f"{arg:x}") + if isinstance(arg, celtypes.UintType): + return celtypes.StringType(f"{arg:x}") + if isinstance(arg, celtypes.BytesType): + return celtypes.StringType(arg.hex()) + if isinstance(arg, celtypes.StringType): + return celtypes.StringType(arg.encode("utf-8").hex()) + return celpy.CELEvalError("format_hex() requires an integer, string, or binary argument") + + def format_oct(self, arg: celtypes.Value) -> celpy.Result: + if isinstance(arg, celtypes.IntType): + return celtypes.StringType(f"{arg:o}") + if isinstance(arg, celtypes.UintType): + return celtypes.StringType(f"{arg:o}") + return celpy.CELEvalError("format_oct() requires an integer argument") + + def format_bin(self, arg: celtypes.Value) -> celpy.Result: + if isinstance(arg, celtypes.IntType): + return celtypes.StringType(f"{arg:b}") + if isinstance(arg, celtypes.UintType): + return celtypes.StringType(f"{arg:b}") + if isinstance(arg, celtypes.BoolType): + return celtypes.StringType(f"{arg:b}") + return celpy.CELEvalError("format_bin() requires an integer argument") + + def format_string(self, arg: celtypes.Value) -> celpy.Result: + if isinstance(arg, celtypes.StringType): + return arg + if isinstance(arg, celtypes.BytesType): + return celtypes.StringType(arg.hex()) + if isinstance(arg, celtypes.ListType): + return self.format_list(arg) + return celtypes.StringType(arg) + + def format_value(self, arg: celtypes.Value) -> celpy.Result: + if isinstance(arg, (celtypes.StringType, str)): + return celtypes.StringType(quote(arg)) + if isinstance(arg, celtypes.UintType): + return celtypes.StringType(arg) + return self.format_string(arg) + + def format_list(self, arg: celtypes.ListType) -> celpy.Result: + result = "[" + for i in range(len(arg)): + if i > 0: + result += ", " + result += self.format_value(arg[i]) + result += "]" + return celtypes.StringType(result) _default_format = StringFormat("en_US") format = _default_format.format # noqa: A001 +format_value = _default_format.format_value From 1bcf22d54a6535b8a3028e9438936cb8253c5141 Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Tue, 18 Feb 2025 10:19:03 -0500 Subject: [PATCH 10/12] Add `--strict_message` to conformance suite runner Looks like we're just a little off in a few places. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8c89c02..8fa3208 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ export PATH := $(BIN):$(PATH) export GOBIN := $(abspath $(BIN)) # Set to use a different Python interpreter. For example, `PYTHON=python make test`. PYTHON ?= python3 -CONFORMANCE_ARGS ?= --strict --expected_failures=tests/conformance/nonconforming.yaml --timeout 10s +CONFORMANCE_ARGS ?= --strict --strict_message --expected_failures=tests/conformance/nonconforming.yaml --timeout 10s ADD_LICENSE_HEADER := $(BIN)/license-header \ --license-type apache \ --copyright-holder "Buf Technologies, Inc." \ From 30cf42c3e2bbf0f9e4083d255cbda01a8233c6cf Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Wed, 19 Feb 2025 09:36:39 -0500 Subject: [PATCH 11/12] Skip type-checking; add link to issue to fix and test --- protovalidate/internal/string_format.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protovalidate/internal/string_format.py b/protovalidate/internal/string_format.py index 9667a9c..0099f13 100644 --- a/protovalidate/internal/string_format.py +++ b/protovalidate/internal/string_format.py @@ -12,6 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# type: ignore +# TODO(#257): Fully test and fix types in this file. + from decimal import Decimal import celpy # type: ignore From de6b5ed7910aef4287337dca578619b1278c0f30 Mon Sep 17 00:00:00 2001 From: Stefan VanBuren Date: Wed, 19 Feb 2025 09:42:03 -0500 Subject: [PATCH 12/12] Add ignore/TODO comment at callsite --- protovalidate/internal/extra_func.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/protovalidate/internal/extra_func.py b/protovalidate/internal/extra_func.py index 3975358..957663b 100644 --- a/protovalidate/internal/extra_func.py +++ b/protovalidate/internal/extra_func.py @@ -238,7 +238,9 @@ def unique(val: celtypes.Value) -> celpy.Result: def make_extra_funcs(locale: str) -> dict[str, celpy.CELFunction]: - string_fmt = string_format.StringFormat(locale) + # TODO(#257): Fix types and add tests for StringFormat. + # For now, ignoring the type. + string_fmt = string_format.StringFormat(locale) # type: ignore return { # Missing standard functions "format": string_fmt.format,