From b46571b1980267a1b7f87ac3ed4fd423934185e7 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Tue, 20 May 2025 14:00:09 +0300 Subject: [PATCH 01/28] [+] fix python 3.10 compatibility 1. add .whl; --- python/cli.py | 6 +- python/meson.build | 2 +- python/online/fxreader/pr34/commands.py | 4 +- .../pr34/commands_typed/cli_bootstrap.py | 12 +- .../fxreader/pr34/commands_typed/pip.py | 2 +- python/pyproject.toml | 1 + python/requirements.txt | 264 +++++++++--------- ...reader_pr34-0.1.5.17+27.1-py3-none-any.whl | 3 + 8 files changed, 153 insertions(+), 141 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.1-py3-none-any.whl diff --git a/python/cli.py b/python/cli.py index cd38ef3..9a41347 100644 --- a/python/cli.py +++ b/python/cli.py @@ -12,6 +12,10 @@ import dataclasses from typing import ( Optional, + # override, +) + +from typing_extensions import ( override, ) @@ -26,7 +30,7 @@ logging_setup() logger = logging.getLogger(__name__) -class Command(enum.StrEnum): +class Command(enum.Enum): mypy = 'mypy' pyright = 'pyright' ruff = 'ruff' diff --git a/python/meson.build b/python/meson.build index 536ce9f..3ddd394 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17', + version: '0.1.5.17+27.1', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands.py b/python/online/fxreader/pr34/commands.py index 723df9d..280aafa 100644 --- a/python/online/fxreader/pr34/commands.py +++ b/python/online/fxreader/pr34/commands.py @@ -1346,7 +1346,7 @@ server { class pass_ssh_osx_t: class kwargs_t: - class Mode(enum.StrEnum): + class Mode(enum.Enum): clipboard = 'clipboard' qrcode = 'qrcode' @@ -3928,7 +3928,7 @@ def backup(argv: list[str]) -> None: ) -class Command(enum.StrEnum): +class Command(enum.Enum): media = 'media' status = 'status' http_server = 'http-server' diff --git a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py index 06f837e..14d20a1 100644 --- a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py +++ b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py @@ -29,12 +29,12 @@ logger = logging.getLogger(__name__) def toml_load(f: BinaryIO) -> Any: - try: - import tomllib - - return tomllib.load(f) - except: - pass + # try: + # import tomllib + # + # return tomllib.load(f) + # except: + # pass try: import tomli diff --git a/python/online/fxreader/pr34/commands_typed/pip.py b/python/online/fxreader/pr34/commands_typed/pip.py index f1dca2f..543e1e2 100644 --- a/python/online/fxreader/pr34/commands_typed/pip.py +++ b/python/online/fxreader/pr34/commands_typed/pip.py @@ -83,7 +83,7 @@ class pip_resolve_t: ) -> None: ... class kwargs_t: - class mode_t(enum.StrEnum): + class mode_t(enum.Enum): copy_paste = 'copy_paste' monkey_patch = 'monkey_patch' uv_pip_freeze = 'uv_pip_freeze' diff --git a/python/pyproject.toml b/python/pyproject.toml index 02f4682..597c06a 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -36,6 +36,7 @@ early = [ lint = [ 'tomli', + # 'tomllib', 'mypy', 'pyright', 'ruff', diff --git a/python/requirements.txt b/python/requirements.txt index 8bc513e..aafd36c 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1,5 +1,5 @@ # This file was autogenerated by uv via the following command: -# uv pip compile --generate-hashes --offline -o /home/nartes/Documents/current/freelance-project-34-marketing-blog/python/requirements.txt /tmp/requirementsguod07w5.in +# uv pip compile --generate-hashes -o /home/nartes/Documents/current/freelance-project-34-marketing-blog/python/requirements.txt /tmp/requirementsx8idgxd2.in annotated-types==0.7.0 \ --hash=sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53 \ --hash=sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89 @@ -7,7 +7,7 @@ annotated-types==0.7.0 \ build==1.2.2.post1 \ --hash=sha256:1d61c0887fa860c01971625baae8bdd338e517b836a2f70dd1f7aa3a6b2fc5b5 \ --hash=sha256:b36993e92ca9375a219c99e606a122ff365a760a2d4bba0caa09bd5278b608b7 - # via -r /tmp/requirementsguod07w5.in + # via -r /tmp/requirementsx8idgxd2.in cffi==1.17.1 \ --hash=sha256:045d61c734659cc045141be4bae381a41d89b741f795af1dd018bfb532fd0df8 \ --hash=sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2 \ @@ -77,45 +77,45 @@ cffi==1.17.1 \ --hash=sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87 \ --hash=sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b # via cryptography -cryptography==44.0.3 \ - --hash=sha256:02f55fb4f8b79c1221b0961488eaae21015b69b210e18c386b69de182ebb1259 \ - --hash=sha256:157f1f3b8d941c2bd8f3ffee0af9b049c9665c39d3da9db2dc338feca5e98a43 \ - --hash=sha256:192ed30fac1728f7587c6f4613c29c584abdc565d7417c13904708db10206645 \ - --hash=sha256:21a83f6f35b9cc656d71b5de8d519f566df01e660ac2578805ab245ffd8523f8 \ - --hash=sha256:25cd194c39fa5a0aa4169125ee27d1172097857b27109a45fadc59653ec06f44 \ - --hash=sha256:3883076d5c4cc56dbef0b898a74eb6992fdac29a7b9013870b34efe4ddb39a0d \ - --hash=sha256:3bb0847e6363c037df8f6ede57d88eaf3410ca2267fb12275370a76f85786a6f \ - --hash=sha256:3be3f649d91cb182c3a6bd336de8b61a0a71965bd13d1a04a0e15b39c3d5809d \ - --hash=sha256:3f07943aa4d7dad689e3bb1638ddc4944cc5e0921e3c227486daae0e31a05e54 \ - --hash=sha256:479d92908277bed6e1a1c69b277734a7771c2b78633c224445b5c60a9f4bc1d9 \ - --hash=sha256:4ffc61e8f3bf5b60346d89cd3d37231019c17a081208dfbbd6e1605ba03fa137 \ - --hash=sha256:5639c2b16764c6f76eedf722dbad9a0914960d3489c0cc38694ddf9464f1bb2f \ - --hash=sha256:58968d331425a6f9eedcee087f77fd3c927c88f55368f43ff7e0a19891f2642c \ - --hash=sha256:5d186f32e52e66994dce4f766884bcb9c68b8da62d61d9d215bfe5fb56d21334 \ - --hash=sha256:5d20cc348cca3a8aa7312f42ab953a56e15323800ca3ab0706b8cd452a3a056c \ - --hash=sha256:6866df152b581f9429020320e5eb9794c8780e90f7ccb021940d7f50ee00ae0b \ - --hash=sha256:7d5fe7195c27c32a64955740b949070f21cba664604291c298518d2e255931d2 \ - --hash=sha256:896530bc9107b226f265effa7ef3f21270f18a2026bc09fed1ebd7b66ddf6375 \ - --hash=sha256:962bc30480a08d133e631e8dfd4783ab71cc9e33d5d7c1e192f0b7c06397bb88 \ - --hash=sha256:978631ec51a6bbc0b7e58f23b68a8ce9e5f09721940933e9c217068388789fe5 \ - --hash=sha256:9b4d4a5dbee05a2c390bf212e78b99434efec37b17a4bff42f50285c5c8c9647 \ - --hash=sha256:ab0b005721cc0039e885ac3503825661bd9810b15d4f374e473f8c89b7d5460c \ - --hash=sha256:af653022a0c25ef2e3ffb2c673a50e5a0d02fecc41608f4954176f1933b12359 \ - --hash=sha256:b0cc66c74c797e1db750aaa842ad5b8b78e14805a9b5d1348dc603612d3e3ff5 \ - --hash=sha256:b424563394c369a804ecbee9b06dfb34997f19d00b3518e39f83a5642618397d \ - --hash=sha256:c138abae3a12a94c75c10499f1cbae81294a6f983b3af066390adee73f433028 \ - --hash=sha256:c6cd67722619e4d55fdb42ead64ed8843d64638e9c07f4011163e46bc512cf01 \ - --hash=sha256:c91fc8e8fd78af553f98bc7f2a1d8db977334e4eea302a4bfd75b9461c2d8904 \ - --hash=sha256:cad399780053fb383dc067475135e41c9fe7d901a97dd5d9c5dfb5611afc0d7d \ - --hash=sha256:cb90f60e03d563ca2445099edf605c16ed1d5b15182d21831f58460c48bffb93 \ - --hash=sha256:dad80b45c22e05b259e33ddd458e9e2ba099c86ccf4e88db7bbab4b747b18d06 \ - --hash=sha256:dd3db61b8fe5be220eee484a17233287d0be6932d056cf5738225b9c05ef4fff \ - --hash=sha256:e28d62e59a4dbd1d22e747f57d4f00c459af22181f0b2f787ea83f5a876d7c76 \ - --hash=sha256:e909df4053064a97f1e6565153ff8bb389af12c5c8d29c343308760890560aff \ - --hash=sha256:f3ffef566ac88f75967d7abd852ed5f182da252d23fac11b4766da3957766759 \ - --hash=sha256:fc3c9babc1e1faefd62704bb46a69f359a9819eb0292e40df3fb6e3574715cd4 \ - --hash=sha256:fe19d8bc5536a91a24a8133328880a41831b6c5df54599a8417b62fe015d3053 - # via -r /tmp/requirementsguod07w5.in +cryptography==45.0.2 \ + --hash=sha256:057723b79752a142efbc609e90b0dff27b0361ccbee3bd48312d70f5cdf53b78 \ + --hash=sha256:05c2385b1f5c89a17df19900cfb1345115a77168f5ed44bdf6fd3de1ce5cc65b \ + --hash=sha256:08281de408e7eb71ba3cd5098709a356bfdf65eebd7ee7633c3610f0aa80d79b \ + --hash=sha256:10d68763892a7b19c22508ab57799c4423c7c8cd61d7eee4c5a6a55a46511949 \ + --hash=sha256:1655d3a76e3dedb683c982a6c3a2cbfae2d08f47a48ec5a3d58db52b3d29ea6f \ + --hash=sha256:18f8084b7ca3ce1b8d38bdfe33c48116edf9a08b4d056ef4a96dceaa36d8d965 \ + --hash=sha256:2cb03a944a1a412724d15a7c051d50e63a868031f26b6a312f2016965b661942 \ + --hash=sha256:4142e20c29224cec63e9e32eb1e6014fb285fe39b7be66b3564ca978a3a8afe9 \ + --hash=sha256:463096533acd5097f8751115bc600b0b64620c4aafcac10c6d0041e6e68f88fe \ + --hash=sha256:48caa55c528617fa6db1a9c3bf2e37ccb31b73e098ac2b71408d1f2db551dde4 \ + --hash=sha256:49af56491473231159c98c2c26f1a8f3799a60e5cf0e872d00745b858ddac9d2 \ + --hash=sha256:4cc31c66411e14dd70e2f384a9204a859dc25b05e1f303df0f5326691061b839 \ + --hash=sha256:501de1296b2041dccf2115e3c7d4947430585601b251b140970ce255c5cfb985 \ + --hash=sha256:59c0c8f043dd376bbd9d4f636223836aed50431af4c5a467ed9bf61520294627 \ + --hash=sha256:614bca7c6ed0d8ad1dce683a6289afae1f880675b4090878a0136c3da16bc693 \ + --hash=sha256:61a8b1bbddd9332917485b2453d1de49f142e6334ce1d97b7916d5a85d179c84 \ + --hash=sha256:7429936146063bd1b2cfc54f0e04016b90ee9b1c908a7bed0800049cbace70eb \ + --hash=sha256:7c73968fbb7698a4c5d6160859db560d3aac160edde89c751edd5a8bc6560c88 \ + --hash=sha256:80303ee6a02ef38c4253160446cbeb5c400c07e01d4ddbd4ff722a89b736d95a \ + --hash=sha256:965611880c3fa8e504b7458484c0697e00ae6e937279cd6734fdaa2bc954dc49 \ + --hash=sha256:9a900036b42f7324df7c7ad9569eb92ba0b613cf699160dd9c2154b24fd02f8e \ + --hash=sha256:9cfd1399064b13043082c660ddd97a0358e41c8b0dc7b77c1243e013d305c344 \ + --hash=sha256:a8ec324711596fbf21837d3a5db543937dd84597d364769b46e0102250023f77 \ + --hash=sha256:a9727a21957d3327cf6b7eb5ffc9e4b663909a25fea158e3fcbc49d4cdd7881b \ + --hash=sha256:b19f4b28dd2ef2e6d600307fee656c00825a2980c4356a7080bd758d633c3a6f \ + --hash=sha256:b2de529027579e43b6dc1f805f467b102fb7d13c1e54c334f1403ee2b37d0059 \ + --hash=sha256:c0c000c1a09f069632d8a9eb3b610ac029fcc682f1d69b758e625d6ee713f4ed \ + --hash=sha256:cdafb86eb673c3211accffbffdb3cdffa3aaafacd14819e0898d23696d18e4d3 \ + --hash=sha256:d2a90ce2f0f5b695e4785ac07c19a58244092f3c85d57db6d8eb1a2b26d2aad6 \ + --hash=sha256:d784d57b958ffd07e9e226d17272f9af0c41572557604ca7554214def32c26bf \ + --hash=sha256:d891942592789fa0ab71b502550bbadb12f540d7413d7d7c4cef4b02af0f5bc6 \ + --hash=sha256:dc7693573f16535428183de8fd27f0ca1ca37a51baa0b41dc5ed7b3d68fe80e2 \ + --hash=sha256:ddb8d01aa900b741d6b7cc585a97aff787175f160ab975e21f880e89d810781a \ + --hash=sha256:e328357b6bbf79928363dbf13f4635b7aac0306afb7e5ad24d21d0c5761c3253 \ + --hash=sha256:e86c8d54cd19a13e9081898b3c24351683fd39d726ecf8e774aaa9d8d96f5f3a \ + --hash=sha256:e9e4bdcd70216b08801e267c0b563316b787f957a46e215249921f99288456f9 \ + --hash=sha256:f169469d04a23282de9d0be349499cb6683b6ff1b68901210faacac9b0c24b7d + # via -r /tmp/requirementsx8idgxd2.in marisa-trie==1.2.1 \ --hash=sha256:06b099dd743676dbcd8abd8465ceac8f6d97d8bfaabe2c83b965495523b4cef2 \ --hash=sha256:0ee6cf6a16d9c3d1c94e21c8e63c93d8b34bede170ca4e937e16e1c0700d399f \ @@ -193,7 +193,7 @@ marisa-trie==1.2.1 \ --hash=sha256:f35c2603a6be168088ed1db6ad1704b078aa8f39974c60888fbbced95dcadad4 \ --hash=sha256:f4cd800704a5fc57e53c39c3a6b0c9b1519ebdbcb644ede3ee67a06eb542697d \ --hash=sha256:f713af9b8aa66a34cd3a78c7d150a560a75734713abe818a69021fd269e927fa - # via -r /tmp/requirementsguod07w5.in + # via -r /tmp/requirementsx8idgxd2.in meson==1.8.0 \ --hash=sha256:0a9b23311271519bd03dca12d7d8b0eab582c3a2c5da433d465b6e519dc88e2f \ --hash=sha256:472b7b25da286447333d32872b82d1c6f1a34024fb8ee017d7308056c25fec1f @@ -201,7 +201,7 @@ meson==1.8.0 \ meson-python==0.18.0 \ --hash=sha256:3b0fe051551cc238f5febb873247c0949cd60ded556efa130aa57021804868e2 \ --hash=sha256:c56a99ec9df669a40662fe46960321af6e4b14106c14db228709c1628e23848d - # via -r /tmp/requirementsguod07w5.in + # via -r /tmp/requirementsx8idgxd2.in mypy==1.15.0 \ --hash=sha256:1124a18bc11a6a62887e3e137f37f53fbae476dc36c185d549d4f837a2a6a14e \ --hash=sha256:171a9ca9a40cd1843abeca0e405bc1940cd9b305eaeea2dda769ba096932bb22 \ @@ -235,7 +235,7 @@ mypy==1.15.0 \ --hash=sha256:d10d994b41fb3497719bbf866f227b3489048ea4bbbb5015357db306249f7980 \ --hash=sha256:e601a7fa172c2131bff456bb3ee08a88360760d0d2f8cbd7a75a65497e2df078 \ --hash=sha256:f95579473af29ab73a10bada2f9722856792a36ec5af5399b653aa28360290a5 - # via -r /tmp/requirementsguod07w5.in + # via -r /tmp/requirementsx8idgxd2.in mypy-extensions==1.1.0 \ --hash=sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505 \ --hash=sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558 @@ -244,63 +244,63 @@ nodeenv==1.9.1 \ --hash=sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f \ --hash=sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9 # via pyright -numpy==2.2.5 \ - --hash=sha256:0255732338c4fdd00996c0421884ea8a3651eea555c3a56b84892b66f696eb70 \ - --hash=sha256:02f226baeefa68f7d579e213d0f3493496397d8f1cff5e2b222af274c86a552a \ - --hash=sha256:059b51b658f4414fff78c6d7b1b4e18283ab5fa56d270ff212d5ba0c561846f4 \ - --hash=sha256:0bcb1d057b7571334139129b7f941588f69ce7c4ed15a9d6162b2ea54ded700c \ - --hash=sha256:0cd48122a6b7eab8f06404805b1bd5856200e3ed6f8a1b9a194f9d9054631beb \ - --hash=sha256:19f4718c9012e3baea91a7dba661dcab2451cda2550678dc30d53acb91a7290f \ - --hash=sha256:1a161c2c79ab30fe4501d5a2bbfe8b162490757cf90b7f05be8b80bc02f7bb8e \ - --hash=sha256:1f4a922da1729f4c40932b2af4fe84909c7a6e167e6e99f71838ce3a29f3fe26 \ - --hash=sha256:261a1ef047751bb02f29dfe337230b5882b54521ca121fc7f62668133cb119c9 \ - --hash=sha256:262d23f383170f99cd9191a7c85b9a50970fe9069b2f8ab5d786eca8a675d60b \ - --hash=sha256:2ba321813a00e508d5421104464510cc962a6f791aa2fca1c97b1e65027da80d \ - --hash=sha256:2c1a1c6ccce4022383583a6ded7bbcda22fc635eb4eb1e0a053336425ed36dfa \ - --hash=sha256:352d330048c055ea6db701130abc48a21bec690a8d38f8284e00fab256dc1376 \ - --hash=sha256:369e0d4647c17c9363244f3468f2227d557a74b6781cb62ce57cf3ef5cc7c610 \ - --hash=sha256:36ab5b23915887543441efd0417e6a3baa08634308894316f446027611b53bf1 \ - --hash=sha256:37e32e985f03c06206582a7323ef926b4e78bdaa6915095ef08070471865b906 \ - --hash=sha256:3a801fef99668f309b88640e28d261991bfad9617c27beda4a3aec4f217ea073 \ - --hash=sha256:3d14b17b9be5f9c9301f43d2e2a4886a33b53f4e6fdf9ca2f4cc60aeeee76372 \ - --hash=sha256:422cc684f17bc963da5f59a31530b3936f57c95a29743056ef7a7903a5dbdf88 \ - --hash=sha256:4520caa3807c1ceb005d125a75e715567806fed67e315cea619d5ec6e75a4191 \ - --hash=sha256:47834cde750d3c9f4e52c6ca28a7361859fcaf52695c7dc3cc1a720b8922683e \ - --hash=sha256:47f9ed103af0bc63182609044b0490747e03bd20a67e391192dde119bf43d52f \ - --hash=sha256:498815b96f67dc347e03b719ef49c772589fb74b8ee9ea2c37feae915ad6ebda \ - --hash=sha256:54088a5a147ab71a8e7fdfd8c3601972751ded0739c6b696ad9cb0343e21ab73 \ - --hash=sha256:55f09e00d4dccd76b179c0f18a44f041e5332fd0e022886ba1c0bbf3ea4a18d0 \ - --hash=sha256:5a0ac90e46fdb5649ab6369d1ab6104bfe5854ab19b645bf5cda0127a13034ae \ - --hash=sha256:6411f744f7f20081b1b4e7112e0f4c9c5b08f94b9f086e6f0adf3645f85d3a4d \ - --hash=sha256:6413d48a9be53e183eb06495d8e3b006ef8f87c324af68241bbe7a39e8ff54c3 \ - --hash=sha256:7451f92eddf8503c9b8aa4fe6aa7e87fd51a29c2cfc5f7dbd72efde6c65acf57 \ - --hash=sha256:8b4c0773b6ada798f51f0f8e30c054d32304ccc6e9c5d93d46cb26f3d385ab19 \ - --hash=sha256:8dfa94b6a4374e7851bbb6f35e6ded2120b752b063e6acdd3157e4d2bb922eba \ - --hash=sha256:97c8425d4e26437e65e1d189d22dff4a079b747ff9c2788057bfb8114ce1e133 \ - --hash=sha256:9d75f338f5f79ee23548b03d801d28a505198297534f62416391857ea0479571 \ - --hash=sha256:9de6832228f617c9ef45d948ec1cd8949c482238d68b2477e6f642c33a7b0a54 \ - --hash=sha256:a4cbdef3ddf777423060c6f81b5694bad2dc9675f110c4b2a60dc0181543fac7 \ - --hash=sha256:a9c0d994680cd991b1cb772e8b297340085466a6fe964bc9d4e80f5e2f43c291 \ - --hash=sha256:aa70fdbdc3b169d69e8c59e65c07a1c9351ceb438e627f0fdcd471015cd956be \ - --hash=sha256:abe38cd8381245a7f49967a6010e77dbf3680bd3627c0fe4362dd693b404c7f8 \ - --hash=sha256:b13f04968b46ad705f7c8a80122a42ae8f620536ea38cf4bdd374302926424dd \ - --hash=sha256:b4ea7e1cff6784e58fe281ce7e7f05036b3e1c89c6f922a6bfbc0a7e8768adbe \ - --hash=sha256:b6f91524d31b34f4a5fee24f5bc16dcd1491b668798b6d85585d836c1e633a6a \ - --hash=sha256:c26843fd58f65da9491165072da2cccc372530681de481ef670dcc8e27cfb066 \ - --hash=sha256:c42365005c7a6c42436a54d28c43fe0e01ca11eb2ac3cefe796c25a5f98e5e9b \ - --hash=sha256:c8b82a55ef86a2d8e81b63da85e55f5537d2157165be1cb2ce7cfa57b6aef38b \ - --hash=sha256:ced69262a8278547e63409b2653b372bf4baff0870c57efa76c5703fd6543282 \ - --hash=sha256:d2e3bdadaba0e040d1e7ab39db73e0afe2c74ae277f5614dad53eadbecbbb169 \ - --hash=sha256:d403c84991b5ad291d3809bace5e85f4bbf44a04bdc9a88ed2bb1807b3360bb8 \ - --hash=sha256:d7543263084a85fbc09c704b515395398d31d6395518446237eac219eab9e55e \ - --hash=sha256:d8882a829fd779f0f43998e931c466802a77ca1ee0fe25a3abe50278616b1471 \ - --hash=sha256:e4f0b035d9d0ed519c813ee23e0a733db81ec37d2e9503afbb6e54ccfdee0fa7 \ - --hash=sha256:e8b025c351b9f0e8b5436cf28a07fa4ac0204d67b38f01433ac7f9b870fa38c6 \ - --hash=sha256:eb7fd5b184e5d277afa9ec0ad5e4eb562ecff541e7f60e69ee69c8d59e9aeaba \ - --hash=sha256:ec31367fd6a255dc8de4772bd1658c3e926d8e860a0b6e922b615e532d320ddc \ - --hash=sha256:ee461a4eaab4f165b68780a6a1af95fb23a29932be7569b9fab666c407969051 \ - --hash=sha256:f5045039100ed58fa817a6227a356240ea1b9a1bc141018864c306c1a16d4175 - # via -r /tmp/requirementsguod07w5.in +numpy==2.2.6 \ + --hash=sha256:038613e9fb8c72b0a41f025a7e4c3f0b7a1b5d768ece4796b674c8f3fe13efff \ + --hash=sha256:0678000bb9ac1475cd454c6b8c799206af8107e310843532b04d49649c717a47 \ + --hash=sha256:0811bb762109d9708cca4d0b13c4f67146e3c3b7cf8d34018c722adb2d957c84 \ + --hash=sha256:0b605b275d7bd0c640cad4e5d30fa701a8d59302e127e5f79138ad62762c3e3d \ + --hash=sha256:0bca768cd85ae743b2affdc762d617eddf3bcf8724435498a1e80132d04879e6 \ + --hash=sha256:1bc23a79bfabc5d056d106f9befb8d50c31ced2fbc70eedb8155aec74a45798f \ + --hash=sha256:287cc3162b6f01463ccd86be154f284d0893d2b3ed7292439ea97eafa8170e0b \ + --hash=sha256:37c0ca431f82cd5fa716eca9506aefcabc247fb27ba69c5062a6d3ade8cf8f49 \ + --hash=sha256:37e990a01ae6ec7fe7fa1c26c55ecb672dd98b19c3d0e1d1f326fa13cb38d163 \ + --hash=sha256:389d771b1623ec92636b0786bc4ae56abafad4a4c513d36a55dce14bd9ce8571 \ + --hash=sha256:3d70692235e759f260c3d837193090014aebdf026dfd167834bcba43e30c2a42 \ + --hash=sha256:41c5a21f4a04fa86436124d388f6ed60a9343a6f767fced1a8a71c3fbca038ff \ + --hash=sha256:481b49095335f8eed42e39e8041327c05b0f6f4780488f61286ed3c01368d491 \ + --hash=sha256:4eeaae00d789f66c7a25ac5f34b71a7035bb474e679f410e5e1a94deb24cf2d4 \ + --hash=sha256:55a4d33fa519660d69614a9fad433be87e5252f4b03850642f88993f7b2ca566 \ + --hash=sha256:5a6429d4be8ca66d889b7cf70f536a397dc45ba6faeb5f8c5427935d9592e9cf \ + --hash=sha256:5bd4fc3ac8926b3819797a7c0e2631eb889b4118a9898c84f585a54d475b7e40 \ + --hash=sha256:5beb72339d9d4fa36522fc63802f469b13cdbe4fdab4a288f0c441b74272ebfd \ + --hash=sha256:6031dd6dfecc0cf9f668681a37648373bddd6421fff6c66ec1624eed0180ee06 \ + --hash=sha256:71594f7c51a18e728451bb50cc60a3ce4e6538822731b2933209a1f3614e9282 \ + --hash=sha256:74d4531beb257d2c3f4b261bfb0fc09e0f9ebb8842d82a7b4209415896adc680 \ + --hash=sha256:7befc596a7dc9da8a337f79802ee8adb30a552a94f792b9c9d18c840055907db \ + --hash=sha256:894b3a42502226a1cac872f840030665f33326fc3dac8e57c607905773cdcde3 \ + --hash=sha256:8e41fd67c52b86603a91c1a505ebaef50b3314de0213461c7a6e99c9a3beff90 \ + --hash=sha256:8e9ace4a37db23421249ed236fdcdd457d671e25146786dfc96835cd951aa7c1 \ + --hash=sha256:8fc377d995680230e83241d8a96def29f204b5782f371c532579b4f20607a289 \ + --hash=sha256:9551a499bf125c1d4f9e250377c1ee2eddd02e01eac6644c080162c0c51778ab \ + --hash=sha256:b0544343a702fa80c95ad5d3d608ea3599dd54d4632df855e4c8d24eb6ecfa1c \ + --hash=sha256:b093dd74e50a8cba3e873868d9e93a85b78e0daf2e98c6797566ad8044e8363d \ + --hash=sha256:b412caa66f72040e6d268491a59f2c43bf03eb6c96dd8f0307829feb7fa2b6fb \ + --hash=sha256:b4f13750ce79751586ae2eb824ba7e1e8dba64784086c98cdbbcc6a42112ce0d \ + --hash=sha256:b64d8d4d17135e00c8e346e0a738deb17e754230d7e0810ac5012750bbd85a5a \ + --hash=sha256:ba10f8411898fc418a521833e014a77d3ca01c15b0c6cdcce6a0d2897e6dbbdf \ + --hash=sha256:bd48227a919f1bafbdda0583705e547892342c26fb127219d60a5c36882609d1 \ + --hash=sha256:c1f9540be57940698ed329904db803cf7a402f3fc200bfe599334c9bd84a40b2 \ + --hash=sha256:c820a93b0255bc360f53eca31a0e676fd1101f673dda8da93454a12e23fc5f7a \ + --hash=sha256:ce47521a4754c8f4593837384bd3424880629f718d87c5d44f8ed763edd63543 \ + --hash=sha256:d042d24c90c41b54fd506da306759e06e568864df8ec17ccc17e9e884634fd00 \ + --hash=sha256:de749064336d37e340f640b05f24e9e3dd678c57318c7289d222a8a2f543e90c \ + --hash=sha256:e1dda9c7e08dc141e0247a5b8f49cf05984955246a327d4c48bda16821947b2f \ + --hash=sha256:e29554e2bef54a90aa5cc07da6ce955accb83f21ab5de01a62c8478897b264fd \ + --hash=sha256:e3143e4451880bed956e706a3220b4e5cf6172ef05fcc397f6f36a550b1dd868 \ + --hash=sha256:e8213002e427c69c45a52bbd94163084025f533a55a59d6f9c5b820774ef3303 \ + --hash=sha256:efd28d4e9cd7d7a8d39074a4d44c63eda73401580c5c76acda2ce969e0a38e83 \ + --hash=sha256:f0fd6321b839904e15c46e0d257fdd101dd7f530fe03fd6359c1ea63738703f3 \ + --hash=sha256:f1372f041402e37e5e633e586f62aa53de2eac8d98cbfb822806ce4bbefcb74d \ + --hash=sha256:f2618db89be1b4e05f7a1a847a9c1c0abd63e63a1607d892dd54668dd92faf87 \ + --hash=sha256:f447e6acb680fd307f40d3da4852208af94afdfab89cf850986c3ca00562f4fa \ + --hash=sha256:f92729c95468a2f4f15e9bb94c432a9229d0d50de67304399627a943201baa2f \ + --hash=sha256:f9f1adb22318e121c5c69a09142811a201ef17ab257a1e66ca3025065b7f53ae \ + --hash=sha256:fc0c5673685c508a142ca65209b4e79ed6740a4ed6b2267dbba90f34b0b3cfda \ + --hash=sha256:fc7b73d02efb0e18c000e9ad8b83480dfcd5dfd11065997ed4c6747470ae8915 \ + --hash=sha256:fd83c01228a688733f1ded5201c678f0c53ecc1006ffbc404db9f7a899ac6249 \ + --hash=sha256:fe27749d33bb772c80dcd84ae7e8df2adc920ae8297400dabec45f0dedb3f6de \ + --hash=sha256:fee4236c876c4e8369388054d02d0e9bb84821feb1a64dd59e137e6511a551f8 + # via -r /tmp/requirementsx8idgxd2.in packaging==25.0 \ --hash=sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484 \ --hash=sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f @@ -311,11 +311,11 @@ packaging==25.0 \ pip==25.1.1 \ --hash=sha256:2913a38a2abf4ea6b64ab507bd9e967f3b53dc1ede74b01b0931e1ce548751af \ --hash=sha256:3de45d411d308d5054c2168185d8da7f9a2cd753dbac8acbfa88a8909ecd9077 - # via -r /tmp/requirementsguod07w5.in + # via -r /tmp/requirementsx8idgxd2.in pybind11==2.13.6 \ --hash=sha256:237c41e29157b962835d356b370ededd57594a26d5894a795960f0047cb5caf5 \ --hash=sha256:ba6af10348c12b24e92fa086b39cfba0eff619b61ac77c406167d813b096d39a - # via -r /tmp/requirementsguod07w5.in + # via -r /tmp/requirementsx8idgxd2.in pycparser==2.22 \ --hash=sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6 \ --hash=sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc @@ -324,7 +324,7 @@ pydantic==2.11.4 \ --hash=sha256:32738d19d63a226a52eed76645a98ee07c1f410ee41d93b4afbfa85ed8111c2d \ --hash=sha256:d9615eaa9ac5a063471da949c8fc16376a84afb5024688b3ff885693506764eb # via - # -r /tmp/requirementsguod07w5.in + # -r /tmp/requirementsx8idgxd2.in # pydantic-settings pydantic-core==2.33.2 \ --hash=sha256:0069c9acc3f3981b9ff4cdfaf088e98d83440a4c7ea1bc07460af3d4dc22e72d \ @@ -430,7 +430,7 @@ pydantic-core==2.33.2 \ pydantic-settings==2.9.1 \ --hash=sha256:59b4f431b1defb26fe620c71a7d3968a710d719f5f4cdbbdb7926edeb770f6ef \ --hash=sha256:c509bf79d27563add44e8446233359004ed85066cd096d8b510f715e6ef5d268 - # via -r /tmp/requirementsguod07w5.in + # via -r /tmp/requirementsx8idgxd2.in pyproject-hooks==1.2.0 \ --hash=sha256:1e859bd5c40fae9448642dd871adf459e5e2084186e8d2c2a79a824c970da1f8 \ --hash=sha256:9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913 @@ -442,7 +442,7 @@ pyproject-metadata==0.9.1 \ pyright==1.1.400 \ --hash=sha256:b8a3ba40481aa47ba08ffb3228e821d22f7d391f83609211335858bf05686bdb \ --hash=sha256:c80d04f98b5a4358ad3a35e241dbf2a408eee33a40779df365644f8054d2517e - # via -r /tmp/requirementsguod07w5.in + # via -r /tmp/requirementsx8idgxd2.in python-dotenv==1.1.0 \ --hash=sha256:41f90bc6f5f177fb41f53e87666db362025010eb28f60a01c9143bfa33a2b2d5 \ --hash=sha256:d7c01d9e2293916c18baf562d95698754b0dbbb5e74d457c45d4f6561fb9d55d @@ -466,12 +466,12 @@ ruff==0.11.10 \ --hash=sha256:ddf8967e08227d1bd95cc0851ef80d2ad9c7c0c5aab1eba31db49cf0a7b99523 \ --hash=sha256:ef69637b35fb8b210743926778d0e45e1bffa850a7c61e428c6b971549b5f5d1 \ --hash=sha256:f4854fd09c7aed5b1590e996a81aeff0c9ff51378b084eb5a0b9cd9518e6cff2 - # via -r /tmp/requirementsguod07w5.in + # via -r /tmp/requirementsx8idgxd2.in setuptools==80.7.1 \ --hash=sha256:ca5cc1069b85dc23070a6628e6bcecb3292acac802399c7f8edc0100619f9009 \ --hash=sha256:f6ffc5f0142b1bd8d0ca94ee91b30c0ca862ffd50826da1ea85258a06fd94552 # via - # -r /tmp/requirementsguod07w5.in + # -r /tmp/requirementsx8idgxd2.in # marisa-trie tomli==2.2.1 \ --hash=sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6 \ @@ -506,11 +506,15 @@ tomli==2.2.1 \ --hash=sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272 \ --hash=sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a \ --hash=sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7 - # via -r /tmp/requirementsguod07w5.in + # via + # -r /tmp/requirementsx8idgxd2.in + # build + # meson-python + # mypy tomlkit==0.13.2 \ --hash=sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde \ --hash=sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79 - # via -r /tmp/requirementsguod07w5.in + # via -r /tmp/requirementsx8idgxd2.in typing-extensions==4.13.2 \ --hash=sha256:a439e7c04b49fec3e5d3e2beaa21755cadbbdc391694e28ccdd36ca4a1408f8c \ --hash=sha256:e6c81219bd689f51865d9e372991c540bda33a0379d5573cddb9a3a23f7caaef @@ -526,23 +530,23 @@ typing-inspection==0.4.0 \ # via # pydantic # pydantic-settings -uv==0.7.3 \ - --hash=sha256:0646e463365e7277f22200ce2d43b7a44e5a3192320500b4983b4fe34d69a5fb \ - --hash=sha256:0a446d4e5b10ce8a793156a276727bb7affa96a85e80dc5ad34e0c2de7e71cc8 \ - --hash=sha256:3e6e1fd5755d4ef4c6e1ce55bd2c6d9dec278a8bef5752703d702ce03704fe29 \ - --hash=sha256:44e2f3fcbd1ab519bdb68986449b2e3103d2261be95f985cadcf7ec7c510b595 \ - --hash=sha256:4809e5f7f5b2d6423d6573fda5655389c955ca649499fe9750b61af95daf9b7d \ - --hash=sha256:5eb4872888a9fb10b62cc00be8e84822d63d3e622a5f340248e53ecf321dba96 \ - --hash=sha256:863ceb63aefc7c2db9918313a1cb3c8bf3fc3d59b656b617db9e4abad90373f3 \ - --hash=sha256:90990e4c289feee24164c8e463fc0ebc9a336960119cd256acca7c1439f0f536 \ - --hash=sha256:acef117a0c52299e60c6f7a3e60849050cd233704c561f688fac1100d113da2e \ - --hash=sha256:acff7fba5ff40dcb5a42de496db92a3965edac7a3d687d9b013ba6e0336995df \ - --hash=sha256:b1414a026c153ae0731daed0812b17bf77d34eafedaeb3a5c72e08181aea116b \ - --hash=sha256:c976fce3d1068a1d007f50127cc7873d67643c1a60439564970f092d9be41877 \ - --hash=sha256:cb2547fd1466698e9b4f11de5eef7055b8cbcc3c693d79f6d747e3f8e6be2ab7 \ - --hash=sha256:cc27207c35c959d2e0e873e86a80a2470a77b7a34a4512a831e8d4f7c87f4404 \ - --hash=sha256:d246243f348796730e8ea9736ddd48702d4448d98af5e61693063ed616e30378 \ - --hash=sha256:db8a5d5995b160158405379deadf0ffccf849a5e7ce048900b73517daf109e2c \ - --hash=sha256:f37c8a6b172776fb5305afe0699907aff44a778669de7a8fbe5a9c09c1a88a97 \ - --hash=sha256:fbb2d322d453e498e1431c51421cee597962ecd3f93fcef853b258e9c7e7636c - # via -r /tmp/requirementsguod07w5.in +uv==0.7.6 \ + --hash=sha256:0bad870f797971423d7f654423cf3ccd3bbd3688f88aee3f84e79af008c6abae \ + --hash=sha256:17c79eec35c65bbd25180203be7266dd7d43381e02e28a8f2cb6ee809d008837 \ + --hash=sha256:1f46cfd2de04dd261cc75158c293de64f99cc907ab0d395f3a0f97c94e7f076a \ + --hash=sha256:310e488493d03a843b838e9301af1731b02bc93b14bcaa38c62d448cebbdca3c \ + --hash=sha256:32aecfd27bd724d8ca8bafa811a69d436fcd403d589b025fbbd2e967eb154b46 \ + --hash=sha256:4026513441dc01326f8bc04517956385442523ed1d40400e14723d8fb3d9c321 \ + --hash=sha256:434f1820a8fbf54494c53d8ebb2b6509d98a2792876a2d990f90ac70afc9a11a \ + --hash=sha256:4cd32743d2c0c0b40ffbde48163ae2835353d319472aadabd71e9dcf98152e8b \ + --hash=sha256:5e283166816f129f29023a4bfdf49fdb33e1e2bcb4e555e9d6996122867a44af \ + --hash=sha256:72e9337db681a16a7203abe112fedc249f01fe4cadd6d65d23c85031183dcf23 \ + --hash=sha256:832d7741117c41455ff43569b88892ec0a81938750a8bc4307e1160b70c91f3c \ + --hash=sha256:8a86cfefd0b9cd3b8a8577e79a0e61d52ade23a7876ed5b5312cc1f05baa140b \ + --hash=sha256:ad79d71d2bb4cc1cb22d09771a23f70190e3b5fa41668da208e694b50b900178 \ + --hash=sha256:bd188ac9d9902f1652130837ede39768d7c8f72b0a68fd484ba884d88e963b66 \ + --hash=sha256:c18b2437e254906b1f48710e1fc1b313052e2ee7261ff104d58b25ef2d347d98 \ + --hash=sha256:c44311ed1a32e397d81e346e7b868e4ae22f2df2e5ba601e055683fa4cc68323 \ + --hash=sha256:e15ac957e0a319dba40c897b9408c93e603d2317807384ec8f7d47a9e17c0d85 \ + --hash=sha256:e3fb41bd4bf88ab21df773b642465fffc469e173645eb986d000db38d7bb8e3c + # via -r /tmp/requirementsx8idgxd2.in diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.1-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.1-py3-none-any.whl new file mode 100644 index 0000000..55cdaac --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.1-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4ff7f00644a122f4dca7c812d1aa57b55ca375c1a59ee270532f783bb899a4b +size 69749 From 4d10656e0ac2bce4a21ced66807a73dc76182ab1 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Thu, 22 May 2025 14:27:30 +0300 Subject: [PATCH 02/28] [+] extend tool.meson 1. allow to specify setup args for meson setup, when building mode=meson of pyproject.toml; --- python/meson.build | 2 +- python/online/fxreader/pr34/commands_typed/cli.py | 12 +++++++++++- ...line_fxreader_pr34-0.1.5.17+27.2-py3-none-any.whl | 3 +++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.2-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index 3ddd394..d06744f 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.1', + version: '0.1.5.17+27.2', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index a225f94..87730c0 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -46,7 +46,8 @@ class PyProject: class Meson: @dataclasses.dataclass class Args: - install: list[str] + install: Optional[list[str]] = None + setup: Optional[list[str]] = None args: Args @@ -541,6 +542,8 @@ class CLI(abc.ABC): env: Optional[dict[str, str]] = None, # third_party_roots: Optional[list[pathlib.Path]] = None, ) -> None: + from . import cli_bootstrap + project = self.projects[project_name] if argv is None: @@ -549,6 +552,10 @@ class CLI(abc.ABC): if env is None: env = dict() + pyproject = cli_bootstrap.pyproject_load(project.source_dir / 'pyproject.toml') + + pyproject_tool = pydantic.RootModel[PyProject.Tool].model_validate(pyproject.tool).root + logger.info(dict(env=env)) if force: @@ -561,6 +568,9 @@ class CLI(abc.ABC): if len(self.third_party_roots) > 0: extra_args.extend(['-Dthird_party_roots=%s' % str(o.absolute()) for o in self.third_party_roots]) + if pyproject_tool.meson and pyproject_tool.meson.args and pyproject_tool.meson.args.setup: + extra_args = pyproject_tool.meson.args.setup + extra_args + cmd = [ shutil_which( 'meson', diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.2-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.2-py3-none-any.whl new file mode 100644 index 0000000..966cae6 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.2-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0bbf0aedd54b15cefeccc2a54d802f8a740e6edbbda4a2b918e8a6a1b4d0078c +size 69786 From b4199d3faa59bd7a95a17a6b5fdf3cc110458c09 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Thu, 22 May 2025 14:40:14 +0300 Subject: [PATCH 03/28] [+] add tomllib option for toml_load --- .../fxreader/pr34/commands_typed/cli_bootstrap.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py index 14d20a1..06f837e 100644 --- a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py +++ b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py @@ -29,12 +29,12 @@ logger = logging.getLogger(__name__) def toml_load(f: BinaryIO) -> Any: - # try: - # import tomllib - # - # return tomllib.load(f) - # except: - # pass + try: + import tomllib + + return tomllib.load(f) + except: + pass try: import tomli From 66e32b4fc9e2337451b566c00c66a5bcdb8c9ff1 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Fri, 23 May 2025 11:31:08 +0300 Subject: [PATCH 04/28] [+] use meson from venv 1. fix typing for tomllib, since it is found in python <3.11 --- python/meson.build | 2 +- .../fxreader/pr34/commands_typed/cli.py | 43 ++++++++++++------- .../pr34/commands_typed/cli_bootstrap.py | 16 +++++-- ...reader_pr34-0.1.5.17+27.3-py3-none-any.whl | 3 ++ 4 files changed, 43 insertions(+), 21 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.3-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index d06744f..15bf5a2 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.2', + version: '0.1.5.17+27.3', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index 87730c0..f772b36 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -421,10 +421,13 @@ class CLI(abc.ABC): argv = pyproject_tool.meson.args.install + argv cmd = [ - shutil_which( - 'meson', - True, - ), + str(self.dist_settings.python_path), + '-m', + 'mesonbuild.mesonmain', + # shutil_which( + # 'meson', + # True, + # ), 'install', '-C', str(project.build_dir / 'meson'), @@ -496,10 +499,12 @@ class CLI(abc.ABC): subprocess.check_call( [ - shutil_which( - 'meson', - True, - ), + str(self.dist_settings.python_path), + 'mesonbuild.mesonmain', + # shutil_which( + # 'meson', + # True, + # ), 'test', '-C', project.build_dir / 'meson', @@ -519,10 +524,13 @@ class CLI(abc.ABC): subprocess.check_call( [ - shutil_which( - 'meson', - True, - ), + str(self.dist_settings.python_path), + '-m', + 'mesonbuild.mesonmain', + # shutil_which( + # 'meson', + # True, + # ), 'compile', '-C', project.build_dir / 'meson', @@ -572,10 +580,13 @@ class CLI(abc.ABC): extra_args = pyproject_tool.meson.args.setup + extra_args cmd = [ - shutil_which( - 'meson', - True, - ), + # shutil_which( + # 'meson', + # True, + # ), + str(self.dist_settings.python_path), + '-m', + 'mesonbuild.mesonmain', 'setup', str(project.source_dir), str(project.build_dir / 'meson'), diff --git a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py index 06f837e..90f53d1 100644 --- a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py +++ b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import glob +import importlib import json import io import tempfile @@ -18,6 +19,7 @@ from typing import ( cast, Type, TypeVar, + Callable, ) from typing_extensions import ( Self, @@ -30,17 +32,23 @@ logger = logging.getLogger(__name__) def toml_load(f: BinaryIO) -> Any: try: - import tomllib + tomllib = importlib.import_module('tomllib') - return tomllib.load(f) - except: + return cast( + Callable[[Any], Any], + getattr( + tomllib, + 'load', + ), + )(f) + except ModuleNotFoundError: pass try: import tomli return tomli.load(f) - except: + except ModuleNotFoundError: pass raise NotImplementedError diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.3-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.3-py3-none-any.whl new file mode 100644 index 0000000..181406e --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.3-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:875a1e88e89bb839ce22c93a10b18c84fe48832c191157b70cac0d3857a88386 +size 69866 From 772279b5d53893f8a9fb0580bef86c1fb3c7ecee Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Fri, 23 May 2025 11:41:45 +0300 Subject: [PATCH 05/28] [+] fix cli_bootstrap --- .../pr34/commands_typed/cli_bootstrap.py | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py index 90f53d1..b539fc7 100644 --- a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py +++ b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py @@ -422,6 +422,17 @@ def env_bootstrap( # *early_dependencies, # ]) + uv_python_version: list[str] = [] + + if not bootstrap_settings.python_version is None: + uv_python_version.extend( + [ + '-p', + bootstrap_settings.python_version, + ] + ) + + if not requirements_path.exists(): with tempfile.NamedTemporaryFile( mode='w', @@ -436,6 +447,7 @@ def env_bootstrap( 'uv', 'pip', 'compile', + *uv_python_version, '--generate-hashes', *pip_find_links_args, # '-p', @@ -447,16 +459,6 @@ def env_bootstrap( ] ) - uv_python_version: list[str] = [] - - if not bootstrap_settings.python_version is None: - uv_python_version.extend( - [ - '-p', - bootstrap_settings.python_version, - ] - ) - subprocess.check_call( [ 'uv', @@ -474,9 +476,10 @@ def env_bootstrap( 'uv', 'pip', 'install', + *uv_python_version, *pip_find_links_args, - '-p', - bootstrap_settings.python_path, + # '-p', + # bootstrap_settings.python_path, '--require-hashes', *bootstrap_settings.uv_args, '-r', From 79f6d3544c4254eff0cd796b76e3ddf7559f47c9 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Fri, 23 May 2025 11:58:46 +0300 Subject: [PATCH 06/28] [+] partially added cross-file parser --- .../fxreader/pr34/commands_typed/cli.py | 65 ++++++++++++++++++- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index f772b36..135f439 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -1,5 +1,7 @@ import dataclasses import io +import importlib +import configparser import glob import os import pathlib @@ -542,6 +544,63 @@ class CLI(abc.ABC): def third_party_roots(self) -> list[pathlib.Path]: return [] + class meson_toolchains_t: + class res_t: + @dataclasses.dataclass + class toolchain_t: + name: str + path: Optional[pathlib.Path] = None + + def meson_toolchains(self) -> list[meson_toolchains_t.res_t.toolchain_t]: + t1 = pathlib.Path(importlib.import_module('online.fxreader.pr34').__path__[0]) + toolchains = glob.glob(str(t1 / 'meson' / 'toolchains' / '*')) + + res : list[CLI.meson_toolchains_t.res_t.toolchain_t] = [] + + for o in toolchains: + entry = self.meson_toolchains_t.res_t.toolchain_t( + name=pathlib.Path(o).name, + path=pathlib.Path(o), + ) + + config = configparser.ConfigParser() + config.read(str(entry.path)) + + return res + + + def _cross_file( + self, + extra_args: list[str], + pyproject_tool: PyProject.Tool, + ) -> list[str]: + if pyproject_tool.meson and pyproject_tool.meson.args and pyproject_tool.meson.args.setup: + extra_args = pyproject_tool.meson.args.setup + extra_args + + parser = argparse.ArgumentParser() + parser.add_argument( + '--cross-file', + dest='cross_file', + default=None, + # type=pathlib.Path, + type=pathlib.Path, + ) + + options, args = pr34_argparse.parse_args(extra_args) + + if not options.cross_file is None: + if not options.cross_file.exists() and ( + not options.cross_file.is_absolute() and \ + options.cross_file.stem in self.meson_toolchains + ): + options.cross_file = self.meson_toolchains[ + options.cross_file.stem + ].path + + extra_args = ['--cross-file', str(options.cross_file)] + args + + return extra_args + def meson_setup( self, project_name: str, @@ -576,8 +635,10 @@ class CLI(abc.ABC): if len(self.third_party_roots) > 0: extra_args.extend(['-Dthird_party_roots=%s' % str(o.absolute()) for o in self.third_party_roots]) - if pyproject_tool.meson and pyproject_tool.meson.args and pyproject_tool.meson.args.setup: - extra_args = pyproject_tool.meson.args.setup + extra_args + self._cross_file( + extra_args=extra_args, + pyproject_tool=pyproject_tool, + ) cmd = [ # shutil_which( From c720465c59d76936b119df226a300354360863c4 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Fri, 23 May 2025 13:57:51 +0300 Subject: [PATCH 07/28] [+] fix typing --- python/online/fxreader/pr34/commands_typed/cli.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index 135f439..5c09dae 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -551,11 +551,15 @@ class CLI(abc.ABC): name: str path: Optional[pathlib.Path] = None - def meson_toolchains(self) -> list[meson_toolchains_t.res_t.toolchain_t]: + @property + def meson_toolchains(self) -> dict[ + str, + meson_toolchains_t.res_t.toolchain_t + ]: t1 = pathlib.Path(importlib.import_module('online.fxreader.pr34').__path__[0]) toolchains = glob.glob(str(t1 / 'meson' / 'toolchains' / '*')) - res : list[CLI.meson_toolchains_t.res_t.toolchain_t] = [] + res : dict[str, CLI.meson_toolchains_t.res_t.toolchain_t] = dict() for o in toolchains: entry = self.meson_toolchains_t.res_t.toolchain_t( @@ -566,6 +570,8 @@ class CLI(abc.ABC): config = configparser.ConfigParser() config.read(str(entry.path)) + res[entry.name] = entry + return res @@ -574,6 +580,8 @@ class CLI(abc.ABC): extra_args: list[str], pyproject_tool: PyProject.Tool, ) -> list[str]: + from . import argparse as pr34_argparse + if pyproject_tool.meson and pyproject_tool.meson.args and pyproject_tool.meson.args.setup: extra_args = pyproject_tool.meson.args.setup + extra_args @@ -586,7 +594,7 @@ class CLI(abc.ABC): type=pathlib.Path, ) - options, args = pr34_argparse.parse_args(extra_args) + options, args = pr34_argparse.parse_args(parser, extra_args) if not options.cross_file is None: if not options.cross_file.exists() and ( From 0a0e8c70794d977634e26269fde421021aea6ca4 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Fri, 23 May 2025 14:01:06 +0300 Subject: [PATCH 08/28] [+] add .whl --- python/meson.build | 2 +- .../online/fxreader/pr34/commands_typed/cli.py | 17 ++++------------- .../pr34/commands_typed/cli_bootstrap.py | 1 - 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/python/meson.build b/python/meson.build index 15bf5a2..561b464 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.3', + version: '0.1.5.17+27.4', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index 5c09dae..933dafc 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -552,14 +552,11 @@ class CLI(abc.ABC): path: Optional[pathlib.Path] = None @property - def meson_toolchains(self) -> dict[ - str, - meson_toolchains_t.res_t.toolchain_t - ]: + def meson_toolchains(self) -> dict[str, meson_toolchains_t.res_t.toolchain_t]: t1 = pathlib.Path(importlib.import_module('online.fxreader.pr34').__path__[0]) toolchains = glob.glob(str(t1 / 'meson' / 'toolchains' / '*')) - res : dict[str, CLI.meson_toolchains_t.res_t.toolchain_t] = dict() + res: dict[str, CLI.meson_toolchains_t.res_t.toolchain_t] = dict() for o in toolchains: entry = self.meson_toolchains_t.res_t.toolchain_t( @@ -574,7 +571,6 @@ class CLI(abc.ABC): return res - def _cross_file( self, extra_args: list[str], @@ -597,13 +593,8 @@ class CLI(abc.ABC): options, args = pr34_argparse.parse_args(parser, extra_args) if not options.cross_file is None: - if not options.cross_file.exists() and ( - not options.cross_file.is_absolute() and \ - options.cross_file.stem in self.meson_toolchains - ): - options.cross_file = self.meson_toolchains[ - options.cross_file.stem - ].path + if not options.cross_file.exists() and (not options.cross_file.is_absolute() and options.cross_file.stem in self.meson_toolchains): + options.cross_file = self.meson_toolchains[options.cross_file.stem].path extra_args = ['--cross-file', str(options.cross_file)] + args diff --git a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py index b539fc7..222b78f 100644 --- a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py +++ b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py @@ -432,7 +432,6 @@ def env_bootstrap( ] ) - if not requirements_path.exists(): with tempfile.NamedTemporaryFile( mode='w', From 8c971fb51881725ee76b2fdbe9d3821b8c08925f Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Fri, 23 May 2025 14:05:27 +0300 Subject: [PATCH 09/28] [+] add .whl --- .../whl/online_fxreader_pr34-0.1.5.17+27.4-py3-none-any.whl | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.4-py3-none-any.whl diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.4-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.4-py3-none-any.whl new file mode 100644 index 0000000..9f112bd --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.4-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ae98cdb29350b55bbb6aa7bb504202b30bc50160f281180d06b3e80299973ec4 +size 70236 From a7c192a51ebdd7bf3c4a6efa7be3bcdb54d6ebba Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Fri, 23 May 2025 14:35:45 +0300 Subject: [PATCH 10/28] [+] update toolchain name --- python/meson.build | 2 +- python/online/fxreader/pr34/commands_typed/cli.py | 4 ++-- .../whl/online_fxreader_pr34-0.1.5.17+27.5-py3-none-any.whl | 3 +++ .../whl/online_fxreader_pr34-0.1.5.17+27.6-py3-none-any.whl | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.5-py3-none-any.whl create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.6-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index 561b464..39896d1 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.4', + version: '0.1.5.17+27.6', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index 933dafc..1451419 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -560,7 +560,7 @@ class CLI(abc.ABC): for o in toolchains: entry = self.meson_toolchains_t.res_t.toolchain_t( - name=pathlib.Path(o).name, + name=pathlib.Path(o).stem, path=pathlib.Path(o), ) @@ -634,7 +634,7 @@ class CLI(abc.ABC): if len(self.third_party_roots) > 0: extra_args.extend(['-Dthird_party_roots=%s' % str(o.absolute()) for o in self.third_party_roots]) - self._cross_file( + extra_args = self._cross_file( extra_args=extra_args, pyproject_tool=pyproject_tool, ) diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.5-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.5-py3-none-any.whl new file mode 100644 index 0000000..50ea3fe --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.5-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:93157873f84b40f29101b25d181175aae77ad885eeea10d7a535de94fcb7b97e +size 70237 diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.6-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.6-py3-none-any.whl new file mode 100644 index 0000000..298c81a --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.6-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18e7c5dbdba0843dde779bfd21a0a84eb44b3b1227deaf6a8c14153534e2fab1 +size 70237 From e0843e84962b92add1331a16c10e999b18708cb1 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Tue, 27 May 2025 10:25:15 +0300 Subject: [PATCH 11/28] [+] remove build dir when deploy with force=True --- python/meson.build | 2 +- python/online/fxreader/pr34/commands_typed/cli.py | 15 +++++++++++++-- ...e_fxreader_pr34-0.1.5.17+27.7-py3-none-any.whl | 3 +++ 3 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.7-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index 39896d1..4273429 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.6', + version: '0.1.5.17+27.7', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index 1451419..4702cec 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -357,6 +357,17 @@ class CLI(abc.ABC): extra_args: list[str] = [] + pyproject_build_dir = project.build_dir / 'pyproject' + + if force and pyproject_build_dir.exists(): + logger.info( + dict( + pyproject_build_dir=pyproject_build_dir, + msg='remove build dir', + ) + ) + shutil.rmtree(pyproject_build_dir) + if len(self.third_party_roots) > 0: extra_args.extend(['-Csetup-args=%s' % ('-Dthird_party_roots=%s' % str(o.absolute())) for o in self.third_party_roots]) @@ -368,7 +379,7 @@ class CLI(abc.ABC): '-n', *extra_args, '-Csetup-args=-Dmodes=pyproject', - '-Cbuild-dir=%s' % str(project.build_dir / 'pyproject'), + '-Cbuild-dir=%s' % str(pyproject_build_dir), '-Csetup-args=-Dinstall_path=%s' % str(project.dest_dir), # '-Cbuild-dir=%s' % str(project.build_dir), str(project.source_dir), @@ -378,7 +389,7 @@ class CLI(abc.ABC): if not output_dir is None: cmd.extend(['-o', str(output_dir)]) - logger.info(dict(env=env)) + logger.info(dict(env=env, cmd=cmd)) subprocess.check_call( cmd, diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.7-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.7-py3-none-any.whl new file mode 100644 index 0000000..233e46f --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.7-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a53c840258d591ea25b0f172457430e5f5db98f54c46f2c5d9a8868f4fd6c41 +size 70297 From a7d68110c8c45915fa3c1e78a63083a6a1030aa1 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Wed, 28 May 2025 16:35:33 +0300 Subject: [PATCH 12/28] [+] add project_name for third_party_roots --- python/meson.build | 2 +- python/online/fxreader/pr34/commands_typed/cli.py | 14 ++++++++------ ...ne_fxreader_pr34-0.1.5.17+27.8-py3-none-any.whl | 3 +++ 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.8-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index 4273429..353d072 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.7', + version: '0.1.5.17+27.8', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index 4702cec..87b3548 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -368,8 +368,8 @@ class CLI(abc.ABC): ) shutil.rmtree(pyproject_build_dir) - if len(self.third_party_roots) > 0: - extra_args.extend(['-Csetup-args=%s' % ('-Dthird_party_roots=%s' % str(o.absolute())) for o in self.third_party_roots]) + if len(self.third_party_roots(project_name)) > 0: + extra_args.extend(['-Csetup-args=%s' % ('-Dthird_party_roots=%s' % str(o.absolute())) for o in self.third_party_roots(project_name)]) cmd = [ sys.executable, @@ -551,8 +551,10 @@ class CLI(abc.ABC): ] ) - @property - def third_party_roots(self) -> list[pathlib.Path]: + def third_party_roots( + self, + project_name: Optional[str] = None, + ) -> list[pathlib.Path]: return [] class meson_toolchains_t: @@ -642,8 +644,8 @@ class CLI(abc.ABC): extra_args: list[str] = [] - if len(self.third_party_roots) > 0: - extra_args.extend(['-Dthird_party_roots=%s' % str(o.absolute()) for o in self.third_party_roots]) + if len(self.third_party_roots(project_name)) > 0: + extra_args.extend(['-Dthird_party_roots=%s' % str(o.absolute()) for o in self.third_party_roots(project_name)]) extra_args = self._cross_file( extra_args=extra_args, diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.8-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.8-py3-none-any.whl new file mode 100644 index 0000000..2e1c370 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.8-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b1e56df83d706c46d96c66516ea970bbdbd858d1fe8f85afcf71e40db08eaa98 +size 70308 From bab76643f2d7be45c85c91cf2deb471a1e8963c5 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Thu, 29 May 2025 12:02:52 +0300 Subject: [PATCH 13/28] [+] fix meson third_party_roots option --- python/meson.build | 2 +- python/online/fxreader/pr34/commands_typed/cli.py | 5 +++-- .../whl/online_fxreader_pr34-0.1.5.17+27.9-py3-none-any.whl | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.9-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index 353d072..71d00f7 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.8', + version: '0.1.5.17+27.9', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index 87b3548..3d8e477 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -1,5 +1,6 @@ import dataclasses import io +import json import importlib import configparser import glob @@ -369,7 +370,7 @@ class CLI(abc.ABC): shutil.rmtree(pyproject_build_dir) if len(self.third_party_roots(project_name)) > 0: - extra_args.extend(['-Csetup-args=%s' % ('-Dthird_party_roots=%s' % str(o.absolute())) for o in self.third_party_roots(project_name)]) + extra_args.append('-Csetup-args=%s' % ('-Dthird_party_roots=%s' % json.dumps([str(o.absolute()) for o in self.third_party_roots(project_name)]))) cmd = [ sys.executable, @@ -645,7 +646,7 @@ class CLI(abc.ABC): extra_args: list[str] = [] if len(self.third_party_roots(project_name)) > 0: - extra_args.extend(['-Dthird_party_roots=%s' % str(o.absolute()) for o in self.third_party_roots(project_name)]) + extra_args.append('-Dthird_party_roots=%s' % json.dumps([str(o.absolute()) for o in self.third_party_roots(project_name)])) extra_args = self._cross_file( extra_args=extra_args, diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.9-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.9-py3-none-any.whl new file mode 100644 index 0000000..3dd9c7c --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.9-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:533d88d8a3b9714d74bdb6fe059368dc95b301e76071c30b27057fa1f9f8b625 +size 70319 From 15ab55e370431ead7b7706d58b5e104415719c6e Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Fri, 30 May 2025 12:10:40 +0300 Subject: [PATCH 14/28] [+] fix meson wrapper --- python/meson.build | 2 +- python/online/fxreader/pr34/commands_typed/cli.py | 1 + .../whl/online_fxreader_pr34-0.1.5.17+27.10-py3-none-any.whl | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.10-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index 71d00f7..4369a8b 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.9', + version: '0.1.5.17+27.10', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index 3d8e477..83cda66 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -514,6 +514,7 @@ class CLI(abc.ABC): subprocess.check_call( [ str(self.dist_settings.python_path), + '-m', 'mesonbuild.mesonmain', # shutil_which( # 'meson', diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.10-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.10-py3-none-any.whl new file mode 100644 index 0000000..ed4616f --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.10-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1772b7258f40040a5fc857270ba1a01d14619201d04a5bef1eba6c7e11573d12 +size 70329 From fbe6fb01cb87f38d6332ce5035dd4e842d49d0c6 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Mon, 2 Jun 2025 14:26:57 +0300 Subject: [PATCH 15/28] [+] add custom shutil_rmtree --- python/meson.build | 2 +- python/online/fxreader/pr34/commands_typed/os.py | 11 +++++++++++ ...line_fxreader_pr34-0.1.5.17+27.11-py3-none-any.whl | 3 +++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.11-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index 4369a8b..3440a1f 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.10', + version: '0.1.5.17+27.11', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/os.py b/python/online/fxreader/pr34/commands_typed/os.py index 68fcd9c..961b51e 100644 --- a/python/online/fxreader/pr34/commands_typed/os.py +++ b/python/online/fxreader/pr34/commands_typed/os.py @@ -123,3 +123,14 @@ def interfaces_index() -> list[interfaces_index_t.Interface]: ) return res + + +def shutil_rmtree( + path: pathlib.Path, + preserve_top_path: bool = False, +) -> None: + if preserve_top_path: + for p in path.iterdir(): + shutil.rmtree(str(p)) + else: + shutil.rmtree(str(path)) diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.11-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.11-py3-none-any.whl new file mode 100644 index 0000000..e4ed388 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.11-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:052bdffa8ca4d8e9a2976fc5c9f6e26b3bfeaeabdbdea62beaa05cd85a87eb21 +size 70393 From fa09245da6d7981813eeb6ce025ad6275c4e0085 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Mon, 2 Jun 2025 17:44:02 +0300 Subject: [PATCH 16/28] [+] update meson_install --- python/meson.build | 2 +- python/online/fxreader/pr34/commands_typed/cli.py | 7 ++++++- .../online_fxreader_pr34-0.1.5.17+27.12-py3-none-any.whl | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.12-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index 3440a1f..1af047a 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.11', + version: '0.1.5.17+27.12', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index 83cda66..6c76c4d 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -415,6 +415,7 @@ class CLI(abc.ABC): argv: Optional[list[str]] = None, ) -> None: from . import cli_bootstrap + from .os import shutil_rmtree project = self.projects[project_name] @@ -425,7 +426,10 @@ class CLI(abc.ABC): argv = [] if force and project.dest_dir.exists(): - shutil.rmtree(project.dest_dir) + shutil_rmtree( + project.dest_dir, + preserve_top_path=True, + ) pyproject = cli_bootstrap.pyproject_load(project.source_dir / 'pyproject.toml') @@ -624,6 +628,7 @@ class CLI(abc.ABC): # third_party_roots: Optional[list[pathlib.Path]] = None, ) -> None: from . import cli_bootstrap + from .os import shutil_rmtree project = self.projects[project_name] diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.12-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.12-py3-none-any.whl new file mode 100644 index 0000000..904debd --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.12-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a6074677f7d95e9e8a5908703599ce829862a9fc199bd484f5a1a5139de88db +size 70415 From 49119673d26ee180aacbb7f32599603bf7a04702 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Tue, 3 Jun 2025 17:24:45 +0300 Subject: [PATCH 17/28] [+] fix wasm cross file --- meson/toolchains/wasm-cross-meson.ini | 3 +++ python/meson.build | 2 +- .../whl/online_fxreader_pr34-0.1.5.17+27.13-py3-none-any.whl | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.13-py3-none-any.whl diff --git a/meson/toolchains/wasm-cross-meson.ini b/meson/toolchains/wasm-cross-meson.ini index da0c2e1..45712c2 100644 --- a/meson/toolchains/wasm-cross-meson.ini +++ b/meson/toolchains/wasm-cross-meson.ini @@ -11,3 +11,6 @@ system = 'linux' cpu_family = 'x86_64' cpu = 'x86_64' endian = 'little' + +[properties] +needs_exe_wrapper = true diff --git a/python/meson.build b/python/meson.build index 1af047a..f5ba78d 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.12', + version: '0.1.5.17+27.13', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.13-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.13-py3-none-any.whl new file mode 100644 index 0000000..e0e7844 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.13-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad29cf11eb6cec2b19051127ae1850623b87b30393537621644f4ccc1aa24902 +size 70429 From 20a457048427b68f760bf343891133ef04832e3a Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Wed, 4 Jun 2025 11:24:06 +0300 Subject: [PATCH 18/28] [+] implement toml_add_overlay --- python/meson.build | 2 +- .../fxreader/pr34/commands_typed/cli.py | 12 ++++++-- .../fxreader/pr34/commands_typed/toml.py | 30 +++++++++++++++++++ ...eader_pr34-0.1.5.17+27.14-py3-none-any.whl | 3 ++ 4 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 python/online/fxreader/pr34/commands_typed/toml.py create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.14-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index f5ba78d..ecaf2d6 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.13', + version: '0.1.5.17+27.14', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index 6c76c4d..82073d1 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -796,6 +796,7 @@ class CLI(abc.ABC): from . import cli_bootstrap from . import argparse as pr34_argparse + from .toml import toml_add_overlay project = self.projects[project_name] @@ -859,9 +860,14 @@ class CLI(abc.ABC): # assert isinstance(pyproject_tool, tomlkit.items.Array) assert isinstance(pyproject_tool, MutableMapping) - for k, v in module.tool.items(): - assert not k in pyproject_tool - pyproject_tool[k] = v + toml_add_overlay( + pyproject_tool, + module.tool, + ) + + # for k, v in module.tool.items(): + # assert not k in pyproject_tool + # pyproject_tool[k] = v del p del pyproject_tool diff --git a/python/online/fxreader/pr34/commands_typed/toml.py b/python/online/fxreader/pr34/commands_typed/toml.py new file mode 100644 index 0000000..1f12901 --- /dev/null +++ b/python/online/fxreader/pr34/commands_typed/toml.py @@ -0,0 +1,30 @@ +from .cli_bootstrap import check_dict + +from typing import ( + Any, + Mapping, + MutableMapping, + Iterable, +) + + +def toml_add_overlay( + toml: Any, + overlay: Any, +) -> Any: + if isinstance(toml, MutableMapping): + overlay2 = check_dict( + overlay, + str, + ) + + for k, v in overlay2.items(): + if not k in toml: + toml[k] = v + else: + toml_add_overlay( + toml[k], + v, + ) + else: + raise NotImplementedError diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.14-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.14-py3-none-any.whl new file mode 100644 index 0000000..ca0c402 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.14-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c428575bce655c0cd14675767564b31c6b16c7d92fbc44103345bdbe9045babc +size 70897 From 520ea4211a7b74675e6ad2597ed3eaf03b44ae8b Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Thu, 5 Jun 2025 11:55:45 +0300 Subject: [PATCH 19/28] [+] improve commands_typed 1. improve third_party_roots from pyproject; 2. improve typing for pip; --- python/meson.build | 2 +- .../pr34/commands_typed/cli_bootstrap.py | 29 +++++++++++++++---- .../fxreader/pr34/commands_typed/pip.py | 2 +- ...eader_pr34-0.1.5.17+27.15-py3-none-any.whl | 3 ++ ...eader_pr34-0.1.5.17+27.16-py3-none-any.whl | 3 ++ ...eader_pr34-0.1.5.17+27.17-py3-none-any.whl | 3 ++ 6 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.15-py3-none-any.whl create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.16-py3-none-any.whl create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.17-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index ecaf2d6..07bb7c0 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.14', + version: '0.1.5.17+27.17', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py index 222b78f..2ac1f1d 100644 --- a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py +++ b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py @@ -68,6 +68,9 @@ class PyProject: pip_find_links: Optional[list[pathlib.Path]] = None runtime_libdirs: Optional[list[pathlib.Path]] = None runtime_preload: Optional[list[pathlib.Path]] = None + third_party_roots: list[str] = dataclasses.field( + default_factory=lambda: [], + ) requirements: dict[str, pathlib.Path] = dataclasses.field(default_factory=lambda: dict()) modules: list[Module] = dataclasses.field( @@ -227,14 +230,21 @@ def pyproject_load( res.runtime_libdirs = [ d.parent / pathlib.Path(o) # pathlib.Path(o) - for o in pr34_tool['runtime_libdirs'] + for o in check_list(pr34_tool['runtime_libdirs'], str) ] if 'runtime_preload' in pr34_tool: res.runtime_preload = [ d.parent / pathlib.Path(o) # pathlib.Path(o) - for o in pr34_tool['runtime_preload'] + for o in check_list(pr34_tool['runtime_preload'], str) + ] + + if 'third_party_roots' in pr34_tool: + res.third_party_roots = [ + o + # pathlib.Path(o) + for o in check_list(pr34_tool['third_party_roots'], str) ] if 'requirements' in pr34_tool: @@ -423,11 +433,20 @@ def env_bootstrap( # ]) uv_python_version: list[str] = [] + venv_python_version: list[str] = [] if not bootstrap_settings.python_version is None: uv_python_version.extend( + [ + # '-p', + '--python-version', + bootstrap_settings.python_version, + ] + ) + venv_python_version.extend( [ '-p', + # '--python-version', bootstrap_settings.python_version, ] ) @@ -462,7 +481,7 @@ def env_bootstrap( [ 'uv', 'venv', - *uv_python_version, + *venv_python_version, *pip_find_links_args, # '--seed', *bootstrap_settings.uv_args, @@ -477,8 +496,8 @@ def env_bootstrap( 'install', *uv_python_version, *pip_find_links_args, - # '-p', - # bootstrap_settings.python_path, + '-p', + bootstrap_settings.python_path, '--require-hashes', *bootstrap_settings.uv_args, '-r', diff --git a/python/online/fxreader/pr34/commands_typed/pip.py b/python/online/fxreader/pr34/commands_typed/pip.py index 543e1e2..c958fb9 100644 --- a/python/online/fxreader/pr34/commands_typed/pip.py +++ b/python/online/fxreader/pr34/commands_typed/pip.py @@ -43,7 +43,7 @@ logger = logging.getLogger(__name__) class pip_show_t: class res_t: class package_info_t: - pass + location: str def pip_show( diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.15-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.15-py3-none-any.whl new file mode 100644 index 0000000..fd46bc6 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.15-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:206847a151f9990f3765df0930dcfaef11e295e94336e2293c4ca6bb8e40bdfc +size 70941 diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.16-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.16-py3-none-any.whl new file mode 100644 index 0000000..1963866 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.16-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8132aac370f677eb45ea1a67a16a758438595ae78feb3cbe946f36ae95684c56 +size 70970 diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.17-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.17-py3-none-any.whl new file mode 100644 index 0000000..9258aa3 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.17-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9b546f6809d1d8a2bebd46491f678a42d20a5e85166b7cdfe4bcc37323e3ed1 +size 70969 From 4474e08e1006720ef0380fa344b0c9e22906c139 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Thu, 5 Jun 2025 18:34:13 +0300 Subject: [PATCH 20/28] [+] add default third_party_roots --- python/meson.build | 2 +- .../fxreader/pr34/commands_typed/cli.py | 25 ++++++++++++++++++- .../pr34/commands_typed/cli_bootstrap.py | 25 ++++++++++++++----- ...eader_pr34-0.1.5.17+27.18-py3-none-any.whl | 3 +++ 4 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.18-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index 07bb7c0..869c477 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.17', + version: '0.1.5.17+27.18', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index 82073d1..cbeb73d 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -561,7 +561,30 @@ class CLI(abc.ABC): self, project_name: Optional[str] = None, ) -> list[pathlib.Path]: - return [] + from . import cli_bootstrap + from .pip import pip_show + + res: list[pathlib.Path] = [] + + if not project_name is None: + pyproject = cli_bootstrap.pyproject_load(self.projects[project_name].source_dir / 'pyproject.toml') + + for third_party_root in pyproject.third_party_roots: + if third_party_root.package: + if not third_party_root.module_root: + third_party_root.module_root = third_party_root.package.replace('.', os.path.sep) + if not third_party_root.path: + packages = pip_show([third_party_root.package]) + assert len(packages) == 1 + third_party_root.path = str(pathlib.Path(packages[0].location) / third_party_root.module_root / 'lib') + else: + assert not third_party_root.package and not third_party_root.module_root and third_party_root.path + + res.append(pathlib.Path(third_party_root.path)) + + # res.append(self.projects[project_name].dest_dir / 'lib') + + return res class meson_toolchains_t: class res_t: diff --git a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py index 2ac1f1d..bbe275f 100644 --- a/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py +++ b/python/online/fxreader/pr34/commands_typed/cli_bootstrap.py @@ -68,7 +68,14 @@ class PyProject: pip_find_links: Optional[list[pathlib.Path]] = None runtime_libdirs: Optional[list[pathlib.Path]] = None runtime_preload: Optional[list[pathlib.Path]] = None - third_party_roots: list[str] = dataclasses.field( + + @dataclasses.dataclass + class ThirdPartyRoot: + package: Optional[str] = None + module_root: Optional[str] = None + path: Optional[str] = None + + third_party_roots: list[ThirdPartyRoot] = dataclasses.field( default_factory=lambda: [], ) requirements: dict[str, pathlib.Path] = dataclasses.field(default_factory=lambda: dict()) @@ -241,11 +248,17 @@ def pyproject_load( ] if 'third_party_roots' in pr34_tool: - res.third_party_roots = [ - o - # pathlib.Path(o) - for o in check_list(pr34_tool['third_party_roots'], str) - ] + for o in check_list(pr34_tool['third_party_roots']): + o2 = check_dict(o, str, str) + assert all([k in {'package', 'module_root', 'path'} for k in o2]) + + res.third_party_roots.append( + PyProject.ThirdPartyRoot( + package=o2.get('package'), + module_root=o2.get('module_root'), + path=o2.get('path'), + ) + ) if 'requirements' in pr34_tool: res.requirements = { diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.18-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.18-py3-none-any.whl new file mode 100644 index 0000000..738ad7c --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.18-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:346be68568fb26152695e9d2dda052867c6640a07f0be11ff8733b34ebdfa490 +size 71259 From fc1060163291f78c1eea13eb762c4ba16f970e71 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Fri, 6 Jun 2025 11:28:38 +0300 Subject: [PATCH 21/28] [+] improve shutil_rmtree --- python/meson.build | 2 +- python/online/fxreader/pr34/commands_typed/os.py | 5 ++++- .../whl/online_fxreader_pr34-0.1.5.17+27.19-py3-none-any.whl | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.19-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index 869c477..6480161 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.18', + version: '0.1.5.17+27.19', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/os.py b/python/online/fxreader/pr34/commands_typed/os.py index 961b51e..4dc2b9b 100644 --- a/python/online/fxreader/pr34/commands_typed/os.py +++ b/python/online/fxreader/pr34/commands_typed/os.py @@ -131,6 +131,9 @@ def shutil_rmtree( ) -> None: if preserve_top_path: for p in path.iterdir(): - shutil.rmtree(str(p)) + if p.is_dir(): + shutil.rmtree(str(p)) + else: + p.unlink() else: shutil.rmtree(str(path)) diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.19-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.19-py3-none-any.whl new file mode 100644 index 0000000..d699b61 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.19-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3aeb86574637f8f24d5480b1badb5e910cdda3393ea3f92a2d5f82c951aab058 +size 71278 From 62a21cc6a070378f513041c1827f14e12a7f052f Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Mon, 9 Jun 2025 17:58:09 +0300 Subject: [PATCH 22/28] [+] fix cross_file usage --- python/meson.build | 2 +- python/online/fxreader/pr34/commands_typed/cli.py | 6 +++--- .../online_fxreader_pr34-0.1.5.17+27.20-py3-none-any.whl | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.20-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index 6480161..9bec48a 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.19', + version: '0.1.5.17+27.20', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/cli.py b/python/online/fxreader/pr34/commands_typed/cli.py index cbeb73d..b5a664c 100644 --- a/python/online/fxreader/pr34/commands_typed/cli.py +++ b/python/online/fxreader/pr34/commands_typed/cli.py @@ -674,14 +674,14 @@ class CLI(abc.ABC): extra_args: list[str] = [] - if len(self.third_party_roots(project_name)) > 0: - extra_args.append('-Dthird_party_roots=%s' % json.dumps([str(o.absolute()) for o in self.third_party_roots(project_name)])) - extra_args = self._cross_file( extra_args=extra_args, pyproject_tool=pyproject_tool, ) + if len(self.third_party_roots(project_name)) > 0: + extra_args.append('-Dthird_party_roots=%s' % json.dumps([str(o.absolute()) for o in self.third_party_roots(project_name)])) + cmd = [ # shutil_which( # 'meson', diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.20-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.20-py3-none-any.whl new file mode 100644 index 0000000..c05dc3f --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.20-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b6d83c5a609b485fab52a8794cded389e9704ba53c790998d826c832da0ea7d +size 71278 From 3b90dbb347986e92e0feeb4bc7c26930590fd547 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Thu, 12 Jun 2025 15:28:37 +0300 Subject: [PATCH 23/28] [+] update wasm cross init --- meson/toolchains/wasm-cross-meson.ini | 1 + python/meson.build | 2 +- .../whl/online_fxreader_pr34-0.1.5.17+27.21-py3-none-any.whl | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.21-py3-none-any.whl diff --git a/meson/toolchains/wasm-cross-meson.ini b/meson/toolchains/wasm-cross-meson.ini index 45712c2..a41f8c1 100644 --- a/meson/toolchains/wasm-cross-meson.ini +++ b/meson/toolchains/wasm-cross-meson.ini @@ -5,6 +5,7 @@ ar = 'emar' windres = '/usr/bin/false' ; exe_wrapper = '/usr/bin/false' exe_wrapper = 'node' +pkg-config = 'pkg-config' [host_machine] system = 'linux' diff --git a/python/meson.build b/python/meson.build index 9bec48a..d7475c8 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.20', + version: '0.1.5.17+27.21', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.21-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.21-py3-none-any.whl new file mode 100644 index 0000000..852abcd --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.21-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d78e2db397e4727ff3e8adc393b5df02635dfdf495605d8ab1951919c938d212 +size 71291 From 91dbbde50da5b010206e68a3521e0e01b098dc0a Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Sat, 21 Jun 2025 13:59:09 +0300 Subject: [PATCH 24/28] [+] add type checking decorator 1. add pydantic based decorator, that checks typing for incoming arguments; 1.1. helps when some wrapping decorator uses *args, **kwargs, since pyright just ignores what happens after wards; --- python/meson.build | 2 +- .../fxreader/pr34/commands_typed/pydantic.py | 82 +++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 python/online/fxreader/pr34/commands_typed/pydantic.py diff --git a/python/meson.build b/python/meson.build index d7475c8..a62f4ed 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.21', + version: '0.1.5.17+27.22', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/python/online/fxreader/pr34/commands_typed/pydantic.py b/python/online/fxreader/pr34/commands_typed/pydantic.py new file mode 100644 index 0000000..57aae96 --- /dev/null +++ b/python/online/fxreader/pr34/commands_typed/pydantic.py @@ -0,0 +1,82 @@ +import pydantic +import inspect +import collections + +from typing import ( + TypeVar, Callable, Any, Optional, + Mapping, cast, +) + +P = TypeVar('P') +R = TypeVar('R') + +def validate_params( + view: Callable[..., R] +) -> Callable[..., R]: + import inspect + + class Parameter: + kind: Any + annotation: Any + + parameters = cast( + Mapping[str, Parameter], + inspect.signature(view).parameters + ) + + positional_parameters: collections.OrderedDict[str, type[Any]] = \ + collections.OrderedDict(( + (k, v.annotation) + for k, v in parameters.items() + if v.kind in ( + inspect.Parameter.POSITIONAL_ONLY, + inspect.Parameter.POSITIONAL_OR_KEYWORD, + ) + )) + positional_names = list(positional_parameters) + + model = pydantic.create_model( + getattr(view, '__name__'), + **{ + k : v.annotation + for k, v in parameters.items() + if v.kind in ( + inspect.Parameter.POSITIONAL_OR_KEYWORD, + inspect.Parameter.POSITIONAL_ONLY, + inspect.Parameter.KEYWORD_ONLY, + ) + }, + __config__=pydantic.ConfigDict( + arbitrary_types_allowed=True, + ) + ) + + def wrapper(*args: Any, **kwargs: Any) -> R: + #data = model.model_validate( + + kwargs_to_check : dict[str, Any] = { + k : v + for k, v in kwargs.items() + } + + for i, o in enumerate(args): + k = positional_names[i] + + parameter = positional_parameters[k] + + assert not k in kwargs_to_check + + kwargs_to_check[k] = o + + model.model_validate( + kwargs_to_check, + ) + #).dict() + + return view( + #**data, + *args, + **kwargs, + ) + + return wrapper From 1e73d19122d1f773e88a2f7fab3396ea9bd8c985 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Sat, 21 Jun 2025 14:05:31 +0300 Subject: [PATCH 25/28] [+] release .whl, fix ruff --- .../fxreader/pr34/commands_typed/pydantic.py | 116 +++++++++--------- ...eader_pr34-0.1.5.17+27.22-py3-none-any.whl | 3 + 2 files changed, 60 insertions(+), 59 deletions(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.22-py3-none-any.whl diff --git a/python/online/fxreader/pr34/commands_typed/pydantic.py b/python/online/fxreader/pr34/commands_typed/pydantic.py index 57aae96..07e1d79 100644 --- a/python/online/fxreader/pr34/commands_typed/pydantic.py +++ b/python/online/fxreader/pr34/commands_typed/pydantic.py @@ -3,80 +3,78 @@ import inspect import collections from typing import ( - TypeVar, Callable, Any, Optional, - Mapping, cast, + TypeVar, + Callable, + Any, + Optional, + Mapping, + cast, ) P = TypeVar('P') R = TypeVar('R') -def validate_params( - view: Callable[..., R] -) -> Callable[..., R]: - import inspect - class Parameter: - kind: Any - annotation: Any +def validate_params(view: Callable[..., R]) -> Callable[..., R]: + class Parameter: + kind: Any + annotation: Any - parameters = cast( - Mapping[str, Parameter], - inspect.signature(view).parameters - ) + parameters = cast(Mapping[str, Parameter], inspect.signature(view).parameters) - positional_parameters: collections.OrderedDict[str, type[Any]] = \ - collections.OrderedDict(( - (k, v.annotation) - for k, v in parameters.items() - if v.kind in ( - inspect.Parameter.POSITIONAL_ONLY, - inspect.Parameter.POSITIONAL_OR_KEYWORD, - ) - )) - positional_names = list(positional_parameters) + positional_parameters: collections.OrderedDict[str, type[Any]] = collections.OrderedDict( + ( + (k, v.annotation) + for k, v in parameters.items() + if v.kind + in ( + inspect.Parameter.POSITIONAL_ONLY, + inspect.Parameter.POSITIONAL_OR_KEYWORD, + ) + ) + ) + positional_names = list(positional_parameters) - model = pydantic.create_model( - getattr(view, '__name__'), - **{ - k : v.annotation - for k, v in parameters.items() - if v.kind in ( - inspect.Parameter.POSITIONAL_OR_KEYWORD, - inspect.Parameter.POSITIONAL_ONLY, - inspect.Parameter.KEYWORD_ONLY, - ) - }, - __config__=pydantic.ConfigDict( - arbitrary_types_allowed=True, - ) - ) + model = pydantic.create_model( + getattr(view, '__name__'), + **{ + k: v.annotation + for k, v in parameters.items() + if v.kind + in ( + inspect.Parameter.POSITIONAL_OR_KEYWORD, + inspect.Parameter.POSITIONAL_ONLY, + inspect.Parameter.KEYWORD_ONLY, + ) + }, + __config__=pydantic.ConfigDict( + arbitrary_types_allowed=True, + ), + ) - def wrapper(*args: Any, **kwargs: Any) -> R: - #data = model.model_validate( + def wrapper(*args: Any, **kwargs: Any) -> R: + # data = model.model_validate( - kwargs_to_check : dict[str, Any] = { - k : v - for k, v in kwargs.items() - } + kwargs_to_check: dict[str, Any] = {k: v for k, v in kwargs.items()} - for i, o in enumerate(args): - k = positional_names[i] + for i, o in enumerate(args): + k = positional_names[i] - parameter = positional_parameters[k] + parameter = positional_parameters[k] - assert not k in kwargs_to_check + assert not k in kwargs_to_check - kwargs_to_check[k] = o + kwargs_to_check[k] = o - model.model_validate( - kwargs_to_check, - ) - #).dict() + model.model_validate( + kwargs_to_check, + ) + # ).dict() - return view( - #**data, - *args, - **kwargs, - ) + return view( + # **data, + *args, + **kwargs, + ) - return wrapper + return wrapper diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.22-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.22-py3-none-any.whl new file mode 100644 index 0000000..6c0d0ae --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.22-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7115d63c505ae60203985e05b69175e5c6a7df460eacfae276dad8d5dd6d46e +size 72131 From bc7ecd5d40da3cb8fb48a937d2303923dce2d760 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Tue, 1 Jul 2025 15:24:10 +0300 Subject: [PATCH 26/28] [+] partially add check_generic --- .../online/fxreader/pr34/commands_typed/typing.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/python/online/fxreader/pr34/commands_typed/typing.py b/python/online/fxreader/pr34/commands_typed/typing.py index 66011df..0ca727e 100644 --- a/python/online/fxreader/pr34/commands_typed/typing.py +++ b/python/online/fxreader/pr34/commands_typed/typing.py @@ -2,7 +2,7 @@ # https://gitea.fxreader.online/fxreader.online/freelance-project-34-marketing-blog/issues/2#issue-25 import typing -from typing import Any +from typing import Any, TypeVar, Optional, Iterable, Sequence from typing_extensions import Protocol from abc import abstractmethod @@ -26,3 +26,15 @@ class Comparable(Protocol): def __ge__(self: C, other: C) -> bool: return not self < other + +T = TypeVar('T', bound='Iterable[Any] | Sequence[Any]') + +def check_generic( + o: Any, + t: type[T] +) -> T: + res = cast(T[Any], o) + + assert isinstance(o, t) + + return res From 8bfce9c4f68a336e6184cb850d3e78a8e3d53ba3 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Tue, 1 Jul 2025 16:24:08 +0300 Subject: [PATCH 27/28] [+] improve check_generic, release .whl --- python/online/fxreader/pr34/commands_typed/typing.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/python/online/fxreader/pr34/commands_typed/typing.py b/python/online/fxreader/pr34/commands_typed/typing.py index 0ca727e..27204b7 100644 --- a/python/online/fxreader/pr34/commands_typed/typing.py +++ b/python/online/fxreader/pr34/commands_typed/typing.py @@ -2,7 +2,7 @@ # https://gitea.fxreader.online/fxreader.online/freelance-project-34-marketing-blog/issues/2#issue-25 import typing -from typing import Any, TypeVar, Optional, Iterable, Sequence +from typing import Any, TypeVar, Optional, Iterable, Sequence, cast from typing_extensions import Protocol from abc import abstractmethod @@ -27,13 +27,12 @@ class Comparable(Protocol): def __ge__(self: C, other: C) -> bool: return not self < other + T = TypeVar('T', bound='Iterable[Any] | Sequence[Any]') -def check_generic( - o: Any, - t: type[T] -) -> T: - res = cast(T[Any], o) + +def check_generic(o: Any, t: type[T]) -> T: + res = cast(T, o) assert isinstance(o, t) From 88e9e9c17fddfca34f54d034a0a0496545ec9e65 Mon Sep 17 00:00:00 2001 From: Siarhei Siniak Date: Tue, 1 Jul 2025 16:27:27 +0300 Subject: [PATCH 28/28] [+] rename version before merging --- python/meson.build | 2 +- .../whl/online_fxreader_pr34-0.1.5.17+27.23-py3-none-any.whl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 releases/whl/online_fxreader_pr34-0.1.5.17+27.23-py3-none-any.whl diff --git a/python/meson.build b/python/meson.build index a62f4ed..0c7aaa4 100644 --- a/python/meson.build +++ b/python/meson.build @@ -5,7 +5,7 @@ project( ).stdout().strip('\n'), # 'online.fxreader.uv', # ['c', 'cpp'], - version: '0.1.5.17+27.22', + version: '0.1.5.17+27.23', # default_options: [ # 'cpp_std=c++23', # # 'prefer_static=true', diff --git a/releases/whl/online_fxreader_pr34-0.1.5.17+27.23-py3-none-any.whl b/releases/whl/online_fxreader_pr34-0.1.5.17+27.23-py3-none-any.whl new file mode 100644 index 0000000..c6e50e5 --- /dev/null +++ b/releases/whl/online_fxreader_pr34-0.1.5.17+27.23-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cdfe829c265ebe121c1e7e233fb6cc1937c53d36227a7736857ac9e1bcec6e27 +size 71413