Bug 1877537 - Update tomlkit to 0.12.3 and mozci to 2.4.0 r=jmaher,mach-reviewers,ahal

Differential Revision: https://phabricator.services.mozilla.com/D200114
This commit is contained in:
Tom Marble 2024-01-31 18:57:03 +00:00
parent 0ea5f38c77
commit 3195b64292
24 changed files with 421 additions and 204 deletions

View file

@ -3,3 +3,4 @@
# which can be used by python-test's "requirements" feature.
poetry==1.4
poetry-core==1.5.1
tomlkit==0.12.3

View file

@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.9
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --generate-hashes --output-file=python/mozbuild/mozbuild/test/vendor_requirements.txt python/mozbuild/mozbuild/test/vendor_requirements.in
@ -19,11 +19,67 @@ build==0.10.0 \
cachecontrol[filecache]==0.12.10 \
--hash=sha256:b0d43d8f71948ef5ebdee5fe236b86c6ffc7799370453dccb0e894c20dfa487c \
--hash=sha256:d8aca75b82eec92d84b5d6eb8c8f66ea16f09d2adb09dbca27fe2d5fc8d3732d
# via poetry
# via
# cachecontrol
# poetry
certifi==2021.10.8 \
--hash=sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872 \
--hash=sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569
# via requests
cffi==1.16.0 \
--hash=sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc \
--hash=sha256:131fd094d1065b19540c3d72594260f118b231090295d8c34e19a7bbcf2e860a \
--hash=sha256:1b8ebc27c014c59692bb2664c7d13ce7a6e9a629be20e54e7271fa696ff2b417 \
--hash=sha256:2c56b361916f390cd758a57f2e16233eb4f64bcbeee88a4881ea90fca14dc6ab \
--hash=sha256:2d92b25dbf6cae33f65005baf472d2c245c050b1ce709cc4588cdcdd5495b520 \
--hash=sha256:31d13b0f99e0836b7ff893d37af07366ebc90b678b6664c955b54561fc36ef36 \
--hash=sha256:32c68ef735dbe5857c810328cb2481e24722a59a2003018885514d4c09af9743 \
--hash=sha256:3686dffb02459559c74dd3d81748269ffb0eb027c39a6fc99502de37d501faa8 \
--hash=sha256:582215a0e9adbe0e379761260553ba11c58943e4bbe9c36430c4ca6ac74b15ed \
--hash=sha256:5b50bf3f55561dac5438f8e70bfcdfd74543fd60df5fa5f62d94e5867deca684 \
--hash=sha256:5bf44d66cdf9e893637896c7faa22298baebcd18d1ddb6d2626a6e39793a1d56 \
--hash=sha256:6602bc8dc6f3a9e02b6c22c4fc1e47aa50f8f8e6d3f78a5e16ac33ef5fefa324 \
--hash=sha256:673739cb539f8cdaa07d92d02efa93c9ccf87e345b9a0b556e3ecc666718468d \
--hash=sha256:68678abf380b42ce21a5f2abde8efee05c114c2fdb2e9eef2efdb0257fba1235 \
--hash=sha256:68e7c44931cc171c54ccb702482e9fc723192e88d25a0e133edd7aff8fcd1f6e \
--hash=sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088 \
--hash=sha256:748dcd1e3d3d7cd5443ef03ce8685043294ad6bd7c02a38d1bd367cfd968e000 \
--hash=sha256:7651c50c8c5ef7bdb41108b7b8c5a83013bfaa8a935590c5d74627c047a583c7 \
--hash=sha256:7b78010e7b97fef4bee1e896df8a4bbb6712b7f05b7ef630f9d1da00f6444d2e \
--hash=sha256:7e61e3e4fa664a8588aa25c883eab612a188c725755afff6289454d6362b9673 \
--hash=sha256:80876338e19c951fdfed6198e70bc88f1c9758b94578d5a7c4c91a87af3cf31c \
--hash=sha256:8895613bcc094d4a1b2dbe179d88d7fb4a15cee43c052e8885783fac397d91fe \
--hash=sha256:88e2b3c14bdb32e440be531ade29d3c50a1a59cd4e51b1dd8b0865c54ea5d2e2 \
--hash=sha256:8f8e709127c6c77446a8c0a8c8bf3c8ee706a06cd44b1e827c3e6a2ee6b8c098 \
--hash=sha256:9cb4a35b3642fc5c005a6755a5d17c6c8b6bcb6981baf81cea8bfbc8903e8ba8 \
--hash=sha256:9f90389693731ff1f659e55c7d1640e2ec43ff725cc61b04b2f9c6d8d017df6a \
--hash=sha256:a09582f178759ee8128d9270cd1344154fd473bb77d94ce0aeb2a93ebf0feaf0 \
--hash=sha256:a6a14b17d7e17fa0d207ac08642c8820f84f25ce17a442fd15e27ea18d67c59b \
--hash=sha256:a72e8961a86d19bdb45851d8f1f08b041ea37d2bd8d4fd19903bc3083d80c896 \
--hash=sha256:abd808f9c129ba2beda4cfc53bde801e5bcf9d6e0f22f095e45327c038bfe68e \
--hash=sha256:ac0f5edd2360eea2f1daa9e26a41db02dd4b0451b48f7c318e217ee092a213e9 \
--hash=sha256:b29ebffcf550f9da55bec9e02ad430c992a87e5f512cd63388abb76f1036d8d2 \
--hash=sha256:b2ca4e77f9f47c55c194982e10f058db063937845bb2b7a86c84a6cfe0aefa8b \
--hash=sha256:b7be2d771cdba2942e13215c4e340bfd76398e9227ad10402a8767ab1865d2e6 \
--hash=sha256:b84834d0cf97e7d27dd5b7f3aca7b6e9263c56308ab9dc8aae9784abb774d404 \
--hash=sha256:b86851a328eedc692acf81fb05444bdf1891747c25af7529e39ddafaf68a4f3f \
--hash=sha256:bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0 \
--hash=sha256:c0f31130ebc2d37cdd8e44605fb5fa7ad59049298b3f745c74fa74c62fbfcfc4 \
--hash=sha256:c6a164aa47843fb1b01e941d385aab7215563bb8816d80ff3a363a9f8448a8dc \
--hash=sha256:d8a9d3ebe49f084ad71f9269834ceccbf398253c9fac910c4fd7053ff1386936 \
--hash=sha256:db8e577c19c0fda0beb7e0d4e09e0ba74b1e4c092e0e40bfa12fe05b6f6d75ba \
--hash=sha256:dc9b18bf40cc75f66f40a7379f6a9513244fe33c0e8aa72e2d56b0196a7ef872 \
--hash=sha256:e09f3ff613345df5e8c3667da1d918f9149bd623cd9070c983c013792a9a62eb \
--hash=sha256:e4108df7fe9b707191e55f33efbcb2d81928e10cea45527879a4749cbe472614 \
--hash=sha256:e6024675e67af929088fda399b2094574609396b1decb609c55fa58b028a32a1 \
--hash=sha256:e70f54f1796669ef691ca07d046cd81a29cb4deb1e5f942003f401c0c4a2695d \
--hash=sha256:e715596e683d2ce000574bae5d07bd522c781a822866c20495e52520564f0969 \
--hash=sha256:e760191dd42581e023a68b758769e2da259b5d52e3103c6060ddc02c9edb8d7b \
--hash=sha256:ed86a35631f7bfbb28e108dd96773b9d5a6ce4811cf6ea468bb6a359b256b1e4 \
--hash=sha256:ee07e47c12890ef248766a6e55bd38ebfb2bb8edd4142d56db91b21ea68b7627 \
--hash=sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956 \
--hash=sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357
# via cryptography
charset-normalizer==2.0.12 \
--hash=sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597 \
--hash=sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df
@ -32,16 +88,46 @@ cleo==2.0.1 \
--hash=sha256:6eb133670a3ed1f3b052d53789017b6e50fca66d1287e6e6696285f4cb8ea448 \
--hash=sha256:eb4b2e1f3063c11085cebe489a6e9124163c226575a3c3be69b2e51af4a15ec5
# via poetry
colorama==0.4.6 \
--hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \
--hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6
# via build
crashtest==0.4.1 \
--hash=sha256:80d7b1f316ebfbd429f648076d6275c877ba30ba48979de4191714a75266f0ce \
--hash=sha256:8d23eac5fa660409f57472e3851dab7ac18aba459a8d19cbbba86d3d5aecd2a5
# via
# cleo
# poetry
cryptography==42.0.2 \
--hash=sha256:087887e55e0b9c8724cf05361357875adb5c20dec27e5816b653492980d20380 \
--hash=sha256:09a77e5b2e8ca732a19a90c5bca2d124621a1edb5438c5daa2d2738bfeb02589 \
--hash=sha256:130c0f77022b2b9c99d8cebcdd834d81705f61c68e91ddd614ce74c657f8b3ea \
--hash=sha256:141e2aa5ba100d3788c0ad7919b288f89d1fe015878b9659b307c9ef867d3a65 \
--hash=sha256:28cb2c41f131a5758d6ba6a0504150d644054fd9f3203a1e8e8d7ac3aea7f73a \
--hash=sha256:2f9f14185962e6a04ab32d1abe34eae8a9001569ee4edb64d2304bf0d65c53f3 \
--hash=sha256:320948ab49883557a256eab46149df79435a22d2fefd6a66fe6946f1b9d9d008 \
--hash=sha256:36d4b7c4be6411f58f60d9ce555a73df8406d484ba12a63549c88bd64f7967f1 \
--hash=sha256:3b15c678f27d66d247132cbf13df2f75255627bcc9b6a570f7d2fd08e8c081d2 \
--hash=sha256:3dbd37e14ce795b4af61b89b037d4bc157f2cb23e676fa16932185a04dfbf635 \
--hash=sha256:4383b47f45b14459cab66048d384614019965ba6c1a1a141f11b5a551cace1b2 \
--hash=sha256:44c95c0e96b3cb628e8452ec060413a49002a247b2b9938989e23a2c8291fc90 \
--hash=sha256:4b063d3413f853e056161eb0c7724822a9740ad3caa24b8424d776cebf98e7ee \
--hash=sha256:52ed9ebf8ac602385126c9a2fe951db36f2cb0c2538d22971487f89d0de4065a \
--hash=sha256:55d1580e2d7e17f45d19d3b12098e352f3a37fe86d380bf45846ef257054b242 \
--hash=sha256:5ef9bc3d046ce83c4bbf4c25e1e0547b9c441c01d30922d812e887dc5f125c12 \
--hash=sha256:5fa82a26f92871eca593b53359c12ad7949772462f887c35edaf36f87953c0e2 \
--hash=sha256:61321672b3ac7aade25c40449ccedbc6db72c7f5f0fdf34def5e2f8b51ca530d \
--hash=sha256:701171f825dcab90969596ce2af253143b93b08f1a716d4b2a9d2db5084ef7be \
--hash=sha256:841ec8af7a8491ac76ec5a9522226e287187a3107e12b7d686ad354bb78facee \
--hash=sha256:8a06641fb07d4e8f6c7dda4fc3f8871d327803ab6542e33831c7ccfdcb4d0ad6 \
--hash=sha256:8e88bb9eafbf6a4014d55fb222e7360eef53e613215085e65a13290577394529 \
--hash=sha256:a00aee5d1b6c20620161984f8ab2ab69134466c51f58c052c11b076715e72929 \
--hash=sha256:a047682d324ba56e61b7ea7c7299d51e61fd3bca7dad2ccc39b72bd0118d60a1 \
--hash=sha256:a7ef8dd0bf2e1d0a27042b231a3baac6883cdd5557036f5e8df7139255feaac6 \
--hash=sha256:ad28cff53f60d99a928dfcf1e861e0b2ceb2bc1f08a074fdd601b314e1cc9e0a \
--hash=sha256:b9097a208875fc7bbeb1286d0125d90bdfed961f61f214d3f5be62cd4ed8a446 \
--hash=sha256:b97fe7d7991c25e6a31e5d5e795986b18fbbb3107b873d5f3ae6dc9a103278e9 \
--hash=sha256:e0ec52ba3c7f1b7d813cd52649a5b3ef1fc0d433219dc8c93827c57eab6cf888 \
--hash=sha256:ea2c3ffb662fec8bbbfce5602e2c159ff097a4631d96235fcf0fb00e59e3ece4 \
--hash=sha256:fa3dec4ba8fb6e662770b74f62f1a0c7d4e37e25b58b2bf2c1be4c95372b4a33 \
--hash=sha256:fbeb725c9dc799a574518109336acccaf1303c30d45c075c665c0793c2f79a7f
# via secretstorage
distlib==0.3.4 \
--hash=sha256:6564fe0a8f51e734df6333d08b8b94d4ea8ee6b99b5ed50613f731fd4089f34b \
--hash=sha256:e4b58818180336dc9c529bfb9a0b58728ffc09ad92027a3f30b7cd91e3458579
@ -121,9 +207,7 @@ idna==3.3 \
importlib-metadata==6.1.0 \
--hash=sha256:43ce9281e097583d758c2c708c4376371261a02c34682491a8e98352365aad20 \
--hash=sha256:ff80f3b5394912eb1b108fcfd444dc78b7f1f3e16b16188054bd01cb9cb86f09
# via
# keyring
# poetry
# via keyring
installer==0.6.0 \
--hash=sha256:ae7c62d1d6158b5c096419102ad0d01fdccebf857e784cee57f94165635fe038 \
--hash=sha256:f3bd36cd261b440a88a1190b1becca0578fee90b4b62decc796932fdd5ae8839
@ -132,6 +216,12 @@ jaraco-classes==3.2.3 \
--hash=sha256:2353de3288bc6b82120752201c6b1c1a14b058267fa424ed5ce5984e3b922158 \
--hash=sha256:89559fa5c1d3c34eff6f631ad80bb21f378dbcbb35dd161fd2c6b93f5be2f98a
# via keyring
jeepney==0.8.0 \
--hash=sha256:5efe48d255973902f6badc3ce55e2aa6c5c3b3bc642059ef3a91247bcfcc5806 \
--hash=sha256:c0a454ad016ca575060802ee4d590dd912e35c122fa04e70306de3d076cce755
# via
# keyring
# secretstorage
jsonschema==4.17.3 \
--hash=sha256:0f864437ab8b6076ba6707453ef8f98a6a0d512a80e93f8abdb676f737ecb60d \
--hash=sha256:a870ad254da1a8ca84b6a2905cac29d265f805acc57af304784962a2aa6508f6
@ -225,6 +315,10 @@ ptyprocess==0.7.0 \
--hash=sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35 \
--hash=sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220
# via pexpect
pycparser==2.21 \
--hash=sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9 \
--hash=sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206
# via cffi
pyparsing==3.0.8 \
--hash=sha256:7bf433498c016c4314268d95df76c81b842a4cb2b276fa3312cfb1e1d85f6954 \
--hash=sha256:ef7b523f6356f763771559412c0d7134753f037822dad1b16945b7b846f7ad06
@ -264,10 +358,6 @@ pyrsistent==0.19.3 \
--hash=sha256:f0774bf48631f3a20471dd7c5989657b639fd2d285b861237ea9e82c36a415a9 \
--hash=sha256:f0e7c4b2f77593871e918be000b96c8107da48444d57005b6a6bc61fb4331b2c
# via jsonschema
pywin32-ctypes==0.2.0 \
--hash=sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942 \
--hash=sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98
# via keyring
rapidfuzz==2.13.7 \
--hash=sha256:020858dd89b60ce38811cd6e37875c4c3c8d7fcd8bc20a0ad2ed1f464b34dc4e \
--hash=sha256:042644133244bfa7b20de635d500eb9f46af7097f3d90b1724f94866f17cb55e \
@ -370,6 +460,10 @@ requests-toolbelt==0.9.1 \
--hash=sha256:380606e1d10dc85c3bd47bf5a6095f815ec007be7a8b69c878507068df059e6f \
--hash=sha256:968089d4584ad4ad7c171454f0a5c6dac23971e9472521ea3b6d49d610aa6fc0
# via poetry
secretstorage==3.3.3 \
--hash=sha256:2403533ef369eca6d2ba81718576c5e0f564d5cca1b58f73a8b23e7d4eeebd77 \
--hash=sha256:f356e6628222568e3af06f2eba8df495efa13b3b63081dafd4f7d9a7b7bc9f99
# via keyring
shellingham==1.5.0.post1 \
--hash=sha256:368bf8c00754fd4f55afb7bbb86e272df77e4dc76ac29dbcbb81a59e9fc15744 \
--hash=sha256:823bc5fb5c34d60f285b624e7264f4dda254bc803a3774a147bf99c0e3004a28
@ -387,10 +481,12 @@ tomli==2.0.1 \
# build
# poetry
# pyproject-hooks
tomlkit==0.11.6 \
--hash=sha256:07de26b0d8cfc18f871aec595fda24d95b08fef89d147caa861939f37230bf4b \
--hash=sha256:71b952e5721688937fb02cf9d354dbcf0785066149d2855e44531ebdd2b65d73
# via poetry
tomlkit==0.12.3 \
--hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \
--hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba
# via
# -r python/mozbuild/mozbuild/test/vendor_requirements.in
# poetry
trove-classifiers==2023.3.9 \
--hash=sha256:06fd10c95d285e7ddebd59e6a4ba299f03d7417d38d369248a4a40c9754a68fa \
--hash=sha256:ee42f2f8c1d4bcfe35f746e472f07633570d485fab45407effc0379270a3bb03

