diff --git a/Pipfile b/Pipfile index 9819fa4..a72e312 100644 --- a/Pipfile +++ b/Pipfile @@ -4,14 +4,15 @@ url = "https://pypi.org/simple" verify_ssl = true [packages] -pysen = {editable = true,extras = ["lint"],path = "."} +pysen = {editable = true, path = "."} pytest = ">=5.4.0,<6.0.0" tox = ">=3.15.0,<4.0.0" -black = "==20.8b1" +black = "==22.8.0" flake8 = "==3.8.4" flake8-bugbear = "==20.11.1" isort = "==5.1.4" -mypy = "==0.782" +mypy = "==0.971" +types-setuptools = "==65.3.0" [requires] -python_version = "3.7" +python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock index 0de8570..dbabeb6 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "d9e0d68ae6bfa08bba124230c7b74844d6234de7144db67f1c82624136ae83fa" + "sha256": "2fe32efe242a371bfe7795c8659528c936f8f0bd8f11cc35bc8888ed4b630db8" }, "pipfile-spec": 6, "requires": { - "python_version": "3.7" + "python_version": "3.8" }, "sources": [ { @@ -16,43 +16,57 @@ ] }, "default": { - "appdirs": { - "hashes": [ - "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41", - "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128" - ], - "version": "==1.4.4" - }, "attrs": { "hashes": [ - "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6", - "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700" + "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6", + "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==20.3.0" + "markers": "python_version >= '3.5'", + "version": "==22.1.0" }, "black": { "hashes": [ - "sha256:1c02557aa099101b9d21496f8a914e9ed2222ef70336404eeeac8edba836fbea", - "sha256:70b62ef1527c950db59062cda342ea224d772abdf6adc58b86a45421bab20a6b" + "sha256:0a12e4e1353819af41df998b02c6742643cfef58282915f781d0e4dd7a200411", + "sha256:0ad827325a3a634bae88ae7747db1a395d5ee02cf05d9aa7a9bd77dfb10e940c", + "sha256:32a4b17f644fc288c6ee2bafdf5e3b045f4eff84693ac069d87b1a347d861497", + "sha256:3b2c25f8dea5e8444bdc6788a2f543e1fb01494e144480bc17f806178378005e", + "sha256:4a098a69a02596e1f2a58a2a1c8d5a05d5a74461af552b371e82f9fa4ada8342", + "sha256:5107ea36b2b61917956d018bd25129baf9ad1125e39324a9b18248d362156a27", + "sha256:53198e28a1fb865e9fe97f88220da2e44df6da82b18833b588b1883b16bb5d41", + "sha256:5594efbdc35426e35a7defa1ea1a1cb97c7dbd34c0e49af7fb593a36bd45edab", + "sha256:5b879eb439094751185d1cfdca43023bc6786bd3c60372462b6f051efa6281a5", + "sha256:78dd85caaab7c3153054756b9fe8c611efa63d9e7aecfa33e533060cb14b6d16", + "sha256:792f7eb540ba9a17e8656538701d3eb1afcb134e3b45b71f20b25c77a8db7e6e", + "sha256:8ce13ffed7e66dda0da3e0b2eb1bdfc83f5812f66e09aca2b0978593ed636b6c", + "sha256:a05da0430bd5ced89176db098567973be52ce175a55677436a271102d7eaa3fe", + "sha256:a983526af1bea1e4cf6768e649990f28ee4f4137266921c2c3cee8116ae42ec3", + "sha256:bc4d4123830a2d190e9cc42a2e43570f82ace35c3aeb26a512a2102bce5af7ec", + "sha256:c3a73f66b6d5ba7288cd5d6dad9b4c9b43f4e8a4b789a94bf5abfb878c663eb3", + "sha256:ce957f1d6b78a8a231b18e0dd2d94a33d2ba738cd88a7fe64f53f659eea49fdd", + "sha256:cea1b2542d4e2c02c332e83150e41e3ca80dc0fb8de20df3c5e98e242156222c", + "sha256:d2c21d439b2baf7aa80d6dd4e3659259be64c6f49dfd0f32091063db0e006db4", + "sha256:d839150f61d09e7217f52917259831fe2b689f5c8e5e32611736351b89bb2a90", + "sha256:dd82842bb272297503cbec1a2600b6bfb338dae017186f8f215c8958f8acf869", + "sha256:e8166b7bfe5dcb56d325385bd1d1e0f635f24aae14b3ae437102dedc0c186747", + "sha256:e981e20ec152dfb3e77418fb616077937378b322d7b26aa1ff87717fb18b4875" ], "index": "pypi", - "version": "==20.8b1" + "version": "==22.8.0" }, "click": { "hashes": [ - "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a", - "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc" + "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e", + "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==7.1.2" + "markers": "python_version >= '3.7'", + "version": "==8.1.3" }, "colorlog": { "hashes": [ - "sha256:0a9dcdba6cab68e8a768448b418a858d73c52b37b6e8dea2568296faece393bd", - "sha256:18d05b616438a75762d7d214b9ec3b05d274466c9f3ddd92807e755840c88251" + "sha256:3dd15cb27e8119a24c1a7b5c93f9f3b455855e0f73993b1c25921b2f646f1dcd", + "sha256:59b53160c60902c405cdec28d38356e09d40686659048893e026ecbd589516b1" ], - "version": "==4.7.2" + "version": "==4.8.0" }, "dacite": { "hashes": [ @@ -64,17 +78,18 @@ }, "distlib": { "hashes": [ - "sha256:8c09de2c67b3e7deef7184574fc060ab8a793e7adbb183d942c389c8b13c52fb", - "sha256:edf6116872c863e1aa9d5bb7cb5e05a022c519a4594dc703843343a9ddd9bff1" + "sha256:14bad2d9b04d3a36127ac97f30b12a19268f211063d8f8ee4f47108896e11b46", + "sha256:f35c4b692542ca110de7ef0bea44d73981caeb34ca0b9b6b2e6d7790dda8f80e" ], - "version": "==0.3.1" + "version": "==0.3.6" }, "filelock": { "hashes": [ - "sha256:18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59", - "sha256:929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836" + "sha256:55447caa666f2198c5b6b13a26d2084d26fa5b115c00d065664b2124680c4edc", + "sha256:617eb4e5eedc82fc5f47b6d61e4d11cb837c56cb4544e39081099fa17ad109d4" ], - "version": "==3.0.12" + "markers": "python_version >= '3.7'", + "version": "==3.8.0" }, "flake8": { "hashes": [ @@ -94,27 +109,19 @@ }, "gitdb": { "hashes": [ - "sha256:91f36bfb1ab7949b3b40e23736db18231bf7593edada2ba5c3a174a7b23657ac", - "sha256:c9e1f2d0db7ddb9a704c2a0217be31214e91a4fe1dea1efad19ae42ba0c285c9" + "sha256:8033ad4e853066ba6ca92050b9df2f89301b8fc8bf7e9324d412a63f8bf1a8fd", + "sha256:bac2fd45c0a1c9cf619e63a90d62bdc63892ef92387424b855792a6cabe789aa" ], - "markers": "python_version >= '3.4'", - "version": "==4.0.5" + "markers": "python_version >= '3.6'", + "version": "==4.0.9" }, "gitpython": { "hashes": [ - "sha256:42dbefd8d9e2576c496ed0059f3103dcef7125b9ce16f9d5f9c834aed44a1dac", - "sha256:867ec3dfb126aac0f8296b19fb63b8c4a399f32b4b6fafe84c4b10af5fa9f7b5" - ], - "markers": "python_version >= '3.4'", - "version": "==3.1.12" - }, - "importlib-metadata": { - "hashes": [ - "sha256:ace61d5fc652dc280e7b6b4ff732a9c2d40db2c0f92bc6cb74e07b73d53a1771", - "sha256:fa5daa4477a7414ae34e95942e4dd07f62adf589143c875c133c1e53c4eff38d" + "sha256:1c885ce809e8ba2d88a29befeb385fcea06338d3640712b59ca623c220bb5704", + "sha256:5b68b000463593e05ff2b261acff0ff0972df8ab1b70d3cdbd41b546c8b8fc3d" ], - "markers": "python_version < '3.8'", - "version": "==3.4.0" + "markers": "python_version >= '3.7'", + "version": "==3.1.27" }, "isort": { "hashes": [ @@ -124,13 +131,6 @@ "index": "pypi", "version": "==5.1.4" }, - "pysen": { - "editable": true, - "extras": [ - "lint" - ], - "path": "." - }, "mccabe": { "hashes": [ "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", @@ -140,31 +140,40 @@ }, "more-itertools": { "hashes": [ - "sha256:8e1a2a43b2f2727425f2b5839587ae37093f19153dc26c0927d1048ff6557330", - "sha256:b3a9005928e5bed54076e6e549c792b306fddfe72b2d1d22dd63d42d5d3899cf" + "sha256:1bc4f91ee5b1b31ac7ceacc17c09befe6a40a503907baf9c839c229b5095cfd2", + "sha256:c09443cd3d5438b8dafccd867a6bc1cb0894389e90cb53d227456b0b0bccb750" ], "markers": "python_version >= '3.5'", - "version": "==8.6.0" + "version": "==8.14.0" }, "mypy": { "hashes": [ - "sha256:2c6cde8aa3426c1682d35190b59b71f661237d74b053822ea3d748e2c9578a7c", - "sha256:3fdda71c067d3ddfb21da4b80e2686b71e9e5c72cca65fa216d207a358827f86", - "sha256:5dd13ff1f2a97f94540fd37a49e5d255950ebcdf446fb597463a40d0df3fac8b", - "sha256:6731603dfe0ce4352c555c6284c6db0dc935b685e9ce2e4cf220abe1e14386fd", - "sha256:6bb93479caa6619d21d6e7160c552c1193f6952f0668cdda2f851156e85186fc", - "sha256:81c7908b94239c4010e16642c9102bfc958ab14e36048fa77d0be3289dda76ea", - "sha256:9c7a9a7ceb2871ba4bac1cf7217a7dd9ccd44c27c2950edbc6dc08530f32ad4e", - "sha256:a4a2cbcfc4cbf45cd126f531dedda8485671545b43107ded25ce952aac6fb308", - "sha256:b7fbfabdbcc78c4f6fc4712544b9b0d6bf171069c6e0e3cb82440dd10ced3406", - "sha256:c05b9e4fb1d8a41d41dec8786c94f3b95d3c5f528298d769eb8e73d293abc48d", - "sha256:d7df6eddb6054d21ca4d3c6249cae5578cb4602951fd2b6ee2f5510ffb098707", - "sha256:e0b61738ab504e656d1fe4ff0c0601387a5489ca122d55390ade31f9ca0e252d", - "sha256:eff7d4a85e9eea55afa34888dfeaccde99e7520b51f867ac28a48492c0b1130c", - "sha256:f05644db6779387ccdb468cc47a44b4356fc2ffa9287135d05b70a98dc83b89a" + "sha256:02ef476f6dcb86e6f502ae39a16b93285fef97e7f1ff22932b657d1ef1f28655", + "sha256:0d054ef16b071149917085f51f89555a576e2618d5d9dd70bd6eea6410af3ac9", + "sha256:19830b7dba7d5356d3e26e2427a2ec91c994cd92d983142cbd025ebe81d69cf3", + "sha256:1f7656b69974a6933e987ee8ffb951d836272d6c0f81d727f1d0e2696074d9e6", + "sha256:23488a14a83bca6e54402c2e6435467a4138785df93ec85aeff64c6170077fb0", + "sha256:23c7ff43fff4b0df93a186581885c8512bc50fc4d4910e0f838e35d6bb6b5e58", + "sha256:25c5750ba5609a0c7550b73a33deb314ecfb559c350bb050b655505e8aed4103", + "sha256:2ad53cf9c3adc43cf3bea0a7d01a2f2e86db9fe7596dfecb4496a5dda63cbb09", + "sha256:3fa7a477b9900be9b7dd4bab30a12759e5abe9586574ceb944bc29cddf8f0417", + "sha256:40b0f21484238269ae6a57200c807d80debc6459d444c0489a102d7c6a75fa56", + "sha256:4b21e5b1a70dfb972490035128f305c39bc4bc253f34e96a4adf9127cf943eb2", + "sha256:5a361d92635ad4ada1b1b2d3630fc2f53f2127d51cf2def9db83cba32e47c856", + "sha256:77a514ea15d3007d33a9e2157b0ba9c267496acf12a7f2b9b9f8446337aac5b0", + "sha256:855048b6feb6dfe09d3353466004490b1872887150c5bb5caad7838b57328cc8", + "sha256:9796a2ba7b4b538649caa5cecd398d873f4022ed2333ffde58eaf604c4d2cb27", + "sha256:98e02d56ebe93981c41211c05adb630d1d26c14195d04d95e49cd97dbc046dc5", + "sha256:b793b899f7cf563b1e7044a5c97361196b938e92f0a4343a5d27966a53d2ec71", + "sha256:d1ea5d12c8e2d266b5fb8c7a5d2e9c0219fedfeb493b7ed60cd350322384ac27", + "sha256:d2022bfadb7a5c2ef410d6a7c9763188afdb7f3533f22a0a32be10d571ee4bbe", + "sha256:d3348e7eb2eea2472db611486846742d5d52d1290576de99d59edeb7cd4a42ca", + "sha256:d744f72eb39f69312bc6c2abf8ff6656973120e2eb3f3ec4f758ed47e414a4bf", + "sha256:ef943c72a786b0f8d90fd76e9b39ce81fb7171172daf84bf43eaf937e9f220a9", + "sha256:f2899a3cbd394da157194f913a931edfd4be5f274a88041c9dc2d9cdcb1c315c" ], "index": "pypi", - "version": "==0.782" + "version": "==0.971" }, "mypy-extensions": { "hashes": [ @@ -175,18 +184,27 @@ }, "packaging": { "hashes": [ - "sha256:24e0da08660a87484d1602c30bb4902d74816b6985b93de36926f5bc95741858", - "sha256:78598185a7008a470d64526a8059de9aaa449238f280fc9eb6b13ba6c4109093" + "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb", + "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==20.8" + "markers": "python_version >= '3.6'", + "version": "==21.3" }, "pathspec": { "hashes": [ - "sha256:86379d6b86d75816baba717e64b1a3a3469deb93bb76d613c9ce79edc5cb68fd", - "sha256:aa0cb481c4041bf52ffa7b0d8fa6cd3e88a2ca4879c533c9153882ee2556790d" + "sha256:46846318467efc4556ccfd27816e004270a9eeeeb4d062ce5e6fc7a87c573f93", + "sha256:7ace6161b621d31e7902eb6b5ae148d12cfd23f4a249b9ffb6b9fee12084323d" + ], + "markers": "python_version >= '3.7'", + "version": "==0.10.1" + }, + "platformdirs": { + "hashes": [ + "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788", + "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19" ], - "version": "==0.8.1" + "markers": "python_version >= '3.7'", + "version": "==2.5.2" }, "pluggy": { "hashes": [ @@ -198,11 +216,11 @@ }, "py": { "hashes": [ - "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3", - "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a" + "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719", + "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.10.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==1.11.0" }, "pycodestyle": { "hashes": [ @@ -222,11 +240,15 @@ }, "pyparsing": { "hashes": [ - "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1", - "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b" + "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb", + "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc" ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==2.4.7" + "markers": "python_full_version >= '3.6.8'", + "version": "==3.0.9" + }, + "pysen": { + "editable": true, + "path": "." }, "pytest": { "hashes": [ @@ -236,150 +258,76 @@ "index": "pypi", "version": "==5.4.3" }, - "regex": { - "hashes": [ - "sha256:02951b7dacb123d8ea6da44fe45ddd084aa6777d4b2454fa0da61d569c6fa538", - "sha256:0d08e71e70c0237883d0bef12cad5145b84c3705e9c6a588b2a9c7080e5af2a4", - "sha256:1862a9d9194fae76a7aaf0150d5f2a8ec1da89e8b55890b1786b8f88a0f619dc", - "sha256:1ab79fcb02b930de09c76d024d279686ec5d532eb814fd0ed1e0051eb8bd2daa", - "sha256:1fa7ee9c2a0e30405e21031d07d7ba8617bc590d391adfc2b7f1e8b99f46f444", - "sha256:262c6825b309e6485ec2493ffc7e62a13cf13fb2a8b6d212f72bd53ad34118f1", - "sha256:2a11a3e90bd9901d70a5b31d7dd85114755a581a5da3fc996abfefa48aee78af", - "sha256:2c99e97d388cd0a8d30f7c514d67887d8021541b875baf09791a3baad48bb4f8", - "sha256:3128e30d83f2e70b0bed9b2a34e92707d0877e460b402faca908c6667092ada9", - "sha256:38c8fd190db64f513fe4e1baa59fed086ae71fa45083b6936b52d34df8f86a88", - "sha256:3bddc701bdd1efa0d5264d2649588cbfda549b2899dc8d50417e47a82e1387ba", - "sha256:4902e6aa086cbb224241adbc2f06235927d5cdacffb2425c73e6570e8d862364", - "sha256:49cae022fa13f09be91b2c880e58e14b6da5d10639ed45ca69b85faf039f7a4e", - "sha256:56e01daca75eae420bce184edd8bb341c8eebb19dd3bce7266332258f9fb9dd7", - "sha256:5862975b45d451b6db51c2e654990c1820523a5b07100fc6903e9c86575202a0", - "sha256:6a8ce43923c518c24a2579fda49f093f1397dad5d18346211e46f134fc624e31", - "sha256:6c54ce4b5d61a7129bad5c5dc279e222afd00e721bf92f9ef09e4fae28755683", - "sha256:6e4b08c6f8daca7d8f07c8d24e4331ae7953333dbd09c648ed6ebd24db5a10ee", - "sha256:717881211f46de3ab130b58ec0908267961fadc06e44f974466d1887f865bd5b", - "sha256:749078d1eb89484db5f34b4012092ad14b327944ee7f1c4f74d6279a6e4d1884", - "sha256:7913bd25f4ab274ba37bc97ad0e21c31004224ccb02765ad984eef43e04acc6c", - "sha256:7a25fcbeae08f96a754b45bdc050e1fb94b95cab046bf56b016c25e9ab127b3e", - "sha256:83d6b356e116ca119db8e7c6fc2983289d87b27b3fac238cfe5dca529d884562", - "sha256:8b882a78c320478b12ff024e81dc7d43c1462aa4a3341c754ee65d857a521f85", - "sha256:8f6a2229e8ad946e36815f2a03386bb8353d4bde368fdf8ca5f0cb97264d3b5c", - "sha256:9801c4c1d9ae6a70aeb2128e5b4b68c45d4f0af0d1535500884d644fa9b768c6", - "sha256:a15f64ae3a027b64496a71ab1f722355e570c3fac5ba2801cafce846bf5af01d", - "sha256:a3d748383762e56337c39ab35c6ed4deb88df5326f97a38946ddd19028ecce6b", - "sha256:a63f1a07932c9686d2d416fb295ec2c01ab246e89b4d58e5fa468089cab44b70", - "sha256:b2b1a5ddae3677d89b686e5c625fc5547c6e492bd755b520de5332773a8af06b", - "sha256:b2f4007bff007c96a173e24dcda236e5e83bde4358a557f9ccf5e014439eae4b", - "sha256:baf378ba6151f6e272824b86a774326f692bc2ef4cc5ce8d5bc76e38c813a55f", - "sha256:bafb01b4688833e099d79e7efd23f99172f501a15c44f21ea2118681473fdba0", - "sha256:bba349276b126947b014e50ab3316c027cac1495992f10e5682dc677b3dfa0c5", - "sha256:c084582d4215593f2f1d28b65d2a2f3aceff8342aa85afd7be23a9cad74a0de5", - "sha256:d1ebb090a426db66dd80df8ca85adc4abfcbad8a7c2e9a5ec7513ede522e0a8f", - "sha256:d2d8ce12b7c12c87e41123997ebaf1a5767a5be3ec545f64675388970f415e2e", - "sha256:e32f5f3d1b1c663af7f9c4c1e72e6ffe9a78c03a31e149259f531e0fed826512", - "sha256:e3faaf10a0d1e8e23a9b51d1900b72e1635c2d5b0e1bea1c18022486a8e2e52d", - "sha256:f7d29a6fc4760300f86ae329e3b6ca28ea9c20823df123a2ea8693e967b29917", - "sha256:f8f295db00ef5f8bae530fc39af0b40486ca6068733fb860b42115052206466f" - ], - "version": "==2020.11.13" - }, "six": { "hashes": [ - "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", - "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" + "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", + "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.15.0" + "version": "==1.16.0" }, "smmap": { "hashes": [ - "sha256:7bfcf367828031dc893530a29cb35eb8c8f2d7c8f2d0989354d75d24c8573714", - "sha256:84c2751ef3072d4f6b2785ec7ee40244c6f45eb934d9e543e2c51f1bd3d54c50" + "sha256:2aba19d6a040e78d8b09de5c57e96207b09ed71d8e55ce0959eeee6c8e190d94", + "sha256:c840e62059cd3be204b0c9c9f74be2c09d5648eddd4580d9314c3ecde0b30936" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==3.0.5" + "markers": "python_version >= '3.6'", + "version": "==5.0.0" }, - "toml": { + "tomli": { "hashes": [ - "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b", - "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f" + "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" ], - "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==0.10.2" + "markers": "python_full_version < '3.11.0a7'", + "version": "==2.0.1" }, "tomlkit": { "hashes": [ - "sha256:6babbd33b17d5c9691896b0e68159215a9387ebfa938aa3ac42f4a4beeb2b831", - "sha256:ac57f29693fab3e309ea789252fcce3061e19110085aa31af5446ca749325618" + "sha256:25d4e2e446c453be6360c67ddfb88838cfc42026322770ba13d1fbd403a93a5c", + "sha256:3235a9010fae54323e727c3ac06fb720752fe6635b3426e379daec60fbd44a83" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==0.7.0" + "markers": "python_version >= '3.6' and python_version < '4.0'", + "version": "==0.11.4" }, "tox": { "hashes": [ - "sha256:0aa777ee466f2ef18e6f58428c793c32378779e0a321dbb8934848bc3e78998c", - "sha256:f501808381c01c6d7827c2f17328be59c0a715046e94605ddca15fb91e65827d" + "sha256:44f3c347c68c2c68799d7d44f1808f9d396fc8a1a500cbc624253375c7ae107e", + "sha256:bf037662d7c740d15c9924ba23bb3e587df20598697bb985ac2b49bdc2d847f6" ], "index": "pypi", - "version": "==3.21.2" - }, - "typed-ast": { - "hashes": [ - "sha256:07d49388d5bf7e863f7fa2f124b1b1d89d8aa0e2f7812faff0a5658c01c59aa1", - "sha256:14bf1522cdee369e8f5581238edac09150c765ec1cb33615855889cf33dcb92d", - "sha256:240296b27397e4e37874abb1df2a608a92df85cf3e2a04d0d4d61055c8305ba6", - "sha256:36d829b31ab67d6fcb30e185ec996e1f72b892255a745d3a82138c97d21ed1cd", - "sha256:37f48d46d733d57cc70fd5f30572d11ab8ed92da6e6b28e024e4a3edfb456e37", - "sha256:4c790331247081ea7c632a76d5b2a265e6d325ecd3179d06e9cf8d46d90dd151", - "sha256:5dcfc2e264bd8a1db8b11a892bd1647154ce03eeba94b461effe68790d8b8e07", - "sha256:7147e2a76c75f0f64c4319886e7639e490fee87c9d25cb1d4faef1d8cf83a440", - "sha256:7703620125e4fb79b64aa52427ec192822e9f45d37d4b6625ab37ef403e1df70", - "sha256:8368f83e93c7156ccd40e49a783a6a6850ca25b556c0fa0240ed0f659d2fe496", - "sha256:84aa6223d71012c68d577c83f4e7db50d11d6b1399a9c779046d75e24bed74ea", - "sha256:85f95aa97a35bdb2f2f7d10ec5bbdac0aeb9dafdaf88e17492da0504de2e6400", - "sha256:8db0e856712f79c45956da0c9a40ca4246abc3485ae0d7ecc86a20f5e4c09abc", - "sha256:9044ef2df88d7f33692ae3f18d3be63dec69c4fb1b5a4a9ac950f9b4ba571606", - "sha256:963c80b583b0661918718b095e02303d8078950b26cc00b5e5ea9ababe0de1fc", - "sha256:987f15737aba2ab5f3928c617ccf1ce412e2e321c77ab16ca5a293e7bbffd581", - "sha256:9ec45db0c766f196ae629e509f059ff05fc3148f9ffd28f3cfe75d4afb485412", - "sha256:9fc0b3cb5d1720e7141d103cf4819aea239f7d136acf9ee4a69b047b7986175a", - "sha256:a2c927c49f2029291fbabd673d51a2180038f8cd5a5b2f290f78c4516be48be2", - "sha256:a38878a223bdd37c9709d07cd357bb79f4c760b29210e14ad0fb395294583787", - "sha256:b4fcdcfa302538f70929eb7b392f536a237cbe2ed9cba88e3bf5027b39f5f77f", - "sha256:c0c74e5579af4b977c8b932f40a5464764b2f86681327410aa028a22d2f54937", - "sha256:c1c876fd795b36126f773db9cbb393f19808edd2637e00fd6caba0e25f2c7b64", - "sha256:c9aadc4924d4b5799112837b226160428524a9a45f830e0d0f184b19e4090487", - "sha256:cc7b98bf58167b7f2db91a4327da24fb93368838eb84a44c472283778fc2446b", - "sha256:cf54cfa843f297991b7388c281cb3855d911137223c6b6d2dd82a47ae5125a41", - "sha256:d003156bb6a59cda9050e983441b7fa2487f7800d76bdc065566b7d728b4581a", - "sha256:d175297e9533d8d37437abc14e8a83cbc68af93cc9c1c59c2c292ec59a0697a3", - "sha256:d746a437cdbca200622385305aedd9aef68e8a645e385cc483bdc5e488f07166", - "sha256:e683e409e5c45d5c9082dc1daf13f6374300806240719f95dc783d1fc942af10" - ], - "version": "==1.4.2" + "version": "==3.26.0" + }, + "types-setuptools": { + "hashes": [ + "sha256:c26779cbba3947823c260354adaab4e91ca8c18888aa2b740f503844b88f1813", + "sha256:f69210049580939c70386252b776eb75ff4b6de488e7d766b9398669b7de68af" + ], + "index": "pypi", + "version": "==65.3.0" }, "typing-extensions": { "hashes": [ - "sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918", - "sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c", - "sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f" + "sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02", + "sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6" ], - "markers": "python_version < '3.8'", - "version": "==3.7.4.3" + "markers": "python_version < '3.10'", + "version": "==4.3.0" }, "unidiff": { "hashes": [ - "sha256:90c5214e9a357ff4b2fee19d91e77706638e3e00592a732d9405ea4e93da981f", - "sha256:e1dd956a492ccc4351e24931b2f2d29c79e3be17a99dd8f14e95324321d93a88" + "sha256:2bbcbc986e1fb97f04b1d7b864aa6002ab02f4d8a996bf03aa6e5a81447d1fc5", + "sha256:688622add422f84a873498cc4ff9bf50da5ea6c23dea908f19d2190fa39a8e39" ], - "version": "==0.6.0" + "version": "==0.7.4" }, "virtualenv": { "hashes": [ - "sha256:219ee956e38b08e32d5639289aaa5bd190cfbe7dafcb8fa65407fca08e808f9c", - "sha256:227a8fed626f2f20a6cdb0870054989f82dd27b2560a911935ba905a2a5e0034" + "sha256:227ea1b9994fdc5ea31977ba3383ef296d7472ea85be9d6732e42a91c04e80da", + "sha256:d07dfc5df5e4e0dbc92862350ad87a36ed505b978f6c39609dc489eadd5b0d27" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==20.4.0" + "markers": "python_version >= '3.6'", + "version": "==20.16.5" }, "wcwidth": { "hashes": [ @@ -387,14 +335,6 @@ "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83" ], "version": "==0.2.5" - }, - "zipp": { - "hashes": [ - "sha256:102c24ef8f171fd729d46599845e95c7ab894a4cf45f5de11a44cc7444fb1108", - "sha256:ed5eee1974372595f9e416cc7bbeeb12335201d8081ca8a0743c954d4446e5cb" - ], - "markers": "python_version >= '3.6'", - "version": "==3.4.0" } }, "develop": {} diff --git a/examples/advanced_example/lint.py b/examples/advanced_example/lint.py index ec51964..c751af0 100644 --- a/examples/advanced_example/lint.py +++ b/examples/advanced_example/lint.py @@ -20,7 +20,7 @@ def build( ), }, mypy_targets=[ - pysen.MypyTarget([pathlib.Path("."), pathlib.Path("tests")]), + pysen.MypyTarget([pathlib.Path(".")]), pysen.MypyTarget([pathlib.Path("tools")]), ], ) diff --git a/examples/sync_cmdclass_pyproject/setup.py b/examples/sync_cmdclass_pyproject/setup.py index 386d3a4..a12899d 100644 --- a/examples/sync_cmdclass_pyproject/setup.py +++ b/examples/sync_cmdclass_pyproject/setup.py @@ -5,7 +5,7 @@ except ImportError: import setuptools - setup = setuptools.setup + setup = setuptools.setup # type: ignore setup( diff --git a/pyproject.toml b/pyproject.toml index 9c5f9bc..66bf499 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,10 +10,22 @@ enable_flake8 = true enable_isort = true enable_mypy = true mypy_preset = "very_strict" -py_version = "py37" +py_version = "py38" isort_known_first_party = ["fakes", "pysen"] [[tool.pysen.lint.mypy_targets]] - paths = [".", "tests/"] + paths = [ + "pysen/", + "setup.py", + "tests/", + ] +[[tool.pysen.lint.mypy_targets]] + paths = ["examples/advanced_example"] +[[tool.pysen.lint.mypy_targets]] + paths = ["examples/simple_package"] +[[tool.pysen.lint.mypy_targets]] + paths = ["examples/plugin_example"] +[[tool.pysen.lint.mypy_targets]] + paths = ["examples/sync_cmdclass_pyproject"] [tool.pysen.lint.source] excludes = ["build/", "dist/", "examples/", ".tox"] @@ -24,7 +36,7 @@ markers = ["examples"] [tool.black] # automatically generated by pysen # pysen ignores and overwrites any modifications line-length = 88 -target-version = ["py37"] +target-version = ["py38"] [tool.isort] # automatically generated by pysen # pysen ignores and overwrites any modifications diff --git a/pysen/cli_config.py b/pysen/cli_config.py index b2f69e7..18a9357 100644 --- a/pysen/cli_config.py +++ b/pysen/cli_config.py @@ -6,7 +6,7 @@ import tomlkit from .exceptions import InvalidConfigurationError -from .pyproject_model import _workaround_tomlkit_unmarshal +from .pyproject_model import _get_descendant, _workaround_tomlkit_unmarshal @dataclasses.dataclass @@ -27,11 +27,10 @@ def _load_cli_section(path: pathlib.Path) -> Optional[Dict[str, Any]]: with path.open("r") as f: pyproject = tomlkit.loads(f.read()) - if "tool" not in pyproject or "pysen-cli" not in pyproject["tool"]: + section = _get_descendant(pyproject, ["tool", "pysen-cli"]) + if section is None: return None - section = pyproject["tool"]["pysen-cli"] - data = _workaround_tomlkit_unmarshal(section) assert isinstance(data, dict) return data diff --git a/pysen/dumper.py b/pysen/dumper.py index 3f715ac..344e6ff 100644 --- a/pysen/dumper.py +++ b/pysen/dumper.py @@ -38,8 +38,8 @@ def _repr_cfg(data: Any) -> Optional[str]: elif isinstance(data, PRIMITIVE_TYPES): return str(data) elif isinstance(data, SEQUENCE_TYPES): - items = sorted(_repr_cfg(x) for x in data) - return ",".join(x for x in items if x is not None) + items = [_repr_cfg(x) for x in data] + return ",".join(sorted(x for x in items if x is not None)) else: raise RuntimeError(f"{type(data)} is not supported in cfg") diff --git a/pysen/error_lines.py b/pysen/error_lines.py index aa423c5..cc74750 100644 --- a/pysen/error_lines.py +++ b/pysen/error_lines.py @@ -29,8 +29,8 @@ def parse_error_lines( """ number = r"(?:0|[1-9]\d*)" _file_path = r"^(?P.*?)" - _line = fr":(?P{number})" - _column = fr"(:(?P{number}))?" + _line = rf":(?P{number})" + _column = rf"(:(?P{number}))?" _message = r": (?P.*$)" pattern = _file_path + _line + _column + _message invalid_lines = [] diff --git a/pysen/exceptions.py b/pysen/exceptions.py index 814f8cd..aec0e83 100644 --- a/pysen/exceptions.py +++ b/pysen/exceptions.py @@ -1,4 +1,6 @@ -import pathlib +from typing import Optional + +from .path import PathLikeType class PysenError(Exception): @@ -23,12 +25,12 @@ class InvalidConfigurationError(PysenError): class InvalidPluginError(PysenError): - def __init__(self, module_path: str, error: str) -> None: + def __init__(self, module_path: Optional[PathLikeType], error: str) -> None: super().__init__(f"invalid plugin: {module_path}, {error}") class InvalidManifestBuilderError(PysenError): - def __init__(self, path: pathlib.Path, error: str) -> None: + def __init__(self, path: PathLikeType, error: str) -> None: super().__init__(f"invalid manifest builder: {path}, {error}") diff --git a/pysen/git_utils.py b/pysen/git_utils.py index 5440828..d6e4db3 100644 --- a/pysen/git_utils.py +++ b/pysen/git_utils.py @@ -10,6 +10,9 @@ try: import git + from git import Blob # type: ignore + + # NOTE: Upstream issue: https://github.com/gitpython-developers/GitPython/issues/1349 _git_available = True except ImportError: @@ -51,7 +54,7 @@ def _list_indexed_files(target_dir: pathlib.Path) -> Sequence[pathlib.Path]: # We avoid pathlib.Path because the loop calling predicate is performance critical. abs_target_dir = os.path.join(str(target_dir.resolve()), "") - def predicate(item: Tuple[int, git.Blob]) -> bool: + def predicate(item: Tuple[int, Blob]) -> bool: blob = item[1] ret: bool = blob.abspath.startswith(abs_target_dir) return ret @@ -82,7 +85,7 @@ def _check_tracked(path: pathlib.Path) -> bool: # TODO(igarashi) use git command directly for better performance abspath = str(path.expanduser().resolve()) - def predicate(item: Tuple[int, git.Blob]) -> bool: + def predicate(item: Tuple[int, Blob]) -> bool: blob = item[1] return cast(bool, blob.abspath == abspath) diff --git a/pysen/logging_utils.py b/pysen/logging_utils.py index dffcd08..ec8d362 100644 --- a/pysen/logging_utils.py +++ b/pysen/logging_utils.py @@ -67,7 +67,7 @@ def emit(self, record: logging.LogRecord) -> None: def shouldFlush(self, record: logging.LogRecord) -> bool: return False - def setFormatter(self, fmt: logging.Formatter) -> None: + def setFormatter(self, fmt: Optional[logging.Formatter]) -> None: self.target: Optional[logging.Handler] assert self.target is not None self.target.setFormatter(fmt) diff --git a/pysen/process_utils.py b/pysen/process_utils.py index 2d08623..f1828d9 100644 --- a/pysen/process_utils.py +++ b/pysen/process_utils.py @@ -8,7 +8,10 @@ from .reporter import Reporter -def _read_stream(stream: IO[str], reporter: Reporter, loglevel: int) -> str: +def _read_stream(stream: Optional[IO[str]], reporter: Reporter, loglevel: int) -> str: + if stream is None: + return "" + ret: List[str] = [] for line in stream: ret.append(line) diff --git a/pysen/py_version.py b/pysen/py_version.py index d9202a2..869d552 100644 --- a/pysen/py_version.py +++ b/pysen/py_version.py @@ -28,10 +28,10 @@ def version(self) -> str: @classmethod def from_str(cls, s: str) -> "VersionRepresentation": number = r"(?:0|[1-9]\d*)" - major = fr"^(?P{number})" - minor = fr"\.(?P{number})" - patch = fr"(\.(?P{number}))?" - pre_release = fr"(?P(a|b|rc){number})?$" + major = rf"^(?P{number})" + minor = rf"\.(?P{number})" + patch = rf"(\.(?P{number}))?" + pre_release = rf"(?P(a|b|rc){number})?$" pattern = major + minor + patch + pre_release m = re.match(pattern, s) diff --git a/pysen/pyproject_model.py b/pysen/pyproject_model.py index 236dc1e..53ffc2b 100644 --- a/pysen/pyproject_model.py +++ b/pysen/pyproject_model.py @@ -1,7 +1,7 @@ import dataclasses import logging import pathlib -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Optional, Sequence import dacite import tomlkit @@ -317,11 +317,33 @@ def _workaround_tomlkit_unmarshal(data: Any) -> Any: return data +def _get_descendant( + document: tomlkit.toml_document.TOMLDocument, paths: Sequence[str] +) -> Optional[Any]: + assert len(paths) > 0 + + node: Dict[str, Any] = document + for p in paths[:-1]: + e = node.get(p) + if not isinstance(e, dict): + return None + node = e + + return node.get(paths[-1]) + + +def get_tool_section( + tool_name: str, + pyproject: tomlkit.toml_document.TOMLDocument, +) -> Optional[tomlkit.toml_document.TOMLDocument]: + return _get_descendant(pyproject, ["tool", tool_name]) + + def has_tool_section( tool_name: str, pyproject: tomlkit.toml_document.TOMLDocument, ) -> bool: - return "tool" in pyproject and tool_name in pyproject["tool"] + return get_tool_section(tool_name, pyproject) is not None def _load_pysen_section(path: pathlib.Path) -> Dict[str, Any]: @@ -331,14 +353,15 @@ def _load_pysen_section(path: pathlib.Path) -> Dict[str, Any]: with path.open("r") as f: pyproject = tomlkit.loads(f.read()) - if has_tool_section("pysen", pyproject): - section = pyproject["tool"]["pysen"] - elif has_tool_section("jiro", pyproject): - _logger.warning( - "jiro section under a config file is deprecated. Use pysen instead." - ) - section = pyproject["tool"]["jiro"] - else: + section = get_tool_section("pysen", pyproject) + if section is None: + section = get_tool_section("jiro", pyproject) + if section is not None: + _logger.warning( + "jiro section under a config file is deprecated. Use pysen instead." + ) + + if section is None: raise PysenSectionNotFoundError(str(path)) data = _workaround_tomlkit_unmarshal(section) diff --git a/pysen/setuptools.py b/pysen/setuptools.py index 6852dbe..74b4aad 100644 --- a/pysen/setuptools.py +++ b/pysen/setuptools.py @@ -1,4 +1,5 @@ import argparse +import distutils.core import functools import pathlib import sys @@ -14,7 +15,7 @@ from .runner_options import RunOptions ManifestLikeType = Union[str, pathlib.Path, ManifestBase] -CommandClassType = Type[setuptools.Command] +CommandClassType = Type[distutils.core.Command] UNDEFINED = object() _PREDEFINED_COMMAND_NAMES = [ @@ -42,7 +43,7 @@ def _get_setuptool_command(name: str) -> CommandClassType: except BaseException: pass # failover - return setuptools.Command # type: ignore + return setuptools.Command def _get_setuptool_user_options( diff --git a/setup.cfg b/setup.cfg index 75548ee..7f57f26 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,7 +24,7 @@ disallow_untyped_defs = True ignore_errors = False ignore_missing_imports = True no_implicit_optional = True -python_version = 3.7 +python_version = 3.8 show_error_codes = True strict_equality = True strict_optional = True diff --git a/tests/example_tests/test_sync_cmdclass_pyproject.py b/tests/example_tests/test_sync_cmdclass_pyproject.py index f758d82..a703381 100644 --- a/tests/example_tests/test_sync_cmdclass_pyproject.py +++ b/tests/example_tests/test_sync_cmdclass_pyproject.py @@ -33,4 +33,4 @@ def test_setuptools_sandbox(example_dir: pathlib.Path) -> None: setup_py = target / "setup.py" assert setup_py.exists() - sandbox.run_setup(str(setup_py), ["lint"]) + sandbox.run_setup(str(setup_py), ["lint"]) # type: ignore diff --git a/tests/fakes/configs/error_builder.py b/tests/fakes/configs/error_builder.py index fe37d2a..8021a14 100644 --- a/tests/fakes/configs/error_builder.py +++ b/tests/fakes/configs/error_builder.py @@ -7,7 +7,7 @@ raise BufferError() -def build( +def build( # type: ignore components: Sequence[ComponentBase], src_path: Optional[pathlib.Path] ) -> ManifestBase: assert src_path is not None diff --git a/tests/test_setting.py b/tests/test_setting.py index 52c1599..da08c74 100644 --- a/tests/test_setting.py +++ b/tests/test_setting.py @@ -1,6 +1,7 @@ import pytest import tomlkit +from pysen.pyproject_model import _get_descendant from pysen.setting import _create_dict, _traverse_toml @@ -27,4 +28,4 @@ def test__traverse_toml() -> None: with pytest.raises(ValueError): _traverse_toml(("tool", "hoge", "answer"), document, False) _traverse_toml(("tool", "hoge", "answer"), document, True) - assert document["tool"]["hoge"]["answer"] == {} + assert _get_descendant(document, ["tool", "hoge", "answer"]) == {} diff --git a/tests/test_setuptools.py b/tests/test_setuptools.py index 895eb8c..ecc8a0c 100644 --- a/tests/test_setuptools.py +++ b/tests/test_setuptools.py @@ -45,7 +45,7 @@ def test__get_setuptool_user_options() -> None: assert build_py_options is not None assert len(build_py_options) > 0 - command_options = _get_setuptool_user_options(setuptools.Command) + command_options = _get_setuptool_user_options(setuptools.Command) # type: ignore assert command_options is not None assert command_options == [] diff --git a/tox.ini b/tox.ini index 53eef83..b008f03 100644 --- a/tox.ini +++ b/tox.ini @@ -24,19 +24,21 @@ setenv = LANG = C [testenv:latest] -basepython = python3.7 +basepython = python3.8 deps = - pipenv==2020.11.15 + pipenv==2022.9.8 commands = - pipenv sync - pipenv run pip install -U black - pipenv run pytest + pipenv sync --system + pip install . + pip install -U black + pytest [testenv:development] -basepython = python3.7 +basepython = python3.8 deps = - pipenv==2020.11.15 + pipenv==2022.9.8 commands = - pipenv sync - pipenv run pysen run lint - pipenv run pytest + pipenv sync --system + pip install . + pysen run lint + pytest