From 108643d89ed1c576c21039038d4a95afb5e9c76c Mon Sep 17 00:00:00 2001 From: Yoan Tournade Date: Wed, 17 May 2023 16:46:47 +0200 Subject: [PATCH] Migrate to Hy 0.26 --- CHANGELOG.md | 4 + Pipfile | 3 +- Pipfile.lock | 234 +++++++++++++++++------------------------ setup.py | 4 +- tqwgp_parser/parser.hy | 27 +++-- tqwgp_parser/utils.hy | 19 ++-- 6 files changed, 127 insertions(+), 164 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 633c061..20378fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.6.2 + +* Migrate to Hy `>= 0.26` + # 0.6.1 * Add decimal number format arguments (`--decimals-csv-locale` and `--decimals-csv-format`) to statistics CSV ouput command diff --git a/Pipfile b/Pipfile index b78bbd3..97331ce 100644 --- a/Pipfile +++ b/Pipfile @@ -4,7 +4,7 @@ verify_ssl = true name = "pypi" [packages] -hy = ">=1.0a2" +hy = ">=0.26.0" toolz = "*" hyrule = "*" click = "*" @@ -18,6 +18,7 @@ black = "*" pytest = "*" pyyaml = "*" twine = "*" +setuptools = "*" [requires] python_version = "3" diff --git a/Pipfile.lock b/Pipfile.lock index 723fbc1..1576ad7 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "c121370fc85867dbedf1073d4594929c91727dbced676af4c3449af457564396" + "sha256": "0009822d591d5ef015d0ec1200d8bea94d95ddc78af76fa6cfb0c2d2f31c9264" }, "pipfile-spec": 6, "requires": { @@ -16,13 +16,6 @@ ] }, "default": { - "appdirs": { - "hashes": [ - "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41", - "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128" - ], - "version": "==1.4.4" - }, "babel": { "hashes": [ "sha256:b4246fb7677d3b98f501a39d43396d3cafdc8eadb045f4a31be01863f655c610", @@ -39,14 +32,6 @@ "index": "pypi", "version": "==8.1.3" }, - "colorama": { - "hashes": [ - "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", - "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6'", - "version": "==0.4.6" - }, "funcparserlib": { "hashes": [ "sha256:95da15d3f0d00b9b6f4bf04005c708af3faa115f7b45692ace064ebe758c68e8", @@ -57,19 +42,17 @@ }, "hy": { "hashes": [ - "sha256:bc484395b1bf7c900d8239e977ac5bcd377101bf04cb3dabc37fe1737d8ad908", - "sha256:f514e45f1b71127f88ed0f233675698326b85a3bb204a3f9d9afab559bf3efb9" + "sha256:07d2cd59f2b6ee6207fa94048a27ed45c5db0bae5a3893335cfa7dc74efc97a9" ], "index": "pypi", - "version": "==1.0a4" + "version": "==0.26.0" }, "hyrule": { "hashes": [ - "sha256:9626be102a47ddb1cb61c2464560063f094541c7990d82e15ca312dd41385703", - "sha256:be7e09f285ef74a18f56a1686a87c7281df85e8a8113eceb0b575cdea40e7cd1" + "sha256:b65127d94d71aa7c05e7eb1c3e550b389247c66f41af24c73f1fe743d39410b4" ], "index": "pypi", - "version": "==0.1" + "version": "==0.3.0" }, "pendulum": { "hashes": [ @@ -160,13 +143,6 @@ "index": "pypi", "version": "==6.0" }, - "rply": { - "hashes": [ - "sha256:28ffd11d656c48aeb8c508eb382acd6a0bd906662624b34388751732a27807e7", - "sha256:2a808ac25a4580a9991fc304d64434e299a8fc75760574492f242cbb5bb301c9" - ], - "version": "==0.7.8" - }, "six": { "hashes": [ "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", @@ -193,44 +169,36 @@ } }, "develop": { - "attrs": { - "hashes": [ - "sha256:29e95c7f6778868dbd49170f98f8818f78f3dc5e0e37c0b1f474e3561b240836", - "sha256:c9227bfc2f01993c03f68db37d1d15c9690188323c067c641f1a35ca58185f99" - ], - "markers": "python_version >= '3.6'", - "version": "==22.2.0" - }, "black": { "hashes": [ - "sha256:0052dba51dec07ed029ed61b18183942043e00008ec65d5028814afaab9a22fd", - "sha256:0680d4380db3719ebcfb2613f34e86c8e6d15ffeabcf8ec59355c5e7b85bb555", - "sha256:121ca7f10b4a01fd99951234abdbd97728e1240be89fde18480ffac16503d481", - "sha256:162e37d49e93bd6eb6f1afc3e17a3d23a823042530c37c3c42eeeaf026f38468", - "sha256:2a951cc83ab535d248c89f300eccbd625e80ab880fbcfb5ac8afb5f01a258ac9", - "sha256:2bf649fda611c8550ca9d7592b69f0637218c2369b7744694c5e4902873b2f3a", - "sha256:382998821f58e5c8238d3166c492139573325287820963d2f7de4d518bd76958", - "sha256:49f7b39e30f326a34b5c9a4213213a6b221d7ae9d58ec70df1c4a307cf2a1580", - "sha256:57c18c5165c1dbe291d5306e53fb3988122890e57bd9b3dcb75f967f13411a26", - "sha256:7a0f701d314cfa0896b9001df70a530eb2472babb76086344e688829efd97d32", - "sha256:8178318cb74f98bc571eef19068f6ab5613b3e59d4f47771582f04e175570ed8", - "sha256:8b70eb40a78dfac24842458476135f9b99ab952dd3f2dab738c1881a9b38b753", - "sha256:9880d7d419bb7e709b37e28deb5e68a49227713b623c72b2b931028ea65f619b", - "sha256:9afd3f493666a0cd8f8df9a0200c6359ac53940cbde049dcb1a7eb6ee2dd7074", - "sha256:a29650759a6a0944e7cca036674655c2f0f63806ddecc45ed40b7b8aa314b651", - "sha256:a436e7881d33acaf2536c46a454bb964a50eff59b21b51c6ccf5a40601fbef24", - "sha256:a59db0a2094d2259c554676403fa2fac3473ccf1354c1c63eccf7ae65aac8ab6", - "sha256:a8471939da5e824b891b25751955be52ee7f8a30a916d570a5ba8e0f2eb2ecad", - "sha256:b0bd97bea8903f5a2ba7219257a44e3f1f9d00073d6cc1add68f0beec69692ac", - "sha256:b6a92a41ee34b883b359998f0c8e6eb8e99803aa8bf3123bf2b2e6fec505a221", - "sha256:bb460c8561c8c1bec7824ecbc3ce085eb50005883a6203dcfb0122e95797ee06", - "sha256:bfffba28dc52a58f04492181392ee380e95262af14ee01d4bc7bb1b1c6ca8d27", - "sha256:c1c476bc7b7d021321e7d93dc2cbd78ce103b84d5a4cf97ed535fbc0d6660648", - "sha256:c91dfc2c2a4e50df0026f88d2215e166616e0c80e86004d0003ece0488db2739", - "sha256:e6663f91b6feca5d06f2ccd49a10f254f9298cc1f7f49c46e498a0771b507104" + "sha256:064101748afa12ad2291c2b91c960be28b817c0c7eaa35bec09cc63aa56493c5", + "sha256:0945e13506be58bf7db93ee5853243eb368ace1c08a24c65ce108986eac65915", + "sha256:11c410f71b876f961d1de77b9699ad19f939094c3a677323f43d7a29855fe326", + "sha256:1c7b8d606e728a41ea1ccbd7264677e494e87cf630e399262ced92d4a8dac940", + "sha256:1d06691f1eb8de91cd1b322f21e3bfc9efe0c7ca1f0e1eb1db44ea367dff656b", + "sha256:3238f2aacf827d18d26db07524e44741233ae09a584273aa059066d644ca7b30", + "sha256:32daa9783106c28815d05b724238e30718f34155653d4d6e125dc7daec8e260c", + "sha256:35d1381d7a22cc5b2be2f72c7dfdae4072a3336060635718cc7e1ede24221d6c", + "sha256:3a150542a204124ed00683f0db1f5cf1c2aaaa9cc3495b7a3b5976fb136090ab", + "sha256:48f9d345675bb7fbc3dd85821b12487e1b9a75242028adad0333ce36ed2a6d27", + "sha256:50cb33cac881766a5cd9913e10ff75b1e8eb71babf4c7104f2e9c52da1fb7de2", + "sha256:562bd3a70495facf56814293149e51aa1be9931567474993c7942ff7d3533961", + "sha256:67de8d0c209eb5b330cce2469503de11bca4085880d62f1628bd9972cc3366b9", + "sha256:6b39abdfb402002b8a7d030ccc85cf5afff64ee90fa4c5aebc531e3ad0175ddb", + "sha256:6f3c333ea1dd6771b2d3777482429864f8e258899f6ff05826c3a4fcc5ce3f70", + "sha256:714290490c18fb0126baa0fca0a54ee795f7502b44177e1ce7624ba1c00f2331", + "sha256:7c3eb7cea23904399866c55826b31c1f55bbcd3890ce22ff70466b907b6775c2", + "sha256:92c543f6854c28a3c7f39f4d9b7694f9a6eb9d3c5e2ece488c327b6e7ea9b266", + "sha256:a6f6886c9869d4daae2d1715ce34a19bbc4b95006d20ed785ca00fa03cba312d", + "sha256:a8a968125d0a6a404842fa1bf0b349a568634f856aa08ffaff40ae0dfa52e7c6", + "sha256:c7ab5790333c448903c4b721b59c0d80b11fe5e9803d8703e84dcb8da56fec1b", + "sha256:e114420bf26b90d4b9daa597351337762b63039752bdf72bf361364c1aa05925", + "sha256:e198cf27888ad6f4ff331ca1c48ffc038848ea9f031a3b40ba36aced7e22f2c8", + "sha256:ec751418022185b0c1bb7d7736e6933d40bbb14c14a0abcf9123d1b159f98dd4", + "sha256:f0bd2f4a58d6666500542b26354978218a9babcdc972722f4bf90779524515f3" ], "index": "pypi", - "version": "==23.1.0" + "version": "==23.3.0" }, "bleach": { "hashes": [ @@ -242,11 +210,11 @@ }, "certifi": { "hashes": [ - "sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3", - "sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18" + "sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7", + "sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716" ], "markers": "python_version >= '3.6'", - "version": "==2022.12.7" + "version": "==2023.5.7" }, "cffi": { "hashes": [ @@ -395,7 +363,7 @@ "sha256:f8303414c7b03f794347ad062c0516cee0e15f7a612abd0ce1e25caf6ceb47df", "sha256:fca62a8301b605b954ad2e9c3666f9d97f63872aa4efcae5492baca2056b74ab" ], - "markers": "python_version >= '3.7'", + "markers": "python_full_version >= '3.7.0'", "version": "==3.1.0" }, "click": { @@ -408,44 +376,36 @@ }, "cryptography": { "hashes": [ - "sha256:14da8c26755ffa5c7863ffa5e8b87cb9596a21b6c34852cb19e0f48c226c64fb", - "sha256:168ded448fb5d82dfa911156ab8b13b1716de65bd50ff977f4657643f998fa05", - "sha256:22e63fb48e2615cfab5a9c4bb457d35e7ae03ea8593996bfbe257e78244d12d0", - "sha256:23c42c59c2b5b9ddc6a85b5c46b8fabc4d63a1714f4dbea4bf20d25690bf2365", - "sha256:34f502619964210939bb7ee7cd5df53178534eb08d3526f941695a8f7aa0efe4", - "sha256:43089be365c0ca4235c6e4e781f3bc125bc1fff576c9dd22cdfb585309b9bb9d", - "sha256:6b36e2864e04c82634879c7e7aad48824b1847fdb06b64cd410d2ec5e51d1b31", - "sha256:7162ae4530958114ca2eee30a56eca46527def33493f622f059dc2e825fd0913", - "sha256:71cb346b9dd1537102e7466a2d629385b01847f8d96cd7405f0e717d91cebc8e", - "sha256:722cfddae79684166840be2cbbae154f44a455519e644b60bf274a50ccb834db", - "sha256:754dc5ab648113dc54197f242db43234a04e4d61193fb5d3ebb42bd569dca571", - "sha256:7cc9fc3ffcb766c313ed0515d77d0deabb4f36bdcff3a9f115c43e5ec611b82a", - "sha256:b05c9f25a1ea42e427085230815bbdebe15a53bb6163c4c06022e5630645046b", - "sha256:e5855a80c77565fe2464e88e0095764e25d8ddb2d24df2b1d31773e80be94435", - "sha256:e917a07094217edeefe8f6ea960b45d7aab650b982e4209da078332cc9d3ac3a", - "sha256:f2c4134d29cdce0735c16abf48fa8435f001a7b0031e68dd9a9ee1c80a29374a", - "sha256:f421f6777592eb199ca8abac7c20b9ecef27c50ad63546e6c614b29771b46d0d", - "sha256:fafa997b9e6818db333ded4b379f5b7679b48bd88ac878428cea2a1aa6e79fd8", - "sha256:fba36ec552794a06a07ac8bdc5ad83a587f6959d98547f373d401975d55c7c9e" + "sha256:05dc219433b14046c476f6f09d7636b92a1c3e5808b9a6536adf4932b3b2c440", + "sha256:0dcca15d3a19a66e63662dc8d30f8036b07be851a8680eda92d079868f106288", + "sha256:142bae539ef28a1c76794cca7f49729e7c54423f615cfd9b0b1fa90ebe53244b", + "sha256:3daf9b114213f8ba460b829a02896789751626a2a4e7a43a28ee77c04b5e4958", + "sha256:48f388d0d153350f378c7f7b41497a54ff1513c816bcbbcafe5b829e59b9ce5b", + "sha256:4df2af28d7bedc84fe45bd49bc35d710aede676e2a4cb7fc6d103a2adc8afe4d", + "sha256:4f01c9863da784558165f5d4d916093737a75203a5c5286fde60e503e4276c7a", + "sha256:7a38250f433cd41df7fcb763caa3ee9362777fdb4dc642b9a349721d2bf47404", + "sha256:8f79b5ff5ad9d3218afb1e7e20ea74da5f76943ee5edb7f76e56ec5161ec782b", + "sha256:956ba8701b4ffe91ba59665ed170a2ebbdc6fc0e40de5f6059195d9f2b33ca0e", + "sha256:a04386fb7bc85fab9cd51b6308633a3c271e3d0d3eae917eebab2fac6219b6d2", + "sha256:a95f4802d49faa6a674242e25bfeea6fc2acd915b5e5e29ac90a32b1139cae1c", + "sha256:adc0d980fd2760c9e5de537c28935cc32b9353baaf28e0814df417619c6c8c3b", + "sha256:aecbb1592b0188e030cb01f82d12556cf72e218280f621deed7d806afd2113f9", + "sha256:b12794f01d4cacfbd3177b9042198f3af1c856eedd0a98f10f141385c809a14b", + "sha256:c0764e72b36a3dc065c155e5b22f93df465da9c39af65516fe04ed3c68c92636", + "sha256:c33c0d32b8594fa647d2e01dbccc303478e16fdd7cf98652d5b3ed11aa5e5c99", + "sha256:cbaba590180cba88cb99a5f76f90808a624f18b169b90a4abb40c1fd8c19420e", + "sha256:d5a1bd0e9e2031465761dfa920c16b0065ad77321d8a8c1f5ee331021fda65e9" ], "markers": "python_version >= '3.6'", - "version": "==40.0.0" + "version": "==40.0.2" }, "docutils": { "hashes": [ - "sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6", - "sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc" + "sha256:96f387a2c5562db4476f09f13bbab2192e764cac08ebbf3a34a95d9b1e4a59d6", + "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b" ], "markers": "python_version >= '3.7'", - "version": "==0.19" - }, - "exceptiongroup": { - "hashes": [ - "sha256:232c37c63e4f682982c8b6459f33a8981039e5fb8756b2074364e5055c498c9e", - "sha256:d484c3090ba2889ae2928419117447a14daf3c1231d5e30d0aae34f354f01785" - ], - "markers": "python_version < '3.11'", - "version": "==1.1.1" + "version": "==0.20.1" }, "idna": { "hashes": [ @@ -457,11 +417,11 @@ }, "importlib-metadata": { "hashes": [ - "sha256:43ce9281e097583d758c2c708c4376371261a02c34682491a8e98352365aad20", - "sha256:ff80f3b5394912eb1b108fcfd444dc78b7f1f3e16b16188054bd01cb9cb86f09" + "sha256:43dd286a2cd8995d5eaef7fee2066340423b818ed3fd70adf0bad5f1fac53fed", + "sha256:92501cdf9cc66ebd3e612f1b4f0c0765dfa42f0fa38ffb319b6bd84dd675d705" ], "markers": "python_version >= '3.7'", - "version": "==6.1.0" + "version": "==6.6.0" }, "iniconfig": { "hashes": [ @@ -529,11 +489,11 @@ }, "packaging": { "hashes": [ - "sha256:714ac14496c3e68c99c29b00845f7a2b85f3bb6f1078fd9f72fd20f0570002b2", - "sha256:b6ad297f8907de0fa2fe1ccbd26fdaf387f5f47c7275fedf8cce89f99446cf97" + "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61", + "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f" ], "markers": "python_version >= '3.7'", - "version": "==23.0" + "version": "==23.1" }, "pathspec": { "hashes": [ @@ -553,11 +513,11 @@ }, "platformdirs": { "hashes": [ - "sha256:024996549ee88ec1a9aa99ff7f8fc819bb59e2c3477b410d90a16d32d6e707aa", - "sha256:e5986afb596e4bb5bde29a79ac9061aa955b94fca2399b7aaac4090860920dd8" + "sha256:412dae91f52a6f84830f39a8078cecd0e866cb72294a5c66808e74d5e88d251f", + "sha256:e2378146f1964972c03c085bb5662ae80b2b8c06226c54b2ff4aa9483e8a13a5" ], "markers": "python_version >= '3.7'", - "version": "==3.1.1" + "version": "==3.5.1" }, "pluggy": { "hashes": [ @@ -576,19 +536,19 @@ }, "pygments": { "hashes": [ - "sha256:b3ed06a9e8ac9a9aae5a6f5dbe78a8a58655d17b43b93c078f094ddc476ae297", - "sha256:fa7bd7bd2771287c0de303af8bfdfc731f51bd2c6a47ab69d117138893b82717" + "sha256:8ace4d3c1dd481894b2005f560ead0f9f19ee64fe983366be1a21e171d12775c", + "sha256:db2db3deb4b4179f399a09054b023b6a586b76499d36965813c71aa8ed7b5fd1" ], - "markers": "python_version >= '3.6'", - "version": "==2.14.0" + "markers": "python_version >= '3.7'", + "version": "==2.15.1" }, "pytest": { "hashes": [ - "sha256:130328f552dcfac0b1cec75c12e3f005619dc5f874f0a06e8ff7263f0ee6225e", - "sha256:c99ab0c73aceb050f68929bc93af19ab6db0558791c6a0715723abe9d0ade9d4" + "sha256:3799fa815351fea3a5e96ac7e503a96fa51cc9942c3753cda7651b93c1cfa362", + "sha256:434afafd78b1d78ed0addf160ad2b77a30d35d4bdf8af234fe621919d9ed15e3" ], "index": "pypi", - "version": "==7.2.2" + "version": "==7.3.1" }, "pyyaml": { "hashes": [ @@ -646,19 +606,19 @@ }, "requests": { "hashes": [ - "sha256:64299f4909223da747622c030b781c0d7811e359c37124b4bd368fb8c6518baa", - "sha256:98b1b2782e3c6c4904938b84c0eb932721069dfdb9134313beff7c83c2df24bf" + "sha256:10e94cc4f3121ee6da529d358cdaeaff2f1c409cd377dbc72b825852f2f7e294", + "sha256:239d7d4458afcb28a692cdd298d87542235f4ca8d36d03a15bfc128a6559a2f4" ], - "markers": "python_version >= '3.7' and python_version < '4'", - "version": "==2.28.2" + "markers": "python_version >= '3.7'", + "version": "==2.30.0" }, "requests-toolbelt": { "hashes": [ - "sha256:18565aa58116d9951ac39baa288d3adb5b3ff975c4f25eee78555d89e8f247f7", - "sha256:62e09f7ff5ccbda92772a29f394a49c3ad6cb181d568b1337626b2abb628a63d" + "sha256:7681a0a3d047012b5bdc0ee37d7f8f07ebe76ab08caeccfc3921ce23c88d5bc6", + "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06" ], "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==0.10.1" + "version": "==1.0.0" }, "rfc3986": { "hashes": [ @@ -670,11 +630,11 @@ }, "rich": { "hashes": [ - "sha256:91954fe80cfb7985727a467ca98a7618e5dd15178cc2da10f553b36a93859001", - "sha256:a104f37270bf677148d8acb07d33be1569eeee87e2d1beb286a4e9113caf6f2f" + "sha256:2d11b9b8dd03868f09b4fffadc84a6a8cda574e40dc90821bd845720ebb8e89c", + "sha256:69cdf53799e63f38b95b9bf9c875f8c90e78dd62b2f00c13a911c7a3b9fa4704" ], - "markers": "python_version >= '3.7'", - "version": "==13.3.2" + "markers": "python_full_version >= '3.7.0'", + "version": "==13.3.5" }, "secretstorage": { "hashes": [ @@ -684,6 +644,14 @@ "markers": "sys_platform == 'linux'", "version": "==3.3.3" }, + "setuptools": { + "hashes": [ + "sha256:23aaf86b85ca52ceb801d32703f12d77517b2556af839621c641fca11287952b", + "sha256:f104fa03692a2602fa0fec6c6a9e63b6c8a968de13e17c026957dd1f53d80990" + ], + "index": "pypi", + "version": "==67.7.2" + }, "six": { "hashes": [ "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", @@ -692,14 +660,6 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.16.0" }, - "tomli": { - "hashes": [ - "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", - "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" - ], - "markers": "python_version < '3.11'", - "version": "==2.0.1" - }, "twine": { "hashes": [ "sha256:929bc3c280033347a00f847236564d1c52a3e61b1ac2516c97c48f3ceab756d8", @@ -710,11 +670,11 @@ }, "urllib3": { "hashes": [ - "sha256:8a388717b9476f934a21484e8c8e61875ab60644d29b9b39e11e4b9dc1c6b305", - "sha256:aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42" + "sha256:61717a1095d7e155cdb737ac7bb2f4324a858a1e2e6466f6d03ff630ca68d3cc", + "sha256:d055c2f9d38dc53c808f6fdc8eab7360b6fdbbde02340ed25cfbcd817c62469e" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", - "version": "==1.26.15" + "markers": "python_version >= '3.7'", + "version": "==2.0.2" }, "webencodings": { "hashes": [ diff --git a/setup.py b/setup.py index 43e776e..f66bd46 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ def package_files(directory): setup( name="tqwgp-parser", - version="0.6.1", + version="0.6.2", url="https://github.com/YtoTech/talk-quote-work-getpaid-parser", license="AGPL-3.0", author="Yoan Tournade", @@ -40,7 +40,7 @@ def package_files(directory): zip_safe=False, platforms="any", install_requires=[ - "hy>=1.0a4", + "hy>=0.26.0", "toolz", "hyrule", "pendulum", diff --git a/tqwgp_parser/parser.hy b/tqwgp_parser/parser.hy index cdfd5a2..7490646 100644 --- a/tqwgp_parser/parser.hy +++ b/tqwgp_parser/parser.hy @@ -3,7 +3,7 @@ tqwgp-parser.parser ~~~~~~~~~~~~~~~~~~~~~ Parse the definitions of TWWGP quotes and invoices. - :copyright: (c) 2017-2021 Yoan Tournade. + :copyright: (c) 2017-2023 Yoan Tournade . """ (import os) (import .utils *) @@ -29,7 +29,7 @@ (.extend all-prestations section-prestations)) (.append all-prestations (parse-prestation prestation section options)) )) prestation)) - (, all-prestations sections)) + #(all-prestations sections)) (defn apply-any-price-formula [price price-formula] (if (and @@ -97,14 +97,14 @@ (fn [total prestation] (setv price (apply-any-price-formula (get prestation "price") price-formula)) (setv add-price (and (numeric? price) (or count-optional (not (get-default prestation "optional" False))))) - (setv prestation-total (if (numeric? price) (* price (get-default prestation "quantity" 1)))) + (setv prestation-total (when (numeric? price) (* price (get-default prestation "quantity" 1)))) (cond - [(and add-price (numeric? total)) - (+ total prestation-total)] - [add-price - prestation-total] - [True - total])) + (and add-price (numeric? total)) + (+ total prestation-total) + add-price + prestation-total + True + total)) prestations None) rounding-decimals)) @@ -184,7 +184,7 @@ (defn unique-batch-names [prestation] (reduce (fn [batches prestation] (setv batch (get prestation "batch")) - (if (and (not (none? batch)) (not (in batch batches))) + (when (and (not (none? batch)) (not (in batch batches))) (.append batches batch)) batches) all-prestations [])) ;; Get all prestations that match the name. @@ -203,8 +203,7 @@ (defn recompose-optional-prestations [sections all-prestations] "Recompose optional prestations: is equal to all optional sections and all optional non-section prestations." - (, - (list (filter (fn [prestation] + #((list (filter (fn [prestation] (and (is-optional? prestation) (not (has-optional-section? prestation)))) all-prestations)) (list (filter is-optional? sections)))) @@ -249,9 +248,9 @@ (parse-parser-options definition) ])) (setv vat-rate (get-default definition "vat_rate" None)) - (setv (, all-prestations sections) + (setv #(all-prestations sections) (parse-all-prestations (get definition "prestations") vat-rate options)) - (setv (, all-optional-prestations optional-sections) + (setv #(all-optional-prestations optional-sections) (recompose-optional-prestations sections all-prestations)) (setv has-quantities (any (map (fn [prestation] (> (get prestation "quantity") 1)) all-prestations))) (merge-dicts [ diff --git a/tqwgp_parser/utils.hy b/tqwgp_parser/utils.hy index ac78b9f..6a99531 100644 --- a/tqwgp_parser/utils.hy +++ b/tqwgp_parser/utils.hy @@ -7,10 +7,10 @@ ; Predicates. (defn numeric? [v] - (isinstance v (, int float))) + (isinstance v #(int float))) (defn string? [v] - (isinstance v (, str bytes))) + (isinstance v #(str bytes))) (defn none? [v] (= v None)) @@ -30,11 +30,11 @@ (print (.format "Ignoring key {}" key)))) key)) ;; Check all mandatories are here. (for [mandatory mandatories] ((fn [mandatory] - (if (not (in mandatory parsed-dict)) + (when (not (in mandatory parsed-dict)) (raise (ValueError (.format "Missing key {}" mandatory))))) mandatory)) ;; Affect None to non-set optionals. (for [optional optionals] ((fn [optional] - (if (not (in optional parsed-dict)) + (when (not (in optional parsed-dict)) (assoc parsed-dict optional None))) optional)) parsed-dict) @@ -54,7 +54,7 @@ (setv new-dict {}) (for [key (.keys a-dict)] ((fn [key] - (if (pred (get a-dict key) key) + (when (pred (get a-dict key) key) (assoc new-dict key (get a-dict key)))) key)) new-dict) @@ -62,7 +62,7 @@ (defn pick-by [pred value] (setv new-value {}) (for [key (.keys value)] ((fn [key] - (if (pred key) + (when (pred key) (assoc new-value key (get value key)))) key)) new-value) @@ -89,10 +89,9 @@ (defn find-in-list [l pred] (setv element None) (for [item l] ((fn [item]) - (if (pred item) - (do - (setv element item) - (break))) l)) + (when (pred item) + (setv element item) + (break)) l)) element)