View file

@ -1,4 +1,4 @@
pypi:mozci==2.3.4
pypi:mozci==2.4.0
pypi:python-bugzilla==3.2.0
vendored:third_party/python/PyYAML/lib/
vendored:third_party/python/requests

View file

@ -30,4 +30,4 @@ requests==2.22.0; sys_platform != 'darwin'
pyyaml==5.1.2; sys_platform != 'darwin'
structlog==15.2.0; sys_platform != 'darwin'
toml==0.10.2
tomlkit==0.11.8
tomlkit==0.12.3

View file

@ -5,12 +5,12 @@
from setuptools import setup
PACKAGE_NAME = "manifestparser"
PACKAGE_VERSION = "2.3.0"
PACKAGE_VERSION = "2.4.0"
DEPS = [
"mozlog >= 6.0",
"toml >= 0.10.2",
"tomlkit >= 0.11.8",
"tomlkit >= 0.12.3",
]
setup(
name=PACKAGE_NAME,

View file

@ -19,7 +19,7 @@ pyflakes==0.6.1
pylint==0.27.0
simplejson==2.1.1
toml==0.10.2
tomlkit==0.11.8
tomlkit==0.12.3
unittest2==0.5.1
virtualenv==1.5.1
wsgiref==0.1.2

View file

@ -1,2 +1,2 @@
mozci==2.3.4
mozci==2.4.0
python-bugzilla==3.2.0

View file

@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --generate-hashes --output-file=python/sites/manifest.txt python/sites/manifest.in
# pip-compile --generate-hashes --output-file=testing/test/test_skipfails.txt testing/test/test_skipfails.in
#
aiohttp==3.8.6 \
--hash=sha256:002f23e6ea8d3dd8d149e569fd580c999232b5fbc601c48d55398fbc2e582e8c \
@ -403,10 +403,10 @@ mohawk==1.1.0 \
--hash=sha256:3ed296a30453d0b724679e0fd41e4e940497f8e461a9a9c3b7f36e43bab0fa09 \
--hash=sha256:d2a0e3ab10a209cc79e95e28f2dd54bd4a73fd1998ffe27b7ba0f962b6be9723
# via taskcluster
mozci==2.3.4 \
--hash=sha256:969be6bc20d3f6853b9c0c418608a82ab332d92832e6a966ebad658fe00388c3 \
--hash=sha256:fa05edd518f9f93822a4a27cdc1e8bbb8cde31b51892d40ba80c96de65ad3611
# via -r python/sites/manifest.in
mozci==2.4.0 \
--hash=sha256:1302ce8b08f53e608b654e54313b1f36f978dafad9a913a58a3331139b2d9225 \
--hash=sha256:b1ee163b31e1696bee7f2b203f508fcd4a3869c1158969615f9bdab2e1a57a9b
# via -r testing/test/test_skipfails.in
multidict==6.0.4 \
--hash=sha256:01a3a55bd90018c9c080fbb0b9f4891db37d148a0a18722b42f94694f8b6d4c9 \
--hash=sha256:0b1a97283e0c85772d613878028fec909f003993e1007eafa715b24b377cb9b8 \
@ -495,7 +495,7 @@ pyflakes==2.4.0 \
# via flake8
python-bugzilla==3.2.0 \
--hash=sha256:4efc8cfa297837c9e4eab220e197176715bd61ee33cec2c1b0f2790f07860387
# via -r python/sites/manifest.in
# via -r testing/test/test_skipfails.in
python-dateutil==2.8.2 \
--hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \
--hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9

19
third_party/python/poetry.lock generated vendored
View file

@ -1129,7 +1129,6 @@ files = [
{file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938"},
{file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d"},
{file = "PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba336e390cd8e4d1739f42dfe9bb83a3cc2e80f567d8805e11b46f4a943f5515"},
{file = "PyYAML-6.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290"},
{file = "PyYAML-6.0.1-cp310-cp310-win32.whl", hash = "sha256:bd4af7373a854424dabd882decdc5579653d7868b8fb26dc7d0e99f823aa5924"},
{file = "PyYAML-6.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:fd1592b3fdf65fff2ad0004b5e363300ef59ced41c2e6b3a99d4089fa8c5435d"},
{file = "PyYAML-6.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007"},
@ -1137,16 +1136,8 @@ files = [
{file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d"},
{file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc"},
{file = "PyYAML-6.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673"},
{file = "PyYAML-6.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b"},
{file = "PyYAML-6.0.1-cp311-cp311-win32.whl", hash = "sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741"},
{file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"},
{file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"},
{file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"},
{file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"},
{file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"},
{file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"},
{file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"},
{file = "PyYAML-6.0.1-cp312-cp312-win_amd64.whl", hash = "sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df"},
{file = "PyYAML-6.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47"},
{file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98"},
{file = "PyYAML-6.0.1-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c"},
@ -1163,7 +1154,6 @@ files = [
{file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5"},
{file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696"},
{file = "PyYAML-6.0.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735"},
{file = "PyYAML-6.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6"},
{file = "PyYAML-6.0.1-cp38-cp38-win32.whl", hash = "sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206"},
{file = "PyYAML-6.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62"},
{file = "PyYAML-6.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8"},
@ -1171,7 +1161,6 @@ files = [
{file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5773183b6446b2c99bb77e77595dd486303b4faab2b086e7b17bc6bef28865f6"},
{file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b786eecbdf8499b9ca1d697215862083bd6d2a99965554781d0d8d1ad31e13a0"},
{file = "PyYAML-6.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bc1bf2925a1ecd43da378f4db9e4f799775d6367bdb94671027b73b393a7c42c"},
{file = "PyYAML-6.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5"},
{file = "PyYAML-6.0.1-cp39-cp39-win32.whl", hash = "sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c"},
{file = "PyYAML-6.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486"},
{file = "PyYAML-6.0.1.tar.gz", hash = "sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43"},
@ -1421,14 +1410,14 @@ files = [
[[package]]
name = "tomlkit"
version = "0.11.8"
version = "0.12.3"
description = "Style preserving TOML library"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
{file = "tomlkit-0.11.8-py3-none-any.whl", hash = "sha256:8c726c4c202bdb148667835f68d68780b9a003a9ec34167b6c673b38eff2a171"},
{file = "tomlkit-0.11.8.tar.gz", hash = "sha256:9330fc7faa1db67b541b28e62018c17d20be733177d290a13b24c62d1614e0c3"},
{file = "tomlkit-0.12.3-py3-none-any.whl", hash = "sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba"},
{file = "tomlkit-0.12.3.tar.gz", hash = "sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4"},
]
[[package]]
@ -1606,4 +1595,4 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=4.6)", "pytest-black (
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
content-hash = "8f6e38dcef9aba9437efbfb39d7cce3b0bb2d1ca42fae2aafe56ab86e2ae3084"
content-hash = "65677d1751349ca40ddb3353b87d30a37a396424a743bd48e376de46c32c3687"

View file

@ -55,7 +55,7 @@ taskcluster==44.2.2
taskcluster-taskgraph==6.3.0
taskcluster-urls==13.0.1
toml==0.10.2
tomlkit==0.11.8
tomlkit==0.12.3
tqdm==4.62.3
urllib3==1.26.17
voluptuous==0.12.1

View file

@ -460,9 +460,7 @@ python-slugify==8.0.1 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:70ca6ea68fe63ecc8fa4fcf00ae651fc8a5d02d93dcd12ae6d4fc7ca46c4d395 \
--hash=sha256:ce0d46ddb668b3be82f4ed5e503dbc33dd815d83e2eb6824211310d3fb172a27
pyyaml==6.0.1 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:04ac92ad1925b2cff1db0cfebffb6ffc43457495c9b3c39d3fcae417d7125dc5 \
--hash=sha256:062582fca9fabdd2c8b54a3ef1c978d786e0f6b3a1510e0ac93ef59e0ddae2bc \
--hash=sha256:0d3304d8c0adc42be59c5f8a4d9e3d7379e6955ad754aa9d6ab7a398b59dd1df \
--hash=sha256:1635fd110e8d85d55237ab316b5b011de701ea0f29d07611174a1b42f1444741 \
--hash=sha256:184c5108a2aca3c5b3d3bf9395d50893a7ab82a38004c8f61c258d4428e80206 \
--hash=sha256:18aeb1bf9a78867dc38b259769503436b7c72f7a1f1f4c93ff9a17de54319b27 \
@ -470,10 +468,7 @@ pyyaml==6.0.1 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:1e2722cc9fbb45d9b87631ac70924c11d3a401b2d7f410cc0e3bbf249f2dca62 \
--hash=sha256:1fe35611261b29bd1de0070f0b2f47cb6ff71fa6595c077e42bd0c419fa27b98 \
--hash=sha256:28c119d996beec18c05208a8bd78cbe4007878c6dd15091efb73a30e90539696 \
--hash=sha256:326c013efe8048858a6d312ddd31d56e468118ad4cdeda36c719bf5bb6192290 \
--hash=sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9 \
--hash=sha256:42f8152b8dbc4fe7d96729ec2b99c7097d656dc1213a3229ca5383f973a5ed6d \
--hash=sha256:49a183be227561de579b4a36efbb21b3eab9651dd81b1858589f796549873dd6 \
--hash=sha256:4fb147e7a67ef577a588a0e2c17b6db51dda102c71de36f8549b6816a96e1867 \
--hash=sha256:50550eb667afee136e9a77d6dc71ae76a44df8b3e51e41b77f6de2932bfe0f47 \
--hash=sha256:510c9deebc5c0225e8c96813043e62b680ba2f9c50a08d3724c7f28a747d1486 \
@ -481,15 +476,11 @@ pyyaml==6.0.1 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:596106435fa6ad000c2991a98fa58eeb8656ef2325d7e158344fb33864ed87e3 \
--hash=sha256:6965a7bc3cf88e5a1c3bd2e0b5c22f8d677dc88a455344035f03399034eb3007 \
--hash=sha256:69b023b2b4daa7548bcfbd4aa3da05b3a74b772db9e23b982788168117739938 \
--hash=sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0 \
--hash=sha256:704219a11b772aea0d8ecd7058d0082713c3562b4e271b849ad7dc4a5c90c13c \
--hash=sha256:7e07cbde391ba96ab58e532ff4803f79c4129397514e1413a7dc761ccd755735 \
--hash=sha256:81e0b275a9ecc9c0c0c07b4b90ba548307583c125f54d5b6946cfee6360c733d \
--hash=sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28 \
--hash=sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4 \
--hash=sha256:9046c58c4395dff28dd494285c82ba00b546adfc7ef001486fbf0324bc174fba \
--hash=sha256:9eb6caa9a297fc2c2fb8862bc5370d0303ddba53ba97e71f08023b6cd73d16a8 \
--hash=sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef \
--hash=sha256:a0cd17c15d3bb3fa06978b4e8958dcdc6e0174ccea823003a106c7d4d7899ac5 \
--hash=sha256:afd7e57eddb1a54f0f1a974bc4391af8bcce0b444685d936840f125cf046d5bd \
--hash=sha256:b1275ad35a5d18c62a7220633c913e1b42d44b46ee12554e5fd39c70a243d6a3 \
@ -502,9 +493,7 @@ pyyaml==6.0.1 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:bfdf460b1736c775f2ba9f6a92bca30bc2095067b8a9d77876d1fad6cc3b4a43 \
--hash=sha256:c8098ddcc2a85b61647b2590f825f3db38891662cfc2fc776415143f599bb859 \
--hash=sha256:d2b04aac4d386b172d5b9692e2d2da8de7bfb6c387fa4f801fbf6fb2e6ba4673 \
--hash=sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54 \
--hash=sha256:d858aa552c999bc8a8d57426ed01e40bef403cd8ccdd0fc5f6f04a00414cac2a \
--hash=sha256:e7d73685e87afe9f3b36c799222440d6cf362062f78be1013661b00c5c6f678b \
--hash=sha256:f003ed9ad21d6a4713f0a9b5a7a0a79e08dd0f221aff4525a2be4c346ee60aab \
--hash=sha256:f22ac1c3cac4dbc50079e965eba2c1058622631e526bd9afd45fedd49ba781fa \
--hash=sha256:faca3bdcf85b2fc05d06ff3fbc1f83e1391b3e724afa3feba7d13eeab355484c \
@ -554,9 +543,9 @@ text-unidecode==1.3 ; python_version >= "3.8" and python_version < "4.0" \
toml==0.10.2 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b \
--hash=sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f
tomlkit==0.11.8 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:8c726c4c202bdb148667835f68d68780b9a003a9ec34167b6c673b38eff2a171 \
--hash=sha256:9330fc7faa1db67b541b28e62018c17d20be733177d290a13b24c62d1614e0c3
tomlkit==0.12.3 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:75baf5012d06501f07bee5bf8e801b9f343e7aac5a92581f20f80ce632e6b5a4 \
--hash=sha256:b0a645a9156dc7cb5d3a1f0d4bab66db287fcb8e0430bdd4664a095ea16414ba
tqdm==4.62.3 ; python_version >= "3.8" and python_version < "4.0" \
--hash=sha256:8dd278a422499cd6b727e6ae4061c40b48fce8b76d1ccbf5d34fca9b7f925b0c \
--hash=sha256:d359de7217506c9851b7869f3708d8ee53ed70a1b8edbba4dbcb47442592920d

View file

@ -1,17 +0,0 @@
tomlkit/__init__.py,sha256=_u6Tsd33N9hf-GhAhpqj6t0soNnTO5LP2uMdWwX9xG0,1148
tomlkit/_compat.py,sha256=gp7P7qNh0yY1dg0wyjiCDbVwFTdUo7p0QwjV4T3Funs,513
tomlkit/_utils.py,sha256=fX1n7boCi7_bBVBemaywk0eyxqhTYnZWPhCZHJgBZv8,4021
tomlkit/api.py,sha256=DnIdqzAyi5FpCcRBGzX7We0wqdBjCYihe0TaGR0YA4E,7065
tomlkit/container.py,sha256=nHeshsFne77La-LqOxMTKk9xyuF0-HrwfMlSwpgP7hs,28192
tomlkit/exceptions.py,sha256=TdeHy9e9yiXI8oSR-eCxqtQOWBlyFgn7tTjvpCWAqTw,5487
tomlkit/items.py,sha256=qQ0jyzSx0aplK6qdpIU-7jEGC5bHo4TMu6bPxnkY-Ts,51695
tomlkit/parser.py,sha256=cBuC9T3ZrvKVtwzK0PFEo5roJqru7A0cXMFhKlcb_LU,37839
tomlkit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
tomlkit/source.py,sha256=nwRrAUkJ2CyDDKFs4jo9o0RpNMNaNNoLDFiwo4ZNZTM,4823
tomlkit/toml_char.py,sha256=w3sQZ0dolZ1qjZ2Rxj_svvlpRNNGB_fjfBcYD0gFnDs,1291
tomlkit/toml_document.py,sha256=OCTkWXd3P58EZT4SD8_ddc1YpkMaqtlS5_stHTBmMOI,110
tomlkit/toml_file.py,sha256=4gVZvvs_Q1_soWaVxBo80rRzny849boXt2LzdMXQ04I,1599
tomlkit-0.11.8.dist-info/LICENSE,sha256=8vm0YLpxnaZiat0mTTeC8nWk_3qrZ3vtoIszCRHiOts,1062
tomlkit-0.11.8.dist-info/METADATA,sha256=zj4O4eLckCCdR1aTCYdhIH3wBf9SQUKx6tbrx4uAGOU,2704
tomlkit-0.11.8.dist-info/WHEEL,sha256=7Z8_27uaHI_UZAc4Uox4PpBhQ9Y5_modZXWMxtUi4NU,88
tomlkit-0.11.8.dist-info/RECORD,,

View file

@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: tomlkit
Version: 0.11.8
Version: 0.12.3
Summary: Style preserving TOML library
Home-page: https://github.com/sdispater/tomlkit
License: MIT
@ -14,6 +14,7 @@ Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Project-URL: Repository, https://github.com/sdispater/tomlkit
Description-Content-Type: text/markdown
@ -43,7 +44,7 @@ Part of the implementation has been adapted, improved and fixed from [Molten](ht
## Usage
See the [documentation](https://github.com/sdispater/tomlkit/blob/master/docs/quickstart.rst) for more information.
See the [documentation](https://tomlkit.readthedocs.io/) for more information.
## Installation

View file

@ -0,0 +1,18 @@
tomlkit/__init__.py,sha256=5lWJy3NIyY9fqzFAOYlPdnFY0NS7nmZrP8KD2_7dzQE,1282
tomlkit/_compat.py,sha256=gp7P7qNh0yY1dg0wyjiCDbVwFTdUo7p0QwjV4T3Funs,513
tomlkit/_types.py,sha256=9dcgqLBMPZ9czFJ56P8d1yENG_98tD-GCFwX5IYQpSg,2240
tomlkit/_utils.py,sha256=m4OyWq9nw5MGabHhQKTIu1YtUD8SVJyoTImHTN6L7Yc,4089
tomlkit/api.py,sha256=n2d8VBTddZVkLGbhlhTDHihnbMqBBmZ4zIW_E6ERcmM,7707
tomlkit/container.py,sha256=VLXXtBsgWokC2TBxq-na06MdGB8v4YBgR3rFhBGNNyc,28637
tomlkit/exceptions.py,sha256=TdeHy9e9yiXI8oSR-eCxqtQOWBlyFgn7tTjvpCWAqTw,5487
tomlkit/items.py,sha256=dQyan_1zi0MNOAWsObtbiQy9DzmLG6Y1C7mQs3JFijc,53319
tomlkit/parser.py,sha256=Zclbli3I1G9ov6EEL9MqspaRIaB-4xZ1oHkgdHZc8T4,37897
tomlkit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
tomlkit/source.py,sha256=wDjYx0yjLEMAjmw98weDyxsg04LJhte1tMomzyIAF9E,4825
tomlkit/toml_char.py,sha256=w3sQZ0dolZ1qjZ2Rxj_svvlpRNNGB_fjfBcYD0gFnDs,1291
tomlkit/toml_document.py,sha256=OCTkWXd3P58EZT4SD8_ddc1YpkMaqtlS5_stHTBmMOI,110
tomlkit/toml_file.py,sha256=4gVZvvs_Q1_soWaVxBo80rRzny849boXt2LzdMXQ04I,1599
tomlkit-0.12.3.dist-info/LICENSE,sha256=8vm0YLpxnaZiat0mTTeC8nWk_3qrZ3vtoIszCRHiOts,1062
tomlkit-0.12.3.dist-info/METADATA,sha256=L0Tin6eoX61jYadhYBv8DA_W3zee8zkr8fMX2rj5UYc,2718
tomlkit-0.12.3.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
tomlkit-0.12.3.dist-info/RECORD,,

View file

@ -1,4 +1,4 @@
Wheel-Version: 1.0
Generator: poetry-core 1.5.2
Generator: poetry-core 1.8.1
Root-Is-Purelib: true
Tag: py3-none-any

View file

@ -18,14 +18,16 @@ from tomlkit.api import load
from tomlkit.api import loads
from tomlkit.api import nl
from tomlkit.api import parse
from tomlkit.api import register_encoder
from tomlkit.api import string
from tomlkit.api import table
from tomlkit.api import time
from tomlkit.api import unregister_encoder
from tomlkit.api import value
from tomlkit.api import ws
__version__ = "0.11.8"
__version__ = "0.12.3"
__all__ = [
"aot",
"array",
@ -52,4 +54,6 @@ __all__ = [
"TOMLDocument",
"value",
"ws",
"register_encoder",
"unregister_encoder",
]

View file

@ -0,0 +1,65 @@
from __future__ import annotations
from typing import TYPE_CHECKING
from typing import Any
from typing import TypeVar
WT = TypeVar("WT", bound="WrapperType")
if TYPE_CHECKING: # pragma: no cover
# Define _CustomList and _CustomDict as a workaround for:
# https://github.com/python/mypy/issues/11427
#
# According to this issue, the typeshed contains a "lie"
# (it adds MutableSequence to the ancestry of list and MutableMapping to
# the ancestry of dict) which completely messes with the type inference for
# Table, InlineTable, Array and Container.
#
# Importing from builtins is preferred over simple assignment, see issues:
# https://github.com/python/mypy/issues/8715
# https://github.com/python/mypy/issues/10068
from builtins import dict as _CustomDict # noqa: N812
from builtins import float as _CustomFloat # noqa: N812
from builtins import int as _CustomInt # noqa: N812
from builtins import list as _CustomList # noqa: N812
from typing import Callable
from typing import Concatenate
from typing import ParamSpec
from typing import Protocol
P = ParamSpec("P")
class WrapperType(Protocol):
def _new(self: WT, value: Any) -> WT:
...
else:
from collections.abc import MutableMapping
from collections.abc import MutableSequence
from numbers import Integral
from numbers import Real
class _CustomList(MutableSequence, list):
"""Adds MutableSequence mixin while pretending to be a builtin list"""
class _CustomDict(MutableMapping, dict):
"""Adds MutableMapping mixin while pretending to be a builtin dict"""
class _CustomInt(Integral, int):
"""Adds Integral mixin while pretending to be a builtin int"""
class _CustomFloat(Real, float):
"""Adds Real mixin while pretending to be a builtin float"""
def wrap_method(
original_method: Callable[Concatenate[WT, P], Any]
) -> Callable[Concatenate[WT, P], Any]:
def wrapper(self: WT, *args: P.args, **kwargs: P.kwargs) -> Any:
result = original_method(self, *args, **kwargs)
if result is NotImplemented:
return result
return self._new(result)
return wrapper

View file

@ -133,9 +133,11 @@ def escape_string(s: str, escape_sequences: Collection[str] = _basic_escapes) ->
return i + inc
found_sequences = {seq for seq in escape_sequences if seq in s}
i = 0
while i < len(s):
for seq in escape_sequences:
for seq in found_sequences:
seq_len = len(seq)
if s[i:].startswith(seq):
start = flush(seq_len)

View file

@ -1,14 +1,17 @@
from __future__ import annotations
import contextlib
import datetime as _datetime
from collections.abc import Mapping
from typing import IO
from typing import Iterable
from typing import TypeVar
from tomlkit._utils import parse_rfc3339
from tomlkit.container import Container
from tomlkit.exceptions import UnexpectedCharError
from tomlkit.items import CUSTOM_ENCODERS
from tomlkit.items import AoT
from tomlkit.items import Array
from tomlkit.items import Bool
@ -16,6 +19,7 @@ from tomlkit.items import Comment
from tomlkit.items import Date
from tomlkit.items import DateTime
from tomlkit.items import DottedKey
from tomlkit.items import Encoder
from tomlkit.items import Float
from tomlkit.items import InlineTable
from tomlkit.items import Integer
@ -284,3 +288,21 @@ def nl() -> Whitespace:
def comment(string: str) -> Comment:
"""Create a comment item."""
return Comment(Trivia(comment_ws=" ", comment="# " + string))
E = TypeVar("E", bound=Encoder)
def register_encoder(encoder: E) -> E:
"""Add a custom encoder, which should be a function that will be called
if the value can't otherwise be converted. It should takes a single value
and return a TOMLKit item or raise a ``TypeError``.
"""
CUSTOM_ENCODERS.append(encoder)
return encoder
def unregister_encoder(encoder: Encoder) -> None:
"""Unregister a custom encoder."""
with contextlib.suppress(ValueError):
CUSTOM_ENCODERS.remove(encoder)

View file

@ -6,6 +6,7 @@ from typing import Any
from typing import Iterator
from tomlkit._compat import decode
from tomlkit._types import _CustomDict
from tomlkit._utils import merge_dicts
from tomlkit.exceptions import KeyAlreadyPresent
from tomlkit.exceptions import NonExistentKey
@ -19,7 +20,6 @@ from tomlkit.items import SingleKey
from tomlkit.items import Table
from tomlkit.items import Trivia
from tomlkit.items import Whitespace
from tomlkit.items import _CustomDict
from tomlkit.items import item as _item
@ -44,6 +44,7 @@ class Container(_CustomDict):
return self._body
def unwrap(self) -> dict[str, Any]:
"""Returns as pure python object (ppo)"""
unwrapped = {}
for k, v in self.items():
if k is None:
@ -64,6 +65,7 @@ class Container(_CustomDict):
@property
def value(self) -> dict[str, Any]:
"""The wrapped dict value"""
d = {}
for k, v in self._body:
if k is None:
@ -145,7 +147,19 @@ class Container(_CustomDict):
last_index = i
return last_index + 1
def append(self, key: Key | str | None, item: Item) -> Container:
def _validate_out_of_order_table(self, key: SingleKey | None = None) -> None:
if key is None:
for k in self._map:
assert k is not None
self._validate_out_of_order_table(k)
return
if key not in self._map or not isinstance(self._map[key], tuple):
return
OutOfOrderTableProxy(self, self._map[key])
def append(
self, key: Key | str | None, item: Item, validate: bool = True
) -> Container:
"""Similar to :meth:`add` but both key and value must be given."""
if not isinstance(key, Key) and key is not None:
key = SingleKey(key)
@ -227,8 +241,8 @@ class Container(_CustomDict):
else:
self._raw_append(key, item)
# Building a temporary proxy to check for errors
OutOfOrderTableProxy(self, self._map[key])
if validate:
self._validate_out_of_order_table(key)
return self
@ -286,7 +300,7 @@ class Container(_CustomDict):
self._raw_append(key, item)
return self
def _raw_append(self, key: Key, item: Item) -> None:
def _raw_append(self, key: Key | None, item: Item) -> None:
if key in self._map:
current_idx = self._map[key]
if not isinstance(current_idx, tuple):
@ -297,7 +311,7 @@ class Container(_CustomDict):
raise KeyAlreadyPresent(key)
self._map[key] = current_idx + (len(self._body),)
else:
elif key is not None:
self._map[key] = len(self._body)
self._body.append((key, item))
@ -605,21 +619,8 @@ class Container(_CustomDict):
# Dictionary methods
def __getitem__(self, key: Key | str) -> Item | Container:
if not isinstance(key, Key):
key = SingleKey(key)
idx = self._map.get(key)
if idx is None:
raise NonExistentKey(key)
if isinstance(idx, tuple):
# The item we are getting is an out of order table
# so we need a proxy to retrieve the proper objects
# from the parent container
return OutOfOrderTableProxy(self, idx)
item = self._body[idx][1]
if item.is_boolean():
item = self.item(key)
if isinstance(item, Item) and item.is_boolean():
return item.value
return item
@ -700,12 +701,18 @@ class Container(_CustomDict):
if isinstance(value, Table):
# Insert a cosmetic new line for tables if:
# - it does not have it yet OR is not followed by one
# - it is not the last item
# - it is not the last item, or
# - The table being replaced has a newline
last, _ = self._previous_item_with_index()
idx = last if idx < 0 else idx
has_ws = ends_with_whitespace(value)
replace_has_ws = (
isinstance(v, Table)
and v.value.body
and isinstance(v.value.body[-1][1], Whitespace)
)
next_ws = idx < last and isinstance(self._body[idx + 1][1], Whitespace)
if idx < last and not (next_ws or has_ws):
if (idx < last or replace_has_ws) and not (next_ws or has_ws):
value.append(None, Whitespace("\n"))
dict.__setitem__(self, new_key.key, value.value)
@ -792,11 +799,13 @@ class OutOfOrderTableProxy(_CustomDict):
self._tables.append(item)
table_idx = len(self._tables) - 1
for k, v in item.value.body:
self._internal_container.append(k, v)
self._internal_container.append(k, v, validate=False)
self._tables_map[k] = table_idx
if k is not None:
dict.__setitem__(self, k.key, v)
self._internal_container._validate_out_of_order_table()
def unwrap(self) -> str:
return self._internal_container.unwrap()

View file

@ -3,8 +3,10 @@ from __future__ import annotations
import abc
import copy
import dataclasses
import math
import re
import string
import sys
from datetime import date
from datetime import datetime
@ -13,6 +15,7 @@ from datetime import tzinfo
from enum import Enum
from typing import TYPE_CHECKING
from typing import Any
from typing import Callable
from typing import Collection
from typing import Iterable
from typing import Iterator
@ -23,40 +26,31 @@ from typing import overload
from tomlkit._compat import PY38
from tomlkit._compat import decode
from tomlkit._types import _CustomDict
from tomlkit._types import _CustomFloat
from tomlkit._types import _CustomInt
from tomlkit._types import _CustomList
from tomlkit._types import wrap_method
from tomlkit._utils import CONTROL_CHARS
from tomlkit._utils import escape_string
from tomlkit.exceptions import InvalidStringError
if TYPE_CHECKING: # pragma: no cover
# Define _CustomList and _CustomDict as a workaround for:
# https://github.com/python/mypy/issues/11427
#
# According to this issue, the typeshed contains a "lie"
# (it adds MutableSequence to the ancestry of list and MutableMapping to
# the ancestry of dict) which completely messes with the type inference for
# Table, InlineTable, Array and Container.
#
# Importing from builtins is preferred over simple assignment, see issues:
# https://github.com/python/mypy/issues/8715
# https://github.com/python/mypy/issues/10068
from builtins import dict as _CustomDict # noqa: N812, TC004
from builtins import list as _CustomList # noqa: N812, TC004
# Allow type annotations but break circular imports
if TYPE_CHECKING:
from tomlkit import container
else:
from collections.abc import MutableMapping
from collections.abc import MutableSequence
class _CustomList(MutableSequence, list):
"""Adds MutableSequence mixin while pretending to be a builtin list"""
class _CustomDict(MutableMapping, dict):
"""Adds MutableMapping mixin while pretending to be a builtin dict"""
ItemT = TypeVar("ItemT", bound="Item")
Encoder = Callable[[Any], "Item"]
CUSTOM_ENCODERS: list[Encoder] = []
AT = TypeVar("AT", bound="AbstractTable")
class _ConvertError(TypeError, ValueError):
"""An internal error raised when item() fails to convert a value.
It should be a TypeError, but due to historical reasons
it needs to subclass ValueError as well.
"""
@overload
@ -155,7 +149,7 @@ def item(value: Any, _parent: Item | None = None, _sort_keys: bool = False) -> I
val = table_constructor(Container(), Trivia(), False)
for k, v in sorted(
value.items(),
key=lambda i: (isinstance(i[1], dict), i[0] if _sort_keys else 1),
key=lambda i: (isinstance(i[1], dict), i[0]) if _sort_keys else 1,
):
val[k] = item(v, _parent=val, _sort_keys=_sort_keys)
@ -218,8 +212,20 @@ def item(value: Any, _parent: Item | None = None, _sort_keys: bool = False) -> I
Trivia(),
value.isoformat(),
)
else:
for encoder in CUSTOM_ENCODERS:
try:
rv = encoder(value)
except TypeError:
pass
else:
if not isinstance(rv, Item):
raise _ConvertError(
f"Custom encoder returned {type(rv)}, not a subclass of Item"
)
return rv
raise ValueError(f"Invalid type {type(value)}")
raise _ConvertError(f"Invalid type {type(value)}")
class StringType(Enum):
@ -434,7 +440,7 @@ class SingleKey(Key):
class DottedKey(Key):
def __init__(
self,
keys: Iterable[Key],
keys: Iterable[SingleKey],
sep: str | None = None,
original: str | None = None,
) -> None:
@ -584,17 +590,17 @@ class Comment(Item):
return f"{self._trivia.indent}{decode(self._trivia.comment)}"
class Integer(int, Item):
class Integer(Item, _CustomInt):
"""
An integer literal.
"""
def __new__(cls, value: int, trivia: Trivia, raw: str) -> Integer:
return super().__new__(cls, value)
return int.__new__(cls, value)
def __init__(self, _: int, trivia: Trivia, raw: str) -> None:
def __init__(self, value: int, trivia: Trivia, raw: str) -> None:
super().__init__(trivia)
self._original = value
self._raw = raw
self._sign = False
@ -602,7 +608,12 @@ class Integer(int, Item):
self._sign = True
def unwrap(self) -> int:
return int(self)
return self._original
__int__ = unwrap
def __hash__(self) -> int:
return hash(self.unwrap())
@property
def discriminant(self) -> int:
@ -616,30 +627,6 @@ class Integer(int, Item):
def as_string(self) -> str:
return self._raw
def __add__(self, other):
result = super().__add__(other)
if result is NotImplemented:
return result
return self._new(result)
def __radd__(self, other):
result = super().__radd__(other)
if result is NotImplemented:
return result
return self._new(result)
def __sub__(self, other):
result = super().__sub__(other)
if result is NotImplemented:
return result
return self._new(result)
def __rsub__(self, other):
result = super().__rsub__(other)
if result is NotImplemented:
return result
return self._new(result)
def _new(self, result):
raw = str(result)
if self._sign:
@ -651,18 +638,63 @@ class Integer(int, Item):
def _getstate(self, protocol=3):
return int(self), self._trivia, self._raw
# int methods
__abs__ = wrap_method(int.__abs__)
__add__ = wrap_method(int.__add__)
__and__ = wrap_method(int.__and__)
__ceil__ = wrap_method(int.__ceil__)
__eq__ = int.__eq__
__floor__ = wrap_method(int.__floor__)
__floordiv__ = wrap_method(int.__floordiv__)
__invert__ = wrap_method(int.__invert__)
__le__ = int.__le__
__lshift__ = wrap_method(int.__lshift__)
__lt__ = int.__lt__
__mod__ = wrap_method(int.__mod__)
__mul__ = wrap_method(int.__mul__)
__neg__ = wrap_method(int.__neg__)
__or__ = wrap_method(int.__or__)
__pos__ = wrap_method(int.__pos__)
__pow__ = wrap_method(int.__pow__)
__radd__ = wrap_method(int.__radd__)
__rand__ = wrap_method(int.__rand__)
__rfloordiv__ = wrap_method(int.__rfloordiv__)
__rlshift__ = wrap_method(int.__rlshift__)
__rmod__ = wrap_method(int.__rmod__)
__rmul__ = wrap_method(int.__rmul__)
__ror__ = wrap_method(int.__ror__)
__round__ = wrap_method(int.__round__)
__rpow__ = wrap_method(int.__rpow__)
__rrshift__ = wrap_method(int.__rrshift__)
__rshift__ = wrap_method(int.__rshift__)
__rxor__ = wrap_method(int.__rxor__)
__trunc__ = wrap_method(int.__trunc__)
__xor__ = wrap_method(int.__xor__)
class Float(float, Item):
def __rtruediv__(self, other):
result = int.__rtruediv__(self, other)
if result is NotImplemented:
return result
return Float._new(self, result)
def __truediv__(self, other):
result = int.__truediv__(self, other)
if result is NotImplemented:
return result
return Float._new(self, result)
class Float(Item, _CustomFloat):
"""
A float literal.
"""
def __new__(cls, value: float, trivia: Trivia, raw: str) -> Integer:
return super().__new__(cls, value)
def __new__(cls, value: float, trivia: Trivia, raw: str) -> Float:
return float.__new__(cls, value)
def __init__(self, _: float, trivia: Trivia, raw: str) -> None:
def __init__(self, value: float, trivia: Trivia, raw: str) -> None:
super().__init__(trivia)
self._original = value
self._raw = raw
self._sign = False
@ -670,7 +702,12 @@ class Float(float, Item):
self._sign = True
def unwrap(self) -> float:
return float(self)
return self._original
__float__ = unwrap
def __hash__(self) -> int:
return hash(self.unwrap())
@property
def discriminant(self) -> int:
@ -684,32 +721,6 @@ class Float(float, Item):
def as_string(self) -> str:
return self._raw
def __add__(self, other):
result = super().__add__(other)
return self._new(result)
def __radd__(self, other):
result = super().__radd__(other)
if isinstance(other, Float):
return self._new(result)
return result
def __sub__(self, other):
result = super().__sub__(other)
return self._new(result)
def __rsub__(self, other):
result = super().__rsub__(other)
if isinstance(other, Float):
return self._new(result)
return result
def _new(self, result):
raw = str(result)
@ -722,6 +733,35 @@ class Float(float, Item):
def _getstate(self, protocol=3):
return float(self), self._trivia, self._raw
# float methods
__abs__ = wrap_method(float.__abs__)
__add__ = wrap_method(float.__add__)
__eq__ = float.__eq__
__floordiv__ = wrap_method(float.__floordiv__)
__le__ = float.__le__
__lt__ = float.__lt__
__mod__ = wrap_method(float.__mod__)
__mul__ = wrap_method(float.__mul__)
__neg__ = wrap_method(float.__neg__)
__pos__ = wrap_method(float.__pos__)
__pow__ = wrap_method(float.__pow__)
__radd__ = wrap_method(float.__radd__)
__rfloordiv__ = wrap_method(float.__rfloordiv__)
__rmod__ = wrap_method(float.__rmod__)
__rmul__ = wrap_method(float.__rmul__)
__round__ = wrap_method(float.__round__)
__rpow__ = wrap_method(float.__rpow__)
__rtruediv__ = wrap_method(float.__rtruediv__)
__truediv__ = wrap_method(float.__truediv__)
__trunc__ = float.__trunc__
if sys.version_info >= (3, 9):
__ceil__ = float.__ceil__
__floor__ = float.__floor__
else:
__ceil__ = math.ceil
__floor__ = math.floor
class Bool(Item):
"""
@ -1388,9 +1428,6 @@ class Array(Item, _CustomList):
return list(self._iter_items()), self._trivia, self._multiline
AT = TypeVar("AT", bound="AbstractTable")
class AbstractTable(Item, _CustomDict):
"""Common behaviour of both :class:`Table` and :class:`InlineTable`"""
@ -1430,11 +1467,11 @@ class AbstractTable(Item, _CustomDict):
raise NotImplementedError
@overload
def add(self: AT, value: Comment | Whitespace) -> AT:
def add(self: AT, key: Comment | Whitespace) -> AT:
...
@overload
def add(self: AT, key: Key | str, value: Any) -> AT:
def add(self: AT, key: Key | str, value: Any = ...) -> AT:
...
def add(self, key, value=None):
@ -1580,7 +1617,7 @@ class Table(AbstractTable):
if not isinstance(_item, Item):
_item = item(_item)
self._value.append(key, _item)
self._value.append(key, _item, validate=False)
if isinstance(key, Key):
key = next(iter(key)).key
@ -1628,6 +1665,7 @@ class Table(AbstractTable):
return self
def invalidate_display_name(self):
"""Call ``invalidate_display_name`` on the contained tables"""
self.display_name = None
for child in self.values():
@ -1908,7 +1946,7 @@ class Null(Item):
"""
def __init__(self) -> None:
pass
super().__init__(Trivia(trail=""))
def unwrap(self) -> None:
return None

View file

@ -60,7 +60,7 @@ class Parser:
Parser for TOML documents.
"""
def __init__(self, string: str) -> None:
def __init__(self, string: str | bytes) -> None:
# Input to parse
self._src = Source(decode(string))
@ -1030,7 +1030,7 @@ class Parser:
InternalParserError,
"_parse_item() returned None on a non-bracket character.",
)
table.value._validate_out_of_order_table()
if isinstance(result, Null):
result = table

View file

@ -50,7 +50,7 @@ class _StateHandler:
def __call__(self, *args, **kwargs):
return _State(self._source, *args, **kwargs)
def __enter__(self) -> None:
def __enter__(self) -> _State:
state = self()
self._states.append(state)
return state.__enter__()