@scrypted/arlo 0.11.26 → 0.11.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin.zip +0 -0
- package/package.json +1 -1
- package/venv/bin/Activate.ps1 +0 -247
- package/venv/bin/activate +0 -69
- package/venv/bin/activate.csh +0 -26
- package/venv/bin/activate.fish +0 -69
- package/venv/bin/normalizer +0 -8
- package/venv/bin/pip +0 -8
- package/venv/bin/pip3 +0 -8
- package/venv/bin/pip3.10 +0 -8
- package/venv/lib/python3.10/site-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so +0 -0
- package/venv/lib/python3.10/site-packages/_distutils_hack/__init__.py +0 -132
- package/venv/lib/python3.10/site-packages/_distutils_hack/override.py +0 -1
- package/venv/lib/python3.10/site-packages/aiohappyeyeballs/__init__.py +0 -13
- package/venv/lib/python3.10/site-packages/aiohappyeyeballs/_staggered.py +0 -202
- package/venv/lib/python3.10/site-packages/aiohappyeyeballs/impl.py +0 -210
- package/venv/lib/python3.10/site-packages/aiohappyeyeballs/py.typed +0 -0
- package/venv/lib/python3.10/site-packages/aiohappyeyeballs/types.py +0 -12
- package/venv/lib/python3.10/site-packages/aiohappyeyeballs/utils.py +0 -97
- package/venv/lib/python3.10/site-packages/aiohappyeyeballs-2.4.6.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/aiohappyeyeballs-2.4.6.dist-info/LICENSE +0 -279
- package/venv/lib/python3.10/site-packages/aiohappyeyeballs-2.4.6.dist-info/METADATA +0 -123
- package/venv/lib/python3.10/site-packages/aiohappyeyeballs-2.4.6.dist-info/RECORD +0 -16
- package/venv/lib/python3.10/site-packages/aiohappyeyeballs-2.4.6.dist-info/WHEEL +0 -4
- package/venv/lib/python3.10/site-packages/aiohttp/.hash/_cparser.pxd.hash +0 -1
- package/venv/lib/python3.10/site-packages/aiohttp/.hash/_find_header.pxd.hash +0 -1
- package/venv/lib/python3.10/site-packages/aiohttp/.hash/_http_parser.pyx.hash +0 -1
- package/venv/lib/python3.10/site-packages/aiohttp/.hash/_http_writer.pyx.hash +0 -1
- package/venv/lib/python3.10/site-packages/aiohttp/.hash/hdrs.py.hash +0 -1
- package/venv/lib/python3.10/site-packages/aiohttp/__init__.py +0 -264
- package/venv/lib/python3.10/site-packages/aiohttp/_cparser.pxd +0 -158
- package/venv/lib/python3.10/site-packages/aiohttp/_find_header.pxd +0 -2
- package/venv/lib/python3.10/site-packages/aiohttp/_headers.pxi +0 -83
- package/venv/lib/python3.10/site-packages/aiohttp/_http_parser.cpython-310-x86_64-linux-gnu.so +0 -0
- package/venv/lib/python3.10/site-packages/aiohttp/_http_parser.pyx +0 -837
- package/venv/lib/python3.10/site-packages/aiohttp/_http_writer.cpython-310-x86_64-linux-gnu.so +0 -0
- package/venv/lib/python3.10/site-packages/aiohttp/_http_writer.pyx +0 -162
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/.hash/mask.pxd.hash +0 -1
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/.hash/mask.pyx.hash +0 -1
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/.hash/reader_c.pxd.hash +0 -1
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/__init__.py +0 -1
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/helpers.py +0 -147
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/mask.cpython-310-x86_64-linux-gnu.so +0 -0
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/mask.pxd +0 -3
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/mask.pyx +0 -48
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/models.py +0 -84
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/reader.py +0 -31
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/reader_c.cpython-310-x86_64-linux-gnu.so +0 -0
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/reader_c.pxd +0 -102
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/reader_c.py +0 -468
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/reader_py.py +0 -468
- package/venv/lib/python3.10/site-packages/aiohttp/_websocket/writer.py +0 -177
- package/venv/lib/python3.10/site-packages/aiohttp/abc.py +0 -253
- package/venv/lib/python3.10/site-packages/aiohttp/base_protocol.py +0 -100
- package/venv/lib/python3.10/site-packages/aiohttp/client.py +0 -1550
- package/venv/lib/python3.10/site-packages/aiohttp/client_exceptions.py +0 -421
- package/venv/lib/python3.10/site-packages/aiohttp/client_proto.py +0 -307
- package/venv/lib/python3.10/site-packages/aiohttp/client_reqrep.py +0 -1315
- package/venv/lib/python3.10/site-packages/aiohttp/client_ws.py +0 -426
- package/venv/lib/python3.10/site-packages/aiohttp/compression_utils.py +0 -173
- package/venv/lib/python3.10/site-packages/aiohttp/connector.py +0 -1652
- package/venv/lib/python3.10/site-packages/aiohttp/cookiejar.py +0 -495
- package/venv/lib/python3.10/site-packages/aiohttp/formdata.py +0 -182
- package/venv/lib/python3.10/site-packages/aiohttp/hdrs.py +0 -121
- package/venv/lib/python3.10/site-packages/aiohttp/helpers.py +0 -944
- package/venv/lib/python3.10/site-packages/aiohttp/http.py +0 -72
- package/venv/lib/python3.10/site-packages/aiohttp/http_exceptions.py +0 -112
- package/venv/lib/python3.10/site-packages/aiohttp/http_parser.py +0 -1046
- package/venv/lib/python3.10/site-packages/aiohttp/http_websocket.py +0 -36
- package/venv/lib/python3.10/site-packages/aiohttp/http_writer.py +0 -249
- package/venv/lib/python3.10/site-packages/aiohttp/log.py +0 -8
- package/venv/lib/python3.10/site-packages/aiohttp/multipart.py +0 -1071
- package/venv/lib/python3.10/site-packages/aiohttp/payload.py +0 -519
- package/venv/lib/python3.10/site-packages/aiohttp/payload_streamer.py +0 -78
- package/venv/lib/python3.10/site-packages/aiohttp/py.typed +0 -1
- package/venv/lib/python3.10/site-packages/aiohttp/pytest_plugin.py +0 -436
- package/venv/lib/python3.10/site-packages/aiohttp/resolver.py +0 -187
- package/venv/lib/python3.10/site-packages/aiohttp/streams.py +0 -727
- package/venv/lib/python3.10/site-packages/aiohttp/tcp_helpers.py +0 -37
- package/venv/lib/python3.10/site-packages/aiohttp/test_utils.py +0 -770
- package/venv/lib/python3.10/site-packages/aiohttp/tracing.py +0 -470
- package/venv/lib/python3.10/site-packages/aiohttp/typedefs.py +0 -69
- package/venv/lib/python3.10/site-packages/aiohttp/web.py +0 -605
- package/venv/lib/python3.10/site-packages/aiohttp/web_app.py +0 -620
- package/venv/lib/python3.10/site-packages/aiohttp/web_exceptions.py +0 -452
- package/venv/lib/python3.10/site-packages/aiohttp/web_fileresponse.py +0 -418
- package/venv/lib/python3.10/site-packages/aiohttp/web_log.py +0 -216
- package/venv/lib/python3.10/site-packages/aiohttp/web_middlewares.py +0 -121
- package/venv/lib/python3.10/site-packages/aiohttp/web_protocol.py +0 -750
- package/venv/lib/python3.10/site-packages/aiohttp/web_request.py +0 -916
- package/venv/lib/python3.10/site-packages/aiohttp/web_response.py +0 -840
- package/venv/lib/python3.10/site-packages/aiohttp/web_routedef.py +0 -214
- package/venv/lib/python3.10/site-packages/aiohttp/web_runner.py +0 -399
- package/venv/lib/python3.10/site-packages/aiohttp/web_server.py +0 -84
- package/venv/lib/python3.10/site-packages/aiohttp/web_urldispatcher.py +0 -1301
- package/venv/lib/python3.10/site-packages/aiohttp/web_ws.py +0 -622
- package/venv/lib/python3.10/site-packages/aiohttp/worker.py +0 -252
- package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/LICENSE.txt +0 -13
- package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/METADATA +0 -250
- package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/RECORD +0 -132
- package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/REQUESTED +0 -0
- package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/WHEEL +0 -6
- package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/aiosignal/__init__.py +0 -36
- package/venv/lib/python3.10/site-packages/aiosignal/__init__.pyi +0 -12
- package/venv/lib/python3.10/site-packages/aiosignal/py.typed +0 -0
- package/venv/lib/python3.10/site-packages/aiosignal-1.3.2.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/aiosignal-1.3.2.dist-info/LICENSE +0 -201
- package/venv/lib/python3.10/site-packages/aiosignal-1.3.2.dist-info/METADATA +0 -123
- package/venv/lib/python3.10/site-packages/aiosignal-1.3.2.dist-info/RECORD +0 -10
- package/venv/lib/python3.10/site-packages/aiosignal-1.3.2.dist-info/WHEEL +0 -6
- package/venv/lib/python3.10/site-packages/aiosignal-1.3.2.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/async_timeout/__init__.py +0 -276
- package/venv/lib/python3.10/site-packages/async_timeout/py.typed +0 -1
- package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/LICENSE +0 -13
- package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/METADATA +0 -163
- package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/RECORD +0 -11
- package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/REQUESTED +0 -0
- package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/WHEEL +0 -5
- package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/zip-safe +0 -1
- package/venv/lib/python3.10/site-packages/attr/__init__.py +0 -104
- package/venv/lib/python3.10/site-packages/attr/__init__.pyi +0 -389
- package/venv/lib/python3.10/site-packages/attr/_cmp.py +0 -160
- package/venv/lib/python3.10/site-packages/attr/_cmp.pyi +0 -13
- package/venv/lib/python3.10/site-packages/attr/_compat.py +0 -94
- package/venv/lib/python3.10/site-packages/attr/_config.py +0 -31
- package/venv/lib/python3.10/site-packages/attr/_funcs.py +0 -468
- package/venv/lib/python3.10/site-packages/attr/_make.py +0 -3055
- package/venv/lib/python3.10/site-packages/attr/_next_gen.py +0 -623
- package/venv/lib/python3.10/site-packages/attr/_typing_compat.pyi +0 -15
- package/venv/lib/python3.10/site-packages/attr/_version_info.py +0 -86
- package/venv/lib/python3.10/site-packages/attr/_version_info.pyi +0 -9
- package/venv/lib/python3.10/site-packages/attr/converters.py +0 -162
- package/venv/lib/python3.10/site-packages/attr/converters.pyi +0 -19
- package/venv/lib/python3.10/site-packages/attr/exceptions.py +0 -95
- package/venv/lib/python3.10/site-packages/attr/exceptions.pyi +0 -17
- package/venv/lib/python3.10/site-packages/attr/filters.py +0 -72
- package/venv/lib/python3.10/site-packages/attr/filters.pyi +0 -6
- package/venv/lib/python3.10/site-packages/attr/py.typed +0 -0
- package/venv/lib/python3.10/site-packages/attr/setters.py +0 -79
- package/venv/lib/python3.10/site-packages/attr/setters.pyi +0 -20
- package/venv/lib/python3.10/site-packages/attr/validators.py +0 -710
- package/venv/lib/python3.10/site-packages/attr/validators.pyi +0 -86
- package/venv/lib/python3.10/site-packages/attrs/__init__.py +0 -69
- package/venv/lib/python3.10/site-packages/attrs/__init__.pyi +0 -263
- package/venv/lib/python3.10/site-packages/attrs/converters.py +0 -3
- package/venv/lib/python3.10/site-packages/attrs/exceptions.py +0 -3
- package/venv/lib/python3.10/site-packages/attrs/filters.py +0 -3
- package/venv/lib/python3.10/site-packages/attrs/py.typed +0 -0
- package/venv/lib/python3.10/site-packages/attrs/setters.py +0 -3
- package/venv/lib/python3.10/site-packages/attrs/validators.py +0 -3
- package/venv/lib/python3.10/site-packages/attrs-25.1.0.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/attrs-25.1.0.dist-info/METADATA +0 -232
- package/venv/lib/python3.10/site-packages/attrs-25.1.0.dist-info/RECORD +0 -55
- package/venv/lib/python3.10/site-packages/attrs-25.1.0.dist-info/WHEEL +0 -4
- package/venv/lib/python3.10/site-packages/attrs-25.1.0.dist-info/licenses/LICENSE +0 -21
- package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/METADATA +0 -123
- package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/RECORD +0 -90
- package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/REQUESTED +0 -0
- package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/WHEEL +0 -4
- package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/licenses/AUTHORS +0 -49
- package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/licenses/LICENSE +0 -31
- package/venv/lib/python3.10/site-packages/bs4/__init__.py +0 -1170
- package/venv/lib/python3.10/site-packages/bs4/_deprecation.py +0 -80
- package/venv/lib/python3.10/site-packages/bs4/_typing.py +0 -196
- package/venv/lib/python3.10/site-packages/bs4/_warnings.py +0 -98
- package/venv/lib/python3.10/site-packages/bs4/builder/__init__.py +0 -848
- package/venv/lib/python3.10/site-packages/bs4/builder/_html5lib.py +0 -594
- package/venv/lib/python3.10/site-packages/bs4/builder/_htmlparser.py +0 -474
- package/venv/lib/python3.10/site-packages/bs4/builder/_lxml.py +0 -490
- package/venv/lib/python3.10/site-packages/bs4/css.py +0 -338
- package/venv/lib/python3.10/site-packages/bs4/dammit.py +0 -1408
- package/venv/lib/python3.10/site-packages/bs4/diagnose.py +0 -268
- package/venv/lib/python3.10/site-packages/bs4/element.py +0 -2886
- package/venv/lib/python3.10/site-packages/bs4/exceptions.py +0 -28
- package/venv/lib/python3.10/site-packages/bs4/filter.py +0 -755
- package/venv/lib/python3.10/site-packages/bs4/formatter.py +0 -276
- package/venv/lib/python3.10/site-packages/bs4/py.typed +0 -0
- package/venv/lib/python3.10/site-packages/bs4/tests/__init__.py +0 -1305
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-4670634698080256.testcase +0 -1
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-4818336571064320.testcase +0 -1
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-4999465949331456.testcase +0 -1
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5000587759190016.testcase +0 -0
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5167584867909632.testcase +0 -0
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5270998950477824.testcase +0 -0
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5375146639360000.testcase +0 -1
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5492400320282624.testcase +0 -0
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5703933063462912.testcase +0 -2
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5843991618256896.testcase +0 -1
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5984173902397440.testcase +0 -0
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6124268085182464.testcase +0 -1
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6241471367348224.testcase +0 -1
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6306874195312640.testcase +0 -1
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6450958476902400.testcase +0 -0
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6600557255327744.testcase +0 -0
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/crash-0d306a50c8ed8bcd0785b67000fcd5dea1d33f08.testcase +0 -0
- package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/crash-ffbdfa8a2b26f13537b68d3794b0478a4090ee4a.testcase +0 -0
- package/venv/lib/python3.10/site-packages/bs4/tests/test_builder.py +0 -28
- package/venv/lib/python3.10/site-packages/bs4/tests/test_builder_registry.py +0 -139
- package/venv/lib/python3.10/site-packages/bs4/tests/test_css.py +0 -536
- package/venv/lib/python3.10/site-packages/bs4/tests/test_dammit.py +0 -433
- package/venv/lib/python3.10/site-packages/bs4/tests/test_element.py +0 -138
- package/venv/lib/python3.10/site-packages/bs4/tests/test_filter.py +0 -674
- package/venv/lib/python3.10/site-packages/bs4/tests/test_formatter.py +0 -170
- package/venv/lib/python3.10/site-packages/bs4/tests/test_fuzz.py +0 -181
- package/venv/lib/python3.10/site-packages/bs4/tests/test_html5lib.py +0 -264
- package/venv/lib/python3.10/site-packages/bs4/tests/test_htmlparser.py +0 -161
- package/venv/lib/python3.10/site-packages/bs4/tests/test_lxml.py +0 -196
- package/venv/lib/python3.10/site-packages/bs4/tests/test_navigablestring.py +0 -144
- package/venv/lib/python3.10/site-packages/bs4/tests/test_pageelement.py +0 -437
- package/venv/lib/python3.10/site-packages/bs4/tests/test_soup.py +0 -602
- package/venv/lib/python3.10/site-packages/bs4/tests/test_tag.py +0 -241
- package/venv/lib/python3.10/site-packages/bs4/tests/test_tree.py +0 -1452
- package/venv/lib/python3.10/site-packages/cachetools/__init__.py +0 -859
- package/venv/lib/python3.10/site-packages/cachetools/func.py +0 -121
- package/venv/lib/python3.10/site-packages/cachetools/keys.py +0 -62
- package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/LICENSE +0 -20
- package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/METADATA +0 -151
- package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/RECORD +0 -13
- package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/REQUESTED +0 -0
- package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/WHEEL +0 -5
- package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/certifi/__init__.py +0 -4
- package/venv/lib/python3.10/site-packages/certifi/__main__.py +0 -12
- package/venv/lib/python3.10/site-packages/certifi/cacert.pem +0 -4897
- package/venv/lib/python3.10/site-packages/certifi/core.py +0 -114
- package/venv/lib/python3.10/site-packages/certifi/py.typed +0 -0
- package/venv/lib/python3.10/site-packages/certifi-2025.1.31.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/certifi-2025.1.31.dist-info/LICENSE +0 -20
- package/venv/lib/python3.10/site-packages/certifi-2025.1.31.dist-info/METADATA +0 -77
- package/venv/lib/python3.10/site-packages/certifi-2025.1.31.dist-info/RECORD +0 -14
- package/venv/lib/python3.10/site-packages/certifi-2025.1.31.dist-info/WHEEL +0 -5
- package/venv/lib/python3.10/site-packages/certifi-2025.1.31.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/cffi/__init__.py +0 -14
- package/venv/lib/python3.10/site-packages/cffi/_cffi_errors.h +0 -149
- package/venv/lib/python3.10/site-packages/cffi/_cffi_include.h +0 -389
- package/venv/lib/python3.10/site-packages/cffi/_embedding.h +0 -550
- package/venv/lib/python3.10/site-packages/cffi/_imp_emulation.py +0 -83
- package/venv/lib/python3.10/site-packages/cffi/_shimmed_dist_utils.py +0 -45
- package/venv/lib/python3.10/site-packages/cffi/api.py +0 -967
- package/venv/lib/python3.10/site-packages/cffi/backend_ctypes.py +0 -1121
- package/venv/lib/python3.10/site-packages/cffi/cffi_opcode.py +0 -187
- package/venv/lib/python3.10/site-packages/cffi/commontypes.py +0 -82
- package/venv/lib/python3.10/site-packages/cffi/cparser.py +0 -1015
- package/venv/lib/python3.10/site-packages/cffi/error.py +0 -31
- package/venv/lib/python3.10/site-packages/cffi/ffiplatform.py +0 -113
- package/venv/lib/python3.10/site-packages/cffi/lock.py +0 -30
- package/venv/lib/python3.10/site-packages/cffi/model.py +0 -618
- package/venv/lib/python3.10/site-packages/cffi/parse_c_type.h +0 -181
- package/venv/lib/python3.10/site-packages/cffi/pkgconfig.py +0 -121
- package/venv/lib/python3.10/site-packages/cffi/recompiler.py +0 -1598
- package/venv/lib/python3.10/site-packages/cffi/setuptools_ext.py +0 -216
- package/venv/lib/python3.10/site-packages/cffi/vengine_cpy.py +0 -1084
- package/venv/lib/python3.10/site-packages/cffi/vengine_gen.py +0 -679
- package/venv/lib/python3.10/site-packages/cffi/verifier.py +0 -306
- package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/LICENSE +0 -26
- package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/METADATA +0 -40
- package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/RECORD +0 -48
- package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/WHEEL +0 -6
- package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/entry_points.txt +0 -2
- package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/top_level.txt +0 -2
- package/venv/lib/python3.10/site-packages/charset_normalizer/__init__.py +0 -48
- package/venv/lib/python3.10/site-packages/charset_normalizer/__main__.py +0 -6
- package/venv/lib/python3.10/site-packages/charset_normalizer/api.py +0 -668
- package/venv/lib/python3.10/site-packages/charset_normalizer/cd.py +0 -395
- package/venv/lib/python3.10/site-packages/charset_normalizer/cli/__init__.py +0 -8
- package/venv/lib/python3.10/site-packages/charset_normalizer/cli/__main__.py +0 -321
- package/venv/lib/python3.10/site-packages/charset_normalizer/constant.py +0 -1998
- package/venv/lib/python3.10/site-packages/charset_normalizer/legacy.py +0 -66
- package/venv/lib/python3.10/site-packages/charset_normalizer/md.cpython-310-x86_64-linux-gnu.so +0 -0
- package/venv/lib/python3.10/site-packages/charset_normalizer/md.py +0 -630
- package/venv/lib/python3.10/site-packages/charset_normalizer/md__mypyc.cpython-310-x86_64-linux-gnu.so +0 -0
- package/venv/lib/python3.10/site-packages/charset_normalizer/models.py +0 -360
- package/venv/lib/python3.10/site-packages/charset_normalizer/py.typed +0 -0
- package/venv/lib/python3.10/site-packages/charset_normalizer/utils.py +0 -408
- package/venv/lib/python3.10/site-packages/charset_normalizer/version.py +0 -8
- package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/LICENSE +0 -21
- package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/METADATA +0 -721
- package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/RECORD +0 -35
- package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/WHEEL +0 -6
- package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/entry_points.txt +0 -2
- package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/cloudscraper/__init__.py +0 -407
- package/venv/lib/python3.10/site-packages/cloudscraper/captcha/2captcha.py +0 -258
- package/venv/lib/python3.10/site-packages/cloudscraper/captcha/9kw.py +0 -214
- package/venv/lib/python3.10/site-packages/cloudscraper/captcha/__init__.py +0 -47
- package/venv/lib/python3.10/site-packages/cloudscraper/captcha/anticaptcha.py +0 -199
- package/venv/lib/python3.10/site-packages/cloudscraper/captcha/capmonster.py +0 -199
- package/venv/lib/python3.10/site-packages/cloudscraper/captcha/capsolver.py +0 -188
- package/venv/lib/python3.10/site-packages/cloudscraper/captcha/deathbycaptcha.py +0 -276
- package/venv/lib/python3.10/site-packages/cloudscraper/cloudflare.py +0 -490
- package/venv/lib/python3.10/site-packages/cloudscraper/exceptions.py +0 -111
- package/venv/lib/python3.10/site-packages/cloudscraper/help.py +0 -72
- package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/__init__.py +0 -56
- package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/chakracore.py +0 -103
- package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/encapsulated.py +0 -62
- package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/js2py.py +0 -44
- package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/jsunfuck.py +0 -97
- package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/native.py +0 -233
- package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/nodejs.py +0 -49
- package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/v8.py +0 -33
- package/venv/lib/python3.10/site-packages/cloudscraper/user_agent/__init__.py +0 -124
- package/venv/lib/python3.10/site-packages/cloudscraper/user_agent/browsers.json +0 -7913
- package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/LICENSE +0 -22
- package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/METADATA +0 -674
- package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/RECORD +0 -48
- package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/REQUESTED +0 -0
- package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/WHEEL +0 -6
- package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/curl_cffi/__init__.py +0 -37
- package/venv/lib/python3.10/site-packages/curl_cffi/__version__.py +0 -8
- package/venv/lib/python3.10/site-packages/curl_cffi/_asyncio_selector.py +0 -344
- package/venv/lib/python3.10/site-packages/curl_cffi/_wrapper.abi3.so +0 -0
- package/venv/lib/python3.10/site-packages/curl_cffi/aio.py +0 -257
- package/venv/lib/python3.10/site-packages/curl_cffi/const.py +0 -581
- package/venv/lib/python3.10/site-packages/curl_cffi/curl.py +0 -548
- package/venv/lib/python3.10/site-packages/curl_cffi/py.typed +0 -1
- package/venv/lib/python3.10/site-packages/curl_cffi/requests/__init__.py +0 -146
- package/venv/lib/python3.10/site-packages/curl_cffi/requests/cookies.py +0 -355
- package/venv/lib/python3.10/site-packages/curl_cffi/requests/errors.py +0 -7
- package/venv/lib/python3.10/site-packages/curl_cffi/requests/exceptions.py +0 -219
- package/venv/lib/python3.10/site-packages/curl_cffi/requests/headers.py +0 -348
- package/venv/lib/python3.10/site-packages/curl_cffi/requests/impersonate.py +0 -360
- package/venv/lib/python3.10/site-packages/curl_cffi/requests/models.py +0 -292
- package/venv/lib/python3.10/site-packages/curl_cffi/requests/session.py +0 -1021
- package/venv/lib/python3.10/site-packages/curl_cffi/requests/utils.py +0 -663
- package/venv/lib/python3.10/site-packages/curl_cffi/requests/websockets.py +0 -711
- package/venv/lib/python3.10/site-packages/curl_cffi/utils.py +0 -13
- package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/LICENSE +0 -21
- package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/METADATA +0 -333
- package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/RECORD +0 -43
- package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/REQUESTED +0 -0
- package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/WHEEL +0 -6
- package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/distutils-precedence.pth +0 -1
- package/venv/lib/python3.10/site-packages/frozenlist/__init__.py +0 -98
- package/venv/lib/python3.10/site-packages/frozenlist/__init__.pyi +0 -47
- package/venv/lib/python3.10/site-packages/frozenlist/_frozenlist.cpython-310-x86_64-linux-gnu.so +0 -0
- package/venv/lib/python3.10/site-packages/frozenlist/_frozenlist.pyx +0 -123
- package/venv/lib/python3.10/site-packages/frozenlist/py.typed +0 -1
- package/venv/lib/python3.10/site-packages/frozenlist-1.5.0.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/frozenlist-1.5.0.dist-info/LICENSE +0 -201
- package/venv/lib/python3.10/site-packages/frozenlist-1.5.0.dist-info/METADATA +0 -477
- package/venv/lib/python3.10/site-packages/frozenlist-1.5.0.dist-info/RECORD +0 -12
- package/venv/lib/python3.10/site-packages/frozenlist-1.5.0.dist-info/WHEEL +0 -8
- package/venv/lib/python3.10/site-packages/frozenlist-1.5.0.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/idna/__init__.py +0 -45
- package/venv/lib/python3.10/site-packages/idna/codec.py +0 -122
- package/venv/lib/python3.10/site-packages/idna/compat.py +0 -15
- package/venv/lib/python3.10/site-packages/idna/core.py +0 -437
- package/venv/lib/python3.10/site-packages/idna/idnadata.py +0 -4243
- package/venv/lib/python3.10/site-packages/idna/intranges.py +0 -57
- package/venv/lib/python3.10/site-packages/idna/package_data.py +0 -1
- package/venv/lib/python3.10/site-packages/idna/py.typed +0 -0
- package/venv/lib/python3.10/site-packages/idna/uts46data.py +0 -8681
- package/venv/lib/python3.10/site-packages/idna-3.10.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/idna-3.10.dist-info/LICENSE.md +0 -31
- package/venv/lib/python3.10/site-packages/idna-3.10.dist-info/METADATA +0 -250
- package/venv/lib/python3.10/site-packages/idna-3.10.dist-info/RECORD +0 -22
- package/venv/lib/python3.10/site-packages/idna-3.10.dist-info/WHEEL +0 -4
- package/venv/lib/python3.10/site-packages/multidict/__init__.py +0 -48
- package/venv/lib/python3.10/site-packages/multidict/__init__.pyi +0 -152
- package/venv/lib/python3.10/site-packages/multidict/_abc.py +0 -48
- package/venv/lib/python3.10/site-packages/multidict/_compat.py +0 -14
- package/venv/lib/python3.10/site-packages/multidict/_multidict.cpython-310-x86_64-linux-gnu.so +0 -0
- package/venv/lib/python3.10/site-packages/multidict/_multidict_base.py +0 -152
- package/venv/lib/python3.10/site-packages/multidict/_multidict_py.py +0 -527
- package/venv/lib/python3.10/site-packages/multidict/py.typed +0 -1
- package/venv/lib/python3.10/site-packages/multidict-6.1.0.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/multidict-6.1.0.dist-info/LICENSE +0 -13
- package/venv/lib/python3.10/site-packages/multidict-6.1.0.dist-info/METADATA +0 -140
- package/venv/lib/python3.10/site-packages/multidict-6.1.0.dist-info/RECORD +0 -19
- package/venv/lib/python3.10/site-packages/multidict-6.1.0.dist-info/WHEEL +0 -6
- package/venv/lib/python3.10/site-packages/multidict-6.1.0.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/paho/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/paho/mqtt/__init__.py +0 -5
- package/venv/lib/python3.10/site-packages/paho/mqtt/client.py +0 -5004
- package/venv/lib/python3.10/site-packages/paho/mqtt/enums.py +0 -113
- package/venv/lib/python3.10/site-packages/paho/mqtt/matcher.py +0 -78
- package/venv/lib/python3.10/site-packages/paho/mqtt/packettypes.py +0 -43
- package/venv/lib/python3.10/site-packages/paho/mqtt/properties.py +0 -421
- package/venv/lib/python3.10/site-packages/paho/mqtt/publish.py +0 -306
- package/venv/lib/python3.10/site-packages/paho/mqtt/py.typed +0 -0
- package/venv/lib/python3.10/site-packages/paho/mqtt/reasoncodes.py +0 -223
- package/venv/lib/python3.10/site-packages/paho/mqtt/subscribe.py +0 -281
- package/venv/lib/python3.10/site-packages/paho/mqtt/subscribeoptions.py +0 -113
- package/venv/lib/python3.10/site-packages/paho_mqtt-2.1.0.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/paho_mqtt-2.1.0.dist-info/METADATA +0 -635
- package/venv/lib/python3.10/site-packages/paho_mqtt-2.1.0.dist-info/RECORD +0 -29
- package/venv/lib/python3.10/site-packages/paho_mqtt-2.1.0.dist-info/REQUESTED +0 -0
- package/venv/lib/python3.10/site-packages/paho_mqtt-2.1.0.dist-info/WHEEL +0 -4
- package/venv/lib/python3.10/site-packages/paho_mqtt-2.1.0.dist-info/licenses/LICENSE.txt +0 -3
- package/venv/lib/python3.10/site-packages/pip/__init__.py +0 -13
- package/venv/lib/python3.10/site-packages/pip/__main__.py +0 -31
- package/venv/lib/python3.10/site-packages/pip/_internal/__init__.py +0 -19
- package/venv/lib/python3.10/site-packages/pip/_internal/build_env.py +0 -296
- package/venv/lib/python3.10/site-packages/pip/_internal/cache.py +0 -264
- package/venv/lib/python3.10/site-packages/pip/_internal/cli/__init__.py +0 -4
- package/venv/lib/python3.10/site-packages/pip/_internal/cli/autocompletion.py +0 -171
- package/venv/lib/python3.10/site-packages/pip/_internal/cli/base_command.py +0 -220
- package/venv/lib/python3.10/site-packages/pip/_internal/cli/cmdoptions.py +0 -1018
- package/venv/lib/python3.10/site-packages/pip/_internal/cli/command_context.py +0 -27
- package/venv/lib/python3.10/site-packages/pip/_internal/cli/main.py +0 -70
- package/venv/lib/python3.10/site-packages/pip/_internal/cli/main_parser.py +0 -87
- package/venv/lib/python3.10/site-packages/pip/_internal/cli/parser.py +0 -292
- package/venv/lib/python3.10/site-packages/pip/_internal/cli/progress_bars.py +0 -321
- package/venv/lib/python3.10/site-packages/pip/_internal/cli/req_command.py +0 -506
- package/venv/lib/python3.10/site-packages/pip/_internal/cli/spinners.py +0 -157
- package/venv/lib/python3.10/site-packages/pip/_internal/cli/status_codes.py +0 -6
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/__init__.py +0 -127
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/cache.py +0 -223
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/check.py +0 -53
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/completion.py +0 -96
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/configuration.py +0 -266
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/debug.py +0 -202
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/download.py +0 -140
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/freeze.py +0 -97
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/hash.py +0 -59
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/help.py +0 -41
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/index.py +0 -139
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/install.py +0 -771
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/list.py +0 -363
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/search.py +0 -174
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/show.py +0 -178
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/uninstall.py +0 -105
- package/venv/lib/python3.10/site-packages/pip/_internal/commands/wheel.py +0 -178
- package/venv/lib/python3.10/site-packages/pip/_internal/configuration.py +0 -366
- package/venv/lib/python3.10/site-packages/pip/_internal/distributions/__init__.py +0 -21
- package/venv/lib/python3.10/site-packages/pip/_internal/distributions/base.py +0 -36
- package/venv/lib/python3.10/site-packages/pip/_internal/distributions/installed.py +0 -20
- package/venv/lib/python3.10/site-packages/pip/_internal/distributions/sdist.py +0 -127
- package/venv/lib/python3.10/site-packages/pip/_internal/distributions/wheel.py +0 -31
- package/venv/lib/python3.10/site-packages/pip/_internal/exceptions.py +0 -658
- package/venv/lib/python3.10/site-packages/pip/_internal/index/__init__.py +0 -2
- package/venv/lib/python3.10/site-packages/pip/_internal/index/collector.py +0 -648
- package/venv/lib/python3.10/site-packages/pip/_internal/index/package_finder.py +0 -1004
- package/venv/lib/python3.10/site-packages/pip/_internal/index/sources.py +0 -224
- package/venv/lib/python3.10/site-packages/pip/_internal/locations/__init__.py +0 -520
- package/venv/lib/python3.10/site-packages/pip/_internal/locations/_distutils.py +0 -169
- package/venv/lib/python3.10/site-packages/pip/_internal/locations/_sysconfig.py +0 -219
- package/venv/lib/python3.10/site-packages/pip/_internal/locations/base.py +0 -52
- package/venv/lib/python3.10/site-packages/pip/_internal/main.py +0 -12
- package/venv/lib/python3.10/site-packages/pip/_internal/metadata/__init__.py +0 -62
- package/venv/lib/python3.10/site-packages/pip/_internal/metadata/base.py +0 -546
- package/venv/lib/python3.10/site-packages/pip/_internal/metadata/pkg_resources.py +0 -256
- package/venv/lib/python3.10/site-packages/pip/_internal/models/__init__.py +0 -2
- package/venv/lib/python3.10/site-packages/pip/_internal/models/candidate.py +0 -34
- package/venv/lib/python3.10/site-packages/pip/_internal/models/direct_url.py +0 -220
- package/venv/lib/python3.10/site-packages/pip/_internal/models/format_control.py +0 -80
- package/venv/lib/python3.10/site-packages/pip/_internal/models/index.py +0 -28
- package/venv/lib/python3.10/site-packages/pip/_internal/models/link.py +0 -288
- package/venv/lib/python3.10/site-packages/pip/_internal/models/scheme.py +0 -31
- package/venv/lib/python3.10/site-packages/pip/_internal/models/search_scope.py +0 -129
- package/venv/lib/python3.10/site-packages/pip/_internal/models/selection_prefs.py +0 -51
- package/venv/lib/python3.10/site-packages/pip/_internal/models/target_python.py +0 -110
- package/venv/lib/python3.10/site-packages/pip/_internal/models/wheel.py +0 -89
- package/venv/lib/python3.10/site-packages/pip/_internal/network/__init__.py +0 -2
- package/venv/lib/python3.10/site-packages/pip/_internal/network/auth.py +0 -323
- package/venv/lib/python3.10/site-packages/pip/_internal/network/cache.py +0 -69
- package/venv/lib/python3.10/site-packages/pip/_internal/network/download.py +0 -185
- package/venv/lib/python3.10/site-packages/pip/_internal/network/lazy_wheel.py +0 -210
- package/venv/lib/python3.10/site-packages/pip/_internal/network/session.py +0 -454
- package/venv/lib/python3.10/site-packages/pip/_internal/network/utils.py +0 -96
- package/venv/lib/python3.10/site-packages/pip/_internal/network/xmlrpc.py +0 -60
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/metadata.py +0 -39
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/metadata_editable.py +0 -41
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/metadata_legacy.py +0 -74
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/wheel.py +0 -37
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/wheel_editable.py +0 -46
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/wheel_legacy.py +0 -102
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/check.py +0 -149
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/freeze.py +0 -254
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/install/__init__.py +0 -2
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/install/editable_legacy.py +0 -47
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/install/legacy.py +0 -120
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/install/wheel.py +0 -738
- package/venv/lib/python3.10/site-packages/pip/_internal/operations/prepare.py +0 -642
- package/venv/lib/python3.10/site-packages/pip/_internal/pyproject.py +0 -168
- package/venv/lib/python3.10/site-packages/pip/_internal/req/__init__.py +0 -94
- package/venv/lib/python3.10/site-packages/pip/_internal/req/constructors.py +0 -490
- package/venv/lib/python3.10/site-packages/pip/_internal/req/req_file.py +0 -536
- package/venv/lib/python3.10/site-packages/pip/_internal/req/req_install.py +0 -858
- package/venv/lib/python3.10/site-packages/pip/_internal/req/req_set.py +0 -189
- package/venv/lib/python3.10/site-packages/pip/_internal/req/req_tracker.py +0 -124
- package/venv/lib/python3.10/site-packages/pip/_internal/req/req_uninstall.py +0 -633
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/base.py +0 -20
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/legacy/resolver.py +0 -467
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/base.py +0 -141
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -547
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/factory.py +0 -739
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +0 -155
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/provider.py +0 -248
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/reporter.py +0 -68
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/requirements.py +0 -166
- package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py +0 -292
- package/venv/lib/python3.10/site-packages/pip/_internal/self_outdated_check.py +0 -189
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/_log.py +0 -38
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/appdirs.py +0 -52
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/compat.py +0 -63
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/compatibility_tags.py +0 -165
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/datetime.py +0 -11
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/deprecation.py +0 -120
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/direct_url_helpers.py +0 -87
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/distutils_args.py +0 -42
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/egg_link.py +0 -75
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/encoding.py +0 -36
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/entrypoints.py +0 -27
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/filesystem.py +0 -182
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/filetypes.py +0 -27
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/glibc.py +0 -88
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/hashes.py +0 -144
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/inject_securetransport.py +0 -35
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/logging.py +0 -343
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/misc.py +0 -653
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/models.py +0 -39
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/packaging.py +0 -57
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/setuptools_build.py +0 -195
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/subprocess.py +0 -260
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/temp_dir.py +0 -246
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/unpacking.py +0 -258
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/urls.py +0 -62
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/virtualenv.py +0 -104
- package/venv/lib/python3.10/site-packages/pip/_internal/utils/wheel.py +0 -136
- package/venv/lib/python3.10/site-packages/pip/_internal/vcs/__init__.py +0 -15
- package/venv/lib/python3.10/site-packages/pip/_internal/vcs/bazaar.py +0 -101
- package/venv/lib/python3.10/site-packages/pip/_internal/vcs/git.py +0 -526
- package/venv/lib/python3.10/site-packages/pip/_internal/vcs/mercurial.py +0 -163
- package/venv/lib/python3.10/site-packages/pip/_internal/vcs/subversion.py +0 -324
- package/venv/lib/python3.10/site-packages/pip/_internal/vcs/versioncontrol.py +0 -705
- package/venv/lib/python3.10/site-packages/pip/_internal/wheel_builder.py +0 -377
- package/venv/lib/python3.10/site-packages/pip/_vendor/__init__.py +0 -111
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__init__.py +0 -18
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/_cmd.py +0 -61
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/adapter.py +0 -137
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/cache.py +0 -43
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +0 -6
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +0 -150
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +0 -37
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/compat.py +0 -32
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/controller.py +0 -415
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/filewrapper.py +0 -111
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/heuristics.py +0 -139
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/serialize.py +0 -186
- package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/wrapper.py +0 -33
- package/venv/lib/python3.10/site-packages/pip/_vendor/certifi/__init__.py +0 -3
- package/venv/lib/python3.10/site-packages/pip/_vendor/certifi/__main__.py +0 -12
- package/venv/lib/python3.10/site-packages/pip/_vendor/certifi/cacert.pem +0 -4362
- package/venv/lib/python3.10/site-packages/pip/_vendor/certifi/core.py +0 -76
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/__init__.py +0 -83
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/big5freq.py +0 -386
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/big5prober.py +0 -47
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/chardistribution.py +0 -233
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/charsetgroupprober.py +0 -107
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/charsetprober.py +0 -145
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/cli/__init__.py +0 -1
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/cli/chardetect.py +0 -84
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/codingstatemachine.py +0 -88
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/compat.py +0 -36
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/cp949prober.py +0 -49
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/enums.py +0 -76
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/escprober.py +0 -101
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/escsm.py +0 -246
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/eucjpprober.py +0 -92
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/euckrfreq.py +0 -195
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/euckrprober.py +0 -47
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/euctwfreq.py +0 -387
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/euctwprober.py +0 -46
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/gb2312freq.py +0 -283
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/gb2312prober.py +0 -46
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/hebrewprober.py +0 -292
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/jisfreq.py +0 -325
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/jpcntx.py +0 -233
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langbulgarianmodel.py +0 -4650
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langgreekmodel.py +0 -4398
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langhebrewmodel.py +0 -4383
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langhungarianmodel.py +0 -4650
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langrussianmodel.py +0 -5718
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langthaimodel.py +0 -4383
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langturkishmodel.py +0 -4383
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/latin1prober.py +0 -145
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/mbcharsetprober.py +0 -91
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/mbcsgroupprober.py +0 -54
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/mbcssm.py +0 -572
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/metadata/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/metadata/languages.py +0 -310
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/sbcharsetprober.py +0 -145
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/sbcsgroupprober.py +0 -83
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/sjisprober.py +0 -92
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/universaldetector.py +0 -286
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/utf8prober.py +0 -82
- package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/version.py +0 -9
- package/venv/lib/python3.10/site-packages/pip/_vendor/colorama/__init__.py +0 -6
- package/venv/lib/python3.10/site-packages/pip/_vendor/colorama/ansi.py +0 -102
- package/venv/lib/python3.10/site-packages/pip/_vendor/colorama/ansitowin32.py +0 -258
- package/venv/lib/python3.10/site-packages/pip/_vendor/colorama/initialise.py +0 -80
- package/venv/lib/python3.10/site-packages/pip/_vendor/colorama/win32.py +0 -152
- package/venv/lib/python3.10/site-packages/pip/_vendor/colorama/winterm.py +0 -169
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/__init__.py +0 -23
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/compat.py +0 -1116
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/database.py +0 -1345
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/index.py +0 -509
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/locators.py +0 -1300
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/manifest.py +0 -393
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/markers.py +0 -152
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/metadata.py +0 -1058
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/resources.py +0 -358
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/scripts.py +0 -429
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/util.py +0 -1932
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/version.py +0 -739
- package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/wheel.py +0 -1053
- package/venv/lib/python3.10/site-packages/pip/_vendor/distro.py +0 -1386
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/__init__.py +0 -35
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_ihatexml.py +0 -289
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_inputstream.py +0 -918
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_tokenizer.py +0 -1735
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_trie/__init__.py +0 -5
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_trie/_base.py +0 -40
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_trie/py.py +0 -67
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_utils.py +0 -159
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/constants.py +0 -2946
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py +0 -29
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/base.py +0 -12
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py +0 -73
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/lint.py +0 -93
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/optionaltags.py +0 -207
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/sanitizer.py +0 -916
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/whitespace.py +0 -38
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/html5parser.py +0 -2795
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/serializer.py +0 -409
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py +0 -30
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py +0 -54
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treeadapters/sax.py +0 -50
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py +0 -88
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/base.py +0 -417
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/dom.py +0 -239
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/etree.py +0 -343
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py +0 -392
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py +0 -154
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/base.py +0 -252
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/dom.py +0 -43
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/etree.py +0 -131
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/etree_lxml.py +0 -215
- package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/genshi.py +0 -69
- package/venv/lib/python3.10/site-packages/pip/_vendor/idna/__init__.py +0 -44
- package/venv/lib/python3.10/site-packages/pip/_vendor/idna/codec.py +0 -112
- package/venv/lib/python3.10/site-packages/pip/_vendor/idna/compat.py +0 -13
- package/venv/lib/python3.10/site-packages/pip/_vendor/idna/core.py +0 -397
- package/venv/lib/python3.10/site-packages/pip/_vendor/idna/idnadata.py +0 -2137
- package/venv/lib/python3.10/site-packages/pip/_vendor/idna/intranges.py +0 -54
- package/venv/lib/python3.10/site-packages/pip/_vendor/idna/package_data.py +0 -2
- package/venv/lib/python3.10/site-packages/pip/_vendor/idna/uts46data.py +0 -8512
- package/venv/lib/python3.10/site-packages/pip/_vendor/msgpack/__init__.py +0 -54
- package/venv/lib/python3.10/site-packages/pip/_vendor/msgpack/_version.py +0 -1
- package/venv/lib/python3.10/site-packages/pip/_vendor/msgpack/exceptions.py +0 -48
- package/venv/lib/python3.10/site-packages/pip/_vendor/msgpack/ext.py +0 -193
- package/venv/lib/python3.10/site-packages/pip/_vendor/msgpack/fallback.py +0 -1012
- package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/__about__.py +0 -26
- package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/__init__.py +0 -25
- package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/_manylinux.py +0 -301
- package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/_musllinux.py +0 -136
- package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/_structures.py +0 -61
- package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/markers.py +0 -304
- package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/requirements.py +0 -146
- package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/specifiers.py +0 -802
- package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/tags.py +0 -487
- package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/utils.py +0 -136
- package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/version.py +0 -504
- package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/__init__.py +0 -6
- package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/build.py +0 -127
- package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/check.py +0 -207
- package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/colorlog.py +0 -115
- package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/compat.py +0 -51
- package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/dirtools.py +0 -44
- package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/envbuild.py +0 -171
- package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/__init__.py +0 -17
- package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py +0 -363
- package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/meta.py +0 -92
- package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/wrappers.py +0 -375
- package/venv/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py +0 -3296
- package/venv/lib/python3.10/site-packages/pip/_vendor/pkg_resources/py31compat.py +0 -23
- package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/__init__.py +0 -331
- package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/__main__.py +0 -46
- package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/android.py +0 -119
- package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/api.py +0 -156
- package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/macos.py +0 -64
- package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/unix.py +0 -181
- package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/version.py +0 -4
- package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/windows.py +0 -182
- package/venv/lib/python3.10/site-packages/pip/_vendor/progress/__init__.py +0 -189
- package/venv/lib/python3.10/site-packages/pip/_vendor/progress/bar.py +0 -93
- package/venv/lib/python3.10/site-packages/pip/_vendor/progress/colors.py +0 -79
- package/venv/lib/python3.10/site-packages/pip/_vendor/progress/counter.py +0 -47
- package/venv/lib/python3.10/site-packages/pip/_vendor/progress/spinner.py +0 -45
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/__init__.py +0 -83
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/__main__.py +0 -17
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/cmdline.py +0 -663
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/console.py +0 -70
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/filter.py +0 -71
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/filters/__init__.py +0 -937
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatter.py +0 -94
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/__init__.py +0 -153
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/_mapping.py +0 -84
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/bbcode.py +0 -108
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/groff.py +0 -168
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/html.py +0 -983
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/img.py +0 -641
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/irc.py +0 -179
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/latex.py +0 -511
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/other.py +0 -161
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/pangomarkup.py +0 -83
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/rtf.py +0 -146
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/svg.py +0 -188
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/terminal.py +0 -127
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/terminal256.py +0 -338
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/lexer.py +0 -879
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/lexers/__init__.py +0 -341
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/lexers/_mapping.py +0 -580
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/lexers/python.py +0 -1188
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/modeline.py +0 -43
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/plugin.py +0 -69
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/regexopt.py +0 -91
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/scanner.py +0 -104
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/sphinxext.py +0 -155
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/style.py +0 -197
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/styles/__init__.py +0 -93
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/token.py +0 -212
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/unistring.py +0 -153
- package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/util.py +0 -308
- package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/__init__.py +0 -328
- package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/actions.py +0 -207
- package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/common.py +0 -424
- package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/core.py +0 -5789
- package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/diagram/__init__.py +0 -593
- package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/exceptions.py +0 -267
- package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/helpers.py +0 -1069
- package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/results.py +0 -760
- package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/testing.py +0 -331
- package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/unicode.py +0 -332
- package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/util.py +0 -235
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/__init__.py +0 -154
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/__version__.py +0 -14
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/_internal_utils.py +0 -42
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/adapters.py +0 -538
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/api.py +0 -159
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/auth.py +0 -305
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/certs.py +0 -18
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/compat.py +0 -77
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/cookies.py +0 -549
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/exceptions.py +0 -133
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/help.py +0 -132
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/hooks.py +0 -34
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/models.py +0 -973
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/packages.py +0 -16
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/sessions.py +0 -771
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/status_codes.py +0 -123
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/structures.py +0 -105
- package/venv/lib/python3.10/site-packages/pip/_vendor/requests/utils.py +0 -1060
- package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/__init__.py +0 -26
- package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/compat/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/compat/collections_abc.py +0 -6
- package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/providers.py +0 -133
- package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/reporters.py +0 -43
- package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py +0 -482
- package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/structs.py +0 -165
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/__init__.py +0 -172
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/__main__.py +0 -280
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_cell_widths.py +0 -451
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_emoji_codes.py +0 -3610
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_emoji_replace.py +0 -32
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_extension.py +0 -10
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_inspect.py +0 -210
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_log_render.py +0 -94
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_loop.py +0 -43
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_lru_cache.py +0 -34
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_palettes.py +0 -309
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_pick.py +0 -17
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_ratio.py +0 -160
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_spinners.py +0 -848
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_stack.py +0 -16
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_timer.py +0 -19
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_windows.py +0 -72
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_wrap.py +0 -55
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/abc.py +0 -33
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/align.py +0 -312
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/ansi.py +0 -228
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/bar.py +0 -94
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/box.py +0 -483
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/cells.py +0 -147
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/color.py +0 -581
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/color_triplet.py +0 -38
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/columns.py +0 -187
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/console.py +0 -2211
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/constrain.py +0 -37
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/containers.py +0 -167
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/control.py +0 -175
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/default_styles.py +0 -183
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/diagnose.py +0 -6
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/emoji.py +0 -96
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/errors.py +0 -34
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/file_proxy.py +0 -54
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/filesize.py +0 -89
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/highlighter.py +0 -147
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/json.py +0 -140
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/jupyter.py +0 -92
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/layout.py +0 -444
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/live.py +0 -365
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/live_render.py +0 -113
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/logging.py +0 -268
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/markup.py +0 -244
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/measure.py +0 -149
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/padding.py +0 -141
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/pager.py +0 -34
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/palette.py +0 -100
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/panel.py +0 -250
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/pretty.py +0 -903
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/progress.py +0 -1036
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/progress_bar.py +0 -216
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/prompt.py +0 -376
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/protocol.py +0 -42
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/region.py +0 -10
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/repr.py +0 -151
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/rule.py +0 -115
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/scope.py +0 -86
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/screen.py +0 -54
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/segment.py +0 -720
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/spinner.py +0 -134
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/status.py +0 -132
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/style.py +0 -785
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/styled.py +0 -42
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/syntax.py +0 -735
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/table.py +0 -968
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/tabulate.py +0 -51
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/terminal_theme.py +0 -55
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/text.py +0 -1282
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/theme.py +0 -112
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/themes.py +0 -5
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/traceback.py +0 -678
- package/venv/lib/python3.10/site-packages/pip/_vendor/rich/tree.py +0 -249
- package/venv/lib/python3.10/site-packages/pip/_vendor/six.py +0 -998
- package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/__init__.py +0 -517
- package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/_asyncio.py +0 -92
- package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/_utils.py +0 -68
- package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/after.py +0 -46
- package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/before.py +0 -41
- package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/before_sleep.py +0 -58
- package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/nap.py +0 -43
- package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/retry.py +0 -213
- package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/stop.py +0 -96
- package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/tornadoweb.py +0 -59
- package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/wait.py +0 -191
- package/venv/lib/python3.10/site-packages/pip/_vendor/tomli/__init__.py +0 -6
- package/venv/lib/python3.10/site-packages/pip/_vendor/tomli/_parser.py +0 -703
- package/venv/lib/python3.10/site-packages/pip/_vendor/tomli/_re.py +0 -83
- package/venv/lib/python3.10/site-packages/pip/_vendor/typing_extensions.py +0 -2296
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/__init__.py +0 -85
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/_collections.py +0 -355
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/_version.py +0 -2
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/connection.py +0 -569
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/connectionpool.py +0 -1113
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +0 -36
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +0 -519
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +0 -397
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/appengine.py +0 -314
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +0 -130
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +0 -511
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +0 -922
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/socks.py +0 -216
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/exceptions.py +0 -323
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/fields.py +0 -274
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/filepost.py +0 -98
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +0 -51
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/packages/six.py +0 -1077
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/poolmanager.py +0 -539
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/request.py +0 -170
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/response.py +0 -821
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/__init__.py +0 -49
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/connection.py +0 -149
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/proxy.py +0 -57
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/queue.py +0 -22
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/request.py +0 -143
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/response.py +0 -107
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/retry.py +0 -622
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/ssl_.py +0 -495
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +0 -161
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/ssltransport.py +0 -221
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/timeout.py +0 -268
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/url.py +0 -432
- package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/wait.py +0 -153
- package/venv/lib/python3.10/site-packages/pip/_vendor/vendor.txt +0 -25
- package/venv/lib/python3.10/site-packages/pip/_vendor/webencodings/__init__.py +0 -342
- package/venv/lib/python3.10/site-packages/pip/_vendor/webencodings/labels.py +0 -231
- package/venv/lib/python3.10/site-packages/pip/_vendor/webencodings/mklabels.py +0 -59
- package/venv/lib/python3.10/site-packages/pip/_vendor/webencodings/tests.py +0 -153
- package/venv/lib/python3.10/site-packages/pip/_vendor/webencodings/x_user_defined.py +0 -325
- package/venv/lib/python3.10/site-packages/pip/py.typed +0 -4
- package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/LICENSE.txt +0 -20
- package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/METADATA +0 -92
- package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/RECORD +0 -1037
- package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/REQUESTED +0 -0
- package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/WHEEL +0 -5
- package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/entry_points.txt +0 -5
- package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/pkg_resources/__init__.py +0 -3303
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/appdirs.py +0 -608
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/__about__.py +0 -26
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/__init__.py +0 -25
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/_manylinux.py +0 -301
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/_musllinux.py +0 -136
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/_structures.py +0 -67
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/markers.py +0 -304
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/requirements.py +0 -146
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/specifiers.py +0 -828
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/tags.py +0 -484
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/utils.py +0 -136
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/version.py +0 -504
- package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/pyparsing.py +0 -5742
- package/venv/lib/python3.10/site-packages/pkg_resources/extern/__init__.py +0 -73
- package/venv/lib/python3.10/site-packages/pkg_resources/tests/data/my-test-package-source/setup.py +0 -6
- package/venv/lib/python3.10/site-packages/propcache/__init__.py +0 -32
- package/venv/lib/python3.10/site-packages/propcache/_helpers.py +0 -39
- package/venv/lib/python3.10/site-packages/propcache/_helpers_c.cpython-310-x86_64-linux-gnu.so +0 -0
- package/venv/lib/python3.10/site-packages/propcache/_helpers_c.pyx +0 -84
- package/venv/lib/python3.10/site-packages/propcache/_helpers_py.py +0 -56
- package/venv/lib/python3.10/site-packages/propcache/api.py +0 -8
- package/venv/lib/python3.10/site-packages/propcache/py.typed +0 -1
- package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/LICENSE +0 -202
- package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/METADATA +0 -275
- package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/NOTICE +0 -13
- package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/RECORD +0 -18
- package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/WHEEL +0 -6
- package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/pycparser/__init__.py +0 -93
- package/venv/lib/python3.10/site-packages/pycparser/_ast_gen.py +0 -336
- package/venv/lib/python3.10/site-packages/pycparser/_build_tables.py +0 -40
- package/venv/lib/python3.10/site-packages/pycparser/_c_ast.cfg +0 -195
- package/venv/lib/python3.10/site-packages/pycparser/ast_transforms.py +0 -164
- package/venv/lib/python3.10/site-packages/pycparser/c_ast.py +0 -1125
- package/venv/lib/python3.10/site-packages/pycparser/c_generator.py +0 -502
- package/venv/lib/python3.10/site-packages/pycparser/c_lexer.py +0 -555
- package/venv/lib/python3.10/site-packages/pycparser/c_parser.py +0 -1950
- package/venv/lib/python3.10/site-packages/pycparser/lextab.py +0 -10
- package/venv/lib/python3.10/site-packages/pycparser/ply/__init__.py +0 -5
- package/venv/lib/python3.10/site-packages/pycparser/ply/cpp.py +0 -905
- package/venv/lib/python3.10/site-packages/pycparser/ply/ctokens.py +0 -133
- package/venv/lib/python3.10/site-packages/pycparser/ply/lex.py +0 -1099
- package/venv/lib/python3.10/site-packages/pycparser/ply/yacc.py +0 -3494
- package/venv/lib/python3.10/site-packages/pycparser/ply/ygen.py +0 -74
- package/venv/lib/python3.10/site-packages/pycparser/plyparser.py +0 -133
- package/venv/lib/python3.10/site-packages/pycparser/yacctab.py +0 -369
- package/venv/lib/python3.10/site-packages/pycparser-2.22.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/pycparser-2.22.dist-info/LICENSE +0 -27
- package/venv/lib/python3.10/site-packages/pycparser-2.22.dist-info/METADATA +0 -28
- package/venv/lib/python3.10/site-packages/pycparser-2.22.dist-info/RECORD +0 -41
- package/venv/lib/python3.10/site-packages/pycparser-2.22.dist-info/WHEEL +0 -5
- package/venv/lib/python3.10/site-packages/pycparser-2.22.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/pyparsing/__init__.py +0 -326
- package/venv/lib/python3.10/site-packages/pyparsing/actions.py +0 -219
- package/venv/lib/python3.10/site-packages/pyparsing/common.py +0 -434
- package/venv/lib/python3.10/site-packages/pyparsing/core.py +0 -6226
- package/venv/lib/python3.10/site-packages/pyparsing/diagram/__init__.py +0 -744
- package/venv/lib/python3.10/site-packages/pyparsing/exceptions.py +0 -314
- package/venv/lib/python3.10/site-packages/pyparsing/helpers.py +0 -1102
- package/venv/lib/python3.10/site-packages/pyparsing/py.typed +0 -0
- package/venv/lib/python3.10/site-packages/pyparsing/results.py +0 -816
- package/venv/lib/python3.10/site-packages/pyparsing/testing.py +0 -362
- package/venv/lib/python3.10/site-packages/pyparsing/unicode.py +0 -356
- package/venv/lib/python3.10/site-packages/pyparsing/util.py +0 -398
- package/venv/lib/python3.10/site-packages/pyparsing-3.2.1.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/pyparsing-3.2.1.dist-info/LICENSE +0 -18
- package/venv/lib/python3.10/site-packages/pyparsing-3.2.1.dist-info/METADATA +0 -124
- package/venv/lib/python3.10/site-packages/pyparsing-3.2.1.dist-info/RECORD +0 -28
- package/venv/lib/python3.10/site-packages/pyparsing-3.2.1.dist-info/WHEEL +0 -4
- package/venv/lib/python3.10/site-packages/requests/__init__.py +0 -184
- package/venv/lib/python3.10/site-packages/requests/__version__.py +0 -14
- package/venv/lib/python3.10/site-packages/requests/_internal_utils.py +0 -50
- package/venv/lib/python3.10/site-packages/requests/adapters.py +0 -719
- package/venv/lib/python3.10/site-packages/requests/api.py +0 -157
- package/venv/lib/python3.10/site-packages/requests/auth.py +0 -314
- package/venv/lib/python3.10/site-packages/requests/certs.py +0 -17
- package/venv/lib/python3.10/site-packages/requests/compat.py +0 -94
- package/venv/lib/python3.10/site-packages/requests/cookies.py +0 -561
- package/venv/lib/python3.10/site-packages/requests/exceptions.py +0 -151
- package/venv/lib/python3.10/site-packages/requests/help.py +0 -134
- package/venv/lib/python3.10/site-packages/requests/hooks.py +0 -33
- package/venv/lib/python3.10/site-packages/requests/models.py +0 -1037
- package/venv/lib/python3.10/site-packages/requests/packages.py +0 -23
- package/venv/lib/python3.10/site-packages/requests/sessions.py +0 -831
- package/venv/lib/python3.10/site-packages/requests/status_codes.py +0 -128
- package/venv/lib/python3.10/site-packages/requests/structures.py +0 -99
- package/venv/lib/python3.10/site-packages/requests/utils.py +0 -1096
- package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/LICENSE +0 -175
- package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/METADATA +0 -119
- package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/RECORD +0 -43
- package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/REQUESTED +0 -0
- package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/WHEEL +0 -5
- package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/requests_toolbelt/__init__.py +0 -34
- package/venv/lib/python3.10/site-packages/requests_toolbelt/_compat.py +0 -302
- package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/__init__.py +0 -15
- package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/appengine.py +0 -206
- package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/fingerprint.py +0 -48
- package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/host_header_ssl.py +0 -43
- package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/socket_options.py +0 -129
- package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/source.py +0 -67
- package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/ssl.py +0 -66
- package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/x509.py +0 -196
- package/venv/lib/python3.10/site-packages/requests_toolbelt/auth/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/requests_toolbelt/auth/_digest_auth_compat.py +0 -29
- package/venv/lib/python3.10/site-packages/requests_toolbelt/auth/guess.py +0 -146
- package/venv/lib/python3.10/site-packages/requests_toolbelt/auth/handler.py +0 -142
- package/venv/lib/python3.10/site-packages/requests_toolbelt/auth/http_proxy_digest.py +0 -103
- package/venv/lib/python3.10/site-packages/requests_toolbelt/cookies/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/requests_toolbelt/cookies/forgetful.py +0 -7
- package/venv/lib/python3.10/site-packages/requests_toolbelt/downloadutils/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/requests_toolbelt/downloadutils/stream.py +0 -176
- package/venv/lib/python3.10/site-packages/requests_toolbelt/downloadutils/tee.py +0 -123
- package/venv/lib/python3.10/site-packages/requests_toolbelt/exceptions.py +0 -25
- package/venv/lib/python3.10/site-packages/requests_toolbelt/multipart/__init__.py +0 -31
- package/venv/lib/python3.10/site-packages/requests_toolbelt/multipart/decoder.py +0 -156
- package/venv/lib/python3.10/site-packages/requests_toolbelt/multipart/encoder.py +0 -655
- package/venv/lib/python3.10/site-packages/requests_toolbelt/sessions.py +0 -89
- package/venv/lib/python3.10/site-packages/requests_toolbelt/streaming_iterator.py +0 -116
- package/venv/lib/python3.10/site-packages/requests_toolbelt/threaded/__init__.py +0 -97
- package/venv/lib/python3.10/site-packages/requests_toolbelt/threaded/pool.py +0 -211
- package/venv/lib/python3.10/site-packages/requests_toolbelt/threaded/thread.py +0 -53
- package/venv/lib/python3.10/site-packages/requests_toolbelt/utils/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/requests_toolbelt/utils/deprecated.py +0 -91
- package/venv/lib/python3.10/site-packages/requests_toolbelt/utils/dump.py +0 -198
- package/venv/lib/python3.10/site-packages/requests_toolbelt/utils/formdata.py +0 -108
- package/venv/lib/python3.10/site-packages/requests_toolbelt/utils/user_agent.py +0 -143
- package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/AUTHORS.rst +0 -57
- package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/LICENSE +0 -13
- package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/METADATA +0 -521
- package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/RECORD +0 -75
- package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/WHEEL +0 -6
- package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go/__init__.py +0 -1
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go/_scrypted_arlo_go.cpython-310-x86_64-linux-gnu.h +0 -555
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go/_scrypted_arlo_go.cpython-310-x86_64-linux-gnu.so +0 -0
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go/build.py +0 -344
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go/go.py +0 -2215
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go/scrypted_arlo_go.c +0 -6019
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go/scrypted_arlo_go.go +0 -3612
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go/scrypted_arlo_go.py +0 -1910
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go/scrypted_arlo_go_go.h +0 -555
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go-0.7.6.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go-0.7.6.dist-info/METADATA +0 -11
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go-0.7.6.dist-info/RECORD +0 -19
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go-0.7.6.dist-info/REQUESTED +0 -0
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go-0.7.6.dist-info/WHEEL +0 -8
- package/venv/lib/python3.10/site-packages/scrypted_arlo_go-0.7.6.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/setuptools/__init__.py +0 -242
- package/venv/lib/python3.10/site-packages/setuptools/_deprecation_warning.py +0 -7
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/__init__.py +0 -24
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/_msvccompiler.py +0 -561
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/archive_util.py +0 -256
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/bcppcompiler.py +0 -393
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/ccompiler.py +0 -1123
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py +0 -403
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/__init__.py +0 -31
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/bdist.py +0 -143
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/bdist_dumb.py +0 -123
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/bdist_msi.py +0 -749
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/bdist_rpm.py +0 -579
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/bdist_wininst.py +0 -377
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build.py +0 -157
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build_clib.py +0 -209
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py +0 -755
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build_py.py +0 -392
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build_scripts.py +0 -152
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/check.py +0 -148
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/clean.py +0 -76
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/config.py +0 -344
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install.py +0 -721
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install_data.py +0 -79
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install_egg_info.py +0 -84
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install_headers.py +0 -47
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install_lib.py +0 -217
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install_scripts.py +0 -60
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/py37compat.py +0 -30
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/register.py +0 -304
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py +0 -494
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/upload.py +0 -214
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/config.py +0 -130
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/core.py +0 -249
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/cygwinccompiler.py +0 -425
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/debug.py +0 -5
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/dep_util.py +0 -92
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/dir_util.py +0 -210
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py +0 -1257
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/errors.py +0 -97
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/extension.py +0 -240
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/fancy_getopt.py +0 -457
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/file_util.py +0 -238
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/filelist.py +0 -355
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/log.py +0 -77
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/msvc9compiler.py +0 -788
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/msvccompiler.py +0 -643
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/py35compat.py +0 -19
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/py38compat.py +0 -7
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/spawn.py +0 -106
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/sysconfig.py +0 -601
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/text_file.py +0 -286
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/unixccompiler.py +0 -325
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/util.py +0 -548
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/version.py +0 -363
- package/venv/lib/python3.10/site-packages/setuptools/_distutils/versionpredicate.py +0 -169
- package/venv/lib/python3.10/site-packages/setuptools/_imp.py +0 -82
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__init__.py +0 -4
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/more.py +0 -3825
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/recipes.py +0 -620
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/ordered_set.py +0 -488
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/__about__.py +0 -26
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/__init__.py +0 -25
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/_manylinux.py +0 -301
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/_musllinux.py +0 -136
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/_structures.py +0 -67
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/markers.py +0 -304
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/requirements.py +0 -146
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/specifiers.py +0 -828
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/tags.py +0 -484
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/utils.py +0 -136
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/version.py +0 -504
- package/venv/lib/python3.10/site-packages/setuptools/_vendor/pyparsing.py +0 -5742
- package/venv/lib/python3.10/site-packages/setuptools/archive_util.py +0 -205
- package/venv/lib/python3.10/site-packages/setuptools/build_meta.py +0 -290
- package/venv/lib/python3.10/site-packages/setuptools/cli-32.exe +0 -0
- package/venv/lib/python3.10/site-packages/setuptools/cli-64.exe +0 -0
- package/venv/lib/python3.10/site-packages/setuptools/cli-arm64.exe +0 -0
- package/venv/lib/python3.10/site-packages/setuptools/cli.exe +0 -0
- package/venv/lib/python3.10/site-packages/setuptools/command/__init__.py +0 -8
- package/venv/lib/python3.10/site-packages/setuptools/command/alias.py +0 -78
- package/venv/lib/python3.10/site-packages/setuptools/command/bdist_egg.py +0 -456
- package/venv/lib/python3.10/site-packages/setuptools/command/bdist_rpm.py +0 -40
- package/venv/lib/python3.10/site-packages/setuptools/command/build_clib.py +0 -101
- package/venv/lib/python3.10/site-packages/setuptools/command/build_ext.py +0 -328
- package/venv/lib/python3.10/site-packages/setuptools/command/build_py.py +0 -242
- package/venv/lib/python3.10/site-packages/setuptools/command/develop.py +0 -193
- package/venv/lib/python3.10/site-packages/setuptools/command/dist_info.py +0 -36
- package/venv/lib/python3.10/site-packages/setuptools/command/easy_install.py +0 -2354
- package/venv/lib/python3.10/site-packages/setuptools/command/egg_info.py +0 -755
- package/venv/lib/python3.10/site-packages/setuptools/command/install.py +0 -132
- package/venv/lib/python3.10/site-packages/setuptools/command/install_egg_info.py +0 -82
- package/venv/lib/python3.10/site-packages/setuptools/command/install_lib.py +0 -148
- package/venv/lib/python3.10/site-packages/setuptools/command/install_scripts.py +0 -69
- package/venv/lib/python3.10/site-packages/setuptools/command/launcher manifest.xml +0 -15
- package/venv/lib/python3.10/site-packages/setuptools/command/py36compat.py +0 -134
- package/venv/lib/python3.10/site-packages/setuptools/command/register.py +0 -18
- package/venv/lib/python3.10/site-packages/setuptools/command/rotate.py +0 -64
- package/venv/lib/python3.10/site-packages/setuptools/command/saveopts.py +0 -22
- package/venv/lib/python3.10/site-packages/setuptools/command/sdist.py +0 -196
- package/venv/lib/python3.10/site-packages/setuptools/command/setopt.py +0 -149
- package/venv/lib/python3.10/site-packages/setuptools/command/test.py +0 -252
- package/venv/lib/python3.10/site-packages/setuptools/command/upload.py +0 -17
- package/venv/lib/python3.10/site-packages/setuptools/command/upload_docs.py +0 -202
- package/venv/lib/python3.10/site-packages/setuptools/config.py +0 -751
- package/venv/lib/python3.10/site-packages/setuptools/dep_util.py +0 -25
- package/venv/lib/python3.10/site-packages/setuptools/depends.py +0 -176
- package/venv/lib/python3.10/site-packages/setuptools/dist.py +0 -1156
- package/venv/lib/python3.10/site-packages/setuptools/errors.py +0 -40
- package/venv/lib/python3.10/site-packages/setuptools/extension.py +0 -55
- package/venv/lib/python3.10/site-packages/setuptools/extern/__init__.py +0 -73
- package/venv/lib/python3.10/site-packages/setuptools/glob.py +0 -167
- package/venv/lib/python3.10/site-packages/setuptools/gui-32.exe +0 -0
- package/venv/lib/python3.10/site-packages/setuptools/gui-64.exe +0 -0
- package/venv/lib/python3.10/site-packages/setuptools/gui-arm64.exe +0 -0
- package/venv/lib/python3.10/site-packages/setuptools/gui.exe +0 -0
- package/venv/lib/python3.10/site-packages/setuptools/installer.py +0 -104
- package/venv/lib/python3.10/site-packages/setuptools/launch.py +0 -36
- package/venv/lib/python3.10/site-packages/setuptools/monkey.py +0 -177
- package/venv/lib/python3.10/site-packages/setuptools/msvc.py +0 -1805
- package/venv/lib/python3.10/site-packages/setuptools/namespaces.py +0 -107
- package/venv/lib/python3.10/site-packages/setuptools/package_index.py +0 -1150
- package/venv/lib/python3.10/site-packages/setuptools/py34compat.py +0 -13
- package/venv/lib/python3.10/site-packages/setuptools/sandbox.py +0 -530
- package/venv/lib/python3.10/site-packages/setuptools/script (dev).tmpl +0 -6
- package/venv/lib/python3.10/site-packages/setuptools/script.tmpl +0 -3
- package/venv/lib/python3.10/site-packages/setuptools/unicode_utils.py +0 -42
- package/venv/lib/python3.10/site-packages/setuptools/version.py +0 -6
- package/venv/lib/python3.10/site-packages/setuptools/wheel.py +0 -213
- package/venv/lib/python3.10/site-packages/setuptools/windows_support.py +0 -29
- package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/LICENSE +0 -19
- package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/METADATA +0 -125
- package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/RECORD +0 -298
- package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/REQUESTED +0 -0
- package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/WHEEL +0 -5
- package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/entry_points.txt +0 -56
- package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/top_level.txt +0 -4
- package/venv/lib/python3.10/site-packages/six-1.17.0.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/six-1.17.0.dist-info/LICENSE +0 -18
- package/venv/lib/python3.10/site-packages/six-1.17.0.dist-info/METADATA +0 -43
- package/venv/lib/python3.10/site-packages/six-1.17.0.dist-info/RECORD +0 -8
- package/venv/lib/python3.10/site-packages/six-1.17.0.dist-info/WHEEL +0 -6
- package/venv/lib/python3.10/site-packages/six-1.17.0.dist-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/six.py +0 -1003
- package/venv/lib/python3.10/site-packages/soupsieve/__init__.py +0 -168
- package/venv/lib/python3.10/site-packages/soupsieve/__meta__.py +0 -197
- package/venv/lib/python3.10/site-packages/soupsieve/css_match.py +0 -1582
- package/venv/lib/python3.10/site-packages/soupsieve/css_parser.py +0 -1289
- package/venv/lib/python3.10/site-packages/soupsieve/css_types.py +0 -407
- package/venv/lib/python3.10/site-packages/soupsieve/pretty.py +0 -139
- package/venv/lib/python3.10/site-packages/soupsieve/py.typed +0 -0
- package/venv/lib/python3.10/site-packages/soupsieve/util.py +0 -117
- package/venv/lib/python3.10/site-packages/soupsieve-2.6.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/soupsieve-2.6.dist-info/METADATA +0 -114
- package/venv/lib/python3.10/site-packages/soupsieve-2.6.dist-info/RECORD +0 -20
- package/venv/lib/python3.10/site-packages/soupsieve-2.6.dist-info/WHEEL +0 -4
- package/venv/lib/python3.10/site-packages/soupsieve-2.6.dist-info/licenses/LICENSE.md +0 -21
- package/venv/lib/python3.10/site-packages/sseclient-0.0.22.egg-info/PKG-INFO +0 -98
- package/venv/lib/python3.10/site-packages/sseclient-0.0.22.egg-info/SOURCES.txt +0 -12
- package/venv/lib/python3.10/site-packages/sseclient-0.0.22.egg-info/dependency_links.txt +0 -1
- package/venv/lib/python3.10/site-packages/sseclient-0.0.22.egg-info/installed-files.txt +0 -7
- package/venv/lib/python3.10/site-packages/sseclient-0.0.22.egg-info/requires.txt +0 -2
- package/venv/lib/python3.10/site-packages/sseclient-0.0.22.egg-info/top_level.txt +0 -1
- package/venv/lib/python3.10/site-packages/sseclient.py +0 -165
- package/venv/lib/python3.10/site-packages/typing_extensions-4.12.2.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/typing_extensions-4.12.2.dist-info/LICENSE +0 -279
- package/venv/lib/python3.10/site-packages/typing_extensions-4.12.2.dist-info/METADATA +0 -67
- package/venv/lib/python3.10/site-packages/typing_extensions-4.12.2.dist-info/RECORD +0 -7
- package/venv/lib/python3.10/site-packages/typing_extensions-4.12.2.dist-info/WHEEL +0 -4
- package/venv/lib/python3.10/site-packages/typing_extensions.py +0 -3641
- package/venv/lib/python3.10/site-packages/urllib3/__init__.py +0 -211
- package/venv/lib/python3.10/site-packages/urllib3/_base_connection.py +0 -165
- package/venv/lib/python3.10/site-packages/urllib3/_collections.py +0 -479
- package/venv/lib/python3.10/site-packages/urllib3/_request_methods.py +0 -278
- package/venv/lib/python3.10/site-packages/urllib3/_version.py +0 -16
- package/venv/lib/python3.10/site-packages/urllib3/connection.py +0 -1044
- package/venv/lib/python3.10/site-packages/urllib3/connectionpool.py +0 -1178
- package/venv/lib/python3.10/site-packages/urllib3/contrib/__init__.py +0 -0
- package/venv/lib/python3.10/site-packages/urllib3/contrib/emscripten/__init__.py +0 -16
- package/venv/lib/python3.10/site-packages/urllib3/contrib/emscripten/connection.py +0 -255
- package/venv/lib/python3.10/site-packages/urllib3/contrib/emscripten/emscripten_fetch_worker.js +0 -110
- package/venv/lib/python3.10/site-packages/urllib3/contrib/emscripten/fetch.py +0 -708
- package/venv/lib/python3.10/site-packages/urllib3/contrib/emscripten/request.py +0 -22
- package/venv/lib/python3.10/site-packages/urllib3/contrib/emscripten/response.py +0 -285
- package/venv/lib/python3.10/site-packages/urllib3/contrib/pyopenssl.py +0 -554
- package/venv/lib/python3.10/site-packages/urllib3/contrib/socks.py +0 -228
- package/venv/lib/python3.10/site-packages/urllib3/exceptions.py +0 -327
- package/venv/lib/python3.10/site-packages/urllib3/fields.py +0 -341
- package/venv/lib/python3.10/site-packages/urllib3/filepost.py +0 -89
- package/venv/lib/python3.10/site-packages/urllib3/http2/__init__.py +0 -53
- package/venv/lib/python3.10/site-packages/urllib3/http2/connection.py +0 -356
- package/venv/lib/python3.10/site-packages/urllib3/http2/probe.py +0 -87
- package/venv/lib/python3.10/site-packages/urllib3/poolmanager.py +0 -637
- package/venv/lib/python3.10/site-packages/urllib3/py.typed +0 -2
- package/venv/lib/python3.10/site-packages/urllib3/response.py +0 -1278
- package/venv/lib/python3.10/site-packages/urllib3/util/__init__.py +0 -42
- package/venv/lib/python3.10/site-packages/urllib3/util/connection.py +0 -137
- package/venv/lib/python3.10/site-packages/urllib3/util/proxy.py +0 -43
- package/venv/lib/python3.10/site-packages/urllib3/util/request.py +0 -258
- package/venv/lib/python3.10/site-packages/urllib3/util/response.py +0 -101
- package/venv/lib/python3.10/site-packages/urllib3/util/retry.py +0 -533
- package/venv/lib/python3.10/site-packages/urllib3/util/ssl_.py +0 -504
- package/venv/lib/python3.10/site-packages/urllib3/util/ssl_match_hostname.py +0 -159
- package/venv/lib/python3.10/site-packages/urllib3/util/ssltransport.py +0 -271
- package/venv/lib/python3.10/site-packages/urllib3/util/timeout.py +0 -275
- package/venv/lib/python3.10/site-packages/urllib3/util/url.py +0 -469
- package/venv/lib/python3.10/site-packages/urllib3/util/util.py +0 -42
- package/venv/lib/python3.10/site-packages/urllib3/util/wait.py +0 -124
- package/venv/lib/python3.10/site-packages/urllib3-2.3.0.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/urllib3-2.3.0.dist-info/METADATA +0 -154
- package/venv/lib/python3.10/site-packages/urllib3-2.3.0.dist-info/RECORD +0 -80
- package/venv/lib/python3.10/site-packages/urllib3-2.3.0.dist-info/REQUESTED +0 -0
- package/venv/lib/python3.10/site-packages/urllib3-2.3.0.dist-info/WHEEL +0 -4
- package/venv/lib/python3.10/site-packages/urllib3-2.3.0.dist-info/licenses/LICENSE.txt +0 -21
- package/venv/lib/python3.10/site-packages/yarl/__init__.py +0 -14
- package/venv/lib/python3.10/site-packages/yarl/_parse.py +0 -189
- package/venv/lib/python3.10/site-packages/yarl/_path.py +0 -41
- package/venv/lib/python3.10/site-packages/yarl/_query.py +0 -118
- package/venv/lib/python3.10/site-packages/yarl/_quoters.py +0 -32
- package/venv/lib/python3.10/site-packages/yarl/_quoting.py +0 -18
- package/venv/lib/python3.10/site-packages/yarl/_quoting_c.cpython-310-x86_64-linux-gnu.so +0 -0
- package/venv/lib/python3.10/site-packages/yarl/_quoting_c.pyi +0 -16
- package/venv/lib/python3.10/site-packages/yarl/_quoting_c.pyx +0 -423
- package/venv/lib/python3.10/site-packages/yarl/_quoting_py.py +0 -197
- package/venv/lib/python3.10/site-packages/yarl/_url.py +0 -1584
- package/venv/lib/python3.10/site-packages/yarl/py.typed +0 -1
- package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/INSTALLER +0 -1
- package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/LICENSE +0 -202
- package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/METADATA +0 -2279
- package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/NOTICE +0 -13
- package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/RECORD +0 -27
- package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/WHEEL +0 -6
- package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/top_level.txt +0 -1
- package/venv/pyvenv.cfg +0 -3
|
@@ -1,3055 +0,0 @@
|
|
|
1
|
-
# SPDX-License-Identifier: MIT
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
import abc
|
|
6
|
-
import contextlib
|
|
7
|
-
import copy
|
|
8
|
-
import enum
|
|
9
|
-
import functools
|
|
10
|
-
import inspect
|
|
11
|
-
import itertools
|
|
12
|
-
import linecache
|
|
13
|
-
import sys
|
|
14
|
-
import types
|
|
15
|
-
import typing
|
|
16
|
-
|
|
17
|
-
from operator import itemgetter
|
|
18
|
-
|
|
19
|
-
# We need to import _compat itself in addition to the _compat members to avoid
|
|
20
|
-
# having the thread-local in the globals here.
|
|
21
|
-
from . import _compat, _config, setters
|
|
22
|
-
from ._compat import (
|
|
23
|
-
PY_3_10_PLUS,
|
|
24
|
-
PY_3_11_PLUS,
|
|
25
|
-
PY_3_13_PLUS,
|
|
26
|
-
_AnnotationExtractor,
|
|
27
|
-
_get_annotations,
|
|
28
|
-
get_generic_base,
|
|
29
|
-
)
|
|
30
|
-
from .exceptions import (
|
|
31
|
-
DefaultAlreadySetError,
|
|
32
|
-
FrozenInstanceError,
|
|
33
|
-
NotAnAttrsClassError,
|
|
34
|
-
UnannotatedAttributeError,
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# This is used at least twice, so cache it here.
|
|
39
|
-
_OBJ_SETATTR = object.__setattr__
|
|
40
|
-
_INIT_FACTORY_PAT = "__attr_factory_%s"
|
|
41
|
-
_CLASSVAR_PREFIXES = (
|
|
42
|
-
"typing.ClassVar",
|
|
43
|
-
"t.ClassVar",
|
|
44
|
-
"ClassVar",
|
|
45
|
-
"typing_extensions.ClassVar",
|
|
46
|
-
)
|
|
47
|
-
# we don't use a double-underscore prefix because that triggers
|
|
48
|
-
# name mangling when trying to create a slot for the field
|
|
49
|
-
# (when slots=True)
|
|
50
|
-
_HASH_CACHE_FIELD = "_attrs_cached_hash"
|
|
51
|
-
|
|
52
|
-
_EMPTY_METADATA_SINGLETON = types.MappingProxyType({})
|
|
53
|
-
|
|
54
|
-
# Unique object for unequivocal getattr() defaults.
|
|
55
|
-
_SENTINEL = object()
|
|
56
|
-
|
|
57
|
-
_DEFAULT_ON_SETATTR = setters.pipe(setters.convert, setters.validate)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
class _Nothing(enum.Enum):
|
|
61
|
-
"""
|
|
62
|
-
Sentinel to indicate the lack of a value when `None` is ambiguous.
|
|
63
|
-
|
|
64
|
-
If extending attrs, you can use ``typing.Literal[NOTHING]`` to show
|
|
65
|
-
that a value may be ``NOTHING``.
|
|
66
|
-
|
|
67
|
-
.. versionchanged:: 21.1.0 ``bool(NOTHING)`` is now False.
|
|
68
|
-
.. versionchanged:: 22.2.0 ``NOTHING`` is now an ``enum.Enum`` variant.
|
|
69
|
-
"""
|
|
70
|
-
|
|
71
|
-
NOTHING = enum.auto()
|
|
72
|
-
|
|
73
|
-
def __repr__(self):
|
|
74
|
-
return "NOTHING"
|
|
75
|
-
|
|
76
|
-
def __bool__(self):
|
|
77
|
-
return False
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
NOTHING = _Nothing.NOTHING
|
|
81
|
-
"""
|
|
82
|
-
Sentinel to indicate the lack of a value when `None` is ambiguous.
|
|
83
|
-
|
|
84
|
-
When using in 3rd party code, use `attrs.NothingType` for type annotations.
|
|
85
|
-
"""
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
class _CacheHashWrapper(int):
|
|
89
|
-
"""
|
|
90
|
-
An integer subclass that pickles / copies as None
|
|
91
|
-
|
|
92
|
-
This is used for non-slots classes with ``cache_hash=True``, to avoid
|
|
93
|
-
serializing a potentially (even likely) invalid hash value. Since `None`
|
|
94
|
-
is the default value for uncalculated hashes, whenever this is copied,
|
|
95
|
-
the copy's value for the hash should automatically reset.
|
|
96
|
-
|
|
97
|
-
See GH #613 for more details.
|
|
98
|
-
"""
|
|
99
|
-
|
|
100
|
-
def __reduce__(self, _none_constructor=type(None), _args=()): # noqa: B008
|
|
101
|
-
return _none_constructor, _args
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
def attrib(
|
|
105
|
-
default=NOTHING,
|
|
106
|
-
validator=None,
|
|
107
|
-
repr=True,
|
|
108
|
-
cmp=None,
|
|
109
|
-
hash=None,
|
|
110
|
-
init=True,
|
|
111
|
-
metadata=None,
|
|
112
|
-
type=None,
|
|
113
|
-
converter=None,
|
|
114
|
-
factory=None,
|
|
115
|
-
kw_only=False,
|
|
116
|
-
eq=None,
|
|
117
|
-
order=None,
|
|
118
|
-
on_setattr=None,
|
|
119
|
-
alias=None,
|
|
120
|
-
):
|
|
121
|
-
"""
|
|
122
|
-
Create a new field / attribute on a class.
|
|
123
|
-
|
|
124
|
-
Identical to `attrs.field`, except it's not keyword-only.
|
|
125
|
-
|
|
126
|
-
Consider using `attrs.field` in new code (``attr.ib`` will *never* go away,
|
|
127
|
-
though).
|
|
128
|
-
|
|
129
|
-
.. warning::
|
|
130
|
-
|
|
131
|
-
Does **nothing** unless the class is also decorated with
|
|
132
|
-
`attr.s` (or similar)!
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
.. versionadded:: 15.2.0 *convert*
|
|
136
|
-
.. versionadded:: 16.3.0 *metadata*
|
|
137
|
-
.. versionchanged:: 17.1.0 *validator* can be a ``list`` now.
|
|
138
|
-
.. versionchanged:: 17.1.0
|
|
139
|
-
*hash* is `None` and therefore mirrors *eq* by default.
|
|
140
|
-
.. versionadded:: 17.3.0 *type*
|
|
141
|
-
.. deprecated:: 17.4.0 *convert*
|
|
142
|
-
.. versionadded:: 17.4.0
|
|
143
|
-
*converter* as a replacement for the deprecated *convert* to achieve
|
|
144
|
-
consistency with other noun-based arguments.
|
|
145
|
-
.. versionadded:: 18.1.0
|
|
146
|
-
``factory=f`` is syntactic sugar for ``default=attr.Factory(f)``.
|
|
147
|
-
.. versionadded:: 18.2.0 *kw_only*
|
|
148
|
-
.. versionchanged:: 19.2.0 *convert* keyword argument removed.
|
|
149
|
-
.. versionchanged:: 19.2.0 *repr* also accepts a custom callable.
|
|
150
|
-
.. deprecated:: 19.2.0 *cmp* Removal on or after 2021-06-01.
|
|
151
|
-
.. versionadded:: 19.2.0 *eq* and *order*
|
|
152
|
-
.. versionadded:: 20.1.0 *on_setattr*
|
|
153
|
-
.. versionchanged:: 20.3.0 *kw_only* backported to Python 2
|
|
154
|
-
.. versionchanged:: 21.1.0
|
|
155
|
-
*eq*, *order*, and *cmp* also accept a custom callable
|
|
156
|
-
.. versionchanged:: 21.1.0 *cmp* undeprecated
|
|
157
|
-
.. versionadded:: 22.2.0 *alias*
|
|
158
|
-
"""
|
|
159
|
-
eq, eq_key, order, order_key = _determine_attrib_eq_order(
|
|
160
|
-
cmp, eq, order, True
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
if hash is not None and hash is not True and hash is not False:
|
|
164
|
-
msg = "Invalid value for hash. Must be True, False, or None."
|
|
165
|
-
raise TypeError(msg)
|
|
166
|
-
|
|
167
|
-
if factory is not None:
|
|
168
|
-
if default is not NOTHING:
|
|
169
|
-
msg = (
|
|
170
|
-
"The `default` and `factory` arguments are mutually exclusive."
|
|
171
|
-
)
|
|
172
|
-
raise ValueError(msg)
|
|
173
|
-
if not callable(factory):
|
|
174
|
-
msg = "The `factory` argument must be a callable."
|
|
175
|
-
raise ValueError(msg)
|
|
176
|
-
default = Factory(factory)
|
|
177
|
-
|
|
178
|
-
if metadata is None:
|
|
179
|
-
metadata = {}
|
|
180
|
-
|
|
181
|
-
# Apply syntactic sugar by auto-wrapping.
|
|
182
|
-
if isinstance(on_setattr, (list, tuple)):
|
|
183
|
-
on_setattr = setters.pipe(*on_setattr)
|
|
184
|
-
|
|
185
|
-
if validator and isinstance(validator, (list, tuple)):
|
|
186
|
-
validator = and_(*validator)
|
|
187
|
-
|
|
188
|
-
if converter and isinstance(converter, (list, tuple)):
|
|
189
|
-
converter = pipe(*converter)
|
|
190
|
-
|
|
191
|
-
return _CountingAttr(
|
|
192
|
-
default=default,
|
|
193
|
-
validator=validator,
|
|
194
|
-
repr=repr,
|
|
195
|
-
cmp=None,
|
|
196
|
-
hash=hash,
|
|
197
|
-
init=init,
|
|
198
|
-
converter=converter,
|
|
199
|
-
metadata=metadata,
|
|
200
|
-
type=type,
|
|
201
|
-
kw_only=kw_only,
|
|
202
|
-
eq=eq,
|
|
203
|
-
eq_key=eq_key,
|
|
204
|
-
order=order,
|
|
205
|
-
order_key=order_key,
|
|
206
|
-
on_setattr=on_setattr,
|
|
207
|
-
alias=alias,
|
|
208
|
-
)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
def _compile_and_eval(script, globs, locs=None, filename=""):
|
|
212
|
-
"""
|
|
213
|
-
Evaluate the script with the given global (globs) and local (locs)
|
|
214
|
-
variables.
|
|
215
|
-
"""
|
|
216
|
-
bytecode = compile(script, filename, "exec")
|
|
217
|
-
eval(bytecode, globs, locs)
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
def _make_method(name, script, filename, globs, locals=None):
|
|
221
|
-
"""
|
|
222
|
-
Create the method with the script given and return the method object.
|
|
223
|
-
"""
|
|
224
|
-
locs = {} if locals is None else locals
|
|
225
|
-
|
|
226
|
-
# In order of debuggers like PDB being able to step through the code,
|
|
227
|
-
# we add a fake linecache entry.
|
|
228
|
-
count = 1
|
|
229
|
-
base_filename = filename
|
|
230
|
-
while True:
|
|
231
|
-
linecache_tuple = (
|
|
232
|
-
len(script),
|
|
233
|
-
None,
|
|
234
|
-
script.splitlines(True),
|
|
235
|
-
filename,
|
|
236
|
-
)
|
|
237
|
-
old_val = linecache.cache.setdefault(filename, linecache_tuple)
|
|
238
|
-
if old_val == linecache_tuple:
|
|
239
|
-
break
|
|
240
|
-
|
|
241
|
-
filename = f"{base_filename[:-1]}-{count}>"
|
|
242
|
-
count += 1
|
|
243
|
-
|
|
244
|
-
_compile_and_eval(script, globs, locs, filename)
|
|
245
|
-
|
|
246
|
-
return locs[name]
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
def _make_attr_tuple_class(cls_name, attr_names):
|
|
250
|
-
"""
|
|
251
|
-
Create a tuple subclass to hold `Attribute`s for an `attrs` class.
|
|
252
|
-
|
|
253
|
-
The subclass is a bare tuple with properties for names.
|
|
254
|
-
|
|
255
|
-
class MyClassAttributes(tuple):
|
|
256
|
-
__slots__ = ()
|
|
257
|
-
x = property(itemgetter(0))
|
|
258
|
-
"""
|
|
259
|
-
attr_class_name = f"{cls_name}Attributes"
|
|
260
|
-
attr_class_template = [
|
|
261
|
-
f"class {attr_class_name}(tuple):",
|
|
262
|
-
" __slots__ = ()",
|
|
263
|
-
]
|
|
264
|
-
if attr_names:
|
|
265
|
-
for i, attr_name in enumerate(attr_names):
|
|
266
|
-
attr_class_template.append(
|
|
267
|
-
f" {attr_name} = _attrs_property(_attrs_itemgetter({i}))"
|
|
268
|
-
)
|
|
269
|
-
else:
|
|
270
|
-
attr_class_template.append(" pass")
|
|
271
|
-
globs = {"_attrs_itemgetter": itemgetter, "_attrs_property": property}
|
|
272
|
-
_compile_and_eval("\n".join(attr_class_template), globs)
|
|
273
|
-
return globs[attr_class_name]
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
# Tuple class for extracted attributes from a class definition.
|
|
277
|
-
# `base_attrs` is a subset of `attrs`.
|
|
278
|
-
_Attributes = _make_attr_tuple_class(
|
|
279
|
-
"_Attributes",
|
|
280
|
-
[
|
|
281
|
-
# all attributes to build dunder methods for
|
|
282
|
-
"attrs",
|
|
283
|
-
# attributes that have been inherited
|
|
284
|
-
"base_attrs",
|
|
285
|
-
# map inherited attributes to their originating classes
|
|
286
|
-
"base_attrs_map",
|
|
287
|
-
],
|
|
288
|
-
)
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
def _is_class_var(annot):
|
|
292
|
-
"""
|
|
293
|
-
Check whether *annot* is a typing.ClassVar.
|
|
294
|
-
|
|
295
|
-
The string comparison hack is used to avoid evaluating all string
|
|
296
|
-
annotations which would put attrs-based classes at a performance
|
|
297
|
-
disadvantage compared to plain old classes.
|
|
298
|
-
"""
|
|
299
|
-
annot = str(annot)
|
|
300
|
-
|
|
301
|
-
# Annotation can be quoted.
|
|
302
|
-
if annot.startswith(("'", '"')) and annot.endswith(("'", '"')):
|
|
303
|
-
annot = annot[1:-1]
|
|
304
|
-
|
|
305
|
-
return annot.startswith(_CLASSVAR_PREFIXES)
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
def _has_own_attribute(cls, attrib_name):
|
|
309
|
-
"""
|
|
310
|
-
Check whether *cls* defines *attrib_name* (and doesn't just inherit it).
|
|
311
|
-
"""
|
|
312
|
-
return attrib_name in cls.__dict__
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
def _collect_base_attrs(cls, taken_attr_names):
|
|
316
|
-
"""
|
|
317
|
-
Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.
|
|
318
|
-
"""
|
|
319
|
-
base_attrs = []
|
|
320
|
-
base_attr_map = {} # A dictionary of base attrs to their classes.
|
|
321
|
-
|
|
322
|
-
# Traverse the MRO and collect attributes.
|
|
323
|
-
for base_cls in reversed(cls.__mro__[1:-1]):
|
|
324
|
-
for a in getattr(base_cls, "__attrs_attrs__", []):
|
|
325
|
-
if a.inherited or a.name in taken_attr_names:
|
|
326
|
-
continue
|
|
327
|
-
|
|
328
|
-
a = a.evolve(inherited=True) # noqa: PLW2901
|
|
329
|
-
base_attrs.append(a)
|
|
330
|
-
base_attr_map[a.name] = base_cls
|
|
331
|
-
|
|
332
|
-
# For each name, only keep the freshest definition i.e. the furthest at the
|
|
333
|
-
# back. base_attr_map is fine because it gets overwritten with every new
|
|
334
|
-
# instance.
|
|
335
|
-
filtered = []
|
|
336
|
-
seen = set()
|
|
337
|
-
for a in reversed(base_attrs):
|
|
338
|
-
if a.name in seen:
|
|
339
|
-
continue
|
|
340
|
-
filtered.insert(0, a)
|
|
341
|
-
seen.add(a.name)
|
|
342
|
-
|
|
343
|
-
return filtered, base_attr_map
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
def _collect_base_attrs_broken(cls, taken_attr_names):
|
|
347
|
-
"""
|
|
348
|
-
Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.
|
|
349
|
-
|
|
350
|
-
N.B. *taken_attr_names* will be mutated.
|
|
351
|
-
|
|
352
|
-
Adhere to the old incorrect behavior.
|
|
353
|
-
|
|
354
|
-
Notably it collects from the front and considers inherited attributes which
|
|
355
|
-
leads to the buggy behavior reported in #428.
|
|
356
|
-
"""
|
|
357
|
-
base_attrs = []
|
|
358
|
-
base_attr_map = {} # A dictionary of base attrs to their classes.
|
|
359
|
-
|
|
360
|
-
# Traverse the MRO and collect attributes.
|
|
361
|
-
for base_cls in cls.__mro__[1:-1]:
|
|
362
|
-
for a in getattr(base_cls, "__attrs_attrs__", []):
|
|
363
|
-
if a.name in taken_attr_names:
|
|
364
|
-
continue
|
|
365
|
-
|
|
366
|
-
a = a.evolve(inherited=True) # noqa: PLW2901
|
|
367
|
-
taken_attr_names.add(a.name)
|
|
368
|
-
base_attrs.append(a)
|
|
369
|
-
base_attr_map[a.name] = base_cls
|
|
370
|
-
|
|
371
|
-
return base_attrs, base_attr_map
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
def _transform_attrs(
|
|
375
|
-
cls, these, auto_attribs, kw_only, collect_by_mro, field_transformer
|
|
376
|
-
):
|
|
377
|
-
"""
|
|
378
|
-
Transform all `_CountingAttr`s on a class into `Attribute`s.
|
|
379
|
-
|
|
380
|
-
If *these* is passed, use that and don't look for them on the class.
|
|
381
|
-
|
|
382
|
-
If *collect_by_mro* is True, collect them in the correct MRO order,
|
|
383
|
-
otherwise use the old -- incorrect -- order. See #428.
|
|
384
|
-
|
|
385
|
-
Return an `_Attributes`.
|
|
386
|
-
"""
|
|
387
|
-
cd = cls.__dict__
|
|
388
|
-
anns = _get_annotations(cls)
|
|
389
|
-
|
|
390
|
-
if these is not None:
|
|
391
|
-
ca_list = list(these.items())
|
|
392
|
-
elif auto_attribs is True:
|
|
393
|
-
ca_names = {
|
|
394
|
-
name
|
|
395
|
-
for name, attr in cd.items()
|
|
396
|
-
if isinstance(attr, _CountingAttr)
|
|
397
|
-
}
|
|
398
|
-
ca_list = []
|
|
399
|
-
annot_names = set()
|
|
400
|
-
for attr_name, type in anns.items():
|
|
401
|
-
if _is_class_var(type):
|
|
402
|
-
continue
|
|
403
|
-
annot_names.add(attr_name)
|
|
404
|
-
a = cd.get(attr_name, NOTHING)
|
|
405
|
-
|
|
406
|
-
if not isinstance(a, _CountingAttr):
|
|
407
|
-
a = attrib() if a is NOTHING else attrib(default=a)
|
|
408
|
-
ca_list.append((attr_name, a))
|
|
409
|
-
|
|
410
|
-
unannotated = ca_names - annot_names
|
|
411
|
-
if len(unannotated) > 0:
|
|
412
|
-
raise UnannotatedAttributeError(
|
|
413
|
-
"The following `attr.ib`s lack a type annotation: "
|
|
414
|
-
+ ", ".join(
|
|
415
|
-
sorted(unannotated, key=lambda n: cd.get(n).counter)
|
|
416
|
-
)
|
|
417
|
-
+ "."
|
|
418
|
-
)
|
|
419
|
-
else:
|
|
420
|
-
ca_list = sorted(
|
|
421
|
-
(
|
|
422
|
-
(name, attr)
|
|
423
|
-
for name, attr in cd.items()
|
|
424
|
-
if isinstance(attr, _CountingAttr)
|
|
425
|
-
),
|
|
426
|
-
key=lambda e: e[1].counter,
|
|
427
|
-
)
|
|
428
|
-
|
|
429
|
-
own_attrs = [
|
|
430
|
-
Attribute.from_counting_attr(
|
|
431
|
-
name=attr_name, ca=ca, type=anns.get(attr_name)
|
|
432
|
-
)
|
|
433
|
-
for attr_name, ca in ca_list
|
|
434
|
-
]
|
|
435
|
-
|
|
436
|
-
if collect_by_mro:
|
|
437
|
-
base_attrs, base_attr_map = _collect_base_attrs(
|
|
438
|
-
cls, {a.name for a in own_attrs}
|
|
439
|
-
)
|
|
440
|
-
else:
|
|
441
|
-
base_attrs, base_attr_map = _collect_base_attrs_broken(
|
|
442
|
-
cls, {a.name for a in own_attrs}
|
|
443
|
-
)
|
|
444
|
-
|
|
445
|
-
if kw_only:
|
|
446
|
-
own_attrs = [a.evolve(kw_only=True) for a in own_attrs]
|
|
447
|
-
base_attrs = [a.evolve(kw_only=True) for a in base_attrs]
|
|
448
|
-
|
|
449
|
-
attrs = base_attrs + own_attrs
|
|
450
|
-
|
|
451
|
-
# Mandatory vs non-mandatory attr order only matters when they are part of
|
|
452
|
-
# the __init__ signature and when they aren't kw_only (which are moved to
|
|
453
|
-
# the end and can be mandatory or non-mandatory in any order, as they will
|
|
454
|
-
# be specified as keyword args anyway). Check the order of those attrs:
|
|
455
|
-
had_default = False
|
|
456
|
-
for a in (a for a in attrs if a.init is not False and a.kw_only is False):
|
|
457
|
-
if had_default is True and a.default is NOTHING:
|
|
458
|
-
msg = f"No mandatory attributes allowed after an attribute with a default value or factory. Attribute in question: {a!r}"
|
|
459
|
-
raise ValueError(msg)
|
|
460
|
-
|
|
461
|
-
if had_default is False and a.default is not NOTHING:
|
|
462
|
-
had_default = True
|
|
463
|
-
|
|
464
|
-
if field_transformer is not None:
|
|
465
|
-
attrs = field_transformer(cls, attrs)
|
|
466
|
-
|
|
467
|
-
# Resolve default field alias after executing field_transformer.
|
|
468
|
-
# This allows field_transformer to differentiate between explicit vs
|
|
469
|
-
# default aliases and supply their own defaults.
|
|
470
|
-
attrs = [
|
|
471
|
-
a.evolve(alias=_default_init_alias_for(a.name)) if not a.alias else a
|
|
472
|
-
for a in attrs
|
|
473
|
-
]
|
|
474
|
-
|
|
475
|
-
# Create AttrsClass *after* applying the field_transformer since it may
|
|
476
|
-
# add or remove attributes!
|
|
477
|
-
attr_names = [a.name for a in attrs]
|
|
478
|
-
AttrsClass = _make_attr_tuple_class(cls.__name__, attr_names)
|
|
479
|
-
|
|
480
|
-
return _Attributes((AttrsClass(attrs), base_attrs, base_attr_map))
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
def _make_cached_property_getattr(cached_properties, original_getattr, cls):
|
|
484
|
-
lines = [
|
|
485
|
-
# Wrapped to get `__class__` into closure cell for super()
|
|
486
|
-
# (It will be replaced with the newly constructed class after construction).
|
|
487
|
-
"def wrapper(_cls):",
|
|
488
|
-
" __class__ = _cls",
|
|
489
|
-
" def __getattr__(self, item, cached_properties=cached_properties, original_getattr=original_getattr, _cached_setattr_get=_cached_setattr_get):",
|
|
490
|
-
" func = cached_properties.get(item)",
|
|
491
|
-
" if func is not None:",
|
|
492
|
-
" result = func(self)",
|
|
493
|
-
" _setter = _cached_setattr_get(self)",
|
|
494
|
-
" _setter(item, result)",
|
|
495
|
-
" return result",
|
|
496
|
-
]
|
|
497
|
-
if original_getattr is not None:
|
|
498
|
-
lines.append(
|
|
499
|
-
" return original_getattr(self, item)",
|
|
500
|
-
)
|
|
501
|
-
else:
|
|
502
|
-
lines.extend(
|
|
503
|
-
[
|
|
504
|
-
" try:",
|
|
505
|
-
" return super().__getattribute__(item)",
|
|
506
|
-
" except AttributeError:",
|
|
507
|
-
" if not hasattr(super(), '__getattr__'):",
|
|
508
|
-
" raise",
|
|
509
|
-
" return super().__getattr__(item)",
|
|
510
|
-
" original_error = f\"'{self.__class__.__name__}' object has no attribute '{item}'\"",
|
|
511
|
-
" raise AttributeError(original_error)",
|
|
512
|
-
]
|
|
513
|
-
)
|
|
514
|
-
|
|
515
|
-
lines.extend(
|
|
516
|
-
[
|
|
517
|
-
" return __getattr__",
|
|
518
|
-
"__getattr__ = wrapper(_cls)",
|
|
519
|
-
]
|
|
520
|
-
)
|
|
521
|
-
|
|
522
|
-
unique_filename = _generate_unique_filename(cls, "getattr")
|
|
523
|
-
|
|
524
|
-
glob = {
|
|
525
|
-
"cached_properties": cached_properties,
|
|
526
|
-
"_cached_setattr_get": _OBJ_SETATTR.__get__,
|
|
527
|
-
"original_getattr": original_getattr,
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
return _make_method(
|
|
531
|
-
"__getattr__",
|
|
532
|
-
"\n".join(lines),
|
|
533
|
-
unique_filename,
|
|
534
|
-
glob,
|
|
535
|
-
locals={
|
|
536
|
-
"_cls": cls,
|
|
537
|
-
},
|
|
538
|
-
)
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
def _frozen_setattrs(self, name, value):
|
|
542
|
-
"""
|
|
543
|
-
Attached to frozen classes as __setattr__.
|
|
544
|
-
"""
|
|
545
|
-
if isinstance(self, BaseException) and name in (
|
|
546
|
-
"__cause__",
|
|
547
|
-
"__context__",
|
|
548
|
-
"__traceback__",
|
|
549
|
-
"__suppress_context__",
|
|
550
|
-
"__notes__",
|
|
551
|
-
):
|
|
552
|
-
BaseException.__setattr__(self, name, value)
|
|
553
|
-
return
|
|
554
|
-
|
|
555
|
-
raise FrozenInstanceError
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
def _frozen_delattrs(self, name):
|
|
559
|
-
"""
|
|
560
|
-
Attached to frozen classes as __delattr__.
|
|
561
|
-
"""
|
|
562
|
-
if isinstance(self, BaseException) and name in ("__notes__",):
|
|
563
|
-
BaseException.__delattr__(self, name)
|
|
564
|
-
return
|
|
565
|
-
|
|
566
|
-
raise FrozenInstanceError
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
def evolve(*args, **changes):
|
|
570
|
-
"""
|
|
571
|
-
Create a new instance, based on the first positional argument with
|
|
572
|
-
*changes* applied.
|
|
573
|
-
|
|
574
|
-
.. tip::
|
|
575
|
-
|
|
576
|
-
On Python 3.13 and later, you can also use `copy.replace` instead.
|
|
577
|
-
|
|
578
|
-
Args:
|
|
579
|
-
|
|
580
|
-
inst:
|
|
581
|
-
Instance of a class with *attrs* attributes. *inst* must be passed
|
|
582
|
-
as a positional argument.
|
|
583
|
-
|
|
584
|
-
changes:
|
|
585
|
-
Keyword changes in the new copy.
|
|
586
|
-
|
|
587
|
-
Returns:
|
|
588
|
-
A copy of inst with *changes* incorporated.
|
|
589
|
-
|
|
590
|
-
Raises:
|
|
591
|
-
TypeError:
|
|
592
|
-
If *attr_name* couldn't be found in the class ``__init__``.
|
|
593
|
-
|
|
594
|
-
attrs.exceptions.NotAnAttrsClassError:
|
|
595
|
-
If *cls* is not an *attrs* class.
|
|
596
|
-
|
|
597
|
-
.. versionadded:: 17.1.0
|
|
598
|
-
.. deprecated:: 23.1.0
|
|
599
|
-
It is now deprecated to pass the instance using the keyword argument
|
|
600
|
-
*inst*. It will raise a warning until at least April 2024, after which
|
|
601
|
-
it will become an error. Always pass the instance as a positional
|
|
602
|
-
argument.
|
|
603
|
-
.. versionchanged:: 24.1.0
|
|
604
|
-
*inst* can't be passed as a keyword argument anymore.
|
|
605
|
-
"""
|
|
606
|
-
try:
|
|
607
|
-
(inst,) = args
|
|
608
|
-
except ValueError:
|
|
609
|
-
msg = (
|
|
610
|
-
f"evolve() takes 1 positional argument, but {len(args)} were given"
|
|
611
|
-
)
|
|
612
|
-
raise TypeError(msg) from None
|
|
613
|
-
|
|
614
|
-
cls = inst.__class__
|
|
615
|
-
attrs = fields(cls)
|
|
616
|
-
for a in attrs:
|
|
617
|
-
if not a.init:
|
|
618
|
-
continue
|
|
619
|
-
attr_name = a.name # To deal with private attributes.
|
|
620
|
-
init_name = a.alias
|
|
621
|
-
if init_name not in changes:
|
|
622
|
-
changes[init_name] = getattr(inst, attr_name)
|
|
623
|
-
|
|
624
|
-
return cls(**changes)
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
class _ClassBuilder:
|
|
628
|
-
"""
|
|
629
|
-
Iteratively build *one* class.
|
|
630
|
-
"""
|
|
631
|
-
|
|
632
|
-
__slots__ = (
|
|
633
|
-
"_attr_names",
|
|
634
|
-
"_attrs",
|
|
635
|
-
"_base_attr_map",
|
|
636
|
-
"_base_names",
|
|
637
|
-
"_cache_hash",
|
|
638
|
-
"_cls",
|
|
639
|
-
"_cls_dict",
|
|
640
|
-
"_delete_attribs",
|
|
641
|
-
"_frozen",
|
|
642
|
-
"_has_custom_setattr",
|
|
643
|
-
"_has_post_init",
|
|
644
|
-
"_has_pre_init",
|
|
645
|
-
"_is_exc",
|
|
646
|
-
"_on_setattr",
|
|
647
|
-
"_pre_init_has_args",
|
|
648
|
-
"_slots",
|
|
649
|
-
"_weakref_slot",
|
|
650
|
-
"_wrote_own_setattr",
|
|
651
|
-
)
|
|
652
|
-
|
|
653
|
-
def __init__(
|
|
654
|
-
self,
|
|
655
|
-
cls,
|
|
656
|
-
these,
|
|
657
|
-
slots,
|
|
658
|
-
frozen,
|
|
659
|
-
weakref_slot,
|
|
660
|
-
getstate_setstate,
|
|
661
|
-
auto_attribs,
|
|
662
|
-
kw_only,
|
|
663
|
-
cache_hash,
|
|
664
|
-
is_exc,
|
|
665
|
-
collect_by_mro,
|
|
666
|
-
on_setattr,
|
|
667
|
-
has_custom_setattr,
|
|
668
|
-
field_transformer,
|
|
669
|
-
):
|
|
670
|
-
attrs, base_attrs, base_map = _transform_attrs(
|
|
671
|
-
cls,
|
|
672
|
-
these,
|
|
673
|
-
auto_attribs,
|
|
674
|
-
kw_only,
|
|
675
|
-
collect_by_mro,
|
|
676
|
-
field_transformer,
|
|
677
|
-
)
|
|
678
|
-
|
|
679
|
-
self._cls = cls
|
|
680
|
-
self._cls_dict = dict(cls.__dict__) if slots else {}
|
|
681
|
-
self._attrs = attrs
|
|
682
|
-
self._base_names = {a.name for a in base_attrs}
|
|
683
|
-
self._base_attr_map = base_map
|
|
684
|
-
self._attr_names = tuple(a.name for a in attrs)
|
|
685
|
-
self._slots = slots
|
|
686
|
-
self._frozen = frozen
|
|
687
|
-
self._weakref_slot = weakref_slot
|
|
688
|
-
self._cache_hash = cache_hash
|
|
689
|
-
self._has_pre_init = bool(getattr(cls, "__attrs_pre_init__", False))
|
|
690
|
-
self._pre_init_has_args = False
|
|
691
|
-
if self._has_pre_init:
|
|
692
|
-
# Check if the pre init method has more arguments than just `self`
|
|
693
|
-
# We want to pass arguments if pre init expects arguments
|
|
694
|
-
pre_init_func = cls.__attrs_pre_init__
|
|
695
|
-
pre_init_signature = inspect.signature(pre_init_func)
|
|
696
|
-
self._pre_init_has_args = len(pre_init_signature.parameters) > 1
|
|
697
|
-
self._has_post_init = bool(getattr(cls, "__attrs_post_init__", False))
|
|
698
|
-
self._delete_attribs = not bool(these)
|
|
699
|
-
self._is_exc = is_exc
|
|
700
|
-
self._on_setattr = on_setattr
|
|
701
|
-
|
|
702
|
-
self._has_custom_setattr = has_custom_setattr
|
|
703
|
-
self._wrote_own_setattr = False
|
|
704
|
-
|
|
705
|
-
self._cls_dict["__attrs_attrs__"] = self._attrs
|
|
706
|
-
|
|
707
|
-
if frozen:
|
|
708
|
-
self._cls_dict["__setattr__"] = _frozen_setattrs
|
|
709
|
-
self._cls_dict["__delattr__"] = _frozen_delattrs
|
|
710
|
-
|
|
711
|
-
self._wrote_own_setattr = True
|
|
712
|
-
elif on_setattr in (
|
|
713
|
-
_DEFAULT_ON_SETATTR,
|
|
714
|
-
setters.validate,
|
|
715
|
-
setters.convert,
|
|
716
|
-
):
|
|
717
|
-
has_validator = has_converter = False
|
|
718
|
-
for a in attrs:
|
|
719
|
-
if a.validator is not None:
|
|
720
|
-
has_validator = True
|
|
721
|
-
if a.converter is not None:
|
|
722
|
-
has_converter = True
|
|
723
|
-
|
|
724
|
-
if has_validator and has_converter:
|
|
725
|
-
break
|
|
726
|
-
if (
|
|
727
|
-
(
|
|
728
|
-
on_setattr == _DEFAULT_ON_SETATTR
|
|
729
|
-
and not (has_validator or has_converter)
|
|
730
|
-
)
|
|
731
|
-
or (on_setattr == setters.validate and not has_validator)
|
|
732
|
-
or (on_setattr == setters.convert and not has_converter)
|
|
733
|
-
):
|
|
734
|
-
# If class-level on_setattr is set to convert + validate, but
|
|
735
|
-
# there's no field to convert or validate, pretend like there's
|
|
736
|
-
# no on_setattr.
|
|
737
|
-
self._on_setattr = None
|
|
738
|
-
|
|
739
|
-
if getstate_setstate:
|
|
740
|
-
(
|
|
741
|
-
self._cls_dict["__getstate__"],
|
|
742
|
-
self._cls_dict["__setstate__"],
|
|
743
|
-
) = self._make_getstate_setstate()
|
|
744
|
-
|
|
745
|
-
def __repr__(self):
|
|
746
|
-
return f"<_ClassBuilder(cls={self._cls.__name__})>"
|
|
747
|
-
|
|
748
|
-
def build_class(self):
|
|
749
|
-
"""
|
|
750
|
-
Finalize class based on the accumulated configuration.
|
|
751
|
-
|
|
752
|
-
Builder cannot be used after calling this method.
|
|
753
|
-
"""
|
|
754
|
-
if self._slots is True:
|
|
755
|
-
cls = self._create_slots_class()
|
|
756
|
-
else:
|
|
757
|
-
cls = self._patch_original_class()
|
|
758
|
-
if PY_3_10_PLUS:
|
|
759
|
-
cls = abc.update_abstractmethods(cls)
|
|
760
|
-
|
|
761
|
-
# The method gets only called if it's not inherited from a base class.
|
|
762
|
-
# _has_own_attribute does NOT work properly for classmethods.
|
|
763
|
-
if (
|
|
764
|
-
getattr(cls, "__attrs_init_subclass__", None)
|
|
765
|
-
and "__attrs_init_subclass__" not in cls.__dict__
|
|
766
|
-
):
|
|
767
|
-
cls.__attrs_init_subclass__()
|
|
768
|
-
|
|
769
|
-
return cls
|
|
770
|
-
|
|
771
|
-
def _patch_original_class(self):
|
|
772
|
-
"""
|
|
773
|
-
Apply accumulated methods and return the class.
|
|
774
|
-
"""
|
|
775
|
-
cls = self._cls
|
|
776
|
-
base_names = self._base_names
|
|
777
|
-
|
|
778
|
-
# Clean class of attribute definitions (`attr.ib()`s).
|
|
779
|
-
if self._delete_attribs:
|
|
780
|
-
for name in self._attr_names:
|
|
781
|
-
if (
|
|
782
|
-
name not in base_names
|
|
783
|
-
and getattr(cls, name, _SENTINEL) is not _SENTINEL
|
|
784
|
-
):
|
|
785
|
-
# An AttributeError can happen if a base class defines a
|
|
786
|
-
# class variable and we want to set an attribute with the
|
|
787
|
-
# same name by using only a type annotation.
|
|
788
|
-
with contextlib.suppress(AttributeError):
|
|
789
|
-
delattr(cls, name)
|
|
790
|
-
|
|
791
|
-
# Attach our dunder methods.
|
|
792
|
-
for name, value in self._cls_dict.items():
|
|
793
|
-
setattr(cls, name, value)
|
|
794
|
-
|
|
795
|
-
# If we've inherited an attrs __setattr__ and don't write our own,
|
|
796
|
-
# reset it to object's.
|
|
797
|
-
if not self._wrote_own_setattr and getattr(
|
|
798
|
-
cls, "__attrs_own_setattr__", False
|
|
799
|
-
):
|
|
800
|
-
cls.__attrs_own_setattr__ = False
|
|
801
|
-
|
|
802
|
-
if not self._has_custom_setattr:
|
|
803
|
-
cls.__setattr__ = _OBJ_SETATTR
|
|
804
|
-
|
|
805
|
-
return cls
|
|
806
|
-
|
|
807
|
-
def _create_slots_class(self):
|
|
808
|
-
"""
|
|
809
|
-
Build and return a new class with a `__slots__` attribute.
|
|
810
|
-
"""
|
|
811
|
-
cd = {
|
|
812
|
-
k: v
|
|
813
|
-
for k, v in self._cls_dict.items()
|
|
814
|
-
if k not in (*tuple(self._attr_names), "__dict__", "__weakref__")
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
# If our class doesn't have its own implementation of __setattr__
|
|
818
|
-
# (either from the user or by us), check the bases, if one of them has
|
|
819
|
-
# an attrs-made __setattr__, that needs to be reset. We don't walk the
|
|
820
|
-
# MRO because we only care about our immediate base classes.
|
|
821
|
-
# XXX: This can be confused by subclassing a slotted attrs class with
|
|
822
|
-
# XXX: a non-attrs class and subclass the resulting class with an attrs
|
|
823
|
-
# XXX: class. See `test_slotted_confused` for details. For now that's
|
|
824
|
-
# XXX: OK with us.
|
|
825
|
-
if not self._wrote_own_setattr:
|
|
826
|
-
cd["__attrs_own_setattr__"] = False
|
|
827
|
-
|
|
828
|
-
if not self._has_custom_setattr:
|
|
829
|
-
for base_cls in self._cls.__bases__:
|
|
830
|
-
if base_cls.__dict__.get("__attrs_own_setattr__", False):
|
|
831
|
-
cd["__setattr__"] = _OBJ_SETATTR
|
|
832
|
-
break
|
|
833
|
-
|
|
834
|
-
# Traverse the MRO to collect existing slots
|
|
835
|
-
# and check for an existing __weakref__.
|
|
836
|
-
existing_slots = {}
|
|
837
|
-
weakref_inherited = False
|
|
838
|
-
for base_cls in self._cls.__mro__[1:-1]:
|
|
839
|
-
if base_cls.__dict__.get("__weakref__", None) is not None:
|
|
840
|
-
weakref_inherited = True
|
|
841
|
-
existing_slots.update(
|
|
842
|
-
{
|
|
843
|
-
name: getattr(base_cls, name)
|
|
844
|
-
for name in getattr(base_cls, "__slots__", [])
|
|
845
|
-
}
|
|
846
|
-
)
|
|
847
|
-
|
|
848
|
-
base_names = set(self._base_names)
|
|
849
|
-
|
|
850
|
-
names = self._attr_names
|
|
851
|
-
if (
|
|
852
|
-
self._weakref_slot
|
|
853
|
-
and "__weakref__" not in getattr(self._cls, "__slots__", ())
|
|
854
|
-
and "__weakref__" not in names
|
|
855
|
-
and not weakref_inherited
|
|
856
|
-
):
|
|
857
|
-
names += ("__weakref__",)
|
|
858
|
-
|
|
859
|
-
cached_properties = {
|
|
860
|
-
name: cached_property.func
|
|
861
|
-
for name, cached_property in cd.items()
|
|
862
|
-
if isinstance(cached_property, functools.cached_property)
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
# Collect methods with a `__class__` reference that are shadowed in the new class.
|
|
866
|
-
# To know to update them.
|
|
867
|
-
additional_closure_functions_to_update = []
|
|
868
|
-
if cached_properties:
|
|
869
|
-
class_annotations = _get_annotations(self._cls)
|
|
870
|
-
for name, func in cached_properties.items():
|
|
871
|
-
# Add cached properties to names for slotting.
|
|
872
|
-
names += (name,)
|
|
873
|
-
# Clear out function from class to avoid clashing.
|
|
874
|
-
del cd[name]
|
|
875
|
-
additional_closure_functions_to_update.append(func)
|
|
876
|
-
annotation = inspect.signature(func).return_annotation
|
|
877
|
-
if annotation is not inspect.Parameter.empty:
|
|
878
|
-
class_annotations[name] = annotation
|
|
879
|
-
|
|
880
|
-
original_getattr = cd.get("__getattr__")
|
|
881
|
-
if original_getattr is not None:
|
|
882
|
-
additional_closure_functions_to_update.append(original_getattr)
|
|
883
|
-
|
|
884
|
-
cd["__getattr__"] = _make_cached_property_getattr(
|
|
885
|
-
cached_properties, original_getattr, self._cls
|
|
886
|
-
)
|
|
887
|
-
|
|
888
|
-
# We only add the names of attributes that aren't inherited.
|
|
889
|
-
# Setting __slots__ to inherited attributes wastes memory.
|
|
890
|
-
slot_names = [name for name in names if name not in base_names]
|
|
891
|
-
|
|
892
|
-
# There are slots for attributes from current class
|
|
893
|
-
# that are defined in parent classes.
|
|
894
|
-
# As their descriptors may be overridden by a child class,
|
|
895
|
-
# we collect them here and update the class dict
|
|
896
|
-
reused_slots = {
|
|
897
|
-
slot: slot_descriptor
|
|
898
|
-
for slot, slot_descriptor in existing_slots.items()
|
|
899
|
-
if slot in slot_names
|
|
900
|
-
}
|
|
901
|
-
slot_names = [name for name in slot_names if name not in reused_slots]
|
|
902
|
-
cd.update(reused_slots)
|
|
903
|
-
if self._cache_hash:
|
|
904
|
-
slot_names.append(_HASH_CACHE_FIELD)
|
|
905
|
-
|
|
906
|
-
cd["__slots__"] = tuple(slot_names)
|
|
907
|
-
|
|
908
|
-
cd["__qualname__"] = self._cls.__qualname__
|
|
909
|
-
|
|
910
|
-
# Create new class based on old class and our methods.
|
|
911
|
-
cls = type(self._cls)(self._cls.__name__, self._cls.__bases__, cd)
|
|
912
|
-
|
|
913
|
-
# The following is a fix for
|
|
914
|
-
# <https://github.com/python-attrs/attrs/issues/102>.
|
|
915
|
-
# If a method mentions `__class__` or uses the no-arg super(), the
|
|
916
|
-
# compiler will bake a reference to the class in the method itself
|
|
917
|
-
# as `method.__closure__`. Since we replace the class with a
|
|
918
|
-
# clone, we rewrite these references so it keeps working.
|
|
919
|
-
for item in itertools.chain(
|
|
920
|
-
cls.__dict__.values(), additional_closure_functions_to_update
|
|
921
|
-
):
|
|
922
|
-
if isinstance(item, (classmethod, staticmethod)):
|
|
923
|
-
# Class- and staticmethods hide their functions inside.
|
|
924
|
-
# These might need to be rewritten as well.
|
|
925
|
-
closure_cells = getattr(item.__func__, "__closure__", None)
|
|
926
|
-
elif isinstance(item, property):
|
|
927
|
-
# Workaround for property `super()` shortcut (PY3-only).
|
|
928
|
-
# There is no universal way for other descriptors.
|
|
929
|
-
closure_cells = getattr(item.fget, "__closure__", None)
|
|
930
|
-
else:
|
|
931
|
-
closure_cells = getattr(item, "__closure__", None)
|
|
932
|
-
|
|
933
|
-
if not closure_cells: # Catch None or the empty list.
|
|
934
|
-
continue
|
|
935
|
-
for cell in closure_cells:
|
|
936
|
-
try:
|
|
937
|
-
match = cell.cell_contents is self._cls
|
|
938
|
-
except ValueError: # noqa: PERF203
|
|
939
|
-
# ValueError: Cell is empty
|
|
940
|
-
pass
|
|
941
|
-
else:
|
|
942
|
-
if match:
|
|
943
|
-
cell.cell_contents = cls
|
|
944
|
-
return cls
|
|
945
|
-
|
|
946
|
-
def add_repr(self, ns):
|
|
947
|
-
self._cls_dict["__repr__"] = self._add_method_dunders(
|
|
948
|
-
_make_repr(self._attrs, ns, self._cls)
|
|
949
|
-
)
|
|
950
|
-
return self
|
|
951
|
-
|
|
952
|
-
def add_str(self):
|
|
953
|
-
repr = self._cls_dict.get("__repr__")
|
|
954
|
-
if repr is None:
|
|
955
|
-
msg = "__str__ can only be generated if a __repr__ exists."
|
|
956
|
-
raise ValueError(msg)
|
|
957
|
-
|
|
958
|
-
def __str__(self):
|
|
959
|
-
return self.__repr__()
|
|
960
|
-
|
|
961
|
-
self._cls_dict["__str__"] = self._add_method_dunders(__str__)
|
|
962
|
-
return self
|
|
963
|
-
|
|
964
|
-
def _make_getstate_setstate(self):
|
|
965
|
-
"""
|
|
966
|
-
Create custom __setstate__ and __getstate__ methods.
|
|
967
|
-
"""
|
|
968
|
-
# __weakref__ is not writable.
|
|
969
|
-
state_attr_names = tuple(
|
|
970
|
-
an for an in self._attr_names if an != "__weakref__"
|
|
971
|
-
)
|
|
972
|
-
|
|
973
|
-
def slots_getstate(self):
|
|
974
|
-
"""
|
|
975
|
-
Automatically created by attrs.
|
|
976
|
-
"""
|
|
977
|
-
return {name: getattr(self, name) for name in state_attr_names}
|
|
978
|
-
|
|
979
|
-
hash_caching_enabled = self._cache_hash
|
|
980
|
-
|
|
981
|
-
def slots_setstate(self, state):
|
|
982
|
-
"""
|
|
983
|
-
Automatically created by attrs.
|
|
984
|
-
"""
|
|
985
|
-
__bound_setattr = _OBJ_SETATTR.__get__(self)
|
|
986
|
-
if isinstance(state, tuple):
|
|
987
|
-
# Backward compatibility with attrs instances pickled with
|
|
988
|
-
# attrs versions before v22.2.0 which stored tuples.
|
|
989
|
-
for name, value in zip(state_attr_names, state):
|
|
990
|
-
__bound_setattr(name, value)
|
|
991
|
-
else:
|
|
992
|
-
for name in state_attr_names:
|
|
993
|
-
if name in state:
|
|
994
|
-
__bound_setattr(name, state[name])
|
|
995
|
-
|
|
996
|
-
# The hash code cache is not included when the object is
|
|
997
|
-
# serialized, but it still needs to be initialized to None to
|
|
998
|
-
# indicate that the first call to __hash__ should be a cache
|
|
999
|
-
# miss.
|
|
1000
|
-
if hash_caching_enabled:
|
|
1001
|
-
__bound_setattr(_HASH_CACHE_FIELD, None)
|
|
1002
|
-
|
|
1003
|
-
return slots_getstate, slots_setstate
|
|
1004
|
-
|
|
1005
|
-
def make_unhashable(self):
|
|
1006
|
-
self._cls_dict["__hash__"] = None
|
|
1007
|
-
return self
|
|
1008
|
-
|
|
1009
|
-
def add_hash(self):
|
|
1010
|
-
self._cls_dict["__hash__"] = self._add_method_dunders(
|
|
1011
|
-
_make_hash(
|
|
1012
|
-
self._cls,
|
|
1013
|
-
self._attrs,
|
|
1014
|
-
frozen=self._frozen,
|
|
1015
|
-
cache_hash=self._cache_hash,
|
|
1016
|
-
)
|
|
1017
|
-
)
|
|
1018
|
-
|
|
1019
|
-
return self
|
|
1020
|
-
|
|
1021
|
-
def add_init(self):
|
|
1022
|
-
self._cls_dict["__init__"] = self._add_method_dunders(
|
|
1023
|
-
_make_init(
|
|
1024
|
-
self._cls,
|
|
1025
|
-
self._attrs,
|
|
1026
|
-
self._has_pre_init,
|
|
1027
|
-
self._pre_init_has_args,
|
|
1028
|
-
self._has_post_init,
|
|
1029
|
-
self._frozen,
|
|
1030
|
-
self._slots,
|
|
1031
|
-
self._cache_hash,
|
|
1032
|
-
self._base_attr_map,
|
|
1033
|
-
self._is_exc,
|
|
1034
|
-
self._on_setattr,
|
|
1035
|
-
attrs_init=False,
|
|
1036
|
-
)
|
|
1037
|
-
)
|
|
1038
|
-
|
|
1039
|
-
return self
|
|
1040
|
-
|
|
1041
|
-
def add_replace(self):
|
|
1042
|
-
self._cls_dict["__replace__"] = self._add_method_dunders(
|
|
1043
|
-
lambda self, **changes: evolve(self, **changes)
|
|
1044
|
-
)
|
|
1045
|
-
return self
|
|
1046
|
-
|
|
1047
|
-
def add_match_args(self):
|
|
1048
|
-
self._cls_dict["__match_args__"] = tuple(
|
|
1049
|
-
field.name
|
|
1050
|
-
for field in self._attrs
|
|
1051
|
-
if field.init and not field.kw_only
|
|
1052
|
-
)
|
|
1053
|
-
|
|
1054
|
-
def add_attrs_init(self):
|
|
1055
|
-
self._cls_dict["__attrs_init__"] = self._add_method_dunders(
|
|
1056
|
-
_make_init(
|
|
1057
|
-
self._cls,
|
|
1058
|
-
self._attrs,
|
|
1059
|
-
self._has_pre_init,
|
|
1060
|
-
self._pre_init_has_args,
|
|
1061
|
-
self._has_post_init,
|
|
1062
|
-
self._frozen,
|
|
1063
|
-
self._slots,
|
|
1064
|
-
self._cache_hash,
|
|
1065
|
-
self._base_attr_map,
|
|
1066
|
-
self._is_exc,
|
|
1067
|
-
self._on_setattr,
|
|
1068
|
-
attrs_init=True,
|
|
1069
|
-
)
|
|
1070
|
-
)
|
|
1071
|
-
|
|
1072
|
-
return self
|
|
1073
|
-
|
|
1074
|
-
def add_eq(self):
|
|
1075
|
-
cd = self._cls_dict
|
|
1076
|
-
|
|
1077
|
-
cd["__eq__"] = self._add_method_dunders(
|
|
1078
|
-
_make_eq(self._cls, self._attrs)
|
|
1079
|
-
)
|
|
1080
|
-
cd["__ne__"] = self._add_method_dunders(_make_ne())
|
|
1081
|
-
|
|
1082
|
-
return self
|
|
1083
|
-
|
|
1084
|
-
def add_order(self):
|
|
1085
|
-
cd = self._cls_dict
|
|
1086
|
-
|
|
1087
|
-
cd["__lt__"], cd["__le__"], cd["__gt__"], cd["__ge__"] = (
|
|
1088
|
-
self._add_method_dunders(meth)
|
|
1089
|
-
for meth in _make_order(self._cls, self._attrs)
|
|
1090
|
-
)
|
|
1091
|
-
|
|
1092
|
-
return self
|
|
1093
|
-
|
|
1094
|
-
def add_setattr(self):
|
|
1095
|
-
if self._frozen:
|
|
1096
|
-
return self
|
|
1097
|
-
|
|
1098
|
-
sa_attrs = {}
|
|
1099
|
-
for a in self._attrs:
|
|
1100
|
-
on_setattr = a.on_setattr or self._on_setattr
|
|
1101
|
-
if on_setattr and on_setattr is not setters.NO_OP:
|
|
1102
|
-
sa_attrs[a.name] = a, on_setattr
|
|
1103
|
-
|
|
1104
|
-
if not sa_attrs:
|
|
1105
|
-
return self
|
|
1106
|
-
|
|
1107
|
-
if self._has_custom_setattr:
|
|
1108
|
-
# We need to write a __setattr__ but there already is one!
|
|
1109
|
-
msg = "Can't combine custom __setattr__ with on_setattr hooks."
|
|
1110
|
-
raise ValueError(msg)
|
|
1111
|
-
|
|
1112
|
-
# docstring comes from _add_method_dunders
|
|
1113
|
-
def __setattr__(self, name, val):
|
|
1114
|
-
try:
|
|
1115
|
-
a, hook = sa_attrs[name]
|
|
1116
|
-
except KeyError:
|
|
1117
|
-
nval = val
|
|
1118
|
-
else:
|
|
1119
|
-
nval = hook(self, a, val)
|
|
1120
|
-
|
|
1121
|
-
_OBJ_SETATTR(self, name, nval)
|
|
1122
|
-
|
|
1123
|
-
self._cls_dict["__attrs_own_setattr__"] = True
|
|
1124
|
-
self._cls_dict["__setattr__"] = self._add_method_dunders(__setattr__)
|
|
1125
|
-
self._wrote_own_setattr = True
|
|
1126
|
-
|
|
1127
|
-
return self
|
|
1128
|
-
|
|
1129
|
-
def _add_method_dunders(self, method):
|
|
1130
|
-
"""
|
|
1131
|
-
Add __module__ and __qualname__ to a *method* if possible.
|
|
1132
|
-
"""
|
|
1133
|
-
with contextlib.suppress(AttributeError):
|
|
1134
|
-
method.__module__ = self._cls.__module__
|
|
1135
|
-
|
|
1136
|
-
with contextlib.suppress(AttributeError):
|
|
1137
|
-
method.__qualname__ = f"{self._cls.__qualname__}.{method.__name__}"
|
|
1138
|
-
|
|
1139
|
-
with contextlib.suppress(AttributeError):
|
|
1140
|
-
method.__doc__ = (
|
|
1141
|
-
"Method generated by attrs for class "
|
|
1142
|
-
f"{self._cls.__qualname__}."
|
|
1143
|
-
)
|
|
1144
|
-
|
|
1145
|
-
return method
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
def _determine_attrs_eq_order(cmp, eq, order, default_eq):
|
|
1149
|
-
"""
|
|
1150
|
-
Validate the combination of *cmp*, *eq*, and *order*. Derive the effective
|
|
1151
|
-
values of eq and order. If *eq* is None, set it to *default_eq*.
|
|
1152
|
-
"""
|
|
1153
|
-
if cmp is not None and any((eq is not None, order is not None)):
|
|
1154
|
-
msg = "Don't mix `cmp` with `eq' and `order`."
|
|
1155
|
-
raise ValueError(msg)
|
|
1156
|
-
|
|
1157
|
-
# cmp takes precedence due to bw-compatibility.
|
|
1158
|
-
if cmp is not None:
|
|
1159
|
-
return cmp, cmp
|
|
1160
|
-
|
|
1161
|
-
# If left None, equality is set to the specified default and ordering
|
|
1162
|
-
# mirrors equality.
|
|
1163
|
-
if eq is None:
|
|
1164
|
-
eq = default_eq
|
|
1165
|
-
|
|
1166
|
-
if order is None:
|
|
1167
|
-
order = eq
|
|
1168
|
-
|
|
1169
|
-
if eq is False and order is True:
|
|
1170
|
-
msg = "`order` can only be True if `eq` is True too."
|
|
1171
|
-
raise ValueError(msg)
|
|
1172
|
-
|
|
1173
|
-
return eq, order
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
def _determine_attrib_eq_order(cmp, eq, order, default_eq):
|
|
1177
|
-
"""
|
|
1178
|
-
Validate the combination of *cmp*, *eq*, and *order*. Derive the effective
|
|
1179
|
-
values of eq and order. If *eq* is None, set it to *default_eq*.
|
|
1180
|
-
"""
|
|
1181
|
-
if cmp is not None and any((eq is not None, order is not None)):
|
|
1182
|
-
msg = "Don't mix `cmp` with `eq' and `order`."
|
|
1183
|
-
raise ValueError(msg)
|
|
1184
|
-
|
|
1185
|
-
def decide_callable_or_boolean(value):
|
|
1186
|
-
"""
|
|
1187
|
-
Decide whether a key function is used.
|
|
1188
|
-
"""
|
|
1189
|
-
if callable(value):
|
|
1190
|
-
value, key = True, value
|
|
1191
|
-
else:
|
|
1192
|
-
key = None
|
|
1193
|
-
return value, key
|
|
1194
|
-
|
|
1195
|
-
# cmp takes precedence due to bw-compatibility.
|
|
1196
|
-
if cmp is not None:
|
|
1197
|
-
cmp, cmp_key = decide_callable_or_boolean(cmp)
|
|
1198
|
-
return cmp, cmp_key, cmp, cmp_key
|
|
1199
|
-
|
|
1200
|
-
# If left None, equality is set to the specified default and ordering
|
|
1201
|
-
# mirrors equality.
|
|
1202
|
-
if eq is None:
|
|
1203
|
-
eq, eq_key = default_eq, None
|
|
1204
|
-
else:
|
|
1205
|
-
eq, eq_key = decide_callable_or_boolean(eq)
|
|
1206
|
-
|
|
1207
|
-
if order is None:
|
|
1208
|
-
order, order_key = eq, eq_key
|
|
1209
|
-
else:
|
|
1210
|
-
order, order_key = decide_callable_or_boolean(order)
|
|
1211
|
-
|
|
1212
|
-
if eq is False and order is True:
|
|
1213
|
-
msg = "`order` can only be True if `eq` is True too."
|
|
1214
|
-
raise ValueError(msg)
|
|
1215
|
-
|
|
1216
|
-
return eq, eq_key, order, order_key
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
def _determine_whether_to_implement(
|
|
1220
|
-
cls, flag, auto_detect, dunders, default=True
|
|
1221
|
-
):
|
|
1222
|
-
"""
|
|
1223
|
-
Check whether we should implement a set of methods for *cls*.
|
|
1224
|
-
|
|
1225
|
-
*flag* is the argument passed into @attr.s like 'init', *auto_detect* the
|
|
1226
|
-
same as passed into @attr.s and *dunders* is a tuple of attribute names
|
|
1227
|
-
whose presence signal that the user has implemented it themselves.
|
|
1228
|
-
|
|
1229
|
-
Return *default* if no reason for either for or against is found.
|
|
1230
|
-
"""
|
|
1231
|
-
if flag is True or flag is False:
|
|
1232
|
-
return flag
|
|
1233
|
-
|
|
1234
|
-
if flag is None and auto_detect is False:
|
|
1235
|
-
return default
|
|
1236
|
-
|
|
1237
|
-
# Logically, flag is None and auto_detect is True here.
|
|
1238
|
-
for dunder in dunders:
|
|
1239
|
-
if _has_own_attribute(cls, dunder):
|
|
1240
|
-
return False
|
|
1241
|
-
|
|
1242
|
-
return default
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
def attrs(
|
|
1246
|
-
maybe_cls=None,
|
|
1247
|
-
these=None,
|
|
1248
|
-
repr_ns=None,
|
|
1249
|
-
repr=None,
|
|
1250
|
-
cmp=None,
|
|
1251
|
-
hash=None,
|
|
1252
|
-
init=None,
|
|
1253
|
-
slots=False,
|
|
1254
|
-
frozen=False,
|
|
1255
|
-
weakref_slot=True,
|
|
1256
|
-
str=False,
|
|
1257
|
-
auto_attribs=False,
|
|
1258
|
-
kw_only=False,
|
|
1259
|
-
cache_hash=False,
|
|
1260
|
-
auto_exc=False,
|
|
1261
|
-
eq=None,
|
|
1262
|
-
order=None,
|
|
1263
|
-
auto_detect=False,
|
|
1264
|
-
collect_by_mro=False,
|
|
1265
|
-
getstate_setstate=None,
|
|
1266
|
-
on_setattr=None,
|
|
1267
|
-
field_transformer=None,
|
|
1268
|
-
match_args=True,
|
|
1269
|
-
unsafe_hash=None,
|
|
1270
|
-
):
|
|
1271
|
-
r"""
|
|
1272
|
-
A class decorator that adds :term:`dunder methods` according to the
|
|
1273
|
-
specified attributes using `attr.ib` or the *these* argument.
|
|
1274
|
-
|
|
1275
|
-
Consider using `attrs.define` / `attrs.frozen` in new code (``attr.s`` will
|
|
1276
|
-
*never* go away, though).
|
|
1277
|
-
|
|
1278
|
-
Args:
|
|
1279
|
-
repr_ns (str):
|
|
1280
|
-
When using nested classes, there was no way in Python 2 to
|
|
1281
|
-
automatically detect that. This argument allows to set a custom
|
|
1282
|
-
name for a more meaningful ``repr`` output. This argument is
|
|
1283
|
-
pointless in Python 3 and is therefore deprecated.
|
|
1284
|
-
|
|
1285
|
-
.. caution::
|
|
1286
|
-
Refer to `attrs.define` for the rest of the parameters, but note that they
|
|
1287
|
-
can have different defaults.
|
|
1288
|
-
|
|
1289
|
-
Notably, leaving *on_setattr* as `None` will **not** add any hooks.
|
|
1290
|
-
|
|
1291
|
-
.. versionadded:: 16.0.0 *slots*
|
|
1292
|
-
.. versionadded:: 16.1.0 *frozen*
|
|
1293
|
-
.. versionadded:: 16.3.0 *str*
|
|
1294
|
-
.. versionadded:: 16.3.0 Support for ``__attrs_post_init__``.
|
|
1295
|
-
.. versionchanged:: 17.1.0
|
|
1296
|
-
*hash* supports `None` as value which is also the default now.
|
|
1297
|
-
.. versionadded:: 17.3.0 *auto_attribs*
|
|
1298
|
-
.. versionchanged:: 18.1.0
|
|
1299
|
-
If *these* is passed, no attributes are deleted from the class body.
|
|
1300
|
-
.. versionchanged:: 18.1.0 If *these* is ordered, the order is retained.
|
|
1301
|
-
.. versionadded:: 18.2.0 *weakref_slot*
|
|
1302
|
-
.. deprecated:: 18.2.0
|
|
1303
|
-
``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` now raise a
|
|
1304
|
-
`DeprecationWarning` if the classes compared are subclasses of
|
|
1305
|
-
each other. ``__eq`` and ``__ne__`` never tried to compared subclasses
|
|
1306
|
-
to each other.
|
|
1307
|
-
.. versionchanged:: 19.2.0
|
|
1308
|
-
``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` now do not consider
|
|
1309
|
-
subclasses comparable anymore.
|
|
1310
|
-
.. versionadded:: 18.2.0 *kw_only*
|
|
1311
|
-
.. versionadded:: 18.2.0 *cache_hash*
|
|
1312
|
-
.. versionadded:: 19.1.0 *auto_exc*
|
|
1313
|
-
.. deprecated:: 19.2.0 *cmp* Removal on or after 2021-06-01.
|
|
1314
|
-
.. versionadded:: 19.2.0 *eq* and *order*
|
|
1315
|
-
.. versionadded:: 20.1.0 *auto_detect*
|
|
1316
|
-
.. versionadded:: 20.1.0 *collect_by_mro*
|
|
1317
|
-
.. versionadded:: 20.1.0 *getstate_setstate*
|
|
1318
|
-
.. versionadded:: 20.1.0 *on_setattr*
|
|
1319
|
-
.. versionadded:: 20.3.0 *field_transformer*
|
|
1320
|
-
.. versionchanged:: 21.1.0
|
|
1321
|
-
``init=False`` injects ``__attrs_init__``
|
|
1322
|
-
.. versionchanged:: 21.1.0 Support for ``__attrs_pre_init__``
|
|
1323
|
-
.. versionchanged:: 21.1.0 *cmp* undeprecated
|
|
1324
|
-
.. versionadded:: 21.3.0 *match_args*
|
|
1325
|
-
.. versionadded:: 22.2.0
|
|
1326
|
-
*unsafe_hash* as an alias for *hash* (for :pep:`681` compliance).
|
|
1327
|
-
.. deprecated:: 24.1.0 *repr_ns*
|
|
1328
|
-
.. versionchanged:: 24.1.0
|
|
1329
|
-
Instances are not compared as tuples of attributes anymore, but using a
|
|
1330
|
-
big ``and`` condition. This is faster and has more correct behavior for
|
|
1331
|
-
uncomparable values like `math.nan`.
|
|
1332
|
-
.. versionadded:: 24.1.0
|
|
1333
|
-
If a class has an *inherited* classmethod called
|
|
1334
|
-
``__attrs_init_subclass__``, it is executed after the class is created.
|
|
1335
|
-
.. deprecated:: 24.1.0 *hash* is deprecated in favor of *unsafe_hash*.
|
|
1336
|
-
"""
|
|
1337
|
-
if repr_ns is not None:
|
|
1338
|
-
import warnings
|
|
1339
|
-
|
|
1340
|
-
warnings.warn(
|
|
1341
|
-
DeprecationWarning(
|
|
1342
|
-
"The `repr_ns` argument is deprecated and will be removed in or after August 2025."
|
|
1343
|
-
),
|
|
1344
|
-
stacklevel=2,
|
|
1345
|
-
)
|
|
1346
|
-
|
|
1347
|
-
eq_, order_ = _determine_attrs_eq_order(cmp, eq, order, None)
|
|
1348
|
-
|
|
1349
|
-
# unsafe_hash takes precedence due to PEP 681.
|
|
1350
|
-
if unsafe_hash is not None:
|
|
1351
|
-
hash = unsafe_hash
|
|
1352
|
-
|
|
1353
|
-
if isinstance(on_setattr, (list, tuple)):
|
|
1354
|
-
on_setattr = setters.pipe(*on_setattr)
|
|
1355
|
-
|
|
1356
|
-
def wrap(cls):
|
|
1357
|
-
is_frozen = frozen or _has_frozen_base_class(cls)
|
|
1358
|
-
is_exc = auto_exc is True and issubclass(cls, BaseException)
|
|
1359
|
-
has_own_setattr = auto_detect and _has_own_attribute(
|
|
1360
|
-
cls, "__setattr__"
|
|
1361
|
-
)
|
|
1362
|
-
|
|
1363
|
-
if has_own_setattr and is_frozen:
|
|
1364
|
-
msg = "Can't freeze a class with a custom __setattr__."
|
|
1365
|
-
raise ValueError(msg)
|
|
1366
|
-
|
|
1367
|
-
builder = _ClassBuilder(
|
|
1368
|
-
cls,
|
|
1369
|
-
these,
|
|
1370
|
-
slots,
|
|
1371
|
-
is_frozen,
|
|
1372
|
-
weakref_slot,
|
|
1373
|
-
_determine_whether_to_implement(
|
|
1374
|
-
cls,
|
|
1375
|
-
getstate_setstate,
|
|
1376
|
-
auto_detect,
|
|
1377
|
-
("__getstate__", "__setstate__"),
|
|
1378
|
-
default=slots,
|
|
1379
|
-
),
|
|
1380
|
-
auto_attribs,
|
|
1381
|
-
kw_only,
|
|
1382
|
-
cache_hash,
|
|
1383
|
-
is_exc,
|
|
1384
|
-
collect_by_mro,
|
|
1385
|
-
on_setattr,
|
|
1386
|
-
has_own_setattr,
|
|
1387
|
-
field_transformer,
|
|
1388
|
-
)
|
|
1389
|
-
if _determine_whether_to_implement(
|
|
1390
|
-
cls, repr, auto_detect, ("__repr__",)
|
|
1391
|
-
):
|
|
1392
|
-
builder.add_repr(repr_ns)
|
|
1393
|
-
if str is True:
|
|
1394
|
-
builder.add_str()
|
|
1395
|
-
|
|
1396
|
-
eq = _determine_whether_to_implement(
|
|
1397
|
-
cls, eq_, auto_detect, ("__eq__", "__ne__")
|
|
1398
|
-
)
|
|
1399
|
-
if not is_exc and eq is True:
|
|
1400
|
-
builder.add_eq()
|
|
1401
|
-
if not is_exc and _determine_whether_to_implement(
|
|
1402
|
-
cls, order_, auto_detect, ("__lt__", "__le__", "__gt__", "__ge__")
|
|
1403
|
-
):
|
|
1404
|
-
builder.add_order()
|
|
1405
|
-
|
|
1406
|
-
builder.add_setattr()
|
|
1407
|
-
|
|
1408
|
-
nonlocal hash
|
|
1409
|
-
if (
|
|
1410
|
-
hash is None
|
|
1411
|
-
and auto_detect is True
|
|
1412
|
-
and _has_own_attribute(cls, "__hash__")
|
|
1413
|
-
):
|
|
1414
|
-
hash = False
|
|
1415
|
-
|
|
1416
|
-
if hash is not True and hash is not False and hash is not None:
|
|
1417
|
-
# Can't use `hash in` because 1 == True for example.
|
|
1418
|
-
msg = "Invalid value for hash. Must be True, False, or None."
|
|
1419
|
-
raise TypeError(msg)
|
|
1420
|
-
|
|
1421
|
-
if hash is False or (hash is None and eq is False) or is_exc:
|
|
1422
|
-
# Don't do anything. Should fall back to __object__'s __hash__
|
|
1423
|
-
# which is by id.
|
|
1424
|
-
if cache_hash:
|
|
1425
|
-
msg = "Invalid value for cache_hash. To use hash caching, hashing must be either explicitly or implicitly enabled."
|
|
1426
|
-
raise TypeError(msg)
|
|
1427
|
-
elif hash is True or (
|
|
1428
|
-
hash is None and eq is True and is_frozen is True
|
|
1429
|
-
):
|
|
1430
|
-
# Build a __hash__ if told so, or if it's safe.
|
|
1431
|
-
builder.add_hash()
|
|
1432
|
-
else:
|
|
1433
|
-
# Raise TypeError on attempts to hash.
|
|
1434
|
-
if cache_hash:
|
|
1435
|
-
msg = "Invalid value for cache_hash. To use hash caching, hashing must be either explicitly or implicitly enabled."
|
|
1436
|
-
raise TypeError(msg)
|
|
1437
|
-
builder.make_unhashable()
|
|
1438
|
-
|
|
1439
|
-
if _determine_whether_to_implement(
|
|
1440
|
-
cls, init, auto_detect, ("__init__",)
|
|
1441
|
-
):
|
|
1442
|
-
builder.add_init()
|
|
1443
|
-
else:
|
|
1444
|
-
builder.add_attrs_init()
|
|
1445
|
-
if cache_hash:
|
|
1446
|
-
msg = "Invalid value for cache_hash. To use hash caching, init must be True."
|
|
1447
|
-
raise TypeError(msg)
|
|
1448
|
-
|
|
1449
|
-
if PY_3_13_PLUS and not _has_own_attribute(cls, "__replace__"):
|
|
1450
|
-
builder.add_replace()
|
|
1451
|
-
|
|
1452
|
-
if (
|
|
1453
|
-
PY_3_10_PLUS
|
|
1454
|
-
and match_args
|
|
1455
|
-
and not _has_own_attribute(cls, "__match_args__")
|
|
1456
|
-
):
|
|
1457
|
-
builder.add_match_args()
|
|
1458
|
-
|
|
1459
|
-
return builder.build_class()
|
|
1460
|
-
|
|
1461
|
-
# maybe_cls's type depends on the usage of the decorator. It's a class
|
|
1462
|
-
# if it's used as `@attrs` but `None` if used as `@attrs()`.
|
|
1463
|
-
if maybe_cls is None:
|
|
1464
|
-
return wrap
|
|
1465
|
-
|
|
1466
|
-
return wrap(maybe_cls)
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
_attrs = attrs
|
|
1470
|
-
"""
|
|
1471
|
-
Internal alias so we can use it in functions that take an argument called
|
|
1472
|
-
*attrs*.
|
|
1473
|
-
"""
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
def _has_frozen_base_class(cls):
|
|
1477
|
-
"""
|
|
1478
|
-
Check whether *cls* has a frozen ancestor by looking at its
|
|
1479
|
-
__setattr__.
|
|
1480
|
-
"""
|
|
1481
|
-
return cls.__setattr__ is _frozen_setattrs
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
def _generate_unique_filename(cls, func_name):
|
|
1485
|
-
"""
|
|
1486
|
-
Create a "filename" suitable for a function being generated.
|
|
1487
|
-
"""
|
|
1488
|
-
return (
|
|
1489
|
-
f"<attrs generated {func_name} {cls.__module__}."
|
|
1490
|
-
f"{getattr(cls, '__qualname__', cls.__name__)}>"
|
|
1491
|
-
)
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
def _make_hash(cls, attrs, frozen, cache_hash):
|
|
1495
|
-
attrs = tuple(
|
|
1496
|
-
a for a in attrs if a.hash is True or (a.hash is None and a.eq is True)
|
|
1497
|
-
)
|
|
1498
|
-
|
|
1499
|
-
tab = " "
|
|
1500
|
-
|
|
1501
|
-
unique_filename = _generate_unique_filename(cls, "hash")
|
|
1502
|
-
type_hash = hash(unique_filename)
|
|
1503
|
-
# If eq is custom generated, we need to include the functions in globs
|
|
1504
|
-
globs = {}
|
|
1505
|
-
|
|
1506
|
-
hash_def = "def __hash__(self"
|
|
1507
|
-
hash_func = "hash(("
|
|
1508
|
-
closing_braces = "))"
|
|
1509
|
-
if not cache_hash:
|
|
1510
|
-
hash_def += "):"
|
|
1511
|
-
else:
|
|
1512
|
-
hash_def += ", *"
|
|
1513
|
-
|
|
1514
|
-
hash_def += ", _cache_wrapper=__import__('attr._make')._make._CacheHashWrapper):"
|
|
1515
|
-
hash_func = "_cache_wrapper(" + hash_func
|
|
1516
|
-
closing_braces += ")"
|
|
1517
|
-
|
|
1518
|
-
method_lines = [hash_def]
|
|
1519
|
-
|
|
1520
|
-
def append_hash_computation_lines(prefix, indent):
|
|
1521
|
-
"""
|
|
1522
|
-
Generate the code for actually computing the hash code.
|
|
1523
|
-
Below this will either be returned directly or used to compute
|
|
1524
|
-
a value which is then cached, depending on the value of cache_hash
|
|
1525
|
-
"""
|
|
1526
|
-
|
|
1527
|
-
method_lines.extend(
|
|
1528
|
-
[
|
|
1529
|
-
indent + prefix + hash_func,
|
|
1530
|
-
indent + f" {type_hash},",
|
|
1531
|
-
]
|
|
1532
|
-
)
|
|
1533
|
-
|
|
1534
|
-
for a in attrs:
|
|
1535
|
-
if a.eq_key:
|
|
1536
|
-
cmp_name = f"_{a.name}_key"
|
|
1537
|
-
globs[cmp_name] = a.eq_key
|
|
1538
|
-
method_lines.append(
|
|
1539
|
-
indent + f" {cmp_name}(self.{a.name}),"
|
|
1540
|
-
)
|
|
1541
|
-
else:
|
|
1542
|
-
method_lines.append(indent + f" self.{a.name},")
|
|
1543
|
-
|
|
1544
|
-
method_lines.append(indent + " " + closing_braces)
|
|
1545
|
-
|
|
1546
|
-
if cache_hash:
|
|
1547
|
-
method_lines.append(tab + f"if self.{_HASH_CACHE_FIELD} is None:")
|
|
1548
|
-
if frozen:
|
|
1549
|
-
append_hash_computation_lines(
|
|
1550
|
-
f"object.__setattr__(self, '{_HASH_CACHE_FIELD}', ", tab * 2
|
|
1551
|
-
)
|
|
1552
|
-
method_lines.append(tab * 2 + ")") # close __setattr__
|
|
1553
|
-
else:
|
|
1554
|
-
append_hash_computation_lines(
|
|
1555
|
-
f"self.{_HASH_CACHE_FIELD} = ", tab * 2
|
|
1556
|
-
)
|
|
1557
|
-
method_lines.append(tab + f"return self.{_HASH_CACHE_FIELD}")
|
|
1558
|
-
else:
|
|
1559
|
-
append_hash_computation_lines("return ", tab)
|
|
1560
|
-
|
|
1561
|
-
script = "\n".join(method_lines)
|
|
1562
|
-
return _make_method("__hash__", script, unique_filename, globs)
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
def _add_hash(cls, attrs):
|
|
1566
|
-
"""
|
|
1567
|
-
Add a hash method to *cls*.
|
|
1568
|
-
"""
|
|
1569
|
-
cls.__hash__ = _make_hash(cls, attrs, frozen=False, cache_hash=False)
|
|
1570
|
-
return cls
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
def _make_ne():
|
|
1574
|
-
"""
|
|
1575
|
-
Create __ne__ method.
|
|
1576
|
-
"""
|
|
1577
|
-
|
|
1578
|
-
def __ne__(self, other):
|
|
1579
|
-
"""
|
|
1580
|
-
Check equality and either forward a NotImplemented or
|
|
1581
|
-
return the result negated.
|
|
1582
|
-
"""
|
|
1583
|
-
result = self.__eq__(other)
|
|
1584
|
-
if result is NotImplemented:
|
|
1585
|
-
return NotImplemented
|
|
1586
|
-
|
|
1587
|
-
return not result
|
|
1588
|
-
|
|
1589
|
-
return __ne__
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
def _make_eq(cls, attrs):
|
|
1593
|
-
"""
|
|
1594
|
-
Create __eq__ method for *cls* with *attrs*.
|
|
1595
|
-
"""
|
|
1596
|
-
attrs = [a for a in attrs if a.eq]
|
|
1597
|
-
|
|
1598
|
-
unique_filename = _generate_unique_filename(cls, "eq")
|
|
1599
|
-
lines = [
|
|
1600
|
-
"def __eq__(self, other):",
|
|
1601
|
-
" if other.__class__ is not self.__class__:",
|
|
1602
|
-
" return NotImplemented",
|
|
1603
|
-
]
|
|
1604
|
-
|
|
1605
|
-
globs = {}
|
|
1606
|
-
if attrs:
|
|
1607
|
-
lines.append(" return (")
|
|
1608
|
-
for a in attrs:
|
|
1609
|
-
if a.eq_key:
|
|
1610
|
-
cmp_name = f"_{a.name}_key"
|
|
1611
|
-
# Add the key function to the global namespace
|
|
1612
|
-
# of the evaluated function.
|
|
1613
|
-
globs[cmp_name] = a.eq_key
|
|
1614
|
-
lines.append(
|
|
1615
|
-
f" {cmp_name}(self.{a.name}) == {cmp_name}(other.{a.name})"
|
|
1616
|
-
)
|
|
1617
|
-
else:
|
|
1618
|
-
lines.append(f" self.{a.name} == other.{a.name}")
|
|
1619
|
-
if a is not attrs[-1]:
|
|
1620
|
-
lines[-1] = f"{lines[-1]} and"
|
|
1621
|
-
lines.append(" )")
|
|
1622
|
-
else:
|
|
1623
|
-
lines.append(" return True")
|
|
1624
|
-
|
|
1625
|
-
script = "\n".join(lines)
|
|
1626
|
-
|
|
1627
|
-
return _make_method("__eq__", script, unique_filename, globs)
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
def _make_order(cls, attrs):
|
|
1631
|
-
"""
|
|
1632
|
-
Create ordering methods for *cls* with *attrs*.
|
|
1633
|
-
"""
|
|
1634
|
-
attrs = [a for a in attrs if a.order]
|
|
1635
|
-
|
|
1636
|
-
def attrs_to_tuple(obj):
|
|
1637
|
-
"""
|
|
1638
|
-
Save us some typing.
|
|
1639
|
-
"""
|
|
1640
|
-
return tuple(
|
|
1641
|
-
key(value) if key else value
|
|
1642
|
-
for value, key in (
|
|
1643
|
-
(getattr(obj, a.name), a.order_key) for a in attrs
|
|
1644
|
-
)
|
|
1645
|
-
)
|
|
1646
|
-
|
|
1647
|
-
def __lt__(self, other):
|
|
1648
|
-
"""
|
|
1649
|
-
Automatically created by attrs.
|
|
1650
|
-
"""
|
|
1651
|
-
if other.__class__ is self.__class__:
|
|
1652
|
-
return attrs_to_tuple(self) < attrs_to_tuple(other)
|
|
1653
|
-
|
|
1654
|
-
return NotImplemented
|
|
1655
|
-
|
|
1656
|
-
def __le__(self, other):
|
|
1657
|
-
"""
|
|
1658
|
-
Automatically created by attrs.
|
|
1659
|
-
"""
|
|
1660
|
-
if other.__class__ is self.__class__:
|
|
1661
|
-
return attrs_to_tuple(self) <= attrs_to_tuple(other)
|
|
1662
|
-
|
|
1663
|
-
return NotImplemented
|
|
1664
|
-
|
|
1665
|
-
def __gt__(self, other):
|
|
1666
|
-
"""
|
|
1667
|
-
Automatically created by attrs.
|
|
1668
|
-
"""
|
|
1669
|
-
if other.__class__ is self.__class__:
|
|
1670
|
-
return attrs_to_tuple(self) > attrs_to_tuple(other)
|
|
1671
|
-
|
|
1672
|
-
return NotImplemented
|
|
1673
|
-
|
|
1674
|
-
def __ge__(self, other):
|
|
1675
|
-
"""
|
|
1676
|
-
Automatically created by attrs.
|
|
1677
|
-
"""
|
|
1678
|
-
if other.__class__ is self.__class__:
|
|
1679
|
-
return attrs_to_tuple(self) >= attrs_to_tuple(other)
|
|
1680
|
-
|
|
1681
|
-
return NotImplemented
|
|
1682
|
-
|
|
1683
|
-
return __lt__, __le__, __gt__, __ge__
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
def _add_eq(cls, attrs=None):
|
|
1687
|
-
"""
|
|
1688
|
-
Add equality methods to *cls* with *attrs*.
|
|
1689
|
-
"""
|
|
1690
|
-
if attrs is None:
|
|
1691
|
-
attrs = cls.__attrs_attrs__
|
|
1692
|
-
|
|
1693
|
-
cls.__eq__ = _make_eq(cls, attrs)
|
|
1694
|
-
cls.__ne__ = _make_ne()
|
|
1695
|
-
|
|
1696
|
-
return cls
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
def _make_repr(attrs, ns, cls):
|
|
1700
|
-
unique_filename = _generate_unique_filename(cls, "repr")
|
|
1701
|
-
# Figure out which attributes to include, and which function to use to
|
|
1702
|
-
# format them. The a.repr value can be either bool or a custom
|
|
1703
|
-
# callable.
|
|
1704
|
-
attr_names_with_reprs = tuple(
|
|
1705
|
-
(a.name, (repr if a.repr is True else a.repr), a.init)
|
|
1706
|
-
for a in attrs
|
|
1707
|
-
if a.repr is not False
|
|
1708
|
-
)
|
|
1709
|
-
globs = {
|
|
1710
|
-
name + "_repr": r for name, r, _ in attr_names_with_reprs if r != repr
|
|
1711
|
-
}
|
|
1712
|
-
globs["_compat"] = _compat
|
|
1713
|
-
globs["AttributeError"] = AttributeError
|
|
1714
|
-
globs["NOTHING"] = NOTHING
|
|
1715
|
-
attribute_fragments = []
|
|
1716
|
-
for name, r, i in attr_names_with_reprs:
|
|
1717
|
-
accessor = (
|
|
1718
|
-
"self." + name if i else 'getattr(self, "' + name + '", NOTHING)'
|
|
1719
|
-
)
|
|
1720
|
-
fragment = (
|
|
1721
|
-
"%s={%s!r}" % (name, accessor)
|
|
1722
|
-
if r == repr
|
|
1723
|
-
else "%s={%s_repr(%s)}" % (name, name, accessor)
|
|
1724
|
-
)
|
|
1725
|
-
attribute_fragments.append(fragment)
|
|
1726
|
-
repr_fragment = ", ".join(attribute_fragments)
|
|
1727
|
-
|
|
1728
|
-
if ns is None:
|
|
1729
|
-
cls_name_fragment = '{self.__class__.__qualname__.rsplit(">.", 1)[-1]}'
|
|
1730
|
-
else:
|
|
1731
|
-
cls_name_fragment = ns + ".{self.__class__.__name__}"
|
|
1732
|
-
|
|
1733
|
-
lines = [
|
|
1734
|
-
"def __repr__(self):",
|
|
1735
|
-
" try:",
|
|
1736
|
-
" already_repring = _compat.repr_context.already_repring",
|
|
1737
|
-
" except AttributeError:",
|
|
1738
|
-
" already_repring = {id(self),}",
|
|
1739
|
-
" _compat.repr_context.already_repring = already_repring",
|
|
1740
|
-
" else:",
|
|
1741
|
-
" if id(self) in already_repring:",
|
|
1742
|
-
" return '...'",
|
|
1743
|
-
" else:",
|
|
1744
|
-
" already_repring.add(id(self))",
|
|
1745
|
-
" try:",
|
|
1746
|
-
f" return f'{cls_name_fragment}({repr_fragment})'",
|
|
1747
|
-
" finally:",
|
|
1748
|
-
" already_repring.remove(id(self))",
|
|
1749
|
-
]
|
|
1750
|
-
|
|
1751
|
-
return _make_method(
|
|
1752
|
-
"__repr__", "\n".join(lines), unique_filename, globs=globs
|
|
1753
|
-
)
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
def _add_repr(cls, ns=None, attrs=None):
|
|
1757
|
-
"""
|
|
1758
|
-
Add a repr method to *cls*.
|
|
1759
|
-
"""
|
|
1760
|
-
if attrs is None:
|
|
1761
|
-
attrs = cls.__attrs_attrs__
|
|
1762
|
-
|
|
1763
|
-
cls.__repr__ = _make_repr(attrs, ns, cls)
|
|
1764
|
-
return cls
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
def fields(cls):
|
|
1768
|
-
"""
|
|
1769
|
-
Return the tuple of *attrs* attributes for a class.
|
|
1770
|
-
|
|
1771
|
-
The tuple also allows accessing the fields by their names (see below for
|
|
1772
|
-
examples).
|
|
1773
|
-
|
|
1774
|
-
Args:
|
|
1775
|
-
cls (type): Class to introspect.
|
|
1776
|
-
|
|
1777
|
-
Raises:
|
|
1778
|
-
TypeError: If *cls* is not a class.
|
|
1779
|
-
|
|
1780
|
-
attrs.exceptions.NotAnAttrsClassError:
|
|
1781
|
-
If *cls* is not an *attrs* class.
|
|
1782
|
-
|
|
1783
|
-
Returns:
|
|
1784
|
-
tuple (with name accessors) of `attrs.Attribute`
|
|
1785
|
-
|
|
1786
|
-
.. versionchanged:: 16.2.0 Returned tuple allows accessing the fields
|
|
1787
|
-
by name.
|
|
1788
|
-
.. versionchanged:: 23.1.0 Add support for generic classes.
|
|
1789
|
-
"""
|
|
1790
|
-
generic_base = get_generic_base(cls)
|
|
1791
|
-
|
|
1792
|
-
if generic_base is None and not isinstance(cls, type):
|
|
1793
|
-
msg = "Passed object must be a class."
|
|
1794
|
-
raise TypeError(msg)
|
|
1795
|
-
|
|
1796
|
-
attrs = getattr(cls, "__attrs_attrs__", None)
|
|
1797
|
-
|
|
1798
|
-
if attrs is None:
|
|
1799
|
-
if generic_base is not None:
|
|
1800
|
-
attrs = getattr(generic_base, "__attrs_attrs__", None)
|
|
1801
|
-
if attrs is not None:
|
|
1802
|
-
# Even though this is global state, stick it on here to speed
|
|
1803
|
-
# it up. We rely on `cls` being cached for this to be
|
|
1804
|
-
# efficient.
|
|
1805
|
-
cls.__attrs_attrs__ = attrs
|
|
1806
|
-
return attrs
|
|
1807
|
-
msg = f"{cls!r} is not an attrs-decorated class."
|
|
1808
|
-
raise NotAnAttrsClassError(msg)
|
|
1809
|
-
|
|
1810
|
-
return attrs
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
def fields_dict(cls):
|
|
1814
|
-
"""
|
|
1815
|
-
Return an ordered dictionary of *attrs* attributes for a class, whose keys
|
|
1816
|
-
are the attribute names.
|
|
1817
|
-
|
|
1818
|
-
Args:
|
|
1819
|
-
cls (type): Class to introspect.
|
|
1820
|
-
|
|
1821
|
-
Raises:
|
|
1822
|
-
TypeError: If *cls* is not a class.
|
|
1823
|
-
|
|
1824
|
-
attrs.exceptions.NotAnAttrsClassError:
|
|
1825
|
-
If *cls* is not an *attrs* class.
|
|
1826
|
-
|
|
1827
|
-
Returns:
|
|
1828
|
-
dict[str, attrs.Attribute]: Dict of attribute name to definition
|
|
1829
|
-
|
|
1830
|
-
.. versionadded:: 18.1.0
|
|
1831
|
-
"""
|
|
1832
|
-
if not isinstance(cls, type):
|
|
1833
|
-
msg = "Passed object must be a class."
|
|
1834
|
-
raise TypeError(msg)
|
|
1835
|
-
attrs = getattr(cls, "__attrs_attrs__", None)
|
|
1836
|
-
if attrs is None:
|
|
1837
|
-
msg = f"{cls!r} is not an attrs-decorated class."
|
|
1838
|
-
raise NotAnAttrsClassError(msg)
|
|
1839
|
-
return {a.name: a for a in attrs}
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
def validate(inst):
|
|
1843
|
-
"""
|
|
1844
|
-
Validate all attributes on *inst* that have a validator.
|
|
1845
|
-
|
|
1846
|
-
Leaves all exceptions through.
|
|
1847
|
-
|
|
1848
|
-
Args:
|
|
1849
|
-
inst: Instance of a class with *attrs* attributes.
|
|
1850
|
-
"""
|
|
1851
|
-
if _config._run_validators is False:
|
|
1852
|
-
return
|
|
1853
|
-
|
|
1854
|
-
for a in fields(inst.__class__):
|
|
1855
|
-
v = a.validator
|
|
1856
|
-
if v is not None:
|
|
1857
|
-
v(inst, a, getattr(inst, a.name))
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
def _is_slot_attr(a_name, base_attr_map):
|
|
1861
|
-
"""
|
|
1862
|
-
Check if the attribute name comes from a slot class.
|
|
1863
|
-
"""
|
|
1864
|
-
cls = base_attr_map.get(a_name)
|
|
1865
|
-
return cls and "__slots__" in cls.__dict__
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
def _make_init(
|
|
1869
|
-
cls,
|
|
1870
|
-
attrs,
|
|
1871
|
-
pre_init,
|
|
1872
|
-
pre_init_has_args,
|
|
1873
|
-
post_init,
|
|
1874
|
-
frozen,
|
|
1875
|
-
slots,
|
|
1876
|
-
cache_hash,
|
|
1877
|
-
base_attr_map,
|
|
1878
|
-
is_exc,
|
|
1879
|
-
cls_on_setattr,
|
|
1880
|
-
attrs_init,
|
|
1881
|
-
):
|
|
1882
|
-
has_cls_on_setattr = (
|
|
1883
|
-
cls_on_setattr is not None and cls_on_setattr is not setters.NO_OP
|
|
1884
|
-
)
|
|
1885
|
-
|
|
1886
|
-
if frozen and has_cls_on_setattr:
|
|
1887
|
-
msg = "Frozen classes can't use on_setattr."
|
|
1888
|
-
raise ValueError(msg)
|
|
1889
|
-
|
|
1890
|
-
needs_cached_setattr = cache_hash or frozen
|
|
1891
|
-
filtered_attrs = []
|
|
1892
|
-
attr_dict = {}
|
|
1893
|
-
for a in attrs:
|
|
1894
|
-
if not a.init and a.default is NOTHING:
|
|
1895
|
-
continue
|
|
1896
|
-
|
|
1897
|
-
filtered_attrs.append(a)
|
|
1898
|
-
attr_dict[a.name] = a
|
|
1899
|
-
|
|
1900
|
-
if a.on_setattr is not None:
|
|
1901
|
-
if frozen is True:
|
|
1902
|
-
msg = "Frozen classes can't use on_setattr."
|
|
1903
|
-
raise ValueError(msg)
|
|
1904
|
-
|
|
1905
|
-
needs_cached_setattr = True
|
|
1906
|
-
elif has_cls_on_setattr and a.on_setattr is not setters.NO_OP:
|
|
1907
|
-
needs_cached_setattr = True
|
|
1908
|
-
|
|
1909
|
-
unique_filename = _generate_unique_filename(cls, "init")
|
|
1910
|
-
|
|
1911
|
-
script, globs, annotations = _attrs_to_init_script(
|
|
1912
|
-
filtered_attrs,
|
|
1913
|
-
frozen,
|
|
1914
|
-
slots,
|
|
1915
|
-
pre_init,
|
|
1916
|
-
pre_init_has_args,
|
|
1917
|
-
post_init,
|
|
1918
|
-
cache_hash,
|
|
1919
|
-
base_attr_map,
|
|
1920
|
-
is_exc,
|
|
1921
|
-
needs_cached_setattr,
|
|
1922
|
-
has_cls_on_setattr,
|
|
1923
|
-
"__attrs_init__" if attrs_init else "__init__",
|
|
1924
|
-
)
|
|
1925
|
-
if cls.__module__ in sys.modules:
|
|
1926
|
-
# This makes typing.get_type_hints(CLS.__init__) resolve string types.
|
|
1927
|
-
globs.update(sys.modules[cls.__module__].__dict__)
|
|
1928
|
-
|
|
1929
|
-
globs.update({"NOTHING": NOTHING, "attr_dict": attr_dict})
|
|
1930
|
-
|
|
1931
|
-
if needs_cached_setattr:
|
|
1932
|
-
# Save the lookup overhead in __init__ if we need to circumvent
|
|
1933
|
-
# setattr hooks.
|
|
1934
|
-
globs["_cached_setattr_get"] = _OBJ_SETATTR.__get__
|
|
1935
|
-
|
|
1936
|
-
init = _make_method(
|
|
1937
|
-
"__attrs_init__" if attrs_init else "__init__",
|
|
1938
|
-
script,
|
|
1939
|
-
unique_filename,
|
|
1940
|
-
globs,
|
|
1941
|
-
)
|
|
1942
|
-
init.__annotations__ = annotations
|
|
1943
|
-
|
|
1944
|
-
return init
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
def _setattr(attr_name: str, value_var: str, has_on_setattr: bool) -> str:
|
|
1948
|
-
"""
|
|
1949
|
-
Use the cached object.setattr to set *attr_name* to *value_var*.
|
|
1950
|
-
"""
|
|
1951
|
-
return f"_setattr('{attr_name}', {value_var})"
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
def _setattr_with_converter(
|
|
1955
|
-
attr_name: str, value_var: str, has_on_setattr: bool, converter: Converter
|
|
1956
|
-
) -> str:
|
|
1957
|
-
"""
|
|
1958
|
-
Use the cached object.setattr to set *attr_name* to *value_var*, but run
|
|
1959
|
-
its converter first.
|
|
1960
|
-
"""
|
|
1961
|
-
return f"_setattr('{attr_name}', {converter._fmt_converter_call(attr_name, value_var)})"
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
def _assign(attr_name: str, value: str, has_on_setattr: bool) -> str:
|
|
1965
|
-
"""
|
|
1966
|
-
Unless *attr_name* has an on_setattr hook, use normal assignment. Otherwise
|
|
1967
|
-
relegate to _setattr.
|
|
1968
|
-
"""
|
|
1969
|
-
if has_on_setattr:
|
|
1970
|
-
return _setattr(attr_name, value, True)
|
|
1971
|
-
|
|
1972
|
-
return f"self.{attr_name} = {value}"
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
def _assign_with_converter(
|
|
1976
|
-
attr_name: str, value_var: str, has_on_setattr: bool, converter: Converter
|
|
1977
|
-
) -> str:
|
|
1978
|
-
"""
|
|
1979
|
-
Unless *attr_name* has an on_setattr hook, use normal assignment after
|
|
1980
|
-
conversion. Otherwise relegate to _setattr_with_converter.
|
|
1981
|
-
"""
|
|
1982
|
-
if has_on_setattr:
|
|
1983
|
-
return _setattr_with_converter(attr_name, value_var, True, converter)
|
|
1984
|
-
|
|
1985
|
-
return f"self.{attr_name} = {converter._fmt_converter_call(attr_name, value_var)}"
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
def _determine_setters(
|
|
1989
|
-
frozen: bool, slots: bool, base_attr_map: dict[str, type]
|
|
1990
|
-
):
|
|
1991
|
-
"""
|
|
1992
|
-
Determine the correct setter functions based on whether a class is frozen
|
|
1993
|
-
and/or slotted.
|
|
1994
|
-
"""
|
|
1995
|
-
if frozen is True:
|
|
1996
|
-
if slots is True:
|
|
1997
|
-
return (), _setattr, _setattr_with_converter
|
|
1998
|
-
|
|
1999
|
-
# Dict frozen classes assign directly to __dict__.
|
|
2000
|
-
# But only if the attribute doesn't come from an ancestor slot
|
|
2001
|
-
# class.
|
|
2002
|
-
# Note _inst_dict will be used again below if cache_hash is True
|
|
2003
|
-
|
|
2004
|
-
def fmt_setter(
|
|
2005
|
-
attr_name: str, value_var: str, has_on_setattr: bool
|
|
2006
|
-
) -> str:
|
|
2007
|
-
if _is_slot_attr(attr_name, base_attr_map):
|
|
2008
|
-
return _setattr(attr_name, value_var, has_on_setattr)
|
|
2009
|
-
|
|
2010
|
-
return f"_inst_dict['{attr_name}'] = {value_var}"
|
|
2011
|
-
|
|
2012
|
-
def fmt_setter_with_converter(
|
|
2013
|
-
attr_name: str,
|
|
2014
|
-
value_var: str,
|
|
2015
|
-
has_on_setattr: bool,
|
|
2016
|
-
converter: Converter,
|
|
2017
|
-
) -> str:
|
|
2018
|
-
if has_on_setattr or _is_slot_attr(attr_name, base_attr_map):
|
|
2019
|
-
return _setattr_with_converter(
|
|
2020
|
-
attr_name, value_var, has_on_setattr, converter
|
|
2021
|
-
)
|
|
2022
|
-
|
|
2023
|
-
return f"_inst_dict['{attr_name}'] = {converter._fmt_converter_call(attr_name, value_var)}"
|
|
2024
|
-
|
|
2025
|
-
return (
|
|
2026
|
-
("_inst_dict = self.__dict__",),
|
|
2027
|
-
fmt_setter,
|
|
2028
|
-
fmt_setter_with_converter,
|
|
2029
|
-
)
|
|
2030
|
-
|
|
2031
|
-
# Not frozen -- we can just assign directly.
|
|
2032
|
-
return (), _assign, _assign_with_converter
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
def _attrs_to_init_script(
|
|
2036
|
-
attrs: list[Attribute],
|
|
2037
|
-
is_frozen: bool,
|
|
2038
|
-
is_slotted: bool,
|
|
2039
|
-
call_pre_init: bool,
|
|
2040
|
-
pre_init_has_args: bool,
|
|
2041
|
-
call_post_init: bool,
|
|
2042
|
-
does_cache_hash: bool,
|
|
2043
|
-
base_attr_map: dict[str, type],
|
|
2044
|
-
is_exc: bool,
|
|
2045
|
-
needs_cached_setattr: bool,
|
|
2046
|
-
has_cls_on_setattr: bool,
|
|
2047
|
-
method_name: str,
|
|
2048
|
-
) -> tuple[str, dict, dict]:
|
|
2049
|
-
"""
|
|
2050
|
-
Return a script of an initializer for *attrs*, a dict of globals, and
|
|
2051
|
-
annotations for the initializer.
|
|
2052
|
-
|
|
2053
|
-
The globals are required by the generated script.
|
|
2054
|
-
"""
|
|
2055
|
-
lines = ["self.__attrs_pre_init__()"] if call_pre_init else []
|
|
2056
|
-
|
|
2057
|
-
if needs_cached_setattr:
|
|
2058
|
-
lines.append(
|
|
2059
|
-
# Circumvent the __setattr__ descriptor to save one lookup per
|
|
2060
|
-
# assignment. Note _setattr will be used again below if
|
|
2061
|
-
# does_cache_hash is True.
|
|
2062
|
-
"_setattr = _cached_setattr_get(self)"
|
|
2063
|
-
)
|
|
2064
|
-
|
|
2065
|
-
extra_lines, fmt_setter, fmt_setter_with_converter = _determine_setters(
|
|
2066
|
-
is_frozen, is_slotted, base_attr_map
|
|
2067
|
-
)
|
|
2068
|
-
lines.extend(extra_lines)
|
|
2069
|
-
|
|
2070
|
-
args = []
|
|
2071
|
-
kw_only_args = []
|
|
2072
|
-
attrs_to_validate = []
|
|
2073
|
-
|
|
2074
|
-
# This is a dictionary of names to validator and converter callables.
|
|
2075
|
-
# Injecting this into __init__ globals lets us avoid lookups.
|
|
2076
|
-
names_for_globals = {}
|
|
2077
|
-
annotations = {"return": None}
|
|
2078
|
-
|
|
2079
|
-
for a in attrs:
|
|
2080
|
-
if a.validator:
|
|
2081
|
-
attrs_to_validate.append(a)
|
|
2082
|
-
|
|
2083
|
-
attr_name = a.name
|
|
2084
|
-
has_on_setattr = a.on_setattr is not None or (
|
|
2085
|
-
a.on_setattr is not setters.NO_OP and has_cls_on_setattr
|
|
2086
|
-
)
|
|
2087
|
-
# a.alias is set to maybe-mangled attr_name in _ClassBuilder if not
|
|
2088
|
-
# explicitly provided
|
|
2089
|
-
arg_name = a.alias
|
|
2090
|
-
|
|
2091
|
-
has_factory = isinstance(a.default, Factory)
|
|
2092
|
-
maybe_self = "self" if has_factory and a.default.takes_self else ""
|
|
2093
|
-
|
|
2094
|
-
if a.converter is not None and not isinstance(a.converter, Converter):
|
|
2095
|
-
converter = Converter(a.converter)
|
|
2096
|
-
else:
|
|
2097
|
-
converter = a.converter
|
|
2098
|
-
|
|
2099
|
-
if a.init is False:
|
|
2100
|
-
if has_factory:
|
|
2101
|
-
init_factory_name = _INIT_FACTORY_PAT % (a.name,)
|
|
2102
|
-
if converter is not None:
|
|
2103
|
-
lines.append(
|
|
2104
|
-
fmt_setter_with_converter(
|
|
2105
|
-
attr_name,
|
|
2106
|
-
init_factory_name + f"({maybe_self})",
|
|
2107
|
-
has_on_setattr,
|
|
2108
|
-
converter,
|
|
2109
|
-
)
|
|
2110
|
-
)
|
|
2111
|
-
names_for_globals[converter._get_global_name(a.name)] = (
|
|
2112
|
-
converter.converter
|
|
2113
|
-
)
|
|
2114
|
-
else:
|
|
2115
|
-
lines.append(
|
|
2116
|
-
fmt_setter(
|
|
2117
|
-
attr_name,
|
|
2118
|
-
init_factory_name + f"({maybe_self})",
|
|
2119
|
-
has_on_setattr,
|
|
2120
|
-
)
|
|
2121
|
-
)
|
|
2122
|
-
names_for_globals[init_factory_name] = a.default.factory
|
|
2123
|
-
elif converter is not None:
|
|
2124
|
-
lines.append(
|
|
2125
|
-
fmt_setter_with_converter(
|
|
2126
|
-
attr_name,
|
|
2127
|
-
f"attr_dict['{attr_name}'].default",
|
|
2128
|
-
has_on_setattr,
|
|
2129
|
-
converter,
|
|
2130
|
-
)
|
|
2131
|
-
)
|
|
2132
|
-
names_for_globals[converter._get_global_name(a.name)] = (
|
|
2133
|
-
converter.converter
|
|
2134
|
-
)
|
|
2135
|
-
else:
|
|
2136
|
-
lines.append(
|
|
2137
|
-
fmt_setter(
|
|
2138
|
-
attr_name,
|
|
2139
|
-
f"attr_dict['{attr_name}'].default",
|
|
2140
|
-
has_on_setattr,
|
|
2141
|
-
)
|
|
2142
|
-
)
|
|
2143
|
-
elif a.default is not NOTHING and not has_factory:
|
|
2144
|
-
arg = f"{arg_name}=attr_dict['{attr_name}'].default"
|
|
2145
|
-
if a.kw_only:
|
|
2146
|
-
kw_only_args.append(arg)
|
|
2147
|
-
else:
|
|
2148
|
-
args.append(arg)
|
|
2149
|
-
|
|
2150
|
-
if converter is not None:
|
|
2151
|
-
lines.append(
|
|
2152
|
-
fmt_setter_with_converter(
|
|
2153
|
-
attr_name, arg_name, has_on_setattr, converter
|
|
2154
|
-
)
|
|
2155
|
-
)
|
|
2156
|
-
names_for_globals[converter._get_global_name(a.name)] = (
|
|
2157
|
-
converter.converter
|
|
2158
|
-
)
|
|
2159
|
-
else:
|
|
2160
|
-
lines.append(fmt_setter(attr_name, arg_name, has_on_setattr))
|
|
2161
|
-
|
|
2162
|
-
elif has_factory:
|
|
2163
|
-
arg = f"{arg_name}=NOTHING"
|
|
2164
|
-
if a.kw_only:
|
|
2165
|
-
kw_only_args.append(arg)
|
|
2166
|
-
else:
|
|
2167
|
-
args.append(arg)
|
|
2168
|
-
lines.append(f"if {arg_name} is not NOTHING:")
|
|
2169
|
-
|
|
2170
|
-
init_factory_name = _INIT_FACTORY_PAT % (a.name,)
|
|
2171
|
-
if converter is not None:
|
|
2172
|
-
lines.append(
|
|
2173
|
-
" "
|
|
2174
|
-
+ fmt_setter_with_converter(
|
|
2175
|
-
attr_name, arg_name, has_on_setattr, converter
|
|
2176
|
-
)
|
|
2177
|
-
)
|
|
2178
|
-
lines.append("else:")
|
|
2179
|
-
lines.append(
|
|
2180
|
-
" "
|
|
2181
|
-
+ fmt_setter_with_converter(
|
|
2182
|
-
attr_name,
|
|
2183
|
-
init_factory_name + "(" + maybe_self + ")",
|
|
2184
|
-
has_on_setattr,
|
|
2185
|
-
converter,
|
|
2186
|
-
)
|
|
2187
|
-
)
|
|
2188
|
-
names_for_globals[converter._get_global_name(a.name)] = (
|
|
2189
|
-
converter.converter
|
|
2190
|
-
)
|
|
2191
|
-
else:
|
|
2192
|
-
lines.append(
|
|
2193
|
-
" " + fmt_setter(attr_name, arg_name, has_on_setattr)
|
|
2194
|
-
)
|
|
2195
|
-
lines.append("else:")
|
|
2196
|
-
lines.append(
|
|
2197
|
-
" "
|
|
2198
|
-
+ fmt_setter(
|
|
2199
|
-
attr_name,
|
|
2200
|
-
init_factory_name + "(" + maybe_self + ")",
|
|
2201
|
-
has_on_setattr,
|
|
2202
|
-
)
|
|
2203
|
-
)
|
|
2204
|
-
names_for_globals[init_factory_name] = a.default.factory
|
|
2205
|
-
else:
|
|
2206
|
-
if a.kw_only:
|
|
2207
|
-
kw_only_args.append(arg_name)
|
|
2208
|
-
else:
|
|
2209
|
-
args.append(arg_name)
|
|
2210
|
-
|
|
2211
|
-
if converter is not None:
|
|
2212
|
-
lines.append(
|
|
2213
|
-
fmt_setter_with_converter(
|
|
2214
|
-
attr_name, arg_name, has_on_setattr, converter
|
|
2215
|
-
)
|
|
2216
|
-
)
|
|
2217
|
-
names_for_globals[converter._get_global_name(a.name)] = (
|
|
2218
|
-
converter.converter
|
|
2219
|
-
)
|
|
2220
|
-
else:
|
|
2221
|
-
lines.append(fmt_setter(attr_name, arg_name, has_on_setattr))
|
|
2222
|
-
|
|
2223
|
-
if a.init is True:
|
|
2224
|
-
if a.type is not None and converter is None:
|
|
2225
|
-
annotations[arg_name] = a.type
|
|
2226
|
-
elif converter is not None and converter._first_param_type:
|
|
2227
|
-
# Use the type from the converter if present.
|
|
2228
|
-
annotations[arg_name] = converter._first_param_type
|
|
2229
|
-
|
|
2230
|
-
if attrs_to_validate: # we can skip this if there are no validators.
|
|
2231
|
-
names_for_globals["_config"] = _config
|
|
2232
|
-
lines.append("if _config._run_validators is True:")
|
|
2233
|
-
for a in attrs_to_validate:
|
|
2234
|
-
val_name = "__attr_validator_" + a.name
|
|
2235
|
-
attr_name = "__attr_" + a.name
|
|
2236
|
-
lines.append(f" {val_name}(self, {attr_name}, self.{a.name})")
|
|
2237
|
-
names_for_globals[val_name] = a.validator
|
|
2238
|
-
names_for_globals[attr_name] = a
|
|
2239
|
-
|
|
2240
|
-
if call_post_init:
|
|
2241
|
-
lines.append("self.__attrs_post_init__()")
|
|
2242
|
-
|
|
2243
|
-
# Because this is set only after __attrs_post_init__ is called, a crash
|
|
2244
|
-
# will result if post-init tries to access the hash code. This seemed
|
|
2245
|
-
# preferable to setting this beforehand, in which case alteration to field
|
|
2246
|
-
# values during post-init combined with post-init accessing the hash code
|
|
2247
|
-
# would result in silent bugs.
|
|
2248
|
-
if does_cache_hash:
|
|
2249
|
-
if is_frozen:
|
|
2250
|
-
if is_slotted:
|
|
2251
|
-
init_hash_cache = f"_setattr('{_HASH_CACHE_FIELD}', None)"
|
|
2252
|
-
else:
|
|
2253
|
-
init_hash_cache = f"_inst_dict['{_HASH_CACHE_FIELD}'] = None"
|
|
2254
|
-
else:
|
|
2255
|
-
init_hash_cache = f"self.{_HASH_CACHE_FIELD} = None"
|
|
2256
|
-
lines.append(init_hash_cache)
|
|
2257
|
-
|
|
2258
|
-
# For exceptions we rely on BaseException.__init__ for proper
|
|
2259
|
-
# initialization.
|
|
2260
|
-
if is_exc:
|
|
2261
|
-
vals = ",".join(f"self.{a.name}" for a in attrs if a.init)
|
|
2262
|
-
|
|
2263
|
-
lines.append(f"BaseException.__init__(self, {vals})")
|
|
2264
|
-
|
|
2265
|
-
args = ", ".join(args)
|
|
2266
|
-
pre_init_args = args
|
|
2267
|
-
if kw_only_args:
|
|
2268
|
-
# leading comma & kw_only args
|
|
2269
|
-
args += f"{', ' if args else ''}*, {', '.join(kw_only_args)}"
|
|
2270
|
-
pre_init_kw_only_args = ", ".join(
|
|
2271
|
-
[
|
|
2272
|
-
f"{kw_arg_name}={kw_arg_name}"
|
|
2273
|
-
# We need to remove the defaults from the kw_only_args.
|
|
2274
|
-
for kw_arg_name in (kwa.split("=")[0] for kwa in kw_only_args)
|
|
2275
|
-
]
|
|
2276
|
-
)
|
|
2277
|
-
pre_init_args += ", " if pre_init_args else ""
|
|
2278
|
-
pre_init_args += pre_init_kw_only_args
|
|
2279
|
-
|
|
2280
|
-
if call_pre_init and pre_init_has_args:
|
|
2281
|
-
# If pre init method has arguments, pass same arguments as `__init__`.
|
|
2282
|
-
lines[0] = f"self.__attrs_pre_init__({pre_init_args})"
|
|
2283
|
-
|
|
2284
|
-
# Python <3.12 doesn't allow backslashes in f-strings.
|
|
2285
|
-
NL = "\n "
|
|
2286
|
-
return (
|
|
2287
|
-
f"""def {method_name}(self, {args}):
|
|
2288
|
-
{NL.join(lines) if lines else "pass"}
|
|
2289
|
-
""",
|
|
2290
|
-
names_for_globals,
|
|
2291
|
-
annotations,
|
|
2292
|
-
)
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
def _default_init_alias_for(name: str) -> str:
|
|
2296
|
-
"""
|
|
2297
|
-
The default __init__ parameter name for a field.
|
|
2298
|
-
|
|
2299
|
-
This performs private-name adjustment via leading-unscore stripping,
|
|
2300
|
-
and is the default value of Attribute.alias if not provided.
|
|
2301
|
-
"""
|
|
2302
|
-
|
|
2303
|
-
return name.lstrip("_")
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
class Attribute:
|
|
2307
|
-
"""
|
|
2308
|
-
*Read-only* representation of an attribute.
|
|
2309
|
-
|
|
2310
|
-
.. warning::
|
|
2311
|
-
|
|
2312
|
-
You should never instantiate this class yourself.
|
|
2313
|
-
|
|
2314
|
-
The class has *all* arguments of `attr.ib` (except for ``factory`` which is
|
|
2315
|
-
only syntactic sugar for ``default=Factory(...)`` plus the following:
|
|
2316
|
-
|
|
2317
|
-
- ``name`` (`str`): The name of the attribute.
|
|
2318
|
-
- ``alias`` (`str`): The __init__ parameter name of the attribute, after
|
|
2319
|
-
any explicit overrides and default private-attribute-name handling.
|
|
2320
|
-
- ``inherited`` (`bool`): Whether or not that attribute has been inherited
|
|
2321
|
-
from a base class.
|
|
2322
|
-
- ``eq_key`` and ``order_key`` (`typing.Callable` or `None`): The
|
|
2323
|
-
callables that are used for comparing and ordering objects by this
|
|
2324
|
-
attribute, respectively. These are set by passing a callable to
|
|
2325
|
-
`attr.ib`'s ``eq``, ``order``, or ``cmp`` arguments. See also
|
|
2326
|
-
:ref:`comparison customization <custom-comparison>`.
|
|
2327
|
-
|
|
2328
|
-
Instances of this class are frequently used for introspection purposes
|
|
2329
|
-
like:
|
|
2330
|
-
|
|
2331
|
-
- `fields` returns a tuple of them.
|
|
2332
|
-
- Validators get them passed as the first argument.
|
|
2333
|
-
- The :ref:`field transformer <transform-fields>` hook receives a list of
|
|
2334
|
-
them.
|
|
2335
|
-
- The ``alias`` property exposes the __init__ parameter name of the field,
|
|
2336
|
-
with any overrides and default private-attribute handling applied.
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
.. versionadded:: 20.1.0 *inherited*
|
|
2340
|
-
.. versionadded:: 20.1.0 *on_setattr*
|
|
2341
|
-
.. versionchanged:: 20.2.0 *inherited* is not taken into account for
|
|
2342
|
-
equality checks and hashing anymore.
|
|
2343
|
-
.. versionadded:: 21.1.0 *eq_key* and *order_key*
|
|
2344
|
-
.. versionadded:: 22.2.0 *alias*
|
|
2345
|
-
|
|
2346
|
-
For the full version history of the fields, see `attr.ib`.
|
|
2347
|
-
"""
|
|
2348
|
-
|
|
2349
|
-
# These slots must NOT be reordered because we use them later for
|
|
2350
|
-
# instantiation.
|
|
2351
|
-
__slots__ = ( # noqa: RUF023
|
|
2352
|
-
"name",
|
|
2353
|
-
"default",
|
|
2354
|
-
"validator",
|
|
2355
|
-
"repr",
|
|
2356
|
-
"eq",
|
|
2357
|
-
"eq_key",
|
|
2358
|
-
"order",
|
|
2359
|
-
"order_key",
|
|
2360
|
-
"hash",
|
|
2361
|
-
"init",
|
|
2362
|
-
"metadata",
|
|
2363
|
-
"type",
|
|
2364
|
-
"converter",
|
|
2365
|
-
"kw_only",
|
|
2366
|
-
"inherited",
|
|
2367
|
-
"on_setattr",
|
|
2368
|
-
"alias",
|
|
2369
|
-
)
|
|
2370
|
-
|
|
2371
|
-
def __init__(
|
|
2372
|
-
self,
|
|
2373
|
-
name,
|
|
2374
|
-
default,
|
|
2375
|
-
validator,
|
|
2376
|
-
repr,
|
|
2377
|
-
cmp, # XXX: unused, remove along with other cmp code.
|
|
2378
|
-
hash,
|
|
2379
|
-
init,
|
|
2380
|
-
inherited,
|
|
2381
|
-
metadata=None,
|
|
2382
|
-
type=None,
|
|
2383
|
-
converter=None,
|
|
2384
|
-
kw_only=False,
|
|
2385
|
-
eq=None,
|
|
2386
|
-
eq_key=None,
|
|
2387
|
-
order=None,
|
|
2388
|
-
order_key=None,
|
|
2389
|
-
on_setattr=None,
|
|
2390
|
-
alias=None,
|
|
2391
|
-
):
|
|
2392
|
-
eq, eq_key, order, order_key = _determine_attrib_eq_order(
|
|
2393
|
-
cmp, eq_key or eq, order_key or order, True
|
|
2394
|
-
)
|
|
2395
|
-
|
|
2396
|
-
# Cache this descriptor here to speed things up later.
|
|
2397
|
-
bound_setattr = _OBJ_SETATTR.__get__(self)
|
|
2398
|
-
|
|
2399
|
-
# Despite the big red warning, people *do* instantiate `Attribute`
|
|
2400
|
-
# themselves.
|
|
2401
|
-
bound_setattr("name", name)
|
|
2402
|
-
bound_setattr("default", default)
|
|
2403
|
-
bound_setattr("validator", validator)
|
|
2404
|
-
bound_setattr("repr", repr)
|
|
2405
|
-
bound_setattr("eq", eq)
|
|
2406
|
-
bound_setattr("eq_key", eq_key)
|
|
2407
|
-
bound_setattr("order", order)
|
|
2408
|
-
bound_setattr("order_key", order_key)
|
|
2409
|
-
bound_setattr("hash", hash)
|
|
2410
|
-
bound_setattr("init", init)
|
|
2411
|
-
bound_setattr("converter", converter)
|
|
2412
|
-
bound_setattr(
|
|
2413
|
-
"metadata",
|
|
2414
|
-
(
|
|
2415
|
-
types.MappingProxyType(dict(metadata)) # Shallow copy
|
|
2416
|
-
if metadata
|
|
2417
|
-
else _EMPTY_METADATA_SINGLETON
|
|
2418
|
-
),
|
|
2419
|
-
)
|
|
2420
|
-
bound_setattr("type", type)
|
|
2421
|
-
bound_setattr("kw_only", kw_only)
|
|
2422
|
-
bound_setattr("inherited", inherited)
|
|
2423
|
-
bound_setattr("on_setattr", on_setattr)
|
|
2424
|
-
bound_setattr("alias", alias)
|
|
2425
|
-
|
|
2426
|
-
def __setattr__(self, name, value):
|
|
2427
|
-
raise FrozenInstanceError
|
|
2428
|
-
|
|
2429
|
-
@classmethod
|
|
2430
|
-
def from_counting_attr(cls, name, ca, type=None):
|
|
2431
|
-
# type holds the annotated value. deal with conflicts:
|
|
2432
|
-
if type is None:
|
|
2433
|
-
type = ca.type
|
|
2434
|
-
elif ca.type is not None:
|
|
2435
|
-
msg = "Type annotation and type argument cannot both be present"
|
|
2436
|
-
raise ValueError(msg)
|
|
2437
|
-
inst_dict = {
|
|
2438
|
-
k: getattr(ca, k)
|
|
2439
|
-
for k in Attribute.__slots__
|
|
2440
|
-
if k
|
|
2441
|
-
not in (
|
|
2442
|
-
"name",
|
|
2443
|
-
"validator",
|
|
2444
|
-
"default",
|
|
2445
|
-
"type",
|
|
2446
|
-
"inherited",
|
|
2447
|
-
) # exclude methods and deprecated alias
|
|
2448
|
-
}
|
|
2449
|
-
return cls(
|
|
2450
|
-
name=name,
|
|
2451
|
-
validator=ca._validator,
|
|
2452
|
-
default=ca._default,
|
|
2453
|
-
type=type,
|
|
2454
|
-
cmp=None,
|
|
2455
|
-
inherited=False,
|
|
2456
|
-
**inst_dict,
|
|
2457
|
-
)
|
|
2458
|
-
|
|
2459
|
-
# Don't use attrs.evolve since fields(Attribute) doesn't work
|
|
2460
|
-
def evolve(self, **changes):
|
|
2461
|
-
"""
|
|
2462
|
-
Copy *self* and apply *changes*.
|
|
2463
|
-
|
|
2464
|
-
This works similarly to `attrs.evolve` but that function does not work
|
|
2465
|
-
with :class:`attrs.Attribute`.
|
|
2466
|
-
|
|
2467
|
-
It is mainly meant to be used for `transform-fields`.
|
|
2468
|
-
|
|
2469
|
-
.. versionadded:: 20.3.0
|
|
2470
|
-
"""
|
|
2471
|
-
new = copy.copy(self)
|
|
2472
|
-
|
|
2473
|
-
new._setattrs(changes.items())
|
|
2474
|
-
|
|
2475
|
-
return new
|
|
2476
|
-
|
|
2477
|
-
# Don't use _add_pickle since fields(Attribute) doesn't work
|
|
2478
|
-
def __getstate__(self):
|
|
2479
|
-
"""
|
|
2480
|
-
Play nice with pickle.
|
|
2481
|
-
"""
|
|
2482
|
-
return tuple(
|
|
2483
|
-
getattr(self, name) if name != "metadata" else dict(self.metadata)
|
|
2484
|
-
for name in self.__slots__
|
|
2485
|
-
)
|
|
2486
|
-
|
|
2487
|
-
def __setstate__(self, state):
|
|
2488
|
-
"""
|
|
2489
|
-
Play nice with pickle.
|
|
2490
|
-
"""
|
|
2491
|
-
self._setattrs(zip(self.__slots__, state))
|
|
2492
|
-
|
|
2493
|
-
def _setattrs(self, name_values_pairs):
|
|
2494
|
-
bound_setattr = _OBJ_SETATTR.__get__(self)
|
|
2495
|
-
for name, value in name_values_pairs:
|
|
2496
|
-
if name != "metadata":
|
|
2497
|
-
bound_setattr(name, value)
|
|
2498
|
-
else:
|
|
2499
|
-
bound_setattr(
|
|
2500
|
-
name,
|
|
2501
|
-
(
|
|
2502
|
-
types.MappingProxyType(dict(value))
|
|
2503
|
-
if value
|
|
2504
|
-
else _EMPTY_METADATA_SINGLETON
|
|
2505
|
-
),
|
|
2506
|
-
)
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
_a = [
|
|
2510
|
-
Attribute(
|
|
2511
|
-
name=name,
|
|
2512
|
-
default=NOTHING,
|
|
2513
|
-
validator=None,
|
|
2514
|
-
repr=True,
|
|
2515
|
-
cmp=None,
|
|
2516
|
-
eq=True,
|
|
2517
|
-
order=False,
|
|
2518
|
-
hash=(name != "metadata"),
|
|
2519
|
-
init=True,
|
|
2520
|
-
inherited=False,
|
|
2521
|
-
alias=_default_init_alias_for(name),
|
|
2522
|
-
)
|
|
2523
|
-
for name in Attribute.__slots__
|
|
2524
|
-
]
|
|
2525
|
-
|
|
2526
|
-
Attribute = _add_hash(
|
|
2527
|
-
_add_eq(
|
|
2528
|
-
_add_repr(Attribute, attrs=_a),
|
|
2529
|
-
attrs=[a for a in _a if a.name != "inherited"],
|
|
2530
|
-
),
|
|
2531
|
-
attrs=[a for a in _a if a.hash and a.name != "inherited"],
|
|
2532
|
-
)
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
class _CountingAttr:
|
|
2536
|
-
"""
|
|
2537
|
-
Intermediate representation of attributes that uses a counter to preserve
|
|
2538
|
-
the order in which the attributes have been defined.
|
|
2539
|
-
|
|
2540
|
-
*Internal* data structure of the attrs library. Running into is most
|
|
2541
|
-
likely the result of a bug like a forgotten `@attr.s` decorator.
|
|
2542
|
-
"""
|
|
2543
|
-
|
|
2544
|
-
__slots__ = (
|
|
2545
|
-
"_default",
|
|
2546
|
-
"_validator",
|
|
2547
|
-
"alias",
|
|
2548
|
-
"converter",
|
|
2549
|
-
"counter",
|
|
2550
|
-
"eq",
|
|
2551
|
-
"eq_key",
|
|
2552
|
-
"hash",
|
|
2553
|
-
"init",
|
|
2554
|
-
"kw_only",
|
|
2555
|
-
"metadata",
|
|
2556
|
-
"on_setattr",
|
|
2557
|
-
"order",
|
|
2558
|
-
"order_key",
|
|
2559
|
-
"repr",
|
|
2560
|
-
"type",
|
|
2561
|
-
)
|
|
2562
|
-
__attrs_attrs__ = (
|
|
2563
|
-
*tuple(
|
|
2564
|
-
Attribute(
|
|
2565
|
-
name=name,
|
|
2566
|
-
alias=_default_init_alias_for(name),
|
|
2567
|
-
default=NOTHING,
|
|
2568
|
-
validator=None,
|
|
2569
|
-
repr=True,
|
|
2570
|
-
cmp=None,
|
|
2571
|
-
hash=True,
|
|
2572
|
-
init=True,
|
|
2573
|
-
kw_only=False,
|
|
2574
|
-
eq=True,
|
|
2575
|
-
eq_key=None,
|
|
2576
|
-
order=False,
|
|
2577
|
-
order_key=None,
|
|
2578
|
-
inherited=False,
|
|
2579
|
-
on_setattr=None,
|
|
2580
|
-
)
|
|
2581
|
-
for name in (
|
|
2582
|
-
"counter",
|
|
2583
|
-
"_default",
|
|
2584
|
-
"repr",
|
|
2585
|
-
"eq",
|
|
2586
|
-
"order",
|
|
2587
|
-
"hash",
|
|
2588
|
-
"init",
|
|
2589
|
-
"on_setattr",
|
|
2590
|
-
"alias",
|
|
2591
|
-
)
|
|
2592
|
-
),
|
|
2593
|
-
Attribute(
|
|
2594
|
-
name="metadata",
|
|
2595
|
-
alias="metadata",
|
|
2596
|
-
default=None,
|
|
2597
|
-
validator=None,
|
|
2598
|
-
repr=True,
|
|
2599
|
-
cmp=None,
|
|
2600
|
-
hash=False,
|
|
2601
|
-
init=True,
|
|
2602
|
-
kw_only=False,
|
|
2603
|
-
eq=True,
|
|
2604
|
-
eq_key=None,
|
|
2605
|
-
order=False,
|
|
2606
|
-
order_key=None,
|
|
2607
|
-
inherited=False,
|
|
2608
|
-
on_setattr=None,
|
|
2609
|
-
),
|
|
2610
|
-
)
|
|
2611
|
-
cls_counter = 0
|
|
2612
|
-
|
|
2613
|
-
def __init__(
|
|
2614
|
-
self,
|
|
2615
|
-
default,
|
|
2616
|
-
validator,
|
|
2617
|
-
repr,
|
|
2618
|
-
cmp,
|
|
2619
|
-
hash,
|
|
2620
|
-
init,
|
|
2621
|
-
converter,
|
|
2622
|
-
metadata,
|
|
2623
|
-
type,
|
|
2624
|
-
kw_only,
|
|
2625
|
-
eq,
|
|
2626
|
-
eq_key,
|
|
2627
|
-
order,
|
|
2628
|
-
order_key,
|
|
2629
|
-
on_setattr,
|
|
2630
|
-
alias,
|
|
2631
|
-
):
|
|
2632
|
-
_CountingAttr.cls_counter += 1
|
|
2633
|
-
self.counter = _CountingAttr.cls_counter
|
|
2634
|
-
self._default = default
|
|
2635
|
-
self._validator = validator
|
|
2636
|
-
self.converter = converter
|
|
2637
|
-
self.repr = repr
|
|
2638
|
-
self.eq = eq
|
|
2639
|
-
self.eq_key = eq_key
|
|
2640
|
-
self.order = order
|
|
2641
|
-
self.order_key = order_key
|
|
2642
|
-
self.hash = hash
|
|
2643
|
-
self.init = init
|
|
2644
|
-
self.metadata = metadata
|
|
2645
|
-
self.type = type
|
|
2646
|
-
self.kw_only = kw_only
|
|
2647
|
-
self.on_setattr = on_setattr
|
|
2648
|
-
self.alias = alias
|
|
2649
|
-
|
|
2650
|
-
def validator(self, meth):
|
|
2651
|
-
"""
|
|
2652
|
-
Decorator that adds *meth* to the list of validators.
|
|
2653
|
-
|
|
2654
|
-
Returns *meth* unchanged.
|
|
2655
|
-
|
|
2656
|
-
.. versionadded:: 17.1.0
|
|
2657
|
-
"""
|
|
2658
|
-
if self._validator is None:
|
|
2659
|
-
self._validator = meth
|
|
2660
|
-
else:
|
|
2661
|
-
self._validator = and_(self._validator, meth)
|
|
2662
|
-
return meth
|
|
2663
|
-
|
|
2664
|
-
def default(self, meth):
|
|
2665
|
-
"""
|
|
2666
|
-
Decorator that allows to set the default for an attribute.
|
|
2667
|
-
|
|
2668
|
-
Returns *meth* unchanged.
|
|
2669
|
-
|
|
2670
|
-
Raises:
|
|
2671
|
-
DefaultAlreadySetError: If default has been set before.
|
|
2672
|
-
|
|
2673
|
-
.. versionadded:: 17.1.0
|
|
2674
|
-
"""
|
|
2675
|
-
if self._default is not NOTHING:
|
|
2676
|
-
raise DefaultAlreadySetError
|
|
2677
|
-
|
|
2678
|
-
self._default = Factory(meth, takes_self=True)
|
|
2679
|
-
|
|
2680
|
-
return meth
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
_CountingAttr = _add_eq(_add_repr(_CountingAttr))
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
class Factory:
|
|
2687
|
-
"""
|
|
2688
|
-
Stores a factory callable.
|
|
2689
|
-
|
|
2690
|
-
If passed as the default value to `attrs.field`, the factory is used to
|
|
2691
|
-
generate a new value.
|
|
2692
|
-
|
|
2693
|
-
Args:
|
|
2694
|
-
factory (typing.Callable):
|
|
2695
|
-
A callable that takes either none or exactly one mandatory
|
|
2696
|
-
positional argument depending on *takes_self*.
|
|
2697
|
-
|
|
2698
|
-
takes_self (bool):
|
|
2699
|
-
Pass the partially initialized instance that is being initialized
|
|
2700
|
-
as a positional argument.
|
|
2701
|
-
|
|
2702
|
-
.. versionadded:: 17.1.0 *takes_self*
|
|
2703
|
-
"""
|
|
2704
|
-
|
|
2705
|
-
__slots__ = ("factory", "takes_self")
|
|
2706
|
-
|
|
2707
|
-
def __init__(self, factory, takes_self=False):
|
|
2708
|
-
self.factory = factory
|
|
2709
|
-
self.takes_self = takes_self
|
|
2710
|
-
|
|
2711
|
-
def __getstate__(self):
|
|
2712
|
-
"""
|
|
2713
|
-
Play nice with pickle.
|
|
2714
|
-
"""
|
|
2715
|
-
return tuple(getattr(self, name) for name in self.__slots__)
|
|
2716
|
-
|
|
2717
|
-
def __setstate__(self, state):
|
|
2718
|
-
"""
|
|
2719
|
-
Play nice with pickle.
|
|
2720
|
-
"""
|
|
2721
|
-
for name, value in zip(self.__slots__, state):
|
|
2722
|
-
setattr(self, name, value)
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
_f = [
|
|
2726
|
-
Attribute(
|
|
2727
|
-
name=name,
|
|
2728
|
-
default=NOTHING,
|
|
2729
|
-
validator=None,
|
|
2730
|
-
repr=True,
|
|
2731
|
-
cmp=None,
|
|
2732
|
-
eq=True,
|
|
2733
|
-
order=False,
|
|
2734
|
-
hash=True,
|
|
2735
|
-
init=True,
|
|
2736
|
-
inherited=False,
|
|
2737
|
-
)
|
|
2738
|
-
for name in Factory.__slots__
|
|
2739
|
-
]
|
|
2740
|
-
|
|
2741
|
-
Factory = _add_hash(_add_eq(_add_repr(Factory, attrs=_f), attrs=_f), attrs=_f)
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
class Converter:
|
|
2745
|
-
"""
|
|
2746
|
-
Stores a converter callable.
|
|
2747
|
-
|
|
2748
|
-
Allows for the wrapped converter to take additional arguments. The
|
|
2749
|
-
arguments are passed in the order they are documented.
|
|
2750
|
-
|
|
2751
|
-
Args:
|
|
2752
|
-
converter (Callable): A callable that converts the passed value.
|
|
2753
|
-
|
|
2754
|
-
takes_self (bool):
|
|
2755
|
-
Pass the partially initialized instance that is being initialized
|
|
2756
|
-
as a positional argument. (default: `False`)
|
|
2757
|
-
|
|
2758
|
-
takes_field (bool):
|
|
2759
|
-
Pass the field definition (an :class:`Attribute`) into the
|
|
2760
|
-
converter as a positional argument. (default: `False`)
|
|
2761
|
-
|
|
2762
|
-
.. versionadded:: 24.1.0
|
|
2763
|
-
"""
|
|
2764
|
-
|
|
2765
|
-
__slots__ = (
|
|
2766
|
-
"__call__",
|
|
2767
|
-
"_first_param_type",
|
|
2768
|
-
"_global_name",
|
|
2769
|
-
"converter",
|
|
2770
|
-
"takes_field",
|
|
2771
|
-
"takes_self",
|
|
2772
|
-
)
|
|
2773
|
-
|
|
2774
|
-
def __init__(self, converter, *, takes_self=False, takes_field=False):
|
|
2775
|
-
self.converter = converter
|
|
2776
|
-
self.takes_self = takes_self
|
|
2777
|
-
self.takes_field = takes_field
|
|
2778
|
-
|
|
2779
|
-
ex = _AnnotationExtractor(converter)
|
|
2780
|
-
self._first_param_type = ex.get_first_param_type()
|
|
2781
|
-
|
|
2782
|
-
if not (self.takes_self or self.takes_field):
|
|
2783
|
-
self.__call__ = lambda value, _, __: self.converter(value)
|
|
2784
|
-
elif self.takes_self and not self.takes_field:
|
|
2785
|
-
self.__call__ = lambda value, instance, __: self.converter(
|
|
2786
|
-
value, instance
|
|
2787
|
-
)
|
|
2788
|
-
elif not self.takes_self and self.takes_field:
|
|
2789
|
-
self.__call__ = lambda value, __, field: self.converter(
|
|
2790
|
-
value, field
|
|
2791
|
-
)
|
|
2792
|
-
else:
|
|
2793
|
-
self.__call__ = lambda value, instance, field: self.converter(
|
|
2794
|
-
value, instance, field
|
|
2795
|
-
)
|
|
2796
|
-
|
|
2797
|
-
rt = ex.get_return_type()
|
|
2798
|
-
if rt is not None:
|
|
2799
|
-
self.__call__.__annotations__["return"] = rt
|
|
2800
|
-
|
|
2801
|
-
@staticmethod
|
|
2802
|
-
def _get_global_name(attr_name: str) -> str:
|
|
2803
|
-
"""
|
|
2804
|
-
Return the name that a converter for an attribute name *attr_name*
|
|
2805
|
-
would have.
|
|
2806
|
-
"""
|
|
2807
|
-
return f"__attr_converter_{attr_name}"
|
|
2808
|
-
|
|
2809
|
-
def _fmt_converter_call(self, attr_name: str, value_var: str) -> str:
|
|
2810
|
-
"""
|
|
2811
|
-
Return a string that calls the converter for an attribute name
|
|
2812
|
-
*attr_name* and the value in variable named *value_var* according to
|
|
2813
|
-
`self.takes_self` and `self.takes_field`.
|
|
2814
|
-
"""
|
|
2815
|
-
if not (self.takes_self or self.takes_field):
|
|
2816
|
-
return f"{self._get_global_name(attr_name)}({value_var})"
|
|
2817
|
-
|
|
2818
|
-
if self.takes_self and self.takes_field:
|
|
2819
|
-
return f"{self._get_global_name(attr_name)}({value_var}, self, attr_dict['{attr_name}'])"
|
|
2820
|
-
|
|
2821
|
-
if self.takes_self:
|
|
2822
|
-
return f"{self._get_global_name(attr_name)}({value_var}, self)"
|
|
2823
|
-
|
|
2824
|
-
return f"{self._get_global_name(attr_name)}({value_var}, attr_dict['{attr_name}'])"
|
|
2825
|
-
|
|
2826
|
-
def __getstate__(self):
|
|
2827
|
-
"""
|
|
2828
|
-
Return a dict containing only converter and takes_self -- the rest gets
|
|
2829
|
-
computed when loading.
|
|
2830
|
-
"""
|
|
2831
|
-
return {
|
|
2832
|
-
"converter": self.converter,
|
|
2833
|
-
"takes_self": self.takes_self,
|
|
2834
|
-
"takes_field": self.takes_field,
|
|
2835
|
-
}
|
|
2836
|
-
|
|
2837
|
-
def __setstate__(self, state):
|
|
2838
|
-
"""
|
|
2839
|
-
Load instance from state.
|
|
2840
|
-
"""
|
|
2841
|
-
self.__init__(**state)
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
_f = [
|
|
2845
|
-
Attribute(
|
|
2846
|
-
name=name,
|
|
2847
|
-
default=NOTHING,
|
|
2848
|
-
validator=None,
|
|
2849
|
-
repr=True,
|
|
2850
|
-
cmp=None,
|
|
2851
|
-
eq=True,
|
|
2852
|
-
order=False,
|
|
2853
|
-
hash=True,
|
|
2854
|
-
init=True,
|
|
2855
|
-
inherited=False,
|
|
2856
|
-
)
|
|
2857
|
-
for name in ("converter", "takes_self", "takes_field")
|
|
2858
|
-
]
|
|
2859
|
-
|
|
2860
|
-
Converter = _add_hash(
|
|
2861
|
-
_add_eq(_add_repr(Converter, attrs=_f), attrs=_f), attrs=_f
|
|
2862
|
-
)
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
def make_class(
|
|
2866
|
-
name, attrs, bases=(object,), class_body=None, **attributes_arguments
|
|
2867
|
-
):
|
|
2868
|
-
r"""
|
|
2869
|
-
A quick way to create a new class called *name* with *attrs*.
|
|
2870
|
-
|
|
2871
|
-
.. note::
|
|
2872
|
-
|
|
2873
|
-
``make_class()`` is a thin wrapper around `attr.s`, not `attrs.define`
|
|
2874
|
-
which means that it doesn't come with some of the improved defaults.
|
|
2875
|
-
|
|
2876
|
-
For example, if you want the same ``on_setattr`` behavior as in
|
|
2877
|
-
`attrs.define`, you have to pass the hooks yourself: ``make_class(...,
|
|
2878
|
-
on_setattr=setters.pipe(setters.convert, setters.validate)``
|
|
2879
|
-
|
|
2880
|
-
Args:
|
|
2881
|
-
name (str): The name for the new class.
|
|
2882
|
-
|
|
2883
|
-
attrs (list | dict):
|
|
2884
|
-
A list of names or a dictionary of mappings of names to `attr.ib`\
|
|
2885
|
-
s / `attrs.field`\ s.
|
|
2886
|
-
|
|
2887
|
-
The order is deduced from the order of the names or attributes
|
|
2888
|
-
inside *attrs*. Otherwise the order of the definition of the
|
|
2889
|
-
attributes is used.
|
|
2890
|
-
|
|
2891
|
-
bases (tuple[type, ...]): Classes that the new class will subclass.
|
|
2892
|
-
|
|
2893
|
-
class_body (dict):
|
|
2894
|
-
An optional dictionary of class attributes for the new class.
|
|
2895
|
-
|
|
2896
|
-
attributes_arguments: Passed unmodified to `attr.s`.
|
|
2897
|
-
|
|
2898
|
-
Returns:
|
|
2899
|
-
type: A new class with *attrs*.
|
|
2900
|
-
|
|
2901
|
-
.. versionadded:: 17.1.0 *bases*
|
|
2902
|
-
.. versionchanged:: 18.1.0 If *attrs* is ordered, the order is retained.
|
|
2903
|
-
.. versionchanged:: 23.2.0 *class_body*
|
|
2904
|
-
"""
|
|
2905
|
-
if isinstance(attrs, dict):
|
|
2906
|
-
cls_dict = attrs
|
|
2907
|
-
elif isinstance(attrs, (list, tuple)):
|
|
2908
|
-
cls_dict = {a: attrib() for a in attrs}
|
|
2909
|
-
else:
|
|
2910
|
-
msg = "attrs argument must be a dict or a list."
|
|
2911
|
-
raise TypeError(msg)
|
|
2912
|
-
|
|
2913
|
-
pre_init = cls_dict.pop("__attrs_pre_init__", None)
|
|
2914
|
-
post_init = cls_dict.pop("__attrs_post_init__", None)
|
|
2915
|
-
user_init = cls_dict.pop("__init__", None)
|
|
2916
|
-
|
|
2917
|
-
body = {}
|
|
2918
|
-
if class_body is not None:
|
|
2919
|
-
body.update(class_body)
|
|
2920
|
-
if pre_init is not None:
|
|
2921
|
-
body["__attrs_pre_init__"] = pre_init
|
|
2922
|
-
if post_init is not None:
|
|
2923
|
-
body["__attrs_post_init__"] = post_init
|
|
2924
|
-
if user_init is not None:
|
|
2925
|
-
body["__init__"] = user_init
|
|
2926
|
-
|
|
2927
|
-
type_ = types.new_class(name, bases, {}, lambda ns: ns.update(body))
|
|
2928
|
-
|
|
2929
|
-
# For pickling to work, the __module__ variable needs to be set to the
|
|
2930
|
-
# frame where the class is created. Bypass this step in environments where
|
|
2931
|
-
# sys._getframe is not defined (Jython for example) or sys._getframe is not
|
|
2932
|
-
# defined for arguments greater than 0 (IronPython).
|
|
2933
|
-
with contextlib.suppress(AttributeError, ValueError):
|
|
2934
|
-
type_.__module__ = sys._getframe(1).f_globals.get(
|
|
2935
|
-
"__name__", "__main__"
|
|
2936
|
-
)
|
|
2937
|
-
|
|
2938
|
-
# We do it here for proper warnings with meaningful stacklevel.
|
|
2939
|
-
cmp = attributes_arguments.pop("cmp", None)
|
|
2940
|
-
(
|
|
2941
|
-
attributes_arguments["eq"],
|
|
2942
|
-
attributes_arguments["order"],
|
|
2943
|
-
) = _determine_attrs_eq_order(
|
|
2944
|
-
cmp,
|
|
2945
|
-
attributes_arguments.get("eq"),
|
|
2946
|
-
attributes_arguments.get("order"),
|
|
2947
|
-
True,
|
|
2948
|
-
)
|
|
2949
|
-
|
|
2950
|
-
cls = _attrs(these=cls_dict, **attributes_arguments)(type_)
|
|
2951
|
-
# Only add type annotations now or "_attrs()" will complain:
|
|
2952
|
-
cls.__annotations__ = {
|
|
2953
|
-
k: v.type for k, v in cls_dict.items() if v.type is not None
|
|
2954
|
-
}
|
|
2955
|
-
return cls
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
# These are required by within this module so we define them here and merely
|
|
2959
|
-
# import into .validators / .converters.
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
@attrs(slots=True, unsafe_hash=True)
|
|
2963
|
-
class _AndValidator:
|
|
2964
|
-
"""
|
|
2965
|
-
Compose many validators to a single one.
|
|
2966
|
-
"""
|
|
2967
|
-
|
|
2968
|
-
_validators = attrib()
|
|
2969
|
-
|
|
2970
|
-
def __call__(self, inst, attr, value):
|
|
2971
|
-
for v in self._validators:
|
|
2972
|
-
v(inst, attr, value)
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
def and_(*validators):
|
|
2976
|
-
"""
|
|
2977
|
-
A validator that composes multiple validators into one.
|
|
2978
|
-
|
|
2979
|
-
When called on a value, it runs all wrapped validators.
|
|
2980
|
-
|
|
2981
|
-
Args:
|
|
2982
|
-
validators (~collections.abc.Iterable[typing.Callable]):
|
|
2983
|
-
Arbitrary number of validators.
|
|
2984
|
-
|
|
2985
|
-
.. versionadded:: 17.1.0
|
|
2986
|
-
"""
|
|
2987
|
-
vals = []
|
|
2988
|
-
for validator in validators:
|
|
2989
|
-
vals.extend(
|
|
2990
|
-
validator._validators
|
|
2991
|
-
if isinstance(validator, _AndValidator)
|
|
2992
|
-
else [validator]
|
|
2993
|
-
)
|
|
2994
|
-
|
|
2995
|
-
return _AndValidator(tuple(vals))
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
def pipe(*converters):
|
|
2999
|
-
"""
|
|
3000
|
-
A converter that composes multiple converters into one.
|
|
3001
|
-
|
|
3002
|
-
When called on a value, it runs all wrapped converters, returning the
|
|
3003
|
-
*last* value.
|
|
3004
|
-
|
|
3005
|
-
Type annotations will be inferred from the wrapped converters', if they
|
|
3006
|
-
have any.
|
|
3007
|
-
|
|
3008
|
-
converters (~collections.abc.Iterable[typing.Callable]):
|
|
3009
|
-
Arbitrary number of converters.
|
|
3010
|
-
|
|
3011
|
-
.. versionadded:: 20.1.0
|
|
3012
|
-
"""
|
|
3013
|
-
|
|
3014
|
-
return_instance = any(isinstance(c, Converter) for c in converters)
|
|
3015
|
-
|
|
3016
|
-
if return_instance:
|
|
3017
|
-
|
|
3018
|
-
def pipe_converter(val, inst, field):
|
|
3019
|
-
for c in converters:
|
|
3020
|
-
val = (
|
|
3021
|
-
c(val, inst, field) if isinstance(c, Converter) else c(val)
|
|
3022
|
-
)
|
|
3023
|
-
|
|
3024
|
-
return val
|
|
3025
|
-
|
|
3026
|
-
else:
|
|
3027
|
-
|
|
3028
|
-
def pipe_converter(val):
|
|
3029
|
-
for c in converters:
|
|
3030
|
-
val = c(val)
|
|
3031
|
-
|
|
3032
|
-
return val
|
|
3033
|
-
|
|
3034
|
-
if not converters:
|
|
3035
|
-
# If the converter list is empty, pipe_converter is the identity.
|
|
3036
|
-
A = typing.TypeVar("A")
|
|
3037
|
-
pipe_converter.__annotations__.update({"val": A, "return": A})
|
|
3038
|
-
else:
|
|
3039
|
-
# Get parameter type from first converter.
|
|
3040
|
-
t = _AnnotationExtractor(converters[0]).get_first_param_type()
|
|
3041
|
-
if t:
|
|
3042
|
-
pipe_converter.__annotations__["val"] = t
|
|
3043
|
-
|
|
3044
|
-
last = converters[-1]
|
|
3045
|
-
if not PY_3_11_PLUS and isinstance(last, Converter):
|
|
3046
|
-
last = last.__call__
|
|
3047
|
-
|
|
3048
|
-
# Get return type from last converter.
|
|
3049
|
-
rt = _AnnotationExtractor(last).get_return_type()
|
|
3050
|
-
if rt:
|
|
3051
|
-
pipe_converter.__annotations__["return"] = rt
|
|
3052
|
-
|
|
3053
|
-
if return_instance:
|
|
3054
|
-
return Converter(pipe_converter, takes_self=True, takes_field=True)
|
|
3055
|
-
return pipe_converter
|