diff --git a/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/INSTALLER b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/METADATA b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..078765d91eb4b08b23a0d13c7b05a5b4946418b2 --- /dev/null +++ b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/METADATA @@ -0,0 +1,262 @@ +Metadata-Version: 2.4 +Name: aiohttp +Version: 3.13.3 +Summary: Async http client/server framework (asyncio) +Maintainer-email: aiohttp team +License: Apache-2.0 AND MIT +Project-URL: Homepage, https://github.com/aio-libs/aiohttp +Project-URL: Chat: Matrix, https://matrix.to/#/#aio-libs:matrix.org +Project-URL: Chat: Matrix Space, https://matrix.to/#/#aio-libs-space:matrix.org +Project-URL: CI: GitHub Actions, https://github.com/aio-libs/aiohttp/actions?query=workflow%3ACI +Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/aiohttp +Project-URL: Docs: Changelog, https://docs.aiohttp.org/en/stable/changes.html +Project-URL: Docs: RTD, https://docs.aiohttp.org +Project-URL: GitHub: issues, https://github.com/aio-libs/aiohttp/issues +Project-URL: GitHub: repo, https://github.com/aio-libs/aiohttp +Classifier: Development Status :: 5 - Production/Stable +Classifier: Framework :: AsyncIO +Classifier: Intended Audience :: Developers +Classifier: Operating System :: POSIX +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Operating System :: Microsoft :: Windows +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Topic :: Internet :: WWW/HTTP +Requires-Python: >=3.9 +Description-Content-Type: text/x-rst +License-File: LICENSE.txt +License-File: vendor/llhttp/LICENSE +Requires-Dist: aiohappyeyeballs>=2.5.0 +Requires-Dist: aiosignal>=1.4.0 +Requires-Dist: async-timeout<6.0,>=4.0; python_version < "3.11" +Requires-Dist: attrs>=17.3.0 +Requires-Dist: frozenlist>=1.1.1 +Requires-Dist: multidict<7.0,>=4.5 +Requires-Dist: propcache>=0.2.0 +Requires-Dist: yarl<2.0,>=1.17.0 +Provides-Extra: speedups +Requires-Dist: aiodns>=3.3.0; extra == "speedups" +Requires-Dist: Brotli>=1.2; platform_python_implementation == "CPython" and extra == "speedups" +Requires-Dist: brotlicffi>=1.2; platform_python_implementation != "CPython" and extra == "speedups" +Requires-Dist: backports.zstd; (platform_python_implementation == "CPython" and python_version < "3.14") and extra == "speedups" +Dynamic: license-file + +================================== +Async http client/server framework +================================== + +.. image:: https://raw.githubusercontent.com/aio-libs/aiohttp/master/docs/aiohttp-plain.svg + :height: 64px + :width: 64px + :alt: aiohttp logo + +| + +.. image:: https://github.com/aio-libs/aiohttp/workflows/CI/badge.svg + :target: https://github.com/aio-libs/aiohttp/actions?query=workflow%3ACI + :alt: GitHub Actions status for master branch + +.. image:: https://codecov.io/gh/aio-libs/aiohttp/branch/master/graph/badge.svg + :target: https://codecov.io/gh/aio-libs/aiohttp + :alt: codecov.io status for master branch + +.. image:: https://badge.fury.io/py/aiohttp.svg + :target: https://pypi.org/project/aiohttp + :alt: Latest PyPI package version + +.. image:: https://img.shields.io/pypi/dm/aiohttp + :target: https://pypistats.org/packages/aiohttp + :alt: Downloads count + +.. image:: https://readthedocs.org/projects/aiohttp/badge/?version=latest + :target: https://docs.aiohttp.org/ + :alt: Latest Read The Docs + +.. image:: https://img.shields.io/endpoint?url=https://codspeed.io/badge.json + :target: https://codspeed.io/aio-libs/aiohttp + :alt: Codspeed.io status for aiohttp + + +Key Features +============ + +- Supports both client and server side of HTTP protocol. +- Supports both client and server Web-Sockets out-of-the-box and avoids + Callback Hell. +- Provides Web-server with middleware and pluggable routing. + + +Getting started +=============== + +Client +------ + +To get something from the web: + +.. code-block:: python + + import aiohttp + import asyncio + + async def main(): + + async with aiohttp.ClientSession() as session: + async with session.get('http://python.org') as response: + + print("Status:", response.status) + print("Content-type:", response.headers['content-type']) + + html = await response.text() + print("Body:", html[:15], "...") + + asyncio.run(main()) + +This prints: + +.. code-block:: + + Status: 200 + Content-type: text/html; charset=utf-8 + Body: ... + +Coming from `requests `_ ? Read `why we need so many lines `_. + +Server +------ + +An example using a simple server: + +.. code-block:: python + + # examples/server_simple.py + from aiohttp import web + + async def handle(request): + name = request.match_info.get('name', "Anonymous") + text = "Hello, " + name + return web.Response(text=text) + + async def wshandle(request): + ws = web.WebSocketResponse() + await ws.prepare(request) + + async for msg in ws: + if msg.type == web.WSMsgType.text: + await ws.send_str("Hello, {}".format(msg.data)) + elif msg.type == web.WSMsgType.binary: + await ws.send_bytes(msg.data) + elif msg.type == web.WSMsgType.close: + break + + return ws + + + app = web.Application() + app.add_routes([web.get('/', handle), + web.get('/echo', wshandle), + web.get('/{name}', handle)]) + + if __name__ == '__main__': + web.run_app(app) + + +Documentation +============= + +https://aiohttp.readthedocs.io/ + + +Demos +===== + +https://github.com/aio-libs/aiohttp-demos + + +External links +============== + +* `Third party libraries + `_ +* `Built with aiohttp + `_ +* `Powered by aiohttp + `_ + +Feel free to make a Pull Request for adding your link to these pages! + + +Communication channels +====================== + +*aio-libs Discussions*: https://github.com/aio-libs/aiohttp/discussions + +*Matrix*: `#aio-libs:matrix.org `_ + +We support `Stack Overflow +`_. +Please add *aiohttp* tag to your question there. + +Requirements +============ + +- attrs_ +- multidict_ +- yarl_ +- frozenlist_ + +Optionally you may install the aiodns_ library (highly recommended for sake of speed). + +.. _aiodns: https://pypi.python.org/pypi/aiodns +.. _attrs: https://github.com/python-attrs/attrs +.. _multidict: https://pypi.python.org/pypi/multidict +.. _frozenlist: https://pypi.org/project/frozenlist/ +.. _yarl: https://pypi.python.org/pypi/yarl +.. _async-timeout: https://pypi.python.org/pypi/async_timeout + +License +======= + +``aiohttp`` is offered under the Apache 2 license. + + +Keepsafe +======== + +The aiohttp community would like to thank Keepsafe +(https://www.getkeepsafe.com) for its support in the early days of +the project. + + +Source code +=========== + +The latest developer version is available in a GitHub repository: +https://github.com/aio-libs/aiohttp + +Benchmarks +========== + +If you are interested in efficiency, the AsyncIO community maintains a +list of benchmarks on the official wiki: +https://github.com/python/asyncio/wiki/Benchmarks + +-------- + +.. image:: https://img.shields.io/matrix/aio-libs:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat + :target: https://matrix.to/#/%23aio-libs:matrix.org + :alt: Matrix Room — #aio-libs:matrix.org + +.. image:: https://img.shields.io/matrix/aio-libs-space:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs-space%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat + :target: https://matrix.to/#/%23aio-libs-space:matrix.org + :alt: Matrix Space — #aio-libs-space:matrix.org + +.. image:: https://insights.linuxfoundation.org/api/badge/health-score?project=aiohttp + :target: https://insights.linuxfoundation.org/project/aiohttp + :alt: LFX Health Score diff --git a/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/RECORD b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..9736b66c144c608f99054a40cf60e2abe1255a20 --- /dev/null +++ b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/RECORD @@ -0,0 +1,138 @@ +aiohttp-3.13.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +aiohttp-3.13.3.dist-info/METADATA,sha256=CQROZCStho-eb7xiFIuAzj30JuupEU_jHpYDFiG_HhM,8145 +aiohttp-3.13.3.dist-info/RECORD,, +aiohttp-3.13.3.dist-info/WHEEL,sha256=DxRnWQz-Kp9-4a4hdDHsSv0KUC3H7sN9Nbef3-8RjXU,190 +aiohttp-3.13.3.dist-info/licenses/LICENSE.txt,sha256=n4DQ2311WpQdtFchcsJw7L2PCCuiFd3QlZhZQu2Uqes,588 +aiohttp-3.13.3.dist-info/licenses/vendor/llhttp/LICENSE,sha256=68qFTgE0zSVtZzYnwgSZ9CV363S6zwi58ltianPJEnc,1105 +aiohttp-3.13.3.dist-info/top_level.txt,sha256=iv-JIaacmTl-hSho3QmphcKnbRRYx1st47yjz_178Ro,8 +aiohttp/.hash/_cparser.pxd.hash,sha256=pjs-sEXNw_eijXGAedwG-BHnlFp8B7sOCgUagIWaU2A,121 +aiohttp/.hash/_find_header.pxd.hash,sha256=_mbpD6vM-CVCKq3ulUvsOAz5Wdo88wrDzfpOsMQaMNA,125 +aiohttp/.hash/_http_parser.pyx.hash,sha256=RKkD9x-EhXksvXrpCaTNWYtffb52urLvuTnxbTN2Lmw,125 +aiohttp/.hash/_http_writer.pyx.hash,sha256=9txOh7t7c3y-vLmiuEY5dltmXvEo0CYyU4U853yyv9E,125 +aiohttp/.hash/hdrs.py.hash,sha256=v6IaKbsxjsdQxBzhb5AjP0x_9G3rUe84D7avf7AI4cs,116 +aiohttp/__init__.py,sha256=QWssFaD-DaFFcwP36lLUQzRmlSZ5KxivJBU-yg5C1wg,8302 +aiohttp/__pycache__/__init__.cpython-312.pyc,, +aiohttp/__pycache__/_cookie_helpers.cpython-312.pyc,, +aiohttp/__pycache__/abc.cpython-312.pyc,, +aiohttp/__pycache__/base_protocol.cpython-312.pyc,, +aiohttp/__pycache__/client.cpython-312.pyc,, +aiohttp/__pycache__/client_exceptions.cpython-312.pyc,, +aiohttp/__pycache__/client_middleware_digest_auth.cpython-312.pyc,, +aiohttp/__pycache__/client_middlewares.cpython-312.pyc,, +aiohttp/__pycache__/client_proto.cpython-312.pyc,, +aiohttp/__pycache__/client_reqrep.cpython-312.pyc,, +aiohttp/__pycache__/client_ws.cpython-312.pyc,, +aiohttp/__pycache__/compression_utils.cpython-312.pyc,, +aiohttp/__pycache__/connector.cpython-312.pyc,, +aiohttp/__pycache__/cookiejar.cpython-312.pyc,, +aiohttp/__pycache__/formdata.cpython-312.pyc,, +aiohttp/__pycache__/hdrs.cpython-312.pyc,, +aiohttp/__pycache__/helpers.cpython-312.pyc,, +aiohttp/__pycache__/http.cpython-312.pyc,, +aiohttp/__pycache__/http_exceptions.cpython-312.pyc,, +aiohttp/__pycache__/http_parser.cpython-312.pyc,, +aiohttp/__pycache__/http_websocket.cpython-312.pyc,, +aiohttp/__pycache__/http_writer.cpython-312.pyc,, +aiohttp/__pycache__/log.cpython-312.pyc,, +aiohttp/__pycache__/multipart.cpython-312.pyc,, +aiohttp/__pycache__/payload.cpython-312.pyc,, +aiohttp/__pycache__/payload_streamer.cpython-312.pyc,, +aiohttp/__pycache__/pytest_plugin.cpython-312.pyc,, +aiohttp/__pycache__/resolver.cpython-312.pyc,, +aiohttp/__pycache__/streams.cpython-312.pyc,, +aiohttp/__pycache__/tcp_helpers.cpython-312.pyc,, +aiohttp/__pycache__/test_utils.cpython-312.pyc,, +aiohttp/__pycache__/tracing.cpython-312.pyc,, +aiohttp/__pycache__/typedefs.cpython-312.pyc,, +aiohttp/__pycache__/web.cpython-312.pyc,, +aiohttp/__pycache__/web_app.cpython-312.pyc,, +aiohttp/__pycache__/web_exceptions.cpython-312.pyc,, +aiohttp/__pycache__/web_fileresponse.cpython-312.pyc,, +aiohttp/__pycache__/web_log.cpython-312.pyc,, +aiohttp/__pycache__/web_middlewares.cpython-312.pyc,, +aiohttp/__pycache__/web_protocol.cpython-312.pyc,, +aiohttp/__pycache__/web_request.cpython-312.pyc,, +aiohttp/__pycache__/web_response.cpython-312.pyc,, +aiohttp/__pycache__/web_routedef.cpython-312.pyc,, +aiohttp/__pycache__/web_runner.cpython-312.pyc,, +aiohttp/__pycache__/web_server.cpython-312.pyc,, +aiohttp/__pycache__/web_urldispatcher.cpython-312.pyc,, +aiohttp/__pycache__/web_ws.cpython-312.pyc,, +aiohttp/__pycache__/worker.cpython-312.pyc,, +aiohttp/_cookie_helpers.py,sha256=_p7y-B8OCAk7FLjByiuwFIpDLGuNoJn3_vixzymAFnE,13659 +aiohttp/_cparser.pxd,sha256=UnbUYCHg4NdXfgyRVYAMv2KTLWClB4P-xCrvtj_r7ew,4295 +aiohttp/_find_header.pxd,sha256=0GfwFCPN2zxEKTO1_MA5sYq2UfzsG8kcV3aTqvwlz3g,68 +aiohttp/_headers.pxi,sha256=n701k28dVPjwRnx5j6LpJhLTfj7dqu2vJt7f0O60Oyg,2007 +aiohttp/_http_parser.cpython-312-x86_64-linux-gnu.so,sha256=WZP45rtTvKwOq_1uXO_1L84Kz6I0AnqYZn0b5L-6HkA,2833152 +aiohttp/_http_parser.pyx,sha256=-YI8YIY4uKd_7Bwr0o3FwEPwjHdexZ5-Ji3XS067c4Q,28261 +aiohttp/_http_writer.cpython-312-x86_64-linux-gnu.so,sha256=mWC-4rsbntVD1V5ZEKEpSW_sm63V0XRe1fDR0lygipo,539144 +aiohttp/_http_writer.pyx,sha256=VlFEBM6HoVv8a0AAJtc6JwFlsv2-cDE8-gB94p3dfhQ,4664 +aiohttp/_websocket/.hash/mask.pxd.hash,sha256=Y0zBddk_ck3pi9-BFzMcpkcvCKvwvZ4GTtZFb9u1nxQ,128 +aiohttp/_websocket/.hash/mask.pyx.hash,sha256=90owpXYM8_kIma4KUcOxhWSk-Uv4NVMBoCYeFM1B3d0,128 +aiohttp/_websocket/.hash/reader_c.pxd.hash,sha256=5xf3oobk6vx4xbJm-xtZ1_QufB8fYFtLQV2MNdqUc1w,132 +aiohttp/_websocket/__init__.py,sha256=Mar3R9_vBN_Ea4lsW7iTAVXD7OKswKPGqF5xgSyt77k,44 +aiohttp/_websocket/__pycache__/__init__.cpython-312.pyc,, +aiohttp/_websocket/__pycache__/helpers.cpython-312.pyc,, +aiohttp/_websocket/__pycache__/models.cpython-312.pyc,, +aiohttp/_websocket/__pycache__/reader.cpython-312.pyc,, +aiohttp/_websocket/__pycache__/reader_c.cpython-312.pyc,, +aiohttp/_websocket/__pycache__/reader_py.cpython-312.pyc,, +aiohttp/_websocket/__pycache__/writer.cpython-312.pyc,, +aiohttp/_websocket/helpers.py,sha256=P-XLv8IUaihKzDenVUqfKU5DJbWE5HvG8uhvUZK8Ic4,5038 +aiohttp/_websocket/mask.cpython-312-x86_64-linux-gnu.so,sha256=EpRwPJm1K1yavMCd9llAWdT4AsqKx_QEN0rb0eJH_Kc,263512 +aiohttp/_websocket/mask.pxd,sha256=sBmZ1Amym9kW4Ge8lj1fLZ7mPPya4LzLdpkQExQXv5M,112 +aiohttp/_websocket/mask.pyx,sha256=BHjOtV0O0w7xp9p0LNADRJvGmgfPn9sGeJvSs0fL__4,1397 +aiohttp/_websocket/models.py,sha256=XAzjs_8JYszWXIgZ6R3ZRrF-tX9Q_6LiD49WRYojopM,2121 +aiohttp/_websocket/reader.py,sha256=eC4qS0c5sOeQ2ebAHLaBpIaTVFaSKX79pY2xvh3Pqyw,1030 +aiohttp/_websocket/reader_c.cpython-312-x86_64-linux-gnu.so,sha256=GYd-y-IkGkOIp3vmma5BmZgmG9Py9fLTybcmMWyHNf0,1822128 +aiohttp/_websocket/reader_c.pxd,sha256=nl_njtDrzlQU0rjgGGjZDB-swguE0tX_bCPobkShVa4,2625 +aiohttp/_websocket/reader_c.py,sha256=V5YtZ2gj2BjE2Q-W9sR_MdAl1VAm1pB7ZjozVJcOpbg,18868 +aiohttp/_websocket/reader_py.py,sha256=V5YtZ2gj2BjE2Q-W9sR_MdAl1VAm1pB7ZjozVJcOpbg,18868 +aiohttp/_websocket/writer.py,sha256=2OvSktPmNh_g20h1cXJt2Xu8u6IvswnPjdur7OwBbJk,11261 +aiohttp/abc.py,sha256=M66F4S6m00bIEn7y4ha_XLTMDmVQ9dPihfOVB0pGfOo,7149 +aiohttp/base_protocol.py,sha256=Tp8cxUPQvv9kUPk3w6lAzk6d2MAzV3scwI_3Go3C47c,3025 +aiohttp/client.py,sha256=fOQfwcIUL1NGAVRV4DDj6-wipBzeD8KZpmzhO-LLKp4,58357 +aiohttp/client_exceptions.py,sha256=uyKbxI2peZhKl7lELBMx3UeusNkfpemPWpGFq0r6JeM,11367 +aiohttp/client_middleware_digest_auth.py,sha256=G5JM9YtzL9AWklz6NP28xEOBeAvrAZgDzU657JqO4qs,17627 +aiohttp/client_middlewares.py,sha256=kP5N9CMzQPMGPIEydeVUiLUTLsw8Vl8Gr4qAWYdu3vM,1918 +aiohttp/client_proto.py,sha256=56_WtLStZGBFPYKzgEgY6v24JkhV1y6JEmmuxeJT2So,12110 +aiohttp/client_reqrep.py,sha256=eEREDrZ0M8ZFTt1wjHduR-P8_sm40K65gNz-iMGYask,53391 +aiohttp/client_ws.py,sha256=1CIjIXwyzOMIYw6AjUES4-qUwbyVHW1seJKQfg_Rta8,15109 +aiohttp/compression_utils.py,sha256=hJ2LXhN2OWukFHm5b78TJFGKcAiL2kthi9Sf5PRYO-U,11738 +aiohttp/connector.py,sha256=vT22BNuCDtbadE1Uq7HC7zpOWCHMxI4n3PtCz7zZZkw,69004 +aiohttp/cookiejar.py,sha256=e28ZMQwJ5P0vbPX1OX4Se7-k3zeGvocFEqzGhwpG53k,18922 +aiohttp/formdata.py,sha256=xqYMbUo1qoLYPuzY92XeR4pyEe-w-DNcToARDF3GUhA,6384 +aiohttp/hdrs.py,sha256=2rj5MyA-6yRdYPhW5UKkW4iNWhEAlGIOSBH5D4FmKNE,5111 +aiohttp/helpers.py,sha256=Q1307PCEnWz4RP8crUw8dk58c0YF2Ei3JywkKfRxz5E,30629 +aiohttp/http.py,sha256=8o8j8xH70OWjnfTWA9V44NR785QPxEPrUtzMXiAVpwc,1842 +aiohttp/http_exceptions.py,sha256=BjIxD4LtrQgytqoR5lOI9zAttNmSygRgksUsMRy7sss,3069 +aiohttp/http_parser.py,sha256=z6djZDOUs7hdPzplTEsAVyz0of-rQAwT7xz8OpXhnuY,38177 +aiohttp/http_websocket.py,sha256=8VXFKw6KQUEmPg48GtRMB37v0gTK7A0inoxXuDxMZEc,842 +aiohttp/http_writer.py,sha256=fbRtKPYSqRbtAdr_gqpjF2-4sI1ESL8dPDF-xY_mAMY,12446 +aiohttp/log.py,sha256=BbNKx9e3VMIm0xYjZI0IcBBoS7wjdeIeSaiJE7-qK2g,325 +aiohttp/multipart.py,sha256=326npYdWxYI3raoRfmpBeUV_ef3-LRn8sV9WqcIOoPk,40482 +aiohttp/payload.py,sha256=O6nsYNULL7AeM2cyJ6TYX73ncVnL5xJwt5AegxwMKqw,40874 +aiohttp/payload_streamer.py,sha256=ZzEYyfzcjGWkVkK3XR2pBthSCSIykYvY3Wr5cGQ2eTc,2211 +aiohttp/py.typed,sha256=sow9soTwP9T_gEAQSVh7Gb8855h04Nwmhs2We-JRgZM,7 +aiohttp/pytest_plugin.py,sha256=z4XwqmsKdyJCKxbGiA5kFf90zcedvomqk4RqjZbhKNk,12901 +aiohttp/resolver.py,sha256=gsrfUpFf8iHlcHfJvY-1fiBHW3PRvRVNb5lNZBg3zlY,10031 +aiohttp/streams.py,sha256=rlwL7ek6CkMMYil_e_EokWv26uHmtzi3lKqlnLNrXCc,23666 +aiohttp/tcp_helpers.py,sha256=BSadqVWaBpMFDRWnhaaR941N9MiDZ7bdTrxgCb0CW-M,961 +aiohttp/test_utils.py,sha256=ZJSzZWjC76KSbtwddTKcP6vHpUl_ozfAf3F93ewmHRU,23016 +aiohttp/tracing.py,sha256=-6aaW6l0J9uJD45LzR4cijYH0j62pt0U_nn_aVzFku4,14558 +aiohttp/typedefs.py,sha256=wUlqwe9Mw9W8jT3HsYJcYk00qP3EMPz3nTkYXmeNN48,1657 +aiohttp/web.py,sha256=JzSNmejg5G6YeFAnkIgZfytqbU86sNu844yYKmoUpqs,17852 +aiohttp/web_app.py,sha256=lGU_aAMN-h3wy-LTTHi6SeKH8ydt1G51BXcCspgD5ZA,19452 +aiohttp/web_exceptions.py,sha256=7nIuiwhZ39vJJ9KrWqArA5QcWbUdqkz2CLwEpJapeN8,10360 +aiohttp/web_fileresponse.py,sha256=Xzau8EMrWNrFg3u46h4UEteg93G4zYq94CU6vy0HiqE,16362 +aiohttp/web_log.py,sha256=rX5D7xLOX2B6BMdiZ-chme_KfJfW5IXEoFwLfkfkajs,7865 +aiohttp/web_middlewares.py,sha256=sFI0AgeNjdyAjuz92QtMIpngmJSOxrqe2Jfbs4BNUu0,4165 +aiohttp/web_protocol.py,sha256=6s9dMzmaqW77bzM1T111uGNSLFo6gNmfDg7XzYnA8xk,27010 +aiohttp/web_request.py,sha256=KqrOp6AeWB5e6tKrG55Lo7Zbwq49DxdrKniuW2t2u04,29849 +aiohttp/web_response.py,sha256=PKcziNU4LmftXqKVvoRMrAbOeVClpSN-iznHsiWezmU,29341 +aiohttp/web_routedef.py,sha256=VT1GAx6BrawoDh5RwBwBu5wSABSqgWwAe74AUCyZAEo,6110 +aiohttp/web_runner.py,sha256=v1G1nKiOOQgFnTSR4IMc6I9ReEFDMaHtMLvO_roDM-A,11786 +aiohttp/web_server.py,sha256=-9WDKUAiR9ll-rSdwXSqG6YjaoW79d1R4y0BGSqgUMA,2888 +aiohttp/web_urldispatcher.py,sha256=JM-TlriKCNbTLNL43Ra9sdZ0zChxZmIEYQM6ZpbyjI4,44290 +aiohttp/web_ws.py,sha256=lItgmyatkXh0M6EY7JoZnSZkUl6R0wv8B88X4ILqQbU,22739 +aiohttp/worker.py,sha256=zT0iWN5Xze194bO6_VjHou0x7lR_k0MviN6Kadnk22g,8152 diff --git a/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/WHEEL b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..f3e8a970f16adf4526f1722547053522d94bf860 --- /dev/null +++ b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/WHEEL @@ -0,0 +1,7 @@ +Wheel-Version: 1.0 +Generator: setuptools (80.9.0) +Root-Is-Purelib: false +Tag: cp312-cp312-manylinux_2_17_x86_64 +Tag: cp312-cp312-manylinux2014_x86_64 +Tag: cp312-cp312-manylinux_2_28_x86_64 + diff --git a/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/licenses/LICENSE.txt b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/licenses/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..e497a322f2091d022983b9c5c043082ab61d1a8c --- /dev/null +++ b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/licenses/LICENSE.txt @@ -0,0 +1,13 @@ + Copyright aio-libs contributors. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/licenses/vendor/llhttp/LICENSE b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/licenses/vendor/llhttp/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6c1512dd6bcd6de314673f8c2c7ff3fd6139f28e --- /dev/null +++ b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/licenses/vendor/llhttp/LICENSE @@ -0,0 +1,22 @@ +This software is licensed under the MIT License. + +Copyright Fedor Indutny, 2018. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to permit +persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/top_level.txt b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..ee4ba4f3d739e094878215c84eb41ba85c80e4a8 --- /dev/null +++ b/lib/python3.12/site-packages/aiohttp-3.13.3.dist-info/top_level.txt @@ -0,0 +1 @@ +aiohttp diff --git a/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/INSTALLER b/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/METADATA b/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..3ac05cfd1077ba5664e98ecd1342f7c54360b936 --- /dev/null +++ b/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/METADATA @@ -0,0 +1,295 @@ +Metadata-Version: 2.3 +Name: annotated-types +Version: 0.7.0 +Summary: Reusable constraint types to use with typing.Annotated +Project-URL: Homepage, https://github.com/annotated-types/annotated-types +Project-URL: Source, https://github.com/annotated-types/annotated-types +Project-URL: Changelog, https://github.com/annotated-types/annotated-types/releases +Author-email: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>, Samuel Colvin , Zac Hatfield-Dodds +License-File: LICENSE +Classifier: Development Status :: 4 - Beta +Classifier: Environment :: Console +Classifier: Environment :: MacOS X +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Information Technology +Classifier: License :: OSI Approved :: MIT License +Classifier: Operating System :: POSIX :: Linux +Classifier: Operating System :: Unix +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Typing :: Typed +Requires-Python: >=3.8 +Requires-Dist: typing-extensions>=4.0.0; python_version < '3.9' +Description-Content-Type: text/markdown + +# annotated-types + +[![CI](https://github.com/annotated-types/annotated-types/workflows/CI/badge.svg?event=push)](https://github.com/annotated-types/annotated-types/actions?query=event%3Apush+branch%3Amain+workflow%3ACI) +[![pypi](https://img.shields.io/pypi/v/annotated-types.svg)](https://pypi.python.org/pypi/annotated-types) +[![versions](https://img.shields.io/pypi/pyversions/annotated-types.svg)](https://github.com/annotated-types/annotated-types) +[![license](https://img.shields.io/github/license/annotated-types/annotated-types.svg)](https://github.com/annotated-types/annotated-types/blob/main/LICENSE) + +[PEP-593](https://peps.python.org/pep-0593/) added `typing.Annotated` as a way of +adding context-specific metadata to existing types, and specifies that +`Annotated[T, x]` _should_ be treated as `T` by any tool or library without special +logic for `x`. + +This package provides metadata objects which can be used to represent common +constraints such as upper and lower bounds on scalar values and collection sizes, +a `Predicate` marker for runtime checks, and +descriptions of how we intend these metadata to be interpreted. In some cases, +we also note alternative representations which do not require this package. + +## Install + +```bash +pip install annotated-types +``` + +## Examples + +```python +from typing import Annotated +from annotated_types import Gt, Len, Predicate + +class MyClass: + age: Annotated[int, Gt(18)] # Valid: 19, 20, ... + # Invalid: 17, 18, "19", 19.0, ... + factors: list[Annotated[int, Predicate(is_prime)]] # Valid: 2, 3, 5, 7, 11, ... + # Invalid: 4, 8, -2, 5.0, "prime", ... + + my_list: Annotated[list[int], Len(0, 10)] # Valid: [], [10, 20, 30, 40, 50] + # Invalid: (1, 2), ["abc"], [0] * 20 +``` + +## Documentation + +_While `annotated-types` avoids runtime checks for performance, users should not +construct invalid combinations such as `MultipleOf("non-numeric")` or `Annotated[int, Len(3)]`. +Downstream implementors may choose to raise an error, emit a warning, silently ignore +a metadata item, etc., if the metadata objects described below are used with an +incompatible type - or for any other reason!_ + +### Gt, Ge, Lt, Le + +Express inclusive and/or exclusive bounds on orderable values - which may be numbers, +dates, times, strings, sets, etc. Note that the boundary value need not be of the +same type that was annotated, so long as they can be compared: `Annotated[int, Gt(1.5)]` +is fine, for example, and implies that the value is an integer x such that `x > 1.5`. + +We suggest that implementors may also interpret `functools.partial(operator.le, 1.5)` +as being equivalent to `Gt(1.5)`, for users who wish to avoid a runtime dependency on +the `annotated-types` package. + +To be explicit, these types have the following meanings: + +* `Gt(x)` - value must be "Greater Than" `x` - equivalent to exclusive minimum +* `Ge(x)` - value must be "Greater than or Equal" to `x` - equivalent to inclusive minimum +* `Lt(x)` - value must be "Less Than" `x` - equivalent to exclusive maximum +* `Le(x)` - value must be "Less than or Equal" to `x` - equivalent to inclusive maximum + +### Interval + +`Interval(gt, ge, lt, le)` allows you to specify an upper and lower bound with a single +metadata object. `None` attributes should be ignored, and non-`None` attributes +treated as per the single bounds above. + +### MultipleOf + +`MultipleOf(multiple_of=x)` might be interpreted in two ways: + +1. Python semantics, implying `value % multiple_of == 0`, or +2. [JSONschema semantics](https://json-schema.org/draft/2020-12/json-schema-validation.html#rfc.section.6.2.1), + where `int(value / multiple_of) == value / multiple_of`. + +We encourage users to be aware of these two common interpretations and their +distinct behaviours, especially since very large or non-integer numbers make +it easy to cause silent data corruption due to floating-point imprecision. + +We encourage libraries to carefully document which interpretation they implement. + +### MinLen, MaxLen, Len + +`Len()` implies that `min_length <= len(value) <= max_length` - lower and upper bounds are inclusive. + +As well as `Len()` which can optionally include upper and lower bounds, we also +provide `MinLen(x)` and `MaxLen(y)` which are equivalent to `Len(min_length=x)` +and `Len(max_length=y)` respectively. + +`Len`, `MinLen`, and `MaxLen` may be used with any type which supports `len(value)`. + +Examples of usage: + +* `Annotated[list, MaxLen(10)]` (or `Annotated[list, Len(max_length=10))`) - list must have a length of 10 or less +* `Annotated[str, MaxLen(10)]` - string must have a length of 10 or less +* `Annotated[list, MinLen(3))` (or `Annotated[list, Len(min_length=3))`) - list must have a length of 3 or more +* `Annotated[list, Len(4, 6)]` - list must have a length of 4, 5, or 6 +* `Annotated[list, Len(8, 8)]` - list must have a length of exactly 8 + +#### Changed in v0.4.0 + +* `min_inclusive` has been renamed to `min_length`, no change in meaning +* `max_exclusive` has been renamed to `max_length`, upper bound is now **inclusive** instead of **exclusive** +* The recommendation that slices are interpreted as `Len` has been removed due to ambiguity and different semantic + meaning of the upper bound in slices vs. `Len` + +See [issue #23](https://github.com/annotated-types/annotated-types/issues/23) for discussion. + +### Timezone + +`Timezone` can be used with a `datetime` or a `time` to express which timezones +are allowed. `Annotated[datetime, Timezone(None)]` must be a naive datetime. +`Timezone[...]` ([literal ellipsis](https://docs.python.org/3/library/constants.html#Ellipsis)) +expresses that any timezone-aware datetime is allowed. You may also pass a specific +timezone string or [`tzinfo`](https://docs.python.org/3/library/datetime.html#tzinfo-objects) +object such as `Timezone(timezone.utc)` or `Timezone("Africa/Abidjan")` to express that you only +allow a specific timezone, though we note that this is often a symptom of fragile design. + +#### Changed in v0.x.x + +* `Timezone` accepts [`tzinfo`](https://docs.python.org/3/library/datetime.html#tzinfo-objects) objects instead of + `timezone`, extending compatibility to [`zoneinfo`](https://docs.python.org/3/library/zoneinfo.html) and third party libraries. + +### Unit + +`Unit(unit: str)` expresses that the annotated numeric value is the magnitude of +a quantity with the specified unit. For example, `Annotated[float, Unit("m/s")]` +would be a float representing a velocity in meters per second. + +Please note that `annotated_types` itself makes no attempt to parse or validate +the unit string in any way. That is left entirely to downstream libraries, +such as [`pint`](https://pint.readthedocs.io) or +[`astropy.units`](https://docs.astropy.org/en/stable/units/). + +An example of how a library might use this metadata: + +```python +from annotated_types import Unit +from typing import Annotated, TypeVar, Callable, Any, get_origin, get_args + +# given a type annotated with a unit: +Meters = Annotated[float, Unit("m")] + + +# you can cast the annotation to a specific unit type with any +# callable that accepts a string and returns the desired type +T = TypeVar("T") +def cast_unit(tp: Any, unit_cls: Callable[[str], T]) -> T | None: + if get_origin(tp) is Annotated: + for arg in get_args(tp): + if isinstance(arg, Unit): + return unit_cls(arg.unit) + return None + + +# using `pint` +import pint +pint_unit = cast_unit(Meters, pint.Unit) + + +# using `astropy.units` +import astropy.units as u +astropy_unit = cast_unit(Meters, u.Unit) +``` + +### Predicate + +`Predicate(func: Callable)` expresses that `func(value)` is truthy for valid values. +Users should prefer the statically inspectable metadata above, but if you need +the full power and flexibility of arbitrary runtime predicates... here it is. + +For some common constraints, we provide generic types: + +* `IsLower = Annotated[T, Predicate(str.islower)]` +* `IsUpper = Annotated[T, Predicate(str.isupper)]` +* `IsDigit = Annotated[T, Predicate(str.isdigit)]` +* `IsFinite = Annotated[T, Predicate(math.isfinite)]` +* `IsNotFinite = Annotated[T, Predicate(Not(math.isfinite))]` +* `IsNan = Annotated[T, Predicate(math.isnan)]` +* `IsNotNan = Annotated[T, Predicate(Not(math.isnan))]` +* `IsInfinite = Annotated[T, Predicate(math.isinf)]` +* `IsNotInfinite = Annotated[T, Predicate(Not(math.isinf))]` + +so that you can write e.g. `x: IsFinite[float] = 2.0` instead of the longer +(but exactly equivalent) `x: Annotated[float, Predicate(math.isfinite)] = 2.0`. + +Some libraries might have special logic to handle known or understandable predicates, +for example by checking for `str.isdigit` and using its presence to both call custom +logic to enforce digit-only strings, and customise some generated external schema. +Users are therefore encouraged to avoid indirection like `lambda s: s.lower()`, in +favor of introspectable methods such as `str.lower` or `re.compile("pattern").search`. + +To enable basic negation of commonly used predicates like `math.isnan` without introducing introspection that makes it impossible for implementers to introspect the predicate we provide a `Not` wrapper that simply negates the predicate in an introspectable manner. Several of the predicates listed above are created in this manner. + +We do not specify what behaviour should be expected for predicates that raise +an exception. For example `Annotated[int, Predicate(str.isdigit)]` might silently +skip invalid constraints, or statically raise an error; or it might try calling it +and then propagate or discard the resulting +`TypeError: descriptor 'isdigit' for 'str' objects doesn't apply to a 'int' object` +exception. We encourage libraries to document the behaviour they choose. + +### Doc + +`doc()` can be used to add documentation information in `Annotated`, for function and method parameters, variables, class attributes, return types, and any place where `Annotated` can be used. + +It expects a value that can be statically analyzed, as the main use case is for static analysis, editors, documentation generators, and similar tools. + +It returns a `DocInfo` class with a single attribute `documentation` containing the value passed to `doc()`. + +This is the early adopter's alternative form of the [`typing-doc` proposal](https://github.com/tiangolo/fastapi/blob/typing-doc/typing_doc.md). + +### Integrating downstream types with `GroupedMetadata` + +Implementers may choose to provide a convenience wrapper that groups multiple pieces of metadata. +This can help reduce verbosity and cognitive overhead for users. +For example, an implementer like Pydantic might provide a `Field` or `Meta` type that accepts keyword arguments and transforms these into low-level metadata: + +```python +from dataclasses import dataclass +from typing import Iterator +from annotated_types import GroupedMetadata, Ge + +@dataclass +class Field(GroupedMetadata): + ge: int | None = None + description: str | None = None + + def __iter__(self) -> Iterator[object]: + # Iterating over a GroupedMetadata object should yield annotated-types + # constraint metadata objects which describe it as fully as possible, + # and may include other unknown objects too. + if self.ge is not None: + yield Ge(self.ge) + if self.description is not None: + yield Description(self.description) +``` + +Libraries consuming annotated-types constraints should check for `GroupedMetadata` and unpack it by iterating over the object and treating the results as if they had been "unpacked" in the `Annotated` type. The same logic should be applied to the [PEP 646 `Unpack` type](https://peps.python.org/pep-0646/), so that `Annotated[T, Field(...)]`, `Annotated[T, Unpack[Field(...)]]` and `Annotated[T, *Field(...)]` are all treated consistently. + +Libraries consuming annotated-types should also ignore any metadata they do not recongize that came from unpacking a `GroupedMetadata`, just like they ignore unrecognized metadata in `Annotated` itself. + +Our own `annotated_types.Interval` class is a `GroupedMetadata` which unpacks itself into `Gt`, `Lt`, etc., so this is not an abstract concern. Similarly, `annotated_types.Len` is a `GroupedMetadata` which unpacks itself into `MinLen` (optionally) and `MaxLen`. + +### Consuming metadata + +We intend to not be prescriptive as to _how_ the metadata and constraints are used, but as an example of how one might parse constraints from types annotations see our [implementation in `test_main.py`](https://github.com/annotated-types/annotated-types/blob/f59cf6d1b5255a0fe359b93896759a180bec30ae/tests/test_main.py#L94-L103). + +It is up to the implementer to determine how this metadata is used. +You could use the metadata for runtime type checking, for generating schemas or to generate example data, amongst other use cases. + +## Design & History + +This package was designed at the PyCon 2022 sprints by the maintainers of Pydantic +and Hypothesis, with the goal of making it as easy as possible for end-users to +provide more informative annotations for use by runtime libraries. + +It is deliberately minimal, and following PEP-593 allows considerable downstream +discretion in what (if anything!) they choose to support. Nonetheless, we expect +that staying simple and covering _only_ the most common use-cases will give users +and maintainers the best experience we can. If you'd like more constraints for your +types - follow our lead, by defining them and documenting them downstream! diff --git a/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/RECORD b/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..a66e2783581bf892d54680ad9a537ca0ec0a06fd --- /dev/null +++ b/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/RECORD @@ -0,0 +1,10 @@ +annotated_types-0.7.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +annotated_types-0.7.0.dist-info/METADATA,sha256=7ltqxksJJ0wCYFGBNIQCWTlWQGeAH0hRFdnK3CB895E,15046 +annotated_types-0.7.0.dist-info/RECORD,, +annotated_types-0.7.0.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87 +annotated_types-0.7.0.dist-info/licenses/LICENSE,sha256=_hBJiEsaDZNCkB6I4H8ykl0ksxIdmXK2poBfuYJLCV0,1083 +annotated_types/__init__.py,sha256=RynLsRKUEGI0KimXydlD1fZEfEzWwDo0Uon3zOKhG1Q,13819 +annotated_types/__pycache__/__init__.cpython-312.pyc,, +annotated_types/__pycache__/test_cases.cpython-312.pyc,, +annotated_types/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +annotated_types/test_cases.py,sha256=zHFX6EpcMbGJ8FzBYDbO56bPwx_DYIVSKbZM-4B3_lg,6421 diff --git a/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/WHEEL b/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..516596c76787b10928cbab24f22c0ea00433b15d --- /dev/null +++ b/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.24.2 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/licenses/LICENSE b/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d99323a9965f146d5b0888c4ca1bf0727e12b04f --- /dev/null +++ b/lib/python3.12/site-packages/annotated_types-0.7.0.dist-info/licenses/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2022 the contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/INSTALLER b/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/METADATA b/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..4729e215e6127997f4ecafeddb784ac0344edab3 --- /dev/null +++ b/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/METADATA @@ -0,0 +1,15 @@ +Metadata-Version: 2.4 +Name: antlr4-python3-runtime +Version: 4.9.3 +Summary: ANTLR 4.9.3 runtime for Python 3.7 +Home-page: http://www.antlr.org +Author: Eric Vergnaud, Terence Parr, Sam Harwell +Author-email: eric.vergnaud@wanadoo.fr +License: BSD +Requires-Dist: typing; python_version < "3.5" +Dynamic: author +Dynamic: author-email +Dynamic: home-page +Dynamic: license +Dynamic: requires-dist +Dynamic: summary diff --git a/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/RECORD b/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..c9a034bdee6777615edecff93d849f1325f446e0 --- /dev/null +++ b/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/RECORD @@ -0,0 +1,118 @@ +../../../bin/pygrun,sha256=LgWtiH30lHPY--MI-aimXUxKFRRvz-VBQxIpy-X-8ek,6157 +antlr4/BufferedTokenStream.py,sha256=_BwmzOH1TO6yL2yC_ZaUzkghq8wzc0UPHfI3UpnZUwM,10780 +antlr4/CommonTokenFactory.py,sha256=Tv16zg_pWD1Dv3IphsxFu8nwWdLeXYcqJ8CC5yHwjH8,2110 +antlr4/CommonTokenStream.py,sha256=NNJHXwRg2_Zn46ZhJyDxZtvZzsPWhb6JjXa7BjM45eg,2770 +antlr4/FileStream.py,sha256=-ZR_-jl_If9IIBYLINIwlQrlTSmu5k1VUKDc3ie7WR4,868 +antlr4/InputStream.py,sha256=sggjE2jEGvSgQmxFvqeeuT3aOVgcH5tS7mMybW8wKS4,2334 +antlr4/IntervalSet.py,sha256=Cd0WKhd_kYbiLYKkDNncgSM19GAuS7OaTOC4-5Yubs4,5965 +antlr4/LL1Analyzer.py,sha256=oJBvO7_S8cAlb_D4qWNxd2IlK0qP4ka-oeoDxx16CZ4,7752 +antlr4/Lexer.py,sha256=C72hqayfkympxb46AcSnhPD9kVZ0quWgboGxa6gcIcg,11542 +antlr4/ListTokenSource.py,sha256=IffLMo7YQnD_CjKryrrgNWSk0q5QSYd7puZyyUk7vOk,5356 +antlr4/Parser.py,sha256=F2Q25z0-__KHfa354KQhDu3ZOVzLFfag3s2ixJ4dl_o,22883 +antlr4/ParserInterpreter.py,sha256=-QU9kn4x3WCQ-LSA99R231HoicTqakiHZ5KM72l-hIo,7206 +antlr4/ParserRuleContext.py,sha256=wHAVdOxMAO5jkUqloTXVzn_xYnJhiHbvvuhZpth0ZF8,6762 +antlr4/PredictionContext.py,sha256=cb4KI6EGpS7sRzJ8UvPEkxphINZuWhyiZ95752g3prI,22977 +antlr4/Recognizer.py,sha256=vmKAtSjIgR9LQr5YzuK5OmPZWMJ3x69OuVZQ_FTzQHE,5383 +antlr4/RuleContext.py,sha256=GiviRv2k_al1IBgdJOEEoD0ohJaVd-_h5T_CPG_Bsmg,8099 +antlr4/StdinStream.py,sha256=MMSH4zN8T6i_nu-3_TlN-3E4nPM4b5KgK4GT6n_FUQA,303 +antlr4/Token.py,sha256=OtWCab4Ut52X_nLLAA-8x4Zl6xaF6TEN-0033uaoaEo,5206 +antlr4/TokenStreamRewriter.py,sha256=cuErQTrXwC_0kqVv3MsTWGZSm-E1Vy1yzA-3SOhKd_s,10324 +antlr4/Utils.py,sha256=Oyg8CJCRL1TrF_QSB_LLlVdWOB4loVcKOgFNT-icO7c,931 +antlr4/__init__.py,sha256=g8UGpflnlMWcAyLtihejzrgAP1Uo3b9GhwfI8QnZjtw,1125 +antlr4/__pycache__/BufferedTokenStream.cpython-312.pyc,, +antlr4/__pycache__/CommonTokenFactory.cpython-312.pyc,, +antlr4/__pycache__/CommonTokenStream.cpython-312.pyc,, +antlr4/__pycache__/FileStream.cpython-312.pyc,, +antlr4/__pycache__/InputStream.cpython-312.pyc,, +antlr4/__pycache__/IntervalSet.cpython-312.pyc,, +antlr4/__pycache__/LL1Analyzer.cpython-312.pyc,, +antlr4/__pycache__/Lexer.cpython-312.pyc,, +antlr4/__pycache__/ListTokenSource.cpython-312.pyc,, +antlr4/__pycache__/Parser.cpython-312.pyc,, +antlr4/__pycache__/ParserInterpreter.cpython-312.pyc,, +antlr4/__pycache__/ParserRuleContext.cpython-312.pyc,, +antlr4/__pycache__/PredictionContext.cpython-312.pyc,, +antlr4/__pycache__/Recognizer.cpython-312.pyc,, +antlr4/__pycache__/RuleContext.cpython-312.pyc,, +antlr4/__pycache__/StdinStream.cpython-312.pyc,, +antlr4/__pycache__/Token.cpython-312.pyc,, +antlr4/__pycache__/TokenStreamRewriter.cpython-312.pyc,, +antlr4/__pycache__/Utils.cpython-312.pyc,, +antlr4/__pycache__/__init__.cpython-312.pyc,, +antlr4/atn/ATN.py,sha256=LYE8kT-D8FpUd5fpOtyOLqvXLFkUSa83TVFowhCWAiY,5789 +antlr4/atn/ATNConfig.py,sha256=tNdIC6_GrxXllHBx3npAWyDh6KrohLZDV_XyPrydRMY,6565 +antlr4/atn/ATNConfigSet.py,sha256=qRzVsBeMqk2txjG3DrGptwF6Vb2hHC5w3umkSL0GNJw,8312 +antlr4/atn/ATNDeserializationOptions.py,sha256=lUV_bGW6mxj7t20esda5Yv-X9m-U_x1-0xaLifhXIPo,1010 +antlr4/atn/ATNDeserializer.py,sha256=aYLDDtQ-wyo3gId6A-wD1E3QmpfrPZlXxj4_IDm-mUY,22252 +antlr4/atn/ATNSimulator.py,sha256=mDc-G3GF3kSeqpfGDabUOLJ0WLVTqibxZlkvXQYmBRk,2298 +antlr4/atn/ATNState.py,sha256=NbndISWUwFDF_vuBfbTiZZ8GPHoQa6UXdqbD-yjJE7c,7663 +antlr4/atn/ATNType.py,sha256=xgv8AMVU7tc07U73_hRTm1AiZ7MvGhoaP5fTiOrrCGg,422 +antlr4/atn/LexerATNSimulator.py,sha256=kYXRwUvHptSRU8T_K9pSrGlCk9YypWeHlAcjgry1VVo,25465 +antlr4/atn/LexerAction.py,sha256=KUeJwKekBch0m1poSPskHIh-15dcKAG4lR7zlq98tzc,10014 +antlr4/atn/LexerActionExecutor.py,sha256=7rlg17THcwLsuTmh7NsLrTbRH4DTrm8qIdW9_235CEc,6420 +antlr4/atn/ParserATNSimulator.py,sha256=IKCzsDLcznROSVojU-daAygKr3svl0DmK5DhkUllASY,80365 +antlr4/atn/PredictionMode.py,sha256=i8B7MULA7v-qbXeCY_xp6sgi21kHM6kybqIrG6rSrro,22486 +antlr4/atn/SemanticContext.py,sha256=ds0TmM4qenb0LN-rl2Fp_N_xB959abN67I19EF6rs8o,10495 +antlr4/atn/Transition.py,sha256=ZAsEFpa5I_n-zxD6U-DauM5_33jFK65x3PWu6-NW0RA,8762 +antlr4/atn/__init__.py,sha256=gsnQdtTH8IUgCiVUpQfzhxx2pFRvksW76SjwIk3fYSk,28 +antlr4/atn/__pycache__/ATN.cpython-312.pyc,, +antlr4/atn/__pycache__/ATNConfig.cpython-312.pyc,, +antlr4/atn/__pycache__/ATNConfigSet.cpython-312.pyc,, +antlr4/atn/__pycache__/ATNDeserializationOptions.cpython-312.pyc,, +antlr4/atn/__pycache__/ATNDeserializer.cpython-312.pyc,, +antlr4/atn/__pycache__/ATNSimulator.cpython-312.pyc,, +antlr4/atn/__pycache__/ATNState.cpython-312.pyc,, +antlr4/atn/__pycache__/ATNType.cpython-312.pyc,, +antlr4/atn/__pycache__/LexerATNSimulator.cpython-312.pyc,, +antlr4/atn/__pycache__/LexerAction.cpython-312.pyc,, +antlr4/atn/__pycache__/LexerActionExecutor.cpython-312.pyc,, +antlr4/atn/__pycache__/ParserATNSimulator.cpython-312.pyc,, +antlr4/atn/__pycache__/PredictionMode.cpython-312.pyc,, +antlr4/atn/__pycache__/SemanticContext.cpython-312.pyc,, +antlr4/atn/__pycache__/Transition.cpython-312.pyc,, +antlr4/atn/__pycache__/__init__.cpython-312.pyc,, +antlr4/dfa/DFA.py,sha256=weIh0uaRfakP12mFvHo7U0tqO3GONV3-nHFkc2xk-ZE,5388 +antlr4/dfa/DFASerializer.py,sha256=1st_HO85yXLYy7gInTEnkztgA6am4CT-yReh-mazp9E,2518 +antlr4/dfa/DFAState.py,sha256=R7JwKf0GtAEs9J_MD_Y0WKcuzdt0BVX1sow-uv9yFYc,5583 +antlr4/dfa/__init__.py,sha256=gsnQdtTH8IUgCiVUpQfzhxx2pFRvksW76SjwIk3fYSk,28 +antlr4/dfa/__pycache__/DFA.cpython-312.pyc,, +antlr4/dfa/__pycache__/DFASerializer.cpython-312.pyc,, +antlr4/dfa/__pycache__/DFAState.cpython-312.pyc,, +antlr4/dfa/__pycache__/__init__.cpython-312.pyc,, +antlr4/error/DiagnosticErrorListener.py,sha256=EwS2D_Ox6CmvCa16NPJ9ud4QYPHmlPXt6-Wdn1h5Kg8,4430 +antlr4/error/ErrorListener.py,sha256=yP_MDguol4Cj0_pEPyNzeH3v4ZvUjW5iwDjhYTVAHbE,2722 +antlr4/error/ErrorStrategy.py,sha256=0mhzFL57ZVnjKkGrtadta93Zm3NXdF-HW10DVD07VXs,30391 +antlr4/error/Errors.py,sha256=hlKngclBfXdkDiAymhYsvh2OCXlvmHM2kTl_A1vgp-w,6759 +antlr4/error/__init__.py,sha256=gsnQdtTH8IUgCiVUpQfzhxx2pFRvksW76SjwIk3fYSk,28 +antlr4/error/__pycache__/DiagnosticErrorListener.cpython-312.pyc,, +antlr4/error/__pycache__/ErrorListener.cpython-312.pyc,, +antlr4/error/__pycache__/ErrorStrategy.cpython-312.pyc,, +antlr4/error/__pycache__/Errors.cpython-312.pyc,, +antlr4/error/__pycache__/__init__.cpython-312.pyc,, +antlr4/tree/Chunk.py,sha256=oCIZjolLq9xkxtVDROEDxfUGgndcEnsDW0eUmLM7Gpk,695 +antlr4/tree/ParseTreeMatch.py,sha256=Dc6GVWSUqoIAFXUaUZqUwCUlZfTcgUbGLGzNf6QxQvE,4485 +antlr4/tree/ParseTreePattern.py,sha256=ASBNaQORh3f7f8KnFeZJC2yWFFx4uQlxvC2Y55ifhY0,2825 +antlr4/tree/ParseTreePatternMatcher.py,sha256=HtE9yi1Urr2QPLGLJDBvr0lxv6bjuj9CHl-4clahSe8,16388 +antlr4/tree/RuleTagToken.py,sha256=n4zXcmrrfsGyl91pj5ZYcc_CeKMhPrvYkUdppgMBpbY,2022 +antlr4/tree/TokenTagToken.py,sha256=S3o3DJhfzL5kpClxsKyI-Il-xvuuZQiBAIsLCKFjRHo,1576 +antlr4/tree/Tree.py,sha256=ZI7U_5IxBLm_IrnfJOtb12BCPIWyzfeZtLnhHKVVZIw,5572 +antlr4/tree/Trees.py,sha256=JtQ7cYWmKwI9TIBP6y9XIgjlNS4mYjv3ARwOfwWc5Vg,3968 +antlr4/tree/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +antlr4/tree/__pycache__/Chunk.cpython-312.pyc,, +antlr4/tree/__pycache__/ParseTreeMatch.cpython-312.pyc,, +antlr4/tree/__pycache__/ParseTreePattern.cpython-312.pyc,, +antlr4/tree/__pycache__/ParseTreePatternMatcher.cpython-312.pyc,, +antlr4/tree/__pycache__/RuleTagToken.cpython-312.pyc,, +antlr4/tree/__pycache__/TokenTagToken.cpython-312.pyc,, +antlr4/tree/__pycache__/Tree.cpython-312.pyc,, +antlr4/tree/__pycache__/Trees.cpython-312.pyc,, +antlr4/tree/__pycache__/__init__.cpython-312.pyc,, +antlr4/xpath/XPath.py,sha256=O9s4-EDvLbAbYytP_bae9Z2khLl0iAtRzPAtVbuWUM4,13015 +antlr4/xpath/__init__.py,sha256=gsnQdtTH8IUgCiVUpQfzhxx2pFRvksW76SjwIk3fYSk,28 +antlr4/xpath/__pycache__/XPath.cpython-312.pyc,, +antlr4/xpath/__pycache__/__init__.cpython-312.pyc,, +antlr4_python3_runtime-4.9.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +antlr4_python3_runtime-4.9.3.dist-info/METADATA,sha256=vzJeUVUxg4Wi_MRoB0LacQu63xOj0cCXmpizSHmA8mE,403 +antlr4_python3_runtime-4.9.3.dist-info/RECORD,, +antlr4_python3_runtime-4.9.3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91 +antlr4_python3_runtime-4.9.3.dist-info/top_level.txt,sha256=OsoZsh9bb30wgXb2zBUjdDwYg46MfV-RVZA6Pk8pcB0,7 diff --git a/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/WHEEL b/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..14a883f292bc96b20c2b76a3081991f2676523a9 --- /dev/null +++ b/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (82.0.1) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/top_level.txt b/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..3dee19f3e13c2cbbb49b818e6ac67c63f77b865f --- /dev/null +++ b/lib/python3.12/site-packages/antlr4_python3_runtime-4.9.3.dist-info/top_level.txt @@ -0,0 +1 @@ +antlr4 diff --git a/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/INSTALLER b/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/LICENSE b/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..93e41fb6965a930641ba181a3ae4e1008246d9d5 --- /dev/null +++ b/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2021-2025, ContourPy Developers. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/METADATA b/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..68529fbd400e902db54175b9286d9f24eb6976e1 --- /dev/null +++ b/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/METADATA @@ -0,0 +1,94 @@ +Metadata-Version: 2.1 +Name: contourpy +Version: 1.3.3 +Summary: Python library for calculating contours of 2D quadrilateral grids +Author-Email: Ian Thomas +License: BSD 3-Clause License + + Copyright (c) 2021-2025, ContourPy Developers. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Science/Research +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: C++ +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Topic :: Scientific/Engineering :: Information Analysis +Classifier: Topic :: Scientific/Engineering :: Mathematics +Classifier: Topic :: Scientific/Engineering :: Visualization +Project-URL: Homepage, https://github.com/contourpy/contourpy +Project-URL: Changelog, https://contourpy.readthedocs.io/en/latest/changelog.html +Project-URL: Documentation, https://contourpy.readthedocs.io +Project-URL: Repository, https://github.com/contourpy/contourpy +Requires-Python: >=3.11 +Requires-Dist: numpy>=1.25 +Provides-Extra: docs +Requires-Dist: furo; extra == "docs" +Requires-Dist: sphinx>=7.2; extra == "docs" +Requires-Dist: sphinx-copybutton; extra == "docs" +Provides-Extra: bokeh +Requires-Dist: bokeh; extra == "bokeh" +Requires-Dist: selenium; extra == "bokeh" +Provides-Extra: mypy +Requires-Dist: contourpy[bokeh,docs]; extra == "mypy" +Requires-Dist: bokeh; extra == "mypy" +Requires-Dist: docutils-stubs; extra == "mypy" +Requires-Dist: mypy==1.17.0; extra == "mypy" +Requires-Dist: types-Pillow; extra == "mypy" +Provides-Extra: test +Requires-Dist: contourpy[test-no-images]; extra == "test" +Requires-Dist: matplotlib; extra == "test" +Requires-Dist: Pillow; extra == "test" +Provides-Extra: test-no-images +Requires-Dist: pytest; extra == "test-no-images" +Requires-Dist: pytest-cov; extra == "test-no-images" +Requires-Dist: pytest-rerunfailures; extra == "test-no-images" +Requires-Dist: pytest-xdist; extra == "test-no-images" +Requires-Dist: wurlitzer; extra == "test-no-images" +Description-Content-Type: text/markdown + +ContourPy + +ContourPy is a Python library for calculating contours of 2D quadrilateral grids. It is written in C++11 and wrapped using pybind11. + +It contains the 2005 and 2014 algorithms used in Matplotlib as well as a newer algorithm that includes more features and is available in both serial and multithreaded versions. It provides an easy way for Python libraries to use contouring algorithms without having to include Matplotlib as a dependency. + + * **Documentation**: https://contourpy.readthedocs.io + * **Source code**: https://github.com/contourpy/contourpy + +| | | +| --- | --- | +| Latest release | [![PyPI version](https://img.shields.io/pypi/v/contourpy.svg?label=pypi&color=fdae61)](https://pypi.python.org/pypi/contourpy) [![conda-forge version](https://img.shields.io/conda/v/conda-forge/contourpy.svg?label=conda-forge&color=a6d96a)](https://anaconda.org/conda-forge/contourpy) | +| Downloads | [![PyPi downloads](https://img.shields.io/pypi/dm/contourpy?label=pypi&style=flat&color=fdae61)](https://pepy.tech/project/contourpy) | +| Python version | [![Platforms](https://img.shields.io/pypi/pyversions/contourpy?color=fdae61)](https://pypi.org/project/contourpy/) | +| Coverage | [![Codecov](https://img.shields.io/codecov/c/gh/contourpy/contourpy?color=fdae61&label=codecov)](https://app.codecov.io/gh/contourpy/contourpy) | diff --git a/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/RECORD b/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..dd5e88763ad8f144c15308d6adee0f4aa91f5af1 --- /dev/null +++ b/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/RECORD @@ -0,0 +1,42 @@ +contourpy-1.3.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +contourpy-1.3.3.dist-info/LICENSE,sha256=NBcJefxk9PXm36Zu8n3sMU___FhSAAxg9INuwd-_FW4,1534 +contourpy-1.3.3.dist-info/METADATA,sha256=xDzvhrrvCc_5x3l15Xj6jMoMlFTfQNwXaTi0maY95Uo,5461 +contourpy-1.3.3.dist-info/RECORD,, +contourpy-1.3.3.dist-info/WHEEL,sha256=rJCplGeGFjRoUvxJWhVONRgyGYGZoOkhyej0s3KyjoI,138 +contourpy/__init__.py,sha256=6sf-K0D4xaEIDhk38USOjszRiLz52rM43-vtcfVrMvY,11765 +contourpy/__pycache__/__init__.cpython-312.pyc,, +contourpy/__pycache__/_version.cpython-312.pyc,, +contourpy/__pycache__/array.cpython-312.pyc,, +contourpy/__pycache__/chunk.cpython-312.pyc,, +contourpy/__pycache__/convert.cpython-312.pyc,, +contourpy/__pycache__/dechunk.cpython-312.pyc,, +contourpy/__pycache__/enum_util.cpython-312.pyc,, +contourpy/__pycache__/typecheck.cpython-312.pyc,, +contourpy/__pycache__/types.cpython-312.pyc,, +contourpy/_contourpy.cpython-312-x86_64-linux-gnu.so,sha256=4LmxkdOIIz_Z3qGsP9JYKLQPZfGdUubdVkeMspJx2lg,954680 +contourpy/_contourpy.pyi,sha256=fvtccxkiZwGb6qYag7Fp4E8bsFmAIjAmobf8LNxqfgc,7122 +contourpy/_version.py,sha256=Vi6om3KImlKsS_Wg5CjUgYffoi2zx7T-SRPnnGL0G7M,22 +contourpy/array.py,sha256=4WwLuiZe30rizn_raymmY13OzE6hlCsDOO8kuVFOP18,8979 +contourpy/chunk.py,sha256=8njDQqlpuD22RjaaCyA75FXQsSQDY5hZGJSrxFpvGGU,3279 +contourpy/convert.py,sha256=mhyn7prEoWCnf0igaH-VqDwlk-CegFsZ4qOy2LL-hpU,26154 +contourpy/dechunk.py,sha256=EgFL6hw5H54ccuof4tJ2ehdnktT7trgZjiZqppsH8QI,7756 +contourpy/enum_util.py,sha256=o8MItJRs08oqzwPP3IwC75BBAY9Qq95saIzjkXBXwqA,1519 +contourpy/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +contourpy/typecheck.py,sha256=t1nvvCuKMYva1Zx4fc30EpdKFcO0Enz3n_UFfXBsq9o,10747 +contourpy/types.py,sha256=2K4T5tJpMIjYrkkg1Lqh3C2ZKlnOhnMtYmtwz92l_y8,247 +contourpy/util/__init__.py,sha256=eVhJ_crOHL7nkG4Kb0dOo7NL4WHMy_Px665aAN_3d-8,118 +contourpy/util/__pycache__/__init__.cpython-312.pyc,, +contourpy/util/__pycache__/_build_config.cpython-312.pyc,, +contourpy/util/__pycache__/bokeh_renderer.cpython-312.pyc,, +contourpy/util/__pycache__/bokeh_util.cpython-312.pyc,, +contourpy/util/__pycache__/data.cpython-312.pyc,, +contourpy/util/__pycache__/mpl_renderer.cpython-312.pyc,, +contourpy/util/__pycache__/mpl_util.cpython-312.pyc,, +contourpy/util/__pycache__/renderer.cpython-312.pyc,, +contourpy/util/_build_config.py,sha256=fyqK0_cupwGvImfUd9AlhzR21EGXN1c_QvByQxD5-D8,1847 +contourpy/util/bokeh_renderer.py,sha256=vSQcq_3zIQWj1E8qoM2j3sI7XlBFJcam9axuhfZle4I,13836 +contourpy/util/bokeh_util.py,sha256=wc-S3ewBUYWyIkEv9jkhFySIergjLQl4Z0UEVnE0HhA,2804 +contourpy/util/data.py,sha256=-7SSGMLX_gN-1H2JzpNSEB_EcEF_uMtYdOo_ePRIcg8,2586 +contourpy/util/mpl_renderer.py,sha256=dhPhSMKwVuFneNGZuBIgXCp9YjffqHpUyPG5C-T-5tU,20092 +contourpy/util/mpl_util.py,sha256=0Jz5f-aA9XMWlpO2pDnHbkVgxIiw4SY_ysxf_gACWEo,3452 +contourpy/util/renderer.py,sha256=8CBHzPmVsFPfqsWxqrxGBhqFpJhVeFHFeDzVXAgT8Fc,5118 diff --git a/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/WHEEL b/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..227a38cf01899aeccdf106d40cea71a6c95d30af --- /dev/null +++ b/lib/python3.12/site-packages/contourpy-1.3.3.dist-info/WHEEL @@ -0,0 +1,6 @@ +Wheel-Version: 1.0 +Generator: meson +Root-Is-Purelib: false +Tag: cp312-cp312-manylinux_2_27_x86_64 +Tag: cp312-cp312-manylinux_2_28_x86_64 + diff --git a/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/INSTALLER b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..a1b589e38a32041e49332e5e81c2d363dc418d68 --- /dev/null +++ b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/INSTALLER @@ -0,0 +1 @@ +pip diff --git a/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/METADATA b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..5f3eda377d54ba97b89611e38aa9cbae20647127 --- /dev/null +++ b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/METADATA @@ -0,0 +1,306 @@ +Metadata-Version: 2.4 +Name: GitPython +Version: 3.1.46 +Summary: GitPython is a Python library used to interact with Git repositories +Home-page: https://github.com/gitpython-developers/GitPython +Author: Sebastian Thiel, Michael Trier +Author-email: byronimo@gmail.com, mtrier@gmail.com +License: BSD-3-Clause +Classifier: Development Status :: 5 - Production/Stable +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: Operating System :: OS Independent +Classifier: Operating System :: POSIX +Classifier: Operating System :: Microsoft :: Windows +Classifier: Operating System :: MacOS :: MacOS X +Classifier: Typing :: Typed +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Requires-Python: >=3.7 +Description-Content-Type: text/markdown +License-File: LICENSE +License-File: AUTHORS +Requires-Dist: gitdb<5,>=4.0.1 +Requires-Dist: typing-extensions>=3.10.0.2; python_version < "3.10" +Provides-Extra: test +Requires-Dist: coverage[toml]; extra == "test" +Requires-Dist: ddt!=1.4.3,>=1.1.1; extra == "test" +Requires-Dist: mock; python_version < "3.8" and extra == "test" +Requires-Dist: mypy==1.18.2; python_version >= "3.9" and extra == "test" +Requires-Dist: pre-commit; extra == "test" +Requires-Dist: pytest>=7.3.1; extra == "test" +Requires-Dist: pytest-cov; extra == "test" +Requires-Dist: pytest-instafail; extra == "test" +Requires-Dist: pytest-mock; extra == "test" +Requires-Dist: pytest-sugar; extra == "test" +Requires-Dist: typing-extensions; python_version < "3.11" and extra == "test" +Provides-Extra: doc +Requires-Dist: sphinx<7.2,>=7.1.2; extra == "doc" +Requires-Dist: sphinx_rtd_theme; extra == "doc" +Requires-Dist: sphinx-autodoc-typehints; extra == "doc" +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: description-content-type +Dynamic: home-page +Dynamic: license +Dynamic: license-file +Dynamic: provides-extra +Dynamic: requires-dist +Dynamic: requires-python +Dynamic: summary + +![Python package](https://github.com/gitpython-developers/GitPython/workflows/Python%20package/badge.svg) +[![Documentation Status](https://readthedocs.org/projects/gitpython/badge/?version=stable)](https://readthedocs.org/projects/gitpython/?badge=stable) +[![Packaging status](https://repology.org/badge/tiny-repos/python:gitpython.svg)](https://repology.org/metapackage/python:gitpython/versions) + +## [Gitoxide](https://github.com/Byron/gitoxide): A peek into the future… + +I started working on GitPython in 2009, back in the days when Python was 'my thing' and I had great plans with it. +Of course, back in the days, I didn't really know what I was doing and this shows in many places. Somewhat similar to +Python this happens to be 'good enough', but at the same time is deeply flawed and broken beyond repair. + +By now, GitPython is widely used and I am sure there is a good reason for that, it's something to be proud of and happy about. +The community is maintaining the software and is keeping it relevant for which I am absolutely grateful. For the time to come I am happy to continue maintaining GitPython, remaining hopeful that one day it won't be needed anymore. + +More than 15 years after my first meeting with 'git' I am still in excited about it, and am happy to finally have the tools and +probably the skills to scratch that itch of mine: implement `git` in a way that makes tool creation a piece of cake for most. + +If you like the idea and want to learn more, please head over to [gitoxide](https://github.com/Byron/gitoxide), an +implementation of 'git' in [Rust](https://www.rust-lang.org). + +*(Please note that `gitoxide` is not currently available for use in Python, and that Rust is required.)* + +## GitPython + +GitPython is a python library used to interact with git repositories, high-level like git-porcelain, +or low-level like git-plumbing. + +It provides abstractions of git objects for easy access of repository data often backed by calling the `git` +command-line program. + +### DEVELOPMENT STATUS + +This project is in **maintenance mode**, which means that + +- …there will be no feature development, unless these are contributed +- …there will be no bug fixes, unless they are relevant to the safety of users, or contributed +- …issues will be responded to with waiting times of up to a month + +The project is open to contributions of all kinds, as well as new maintainers. + +### REQUIREMENTS + +GitPython needs the `git` executable to be installed on the system and available in your +`PATH` for most operations. If it is not in your `PATH`, you can help GitPython find it +by setting the `GIT_PYTHON_GIT_EXECUTABLE=` environment variable. + +- Git (1.7.x or newer) +- Python >= 3.7 + +The list of dependencies are listed in `./requirements.txt` and `./test-requirements.txt`. +The installer takes care of installing them for you. + +### INSTALL + +GitPython and its required package dependencies can be installed in any of the following ways, all of which should typically be done in a [virtual environment](https://docs.python.org/3/tutorial/venv.html). + +#### From PyPI + +To obtain and install a copy [from PyPI](https://pypi.org/project/GitPython/), run: + +```sh +pip install GitPython +``` + +(A distribution package can also be downloaded for manual installation at [the PyPI page](https://pypi.org/project/GitPython/).) + +#### From downloaded source code + +If you have downloaded the source code, run this from inside the unpacked `GitPython` directory: + +```sh +pip install . +``` + +#### By cloning the source code repository + +To clone the [the GitHub repository](https://github.com/gitpython-developers/GitPython) from source to work on the code, you can do it like so: + +```sh +git clone https://github.com/gitpython-developers/GitPython +cd GitPython +./init-tests-after-clone.sh +``` + +On Windows, `./init-tests-after-clone.sh` can be run in a Git Bash shell. + +If you are cloning [your own fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks), then replace the above `git clone` command with one that gives the URL of your fork. Or use this [`gh`](https://cli.github.com/) command (assuming you have `gh` and your fork is called `GitPython`): + +```sh +gh repo clone GitPython +``` + +Having cloned the repo, create and activate your [virtual environment](https://docs.python.org/3/tutorial/venv.html). + +Then make an [editable install](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs): + +```sh +pip install -e ".[test]" +``` + +In the less common case that you do not want to install test dependencies, `pip install -e .` can be used instead. + +#### With editable *dependencies* (not preferred, and rarely needed) + +In rare cases, you may want to work on GitPython and one or both of its [gitdb](https://github.com/gitpython-developers/gitdb) and [smmap](https://github.com/gitpython-developers/smmap) dependencies at the same time, with changes in your local working copy of gitdb or smmap immediately reflected in the behavior of your local working copy of GitPython. This can be done by making editable installations of those dependencies in the same virtual environment where you install GitPython. + +If you want to do that *and* you want the versions in GitPython's git submodules to be used, then pass `-e git/ext/gitdb` and/or `-e git/ext/gitdb/gitdb/ext/smmap` to `pip install`. This can be done in any order, and in separate `pip install` commands or the same one, so long as `-e` appears before *each* path. For example, you can install GitPython, gitdb, and smmap editably in the currently active virtual environment this way: + +```sh +pip install -e ".[test]" -e git/ext/gitdb -e git/ext/gitdb/gitdb/ext/smmap +``` + +The submodules must have been cloned for that to work, but that will already be the case if you have run `./init-tests-after-clone.sh`. You can use `pip list` to check which packages are installed editably and which are installed normally. + +To reiterate, this approach should only rarely be used. For most development it is preferable to allow the gitdb and smmap dependencices to be retrieved automatically from PyPI in their latest stable packaged versions. + +### Limitations + +#### Leakage of System Resources + +GitPython is not suited for long-running processes (like daemons) as it tends to +leak system resources. It was written in a time where destructors (as implemented +in the `__del__` method) still ran deterministically. + +In case you still want to use it in such a context, you will want to search the +codebase for `__del__` implementations and call these yourself when you see fit. + +Another way assure proper cleanup of resources is to factor out GitPython into a +separate process which can be dropped periodically. + +#### Windows support + +See [Issue #525](https://github.com/gitpython-developers/GitPython/issues/525). + +### RUNNING TESTS + +_Important_: Right after cloning this repository, please be sure to have executed +the `./init-tests-after-clone.sh` script in the repository root. Otherwise +you will encounter test failures. + +#### Install test dependencies + +Ensure testing libraries are installed. This is taken care of already if you installed with: + +```sh +pip install -e ".[test]" +``` + +If you had installed with a command like `pip install -e .` instead, you can still run +the above command to add the testing dependencies. + +#### Test commands + +To test, run: + +```sh +pytest +``` + +To lint, and apply some linting fixes as well as automatic code formatting, run: + +```sh +pre-commit run --all-files +``` + +This includes the linting and autoformatting done by Ruff, as well as some other checks. + +To typecheck, run: + +```sh +mypy +``` + +#### CI (and tox) + +Style and formatting checks, and running tests on all the different supported Python versions, will be performed: + +- Upon submitting a pull request. +- On each push, *if* you have a fork with GitHub Actions enabled. +- Locally, if you run [`tox`](https://tox.wiki/) (this skips any Python versions you don't have installed). + +#### Configuration files + +Specific tools are all configured in the `./pyproject.toml` file: + +- `pytest` (test runner) +- `coverage.py` (code coverage) +- `ruff` (linter and formatter) +- `mypy` (type checker) + +Orchestration tools: + +- Configuration for `pre-commit` is in the `./.pre-commit-config.yaml` file. +- Configuration for `tox` is in `./tox.ini`. +- Configuration for GitHub Actions (CI) is in files inside `./.github/workflows/`. + +### Contributions + +Please have a look at the [contributions file][contributing]. + +### INFRASTRUCTURE + +- [User Documentation](http://gitpython.readthedocs.org) +- [Questions and Answers](http://stackexchange.com/filters/167317/gitpython) +- Please post on Stack Overflow and use the `gitpython` tag +- [Issue Tracker](https://github.com/gitpython-developers/GitPython/issues) + - Post reproducible bugs and feature requests as a new issue. + Please be sure to provide the following information if posting bugs: + - GitPython version (e.g. `import git; git.__version__`) + - Python version (e.g. `python --version`) + - The encountered stack-trace, if applicable + - Enough information to allow reproducing the issue + +### How to make a new release + +1. Update/verify the **version** in the `VERSION` file. +2. Update/verify that the `doc/source/changes.rst` changelog file was updated. It should include a link to the forthcoming release page: `https://github.com/gitpython-developers/GitPython/releases/tag/` +3. Commit everything. +4. Run `git tag -s ` to tag the version in Git. +5. _Optionally_ create and activate a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment). (Then the next step can install `build` and `twine`.) +6. Run `make release`. +7. Go to [GitHub Releases](https://github.com/gitpython-developers/GitPython/releases) and publish a new one with the recently pushed tag. Generate the changelog. + +### Projects using GitPython + +- [PyDriller](https://github.com/ishepard/pydriller) +- [Kivy Designer](https://github.com/kivy/kivy-designer) +- [Prowl](https://github.com/nettitude/Prowl) +- [Python Taint](https://github.com/python-security/pyt) +- [Buster](https://github.com/axitkhurana/buster) +- [git-ftp](https://github.com/ezyang/git-ftp) +- [Git-Pandas](https://github.com/wdm0006/git-pandas) +- [PyGitUp](https://github.com/msiemens/PyGitUp) +- [PyJFuzz](https://github.com/mseclab/PyJFuzz) +- [Loki](https://github.com/Neo23x0/Loki) +- [Omniwallet](https://github.com/OmniLayer/omniwallet) +- [GitViper](https://github.com/BeayemX/GitViper) +- [Git Gud](https://github.com/bthayer2365/git-gud) + +### LICENSE + +[3-Clause BSD License](https://opensource.org/license/bsd-3-clause/), also known as the New BSD License. See the [LICENSE file][license]. + +One file exclusively used for fuzz testing is subject to [a separate license, detailed here](./fuzzing/README.md#license). +This file is not included in the wheel or sdist packages published by the maintainers of GitPython. + +[contributing]: https://github.com/gitpython-developers/GitPython/blob/main/CONTRIBUTING.md +[license]: https://github.com/gitpython-developers/GitPython/blob/main/LICENSE diff --git a/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/RECORD b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..75612928c8b0b773da8bad0602aa9b1ba377cd72 --- /dev/null +++ b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/RECORD @@ -0,0 +1,82 @@ +git/__init__.py,sha256=IFCdAVZx_IuQOh_BBdtSkdIrZHsOSd0cj0O50t9orso,8899 +git/__pycache__/__init__.cpython-312.pyc,, +git/__pycache__/cmd.cpython-312.pyc,, +git/__pycache__/compat.cpython-312.pyc,, +git/__pycache__/config.cpython-312.pyc,, +git/__pycache__/db.cpython-312.pyc,, +git/__pycache__/diff.cpython-312.pyc,, +git/__pycache__/exc.cpython-312.pyc,, +git/__pycache__/remote.cpython-312.pyc,, +git/__pycache__/types.cpython-312.pyc,, +git/__pycache__/util.cpython-312.pyc,, +git/cmd.py,sha256=y01yN8P2JFuFP5dGzHIW9vd-uBQjPzK8yfZMZIZZb34,67472 +git/compat.py,sha256=y1E6y6O2q5r8clSlr8ZNmuIWG9nmHuehQEsVsmBffs8,4526 +git/config.py,sha256=pMrIel6qEqbzC1MLVjoyG9MRDemiEVP-paptgnAV9sA,35505 +git/db.py,sha256=vIW9uWSbqu99zbuU2ZDmOhVOv1UPTmxrnqiCtRHCfjE,2368 +git/diff.py,sha256=xhOeMmFDmXOdpje2vA1mzJpmpBnyX-nrt-mp2RiVR1M,27172 +git/exc.py,sha256=Gc7g1pHpn8OmTse30NHmJVsBJ2CYH8LxaR8y8UA3lIM,7119 +git/index/__init__.py,sha256=i-Nqb8Lufp9aFbmxpQBORmmQnjEVVM1Pn58fsQkyGgQ,406 +git/index/__pycache__/__init__.cpython-312.pyc,, +git/index/__pycache__/base.cpython-312.pyc,, +git/index/__pycache__/fun.cpython-312.pyc,, +git/index/__pycache__/typ.cpython-312.pyc,, +git/index/__pycache__/util.cpython-312.pyc,, +git/index/base.py,sha256=QBzkdpNKSjXVRDUqcl08BPyF0VItsO6uXzziclwNPJI,61121 +git/index/fun.py,sha256=v0WnKQxaAffMZxXXC7pQOiMvRRJfODhUNKDMruxKrN4,17110 +git/index/typ.py,sha256=ZjRWp5J79OwFQor1XXN4C6JmHTDclD9H-tKZtAeqyTI,7019 +git/index/util.py,sha256=f0BfE2JPkdypsB2Q_HJ8KU7MC45RRHywL_GWwxa_5hw,3676 +git/objects/__init__.py,sha256=O6ZL_olX7e5-8iIbKviRPkVSJxN37WA-EC0q9d48U5Y,637 +git/objects/__pycache__/__init__.cpython-312.pyc,, +git/objects/__pycache__/base.cpython-312.pyc,, +git/objects/__pycache__/blob.cpython-312.pyc,, +git/objects/__pycache__/commit.cpython-312.pyc,, +git/objects/__pycache__/fun.cpython-312.pyc,, +git/objects/__pycache__/tag.cpython-312.pyc,, +git/objects/__pycache__/tree.cpython-312.pyc,, +git/objects/__pycache__/util.cpython-312.pyc,, +git/objects/base.py,sha256=5-p9uSGWvPxX9hidvkGH9tQOJoH2eaRggUbMr9VJiL0,10285 +git/objects/blob.py,sha256=G9PZMNc5CFRQFNnlquBRAM5-jZg8581lRcxkvARobSk,1231 +git/objects/commit.py,sha256=VhfRNpYM-ormwpXjY6cKV6Zur3GHsuDzVn4TP0mSz2I,30565 +git/objects/fun.py,sha256=B4jCqhAjm6Hl79GK58FPzW1H9K6Wc7Tx0rssyWmAcEE,8935 +git/objects/submodule/__init__.py,sha256=6xySp767LVz3UylWgUalntS_nGXRuVzXxDuFAv_Wc2c,303 +git/objects/submodule/__pycache__/__init__.cpython-312.pyc,, +git/objects/submodule/__pycache__/base.cpython-312.pyc,, +git/objects/submodule/__pycache__/root.cpython-312.pyc,, +git/objects/submodule/__pycache__/util.cpython-312.pyc,, +git/objects/submodule/base.py,sha256=EWkbiJsFSpCt5zacoVrq-9JQFJWn4BWA7kdsXtjL5PU,64412 +git/objects/submodule/root.py,sha256=5eTtYNHasqdPq6q0oDCPr7IaO6uAHL3b4DxMoiO2LhE,20246 +git/objects/submodule/util.py,sha256=sQqAYaiSJdFkZa9NlAuK_wTsMNiS-kkQnQjvIoJtc_o,3509 +git/objects/tag.py,sha256=jAGESnpmTEv-dLakPzheT5ILZFFArcItnXYqfxfDrgc,4441 +git/objects/tree.py,sha256=MmExcS59Iamb2cBqUvoHPdzgixabyvv5voHabossrl8,13898 +git/objects/util.py,sha256=Nlza4zLgdPmr_Yasyvvs6c1rKtW_wMxI6wDmQpQ3ufw,23846 +git/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +git/refs/__init__.py,sha256=DWlJNnsx-4jM_E-VycbP-FZUdn6iWhjnH_uZ_pZXBro,509 +git/refs/__pycache__/__init__.cpython-312.pyc,, +git/refs/__pycache__/head.cpython-312.pyc,, +git/refs/__pycache__/log.cpython-312.pyc,, +git/refs/__pycache__/reference.cpython-312.pyc,, +git/refs/__pycache__/remote.cpython-312.pyc,, +git/refs/__pycache__/symbolic.cpython-312.pyc,, +git/refs/__pycache__/tag.cpython-312.pyc,, +git/refs/head.py,sha256=59MUMVu9phmE_ImkmNw0sDDSCc75s7TxkQj_cKzRhbo,10397 +git/refs/log.py,sha256=ooqlw_mn14FSQGvZXDC0Tt4MQG-4Hob8T92SDH9ZzfY,12517 +git/refs/reference.py,sha256=uzrvNTZ5fg7A0Aq4VC3KLSMbksgYUf4KvmHau0tFYIM,5646 +git/refs/remote.py,sha256=WwqV9T7BbYf3F_WZNUQivu9xktIIKGklCjDpwQrhD-A,2806 +git/refs/symbolic.py,sha256=seRKwWw7eegQyGoObE-PuuVpSvNyQRUAXqFRq0wI6yA,34892 +git/refs/tag.py,sha256=AKrFrMhkNzX8e9x5WmDRtHovbN9zYQghuKoneVW-TJg,5002 +git/remote.py,sha256=pYn9dAlz-QwvNMWXD1M57pMPQitthOM86qTRK_cpTqU,46786 +git/repo/__init__.py,sha256=CILSVH36fX_WxVFSjD9o1WF5LgsNedPiJvSngKZqfVU,210 +git/repo/__pycache__/__init__.cpython-312.pyc,, +git/repo/__pycache__/base.cpython-312.pyc,, +git/repo/__pycache__/fun.cpython-312.pyc,, +git/repo/base.py,sha256=WB-tKymX1pCWJS6NJvk8nrc9uwjPKOswfIjIB4Piylg,59900 +git/repo/fun.py,sha256=sjzJH8jy18nacsJjKKIqRBKadhhhxiyjmZKWXDErNnw,13787 +git/types.py,sha256=d3oDduUGjfoqffcUL_GOD-3qroF8m3r9ai6Xi9_FraM,10279 +git/util.py,sha256=T1M3Nv-AbKSeZ3if33bpJFX450EeoGK67tr3SrEkjlU,44057 +gitpython-3.1.46.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +gitpython-3.1.46.dist-info/METADATA,sha256=2SpjTUkbQB5rdgU7bSkG9Bd27Cx-JRgdWGEMZ8MKHgs,13492 +gitpython-3.1.46.dist-info/RECORD,, +gitpython-3.1.46.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91 +gitpython-3.1.46.dist-info/licenses/AUTHORS,sha256=_upJOkW3eLK_ZywFzQDkKDp4JtF6xBf_Qk0ObAqTPvE,2347 +gitpython-3.1.46.dist-info/licenses/LICENSE,sha256=hvyUwyGpr7wRUUcTURuv3tIl8lEA3MD3NQ6CvCMbi-s,1503 +gitpython-3.1.46.dist-info/top_level.txt,sha256=0hzDuIp8obv624V3GmbqsagBWkk8ohtGU-Bc1PmTT0o,4 diff --git a/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/WHEEL b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..e7fa31b6f3f78deb1022c1f7927f07d4d16da822 --- /dev/null +++ b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (80.9.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/licenses/AUTHORS b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/licenses/AUTHORS new file mode 100644 index 0000000000000000000000000000000000000000..b57113edd14b5854b802710a8914097e9234c31b --- /dev/null +++ b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/licenses/AUTHORS @@ -0,0 +1,60 @@ +GitPython was originally written by Michael Trier. +GitPython 0.2 was partially (re)written by Sebastian Thiel, based on 0.1.6 and git-dulwich. + +Contributors are: + +-Michael Trier +-Alan Briolat +-Florian Apolloner +-David Aguilar +-Jelmer Vernooij +-Steve Frécinaux +-Kai Lautaportti +-Paul Sowden +-Sebastian Thiel +-Jonathan Chu +-Vincent Driessen +-Phil Elson +-Bernard `Guyzmo` Pratz +-Timothy B. Hartman +-Konstantin Popov +-Peter Jones +-Anson Mansfield +-Ken Odegard +-Alexis Horgix Chotard +-Piotr Babij +-Mikuláš Poul +-Charles Bouchard-Légaré +-Yaroslav Halchenko +-Tim Swast +-William Luc Ritchie +-David Host +-A. Jesse Jiryu Davis +-Steven Whitman +-Stefan Stancu +-César Izurieta +-Arthur Milchior +-Anil Khatri +-JJ Graham +-Ben Thayer +-Dries Kennes +-Pratik Anurag +-Harmon +-Liam Beguin +-Ram Rachum +-Alba Mendez +-Robert Westman +-Hugo van Kemenade +-Hiroki Tokunaga +-Julien Mauroy +-Patrick Gerard +-Luke Twist +-Joseph Hale +-Santos Gallegos +-Wenhan Zhu +-Eliah Kagan +-Ethan Lin +-Jonas Scharpf +-Gordon Marx + +Portions derived from other open source works and are clearly marked. diff --git a/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/licenses/LICENSE b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..ba8a219fe1f27c10b50df8cd4f26c0ab833bbbc8 --- /dev/null +++ b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/licenses/LICENSE @@ -0,0 +1,29 @@ +Copyright (C) 2008, 2009 Michael Trier and contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +* Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +* Neither the name of the GitPython project nor the names of +its contributors may be used to endorse or promote products derived +from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/top_level.txt b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..5664e303b5dc2e9ef8e14a0845d9486ec1920afd --- /dev/null +++ b/lib/python3.12/site-packages/gitpython-3.1.46.dist-info/top_level.txt @@ -0,0 +1 @@ +git diff --git a/lib/python3.12/site-packages/hydra/__init__.py b/lib/python3.12/site-packages/hydra/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cb91a833c59ce4c286aabf2642263b61a0e561e6 --- /dev/null +++ b/lib/python3.12/site-packages/hydra/__init__.py @@ -0,0 +1,23 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +# Source of truth for Hydra's version +__version__ = "1.3.2" +from hydra import utils +from hydra.errors import MissingConfigException +from hydra.main import main +from hydra.types import TaskFunction + +from .compose import compose +from .initialize import initialize, initialize_config_dir, initialize_config_module + +__all__ = [ + "__version__", + "MissingConfigException", + "main", + "utils", + "TaskFunction", + "compose", + "initialize", + "initialize_config_module", + "initialize_config_dir", +] diff --git a/lib/python3.12/site-packages/hydra/_internal/__init__.py b/lib/python3.12/site-packages/hydra/_internal/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..168f9979a4623806934b0ff1102ac166704e7dec --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/__init__.py @@ -0,0 +1 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved diff --git a/lib/python3.12/site-packages/hydra/_internal/__pycache__/__init__.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4fbbfb4d82f9a98a533758dd40cf2eefa454fd7d Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/__pycache__/__init__.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/__pycache__/callbacks.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/__pycache__/callbacks.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..79c66b50cbcb987f9bc74293b5ef1af6be244a5c Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/__pycache__/callbacks.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/__pycache__/config_loader_impl.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/__pycache__/config_loader_impl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1abcd3115d72cc55e4a08f580b2b19208923ba67 Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/__pycache__/config_loader_impl.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/__pycache__/config_repository.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/__pycache__/config_repository.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d89d02a369590f5f460c9f5b6e5f34029892a770 Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/__pycache__/config_repository.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/__pycache__/config_search_path_impl.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/__pycache__/config_search_path_impl.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..473a2074cad40eccd9d3ddfed949a75c77ba6532 Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/__pycache__/config_search_path_impl.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/__pycache__/defaults_list.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/__pycache__/defaults_list.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4bc325f06c14d15ba08b31b7ecbb0899995d9694 Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/__pycache__/defaults_list.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/__pycache__/deprecation_warning.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/__pycache__/deprecation_warning.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e6d073c66eec8a61561bad0a30a9e17e788579a Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/__pycache__/deprecation_warning.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/__pycache__/hydra.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/__pycache__/hydra.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1aea7fad9d44a8db7c2220611e6111e2807a6ff Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/__pycache__/hydra.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/__pycache__/sources_registry.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/__pycache__/sources_registry.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b1b442efded140aaf40d7a8fb2c1d11a83fa702e Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/__pycache__/sources_registry.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/__pycache__/utils.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/__pycache__/utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e62c4e4cf493cc21b64325e9875eba64e492ea42 Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/__pycache__/utils.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/callbacks.py b/lib/python3.12/site-packages/hydra/_internal/callbacks.py new file mode 100644 index 0000000000000000000000000000000000000000..36226bc90d45582e918525b6ee774523c8a2d9b8 --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/callbacks.py @@ -0,0 +1,65 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import warnings +from typing import TYPE_CHECKING, Any, Optional + +from omegaconf import DictConfig, OmegaConf + +from hydra.types import TaskFunction + +if TYPE_CHECKING: + from hydra.core.utils import JobReturn + + +class Callbacks: + def __init__(self, config: Optional[DictConfig] = None) -> None: + self.callbacks = [] + from hydra.utils import instantiate + + if config is not None and OmegaConf.select(config, "hydra.callbacks"): + for params in config.hydra.callbacks.values(): + self.callbacks.append(instantiate(params)) + + def _notify(self, function_name: str, reverse: bool = False, **kwargs: Any) -> None: + callbacks = reversed(self.callbacks) if reverse else self.callbacks + for c in callbacks: + try: + getattr(c, function_name)(**kwargs) + except Exception as e: + warnings.warn( + f"Callback {type(c).__name__}.{function_name} raised {type(e).__name__}: {e}" + ) + + def on_run_start(self, config: DictConfig, **kwargs: Any) -> None: + self._notify(function_name="on_run_start", config=config, **kwargs) + + def on_run_end(self, config: DictConfig, **kwargs: Any) -> None: + self._notify(function_name="on_run_end", config=config, reverse=True, **kwargs) + + def on_multirun_start(self, config: DictConfig, **kwargs: Any) -> None: + self._notify(function_name="on_multirun_start", config=config, **kwargs) + + def on_multirun_end(self, config: DictConfig, **kwargs: Any) -> None: + self._notify( + function_name="on_multirun_end", reverse=True, config=config, **kwargs + ) + + def on_job_start( + self, config: DictConfig, *, task_function: TaskFunction, **kwargs: Any + ) -> None: + self._notify( + function_name="on_job_start", + config=config, + task_function=task_function, + **kwargs, + ) + + def on_job_end( + self, config: DictConfig, job_return: "JobReturn", **kwargs: Any + ) -> None: + self._notify( + function_name="on_job_end", + config=config, + job_return=job_return, + reverse=True, + **kwargs, + ) diff --git a/lib/python3.12/site-packages/hydra/_internal/config_loader_impl.py b/lib/python3.12/site-packages/hydra/_internal/config_loader_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..bf89b0d2b12d70b412f298524d55a3a0a584a9f1 --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/config_loader_impl.py @@ -0,0 +1,600 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import copy +import os +import re +import sys +import warnings +from textwrap import dedent +from typing import Any, List, MutableSequence, Optional, Tuple + +from omegaconf import Container, DictConfig, OmegaConf, flag_override, open_dict +from omegaconf.errors import ( + ConfigAttributeError, + ConfigKeyError, + OmegaConfBaseException, +) + +from hydra._internal.config_repository import ( + CachingConfigRepository, + ConfigRepository, + IConfigRepository, +) +from hydra._internal.defaults_list import DefaultsList, create_defaults_list +from hydra.conf import ConfigSourceInfo +from hydra.core.config_loader import ConfigLoader +from hydra.core.config_search_path import ConfigSearchPath +from hydra.core.default_element import ResultDefault +from hydra.core.object_type import ObjectType +from hydra.core.override_parser.overrides_parser import OverridesParser +from hydra.core.override_parser.types import Override, ValueType +from hydra.core.utils import JobRuntime +from hydra.errors import ConfigCompositionException, MissingConfigException +from hydra.plugins.config_source import ConfigLoadError, ConfigResult, ConfigSource +from hydra.types import RunMode + +from .deprecation_warning import deprecation_warning + + +class ConfigLoaderImpl(ConfigLoader): + """ + Configuration loader + """ + + def __init__( + self, + config_search_path: ConfigSearchPath, + ) -> None: + self.config_search_path = config_search_path + self.repository = ConfigRepository(config_search_path=config_search_path) + + @staticmethod + def validate_sweep_overrides_legal( + overrides: List[Override], + run_mode: RunMode, + from_shell: bool, + ) -> None: + for x in overrides: + if x.is_sweep_override(): + if run_mode == RunMode.MULTIRUN: + if x.is_hydra_override(): + raise ConfigCompositionException( + "Sweeping over Hydra's configuration is not supported :" + f" '{x.input_line}'" + ) + elif run_mode == RunMode.RUN: + if x.value_type == ValueType.SIMPLE_CHOICE_SWEEP: + vals = "value1,value2" + if from_shell: + example_override = f"key=\\'{vals}\\'" + else: + example_override = f"key='{vals}'" + + msg = dedent( + f"""\ + Ambiguous value for argument '{x.input_line}' + 1. To use it as a list, use key=[value1,value2] + 2. To use it as string, quote the value: {example_override} + 3. To sweep over it, add --multirun to your command line""" + ) + raise ConfigCompositionException(msg) + else: + raise ConfigCompositionException( + f"Sweep parameters '{x.input_line}' requires --multirun" + ) + else: + assert False + + def _missing_config_error( + self, config_name: Optional[str], msg: str, with_search_path: bool + ) -> None: + def add_search_path() -> str: + descs = [] + for src in self.repository.get_sources(): + if src.provider != "schema": + descs.append(f"\t{repr(src)}") + lines = "\n".join(descs) + + if with_search_path: + return msg + "\nSearch path:" + f"\n{lines}" + else: + return msg + + raise MissingConfigException( + missing_cfg_file=config_name, message=add_search_path() + ) + + def ensure_main_config_source_available(self) -> None: + for source in self.get_sources(): + # if specified, make sure main config search path exists + if source.provider == "main": + if not source.available(): + if source.scheme() == "pkg": + if source.path == "": + msg = ( + "Primary config module is empty.\nPython requires" + " resources to be in a module with an __init__.py file" + ) + else: + msg = ( + f"Primary config module '{source.path}' not" + " found.\nCheck that it's correct and contains an" + " __init__.py file" + ) + else: + msg = ( + "Primary config directory not found.\nCheck that the" + f" config directory '{source.path}' exists and readable" + ) + + self._missing_config_error( + config_name=None, msg=msg, with_search_path=False + ) + + def load_configuration( + self, + config_name: Optional[str], + overrides: List[str], + run_mode: RunMode, + from_shell: bool = True, + validate_sweep_overrides: bool = True, + ) -> DictConfig: + try: + return self._load_configuration_impl( + config_name=config_name, + overrides=overrides, + run_mode=run_mode, + from_shell=from_shell, + validate_sweep_overrides=validate_sweep_overrides, + ) + except OmegaConfBaseException as e: + raise ConfigCompositionException().with_traceback(sys.exc_info()[2]) from e + + def _process_config_searchpath( + self, + config_name: Optional[str], + parsed_overrides: List[Override], + repo: CachingConfigRepository, + ) -> None: + if config_name is not None: + loaded = repo.load_config(config_path=config_name) + primary_config: Container + if loaded is None: + primary_config = OmegaConf.create() + else: + primary_config = loaded.config + else: + primary_config = OmegaConf.create() + + if not OmegaConf.is_dict(primary_config): + raise ConfigCompositionException( + f"primary config '{config_name}' must be a DictConfig, got" + f" {type(primary_config).__name__}" + ) + + def is_searchpath_override(v: Override) -> bool: + return v.get_key_element() == "hydra.searchpath" + + override = None + for v in parsed_overrides: + if is_searchpath_override(v): + override = v.value() + break + + searchpath = OmegaConf.select(primary_config, "hydra.searchpath") + if override is not None: + provider = "hydra.searchpath in command-line" + searchpath = override + else: + provider = "hydra.searchpath in main" + + def _err() -> None: + raise ConfigCompositionException( + f"hydra.searchpath must be a list of strings. Got: {searchpath}" + ) + + if searchpath is None: + return + + # validate hydra.searchpath. + # Note that we cannot rely on OmegaConf validation here because we did not yet merge with the Hydra schema node + if not isinstance(searchpath, MutableSequence): + _err() + for v in searchpath: + if not isinstance(v, str): + _err() + + new_csp = copy.deepcopy(self.config_search_path) + schema = new_csp.get_path().pop(-1) + assert schema.provider == "schema" + for sp in searchpath: + new_csp.append(provider=provider, path=sp) + new_csp.append("schema", "structured://") + repo.initialize_sources(new_csp) + + for source in repo.get_sources(): + if not source.available(): + warnings.warn( + category=UserWarning, + message=( + f"provider={source.provider}, path={source.path} is not" + " available." + ), + ) + + def _parse_overrides_and_create_caching_repo( + self, config_name: Optional[str], overrides: List[str] + ) -> Tuple[List[Override], CachingConfigRepository]: + parser = OverridesParser.create() + parsed_overrides = parser.parse_overrides(overrides=overrides) + caching_repo = CachingConfigRepository(self.repository) + self._process_config_searchpath(config_name, parsed_overrides, caching_repo) + return parsed_overrides, caching_repo + + def _load_configuration_impl( + self, + config_name: Optional[str], + overrides: List[str], + run_mode: RunMode, + from_shell: bool = True, + validate_sweep_overrides: bool = True, + ) -> DictConfig: + from hydra import __version__, version + + self.ensure_main_config_source_available() + parsed_overrides, caching_repo = self._parse_overrides_and_create_caching_repo( + config_name, overrides + ) + + if validate_sweep_overrides: + self.validate_sweep_overrides_legal( + overrides=parsed_overrides, run_mode=run_mode, from_shell=from_shell + ) + + defaults_list = create_defaults_list( + repo=caching_repo, + config_name=config_name, + overrides_list=parsed_overrides, + prepend_hydra=True, + skip_missing=run_mode == RunMode.MULTIRUN, + ) + + config_overrides = defaults_list.config_overrides + + cfg = self._compose_config_from_defaults_list( + defaults=defaults_list.defaults, repo=caching_repo + ) + + # Set config root to struct mode. + # Note that this will close any dictionaries (including dicts annotated as Dict[K, V]. + # One must use + to add new fields to them. + OmegaConf.set_struct(cfg, True) + + # The Hydra node should not be read-only even if the root config is read-only. + OmegaConf.set_readonly(cfg.hydra, False) + + # Apply command line overrides after enabling strict flag + ConfigLoaderImpl._apply_overrides_to_config(config_overrides, cfg) + app_overrides = [] + for override in parsed_overrides: + if override.is_hydra_override(): + cfg.hydra.overrides.hydra.append(override.input_line) + else: + cfg.hydra.overrides.task.append(override.input_line) + app_overrides.append(override) + + with open_dict(cfg.hydra): + cfg.hydra.runtime.choices.update(defaults_list.overrides.known_choices) + for key in cfg.hydra.job.env_copy: + cfg.hydra.job.env_set[key] = os.environ[key] + + cfg.hydra.runtime.version = __version__ + cfg.hydra.runtime.version_base = version.getbase() + cfg.hydra.runtime.cwd = os.getcwd() + + cfg.hydra.runtime.config_sources = [ + ConfigSourceInfo(path=x.path, schema=x.scheme(), provider=x.provider) + for x in caching_repo.get_sources() + ] + + if "name" not in cfg.hydra.job: + cfg.hydra.job.name = JobRuntime().get("name") + + cfg.hydra.job.override_dirname = get_overrides_dirname( + overrides=app_overrides, + kv_sep=cfg.hydra.job.config.override_dirname.kv_sep, + item_sep=cfg.hydra.job.config.override_dirname.item_sep, + exclude_keys=cfg.hydra.job.config.override_dirname.exclude_keys, + ) + cfg.hydra.job.config_name = config_name + + return cfg + + def load_sweep_config( + self, master_config: DictConfig, sweep_overrides: List[str] + ) -> DictConfig: + # Recreate the config for this sweep instance with the appropriate overrides + overrides = OmegaConf.to_container(master_config.hydra.overrides.hydra) + assert isinstance(overrides, list) + overrides = overrides + sweep_overrides + sweep_config = self.load_configuration( + config_name=master_config.hydra.job.config_name, + overrides=overrides, + run_mode=RunMode.RUN, + ) + + # Copy old config cache to ensure we get the same resolved values (for things + # like timestamps etc). Since `oc.env` does not cache environment variables + # (but the deprecated `env` resolver did), the entire config should be copied + OmegaConf.copy_cache(from_config=master_config, to_config=sweep_config) + + return sweep_config + + def get_search_path(self) -> ConfigSearchPath: + return self.config_search_path + + @staticmethod + def _apply_overrides_to_config(overrides: List[Override], cfg: DictConfig) -> None: + for override in overrides: + if override.package is not None: + raise ConfigCompositionException( + f"Override {override.input_line} looks like a config group" + f" override, but config group '{override.key_or_group}' does not" + " exist." + ) + + key = override.key_or_group + value = override.value() + try: + if override.is_delete(): + config_val = OmegaConf.select(cfg, key, throw_on_missing=False) + if config_val is None: + raise ConfigCompositionException( + f"Could not delete from config. '{override.key_or_group}'" + " does not exist." + ) + elif value is not None and value != config_val: + raise ConfigCompositionException( + "Could not delete from config. The value of" + f" '{override.key_or_group}' is {config_val} and not" + f" {value}." + ) + + last_dot = key.rfind(".") + with open_dict(cfg): + if last_dot == -1: + del cfg[key] + else: + node = OmegaConf.select(cfg, key[0:last_dot]) + del node[key[last_dot + 1 :]] + + elif override.is_add(): + if OmegaConf.select( + cfg, key, throw_on_missing=False + ) is None or isinstance(value, (dict, list)): + OmegaConf.update(cfg, key, value, merge=True, force_add=True) + else: + assert override.input_line is not None + raise ConfigCompositionException( + dedent( + f"""\ + Could not append to config. An item is already at '{override.key_or_group}'. + Either remove + prefix: '{override.input_line[1:]}' + Or add a second + to add or override '{override.key_or_group}': '+{override.input_line}' + """ + ) + ) + elif override.is_force_add(): + OmegaConf.update(cfg, key, value, merge=True, force_add=True) + else: + try: + OmegaConf.update(cfg, key, value, merge=True) + except (ConfigAttributeError, ConfigKeyError) as ex: + raise ConfigCompositionException( + f"Could not override '{override.key_or_group}'." + f"\nTo append to your config use +{override.input_line}" + ) from ex + except OmegaConfBaseException as ex: + raise ConfigCompositionException( + f"Error merging override {override.input_line}" + ).with_traceback(sys.exc_info()[2]) from ex + + def _load_single_config( + self, default: ResultDefault, repo: IConfigRepository + ) -> ConfigResult: + config_path = default.config_path + + assert config_path is not None + ret = repo.load_config(config_path=config_path) + assert ret is not None + + if not OmegaConf.is_config(ret.config): + raise ValueError( + f"Config {config_path} must be an OmegaConf config, got" + f" {type(ret.config).__name__}" + ) + + if not ret.is_schema_source: + schema = None + try: + schema_source = repo.get_schema_source() + cname = ConfigSource._normalize_file_name(filename=config_path) + schema = schema_source.load_config(cname) + except ConfigLoadError: + # schema not found, ignore + pass + + if schema is not None: + try: + url = "https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/automatic_schema_matching" + if "defaults" in schema.config: + raise ConfigCompositionException( + dedent( + f"""\ + '{config_path}' is validated against ConfigStore schema with the same name. + This behavior is deprecated in Hydra 1.1 and will be removed in Hydra 1.2. + In addition, the automatically matched schema contains a defaults list. + This combination is no longer supported. + See {url} for migration instructions.""" + ) + ) + else: + deprecation_warning( + dedent( + f"""\ + + '{config_path}' is validated against ConfigStore schema with the same name. + This behavior is deprecated in Hydra 1.1 and will be removed in Hydra 1.2. + See {url} for migration instructions.""" + ), + stacklevel=11, + ) + + # if primary config has a hydra node, remove it during validation and add it back. + # This allows overriding Hydra's configuration without declaring it's node + # in the schema of every primary config + hydra = None + hydra_config_group = ( + default.config_path is not None + and default.config_path.startswith("hydra/") + ) + config = ret.config + if ( + default.primary + and isinstance(config, DictConfig) + and "hydra" in config + and not hydra_config_group + ): + hydra = config.pop("hydra") + + merged = OmegaConf.merge(schema.config, config) + assert isinstance(merged, DictConfig) + + if hydra is not None: + with open_dict(merged): + merged.hydra = hydra + ret.config = merged + except OmegaConfBaseException as e: + raise ConfigCompositionException( + f"Error merging '{config_path}' with schema" + ) from e + + assert isinstance(merged, DictConfig) + + res = self._embed_result_config(ret, default.package) + if ( + not default.primary + and config_path != "hydra/config" + and isinstance(res.config, DictConfig) + and OmegaConf.select(res.config, "hydra.searchpath") is not None + ): + raise ConfigCompositionException( + f"In '{config_path}': Overriding hydra.searchpath is only supported" + " from the primary config" + ) + + return res + + @staticmethod + def _embed_result_config( + ret: ConfigResult, package_override: Optional[str] + ) -> ConfigResult: + package = ret.header["package"] + if package_override is not None: + package = package_override + + if package is not None and package != "": + cfg = OmegaConf.create() + OmegaConf.update(cfg, package, ret.config, merge=False) + ret = copy.copy(ret) + ret.config = cfg + + return ret + + def list_groups(self, parent_name: str) -> List[str]: + return self.get_group_options( + group_name=parent_name, results_filter=ObjectType.GROUP + ) + + def get_group_options( + self, + group_name: str, + results_filter: Optional[ObjectType] = ObjectType.CONFIG, + config_name: Optional[str] = None, + overrides: Optional[List[str]] = None, + ) -> List[str]: + if overrides is None: + overrides = [] + _, caching_repo = self._parse_overrides_and_create_caching_repo( + config_name, overrides + ) + return caching_repo.get_group_options(group_name, results_filter) + + def _compose_config_from_defaults_list( + self, + defaults: List[ResultDefault], + repo: IConfigRepository, + ) -> DictConfig: + cfg = OmegaConf.create() + with flag_override(cfg, "no_deepcopy_set_nodes", True): + for default in defaults: + loaded = self._load_single_config(default=default, repo=repo) + try: + cfg.merge_with(loaded.config) + except OmegaConfBaseException as e: + raise ConfigCompositionException( + f"In '{default.config_path}': {type(e).__name__} raised while" + f" composing config:\n{e}" + ).with_traceback(sys.exc_info()[2]) + + # # remove remaining defaults lists from all nodes. + def strip_defaults(cfg: Any) -> None: + if isinstance(cfg, DictConfig): + if cfg._is_missing() or cfg._is_none(): + return + with flag_override(cfg, ["readonly", "struct"], False): + if cfg._get_flag("HYDRA_REMOVE_TOP_LEVEL_DEFAULTS"): + cfg._set_flag("HYDRA_REMOVE_TOP_LEVEL_DEFAULTS", None) + cfg.pop("defaults", None) + + for _key, value in cfg.items_ex(resolve=False): + strip_defaults(value) + + strip_defaults(cfg) + + return cfg + + def get_sources(self) -> List[ConfigSource]: + return self.repository.get_sources() + + def compute_defaults_list( + self, + config_name: Optional[str], + overrides: List[str], + run_mode: RunMode, + ) -> DefaultsList: + parsed_overrides, caching_repo = self._parse_overrides_and_create_caching_repo( + config_name, overrides + ) + defaults_list = create_defaults_list( + repo=caching_repo, + config_name=config_name, + overrides_list=parsed_overrides, + prepend_hydra=True, + skip_missing=run_mode == RunMode.MULTIRUN, + ) + return defaults_list + + +def get_overrides_dirname( + overrides: List[Override], exclude_keys: List[str], item_sep: str, kv_sep: str +) -> str: + lines = [] + for override in overrides: + if override.key_or_group not in exclude_keys: + line = override.input_line + assert line is not None + lines.append(line) + + lines.sort() + ret = re.sub(pattern="[=]", repl=kv_sep, string=item_sep.join(lines)) + return ret diff --git a/lib/python3.12/site-packages/hydra/_internal/config_repository.py b/lib/python3.12/site-packages/hydra/_internal/config_repository.py new file mode 100644 index 0000000000000000000000000000000000000000..3beb5e43238bf0656e9abd79a02ea0c59d7af338 --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/config_repository.py @@ -0,0 +1,366 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import copy +from abc import ABC, abstractmethod +from dataclasses import dataclass +from textwrap import dedent +from typing import Dict, List, Optional, Tuple + +from omegaconf import ( + Container, + DictConfig, + ListConfig, + Node, + OmegaConf, + open_dict, + read_write, +) + +from hydra import version +from hydra.core.config_search_path import ConfigSearchPath +from hydra.core.object_type import ObjectType +from hydra.plugins.config_source import ConfigResult, ConfigSource + +from ..core.default_element import ConfigDefault, GroupDefault, InputDefault +from .deprecation_warning import deprecation_warning +from .sources_registry import SourcesRegistry + + +class IConfigRepository(ABC): + @abstractmethod + def get_schema_source(self) -> ConfigSource: + ... + + @abstractmethod + def load_config(self, config_path: str) -> Optional[ConfigResult]: + ... + + @abstractmethod + def group_exists(self, config_path: str) -> bool: + ... + + @abstractmethod + def config_exists(self, config_path: str) -> bool: + ... + + @abstractmethod + def get_group_options( + self, group_name: str, results_filter: Optional[ObjectType] = ObjectType.CONFIG + ) -> List[str]: + ... + + @abstractmethod + def get_sources(self) -> List[ConfigSource]: + ... + + @abstractmethod + def initialize_sources(self, config_search_path: ConfigSearchPath) -> None: + ... + + +class ConfigRepository(IConfigRepository): + config_search_path: ConfigSearchPath + sources: List[ConfigSource] + + def __init__(self, config_search_path: ConfigSearchPath) -> None: + self.initialize_sources(config_search_path) + + def initialize_sources(self, config_search_path: ConfigSearchPath) -> None: + self.sources = [] + for search_path in config_search_path.get_path(): + assert search_path.path is not None + assert search_path.provider is not None + scheme = self._get_scheme(search_path.path) + source_type = SourcesRegistry.instance().resolve(scheme) + source = source_type(search_path.provider, search_path.path) + self.sources.append(source) + + def get_schema_source(self) -> ConfigSource: + source = self.sources[-1] # should always be last + assert ( + source.__class__.__name__ == "StructuredConfigSource" + and source.provider == "schema" + ), "schema config source must be last" + return source + + def load_config(self, config_path: str) -> Optional[ConfigResult]: + source = self._find_object_source( + config_path=config_path, object_type=ObjectType.CONFIG + ) + ret = None + if source is not None: + ret = source.load_config(config_path=config_path) + # if this source is THE schema source, flag the result as coming from it. + ret.is_schema_source = ( + source.__class__.__name__ == "StructuredConfigSource" + and source.provider == "schema" + ) + + if ret is not None: + raw_defaults = self._extract_defaults_list(config_path, ret.config) + ret.defaults_list = self._create_defaults_list(config_path, raw_defaults) + + return ret + + def group_exists(self, config_path: str) -> bool: + return self._find_object_source(config_path, ObjectType.GROUP) is not None + + def config_exists(self, config_path: str) -> bool: + return self._find_object_source(config_path, ObjectType.CONFIG) is not None + + def get_group_options( + self, group_name: str, results_filter: Optional[ObjectType] = ObjectType.CONFIG + ) -> List[str]: + options: List[str] = [] + for source in self.sources: + if source.is_group(config_path=group_name): + options.extend( + source.list(config_path=group_name, results_filter=results_filter) + ) + return sorted(list(set(options))) + + def get_sources(self) -> List[ConfigSource]: + return self.sources + + def _find_object_source( + self, config_path: str, object_type: Optional[ObjectType] + ) -> Optional[ConfigSource]: + found_source = None + for source in self.sources: + if object_type == ObjectType.CONFIG: + if source.is_config(config_path): + found_source = source + break + elif object_type == ObjectType.GROUP: + if source.is_group(config_path): + found_source = source + break + else: + raise ValueError("Unexpected object_type") + return found_source + + @staticmethod + def _get_scheme(path: str) -> str: + idx = path.find("://") + if idx == -1: + return "file" + else: + return path[0:idx] + + def _split_group( + self, + group_with_package: str, + ) -> Tuple[str, Optional[str], Optional[str]]: + idx = group_with_package.find("@") + if idx == -1: + # group + group = group_with_package + package = None + else: + # group@package + group = group_with_package[0:idx] + package = group_with_package[idx + 1 :] + + package2 = None + if package is not None: + # if we have a package, break it down if it's a rename + idx = package.find(":") + if idx != -1: + package2 = package[idx + 1 :] + package = package[0:idx] + + return group, package, package2 + + def _create_defaults_list( + self, + config_path: str, + defaults: ListConfig, + ) -> List[InputDefault]: + def issue_deprecated_name_warning() -> None: + # DEPRECATED: remove in 1.2 + url = "https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header" + deprecation_warning( + message=dedent( + f"""\ + In {config_path}: Defaults List contains deprecated keyword _name_, see {url} + """ + ), + ) + + res: List[InputDefault] = [] + for item in defaults._iter_ex(resolve=False): + default: InputDefault + if isinstance(item, DictConfig): + if not version.base_at_least("1.2"): + old_optional = None + if len(item) > 1: + if "optional" in item: + old_optional = item.pop("optional") + keys = list(item.keys()) + + if len(keys) > 1: + raise ValueError( + f"In {config_path}: Too many keys in default item {item}" + ) + if len(keys) == 0: + raise ValueError(f"In {config_path}: Missing group name in {item}") + + key = keys[0] + assert isinstance(key, str) + config_group, package, _package2 = self._split_group(key) + keywords = ConfigRepository.Keywords() + self._extract_keywords_from_config_group(config_group, keywords) + + if not version.base_at_least("1.2"): + if not keywords.optional and old_optional is not None: + keywords.optional = old_optional + + node = item._get_node(key) + assert node is not None and isinstance(node, Node) + config_value = node._value() + + if not version.base_at_least("1.2"): + if old_optional is not None: + msg = dedent( + f""" + In {config_path}: 'optional: true' is deprecated. + Use 'optional {key}: {config_value}' instead. + Support for the old style is removed for Hydra version_base >= 1.2""" + ) + + deprecation_warning(msg) + + if config_value is not None and not isinstance( + config_value, (str, list) + ): + raise ValueError( + f"Unsupported item value in defaults : {type(config_value).__name__}." + " Supported: string or list" + ) + + if isinstance(config_value, list): + options = [] + for v in config_value: + vv = v._value() + if not isinstance(vv, str): + raise ValueError( + f"Unsupported item value in defaults : {type(vv).__name__}," + " nested list items must be strings" + ) + options.append(vv) + config_value = options + + if not version.base_at_least("1.2"): + if package is not None and "_name_" in package: + issue_deprecated_name_warning() + + default = GroupDefault( + group=keywords.group, + value=config_value, + package=package, + optional=keywords.optional, + override=keywords.override, + ) + + elif isinstance(item, str): + path, package, _package2 = self._split_group(item) + if not version.base_at_least("1.2"): + if package is not None and "_name_" in package: + issue_deprecated_name_warning() + + default = ConfigDefault(path=path, package=package) + else: + raise ValueError( + f"Unsupported type in defaults : {type(item).__name__}" + ) + res.append(default) + return res + + def _extract_defaults_list(self, config_path: str, cfg: Container) -> ListConfig: + empty = OmegaConf.create([]) + if not OmegaConf.is_dict(cfg): + return empty + assert isinstance(cfg, DictConfig) + with read_write(cfg): + with open_dict(cfg): + if not cfg._is_typed(): + defaults = cfg.pop("defaults", empty) + else: + # If node is a backed by Structured Config, flag it and temporarily keep the defaults list in. + # It will be removed later. + # This is addressing an edge case where the defaults list re-appears once the dataclass is used + # as a prototype during OmegaConf merge. + cfg._set_flag("HYDRA_REMOVE_TOP_LEVEL_DEFAULTS", True) + defaults = cfg.get("defaults", empty) + if not isinstance(defaults, ListConfig): + if isinstance(defaults, DictConfig): + type_str = "mapping" + else: + type_str = type(defaults).__name__ + raise ValueError( + f"Invalid defaults list in '{config_path}', defaults must be a list (got {type_str})" + ) + + return defaults + + @dataclass + class Keywords: + optional: bool = False + override: bool = False + group: str = "" + + @staticmethod + def _extract_keywords_from_config_group( + group: str, keywords: "ConfigRepository.Keywords" + ) -> None: + elements = group.split(" ") + group = elements[-1] + elements = elements[0:-1] + for idx, e in enumerate(elements): + if e == "optional": + keywords.optional = True + elif e == "override": + keywords.override = True + else: + break + keywords.group = group + + +class CachingConfigRepository(IConfigRepository): + def __init__(self, delegate: IConfigRepository): + # copy the underlying repository to avoid mutating it with initialize_sources() + self.delegate = copy.deepcopy(delegate) + self.cache: Dict[str, Optional[ConfigResult]] = {} + + def get_schema_source(self) -> ConfigSource: + return self.delegate.get_schema_source() + + def initialize_sources(self, config_search_path: ConfigSearchPath) -> None: + self.delegate.initialize_sources(config_search_path) + # not clearing the cache. + # For the use case this is used, the only thing in the cache is the primary config + # and we want to keep it even though we re-initialized the sources. + + def load_config(self, config_path: str) -> Optional[ConfigResult]: + cache_key = f"config_path={config_path}" + if cache_key in self.cache: + return self.cache[cache_key] + else: + ret = self.delegate.load_config(config_path=config_path) + self.cache[cache_key] = ret + return ret + + def group_exists(self, config_path: str) -> bool: + return self.delegate.group_exists(config_path=config_path) + + def config_exists(self, config_path: str) -> bool: + return self.delegate.config_exists(config_path=config_path) + + def get_group_options( + self, group_name: str, results_filter: Optional[ObjectType] = ObjectType.CONFIG + ) -> List[str]: + return self.delegate.get_group_options( + group_name=group_name, results_filter=results_filter + ) + + def get_sources(self) -> List[ConfigSource]: + return self.delegate.get_sources() diff --git a/lib/python3.12/site-packages/hydra/_internal/config_search_path_impl.py b/lib/python3.12/site-packages/hydra/_internal/config_search_path_impl.py new file mode 100644 index 0000000000000000000000000000000000000000..d0d7131f476866b0607656444b058393cb29c7d0 --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/config_search_path_impl.py @@ -0,0 +1,98 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +from typing import List, MutableSequence, Optional, Union + +from hydra.core.config_search_path import ( + ConfigSearchPath, + SearchPathElement, + SearchPathQuery, +) + + +class ConfigSearchPathImpl(ConfigSearchPath): + config_search_path: List[SearchPathElement] + + def __init__(self) -> None: + self.config_search_path = [] + + def get_path(self) -> MutableSequence[SearchPathElement]: + return self.config_search_path + + def find_last_match(self, reference: SearchPathQuery) -> int: + return self.find_match(reference, reverse=True) + + def find_first_match(self, reference: SearchPathQuery) -> int: + return self.find_match(reference, reverse=False) + + def find_match(self, reference: SearchPathQuery, reverse: bool) -> int: + p = self.config_search_path + if reverse: + iterator = zip(reversed(range(len(p))), reversed(p)) + else: + iterator = zip(range(len(p)), p) + for idx, sp in iterator: + has_prov = reference.provider is not None + has_path = reference.path is not None + if has_prov and has_path: + if reference.provider == sp.provider and reference.path == sp.path: + return idx + elif has_prov: + if reference.provider == sp.provider: + return idx + elif has_path: + if reference.path == sp.path: + return idx + else: + assert False + return -1 + + def append( + self, provider: str, path: str, anchor: Optional[SearchPathQuery] = None + ) -> None: + if anchor is None: + self.config_search_path.append(SearchPathElement(provider, path)) + else: + if isinstance(anchor, str): + anchor = SearchPathQuery(anchor, None) + + idx = self.find_last_match(anchor) + if idx != -1: + self.config_search_path.insert( + idx + 1, SearchPathElement(provider, path) + ) + else: + self.append(provider, path, anchor=None) + + def prepend( + self, + provider: str, + path: str, + anchor: Optional[Union[SearchPathQuery, str]] = None, + ) -> None: + """ + Prepends to the search path. + Note, this currently only takes effect if called before the ConfigRepository is instantiated. + + :param provider: who is providing this search path, can be Hydra, + the @hydra.main() function, or individual plugins or libraries. + :param path: path element, can be a file system path or a package path (For example pkg://hydra.conf) + :param anchor: if string, acts as provider. if SearchPath can be used to match against provider and / or path + """ + if anchor is None: + self.config_search_path.insert(0, SearchPathElement(provider, path)) + else: + if isinstance(anchor, str): + anchor = SearchPathQuery(anchor, None) + + idx = self.find_first_match(anchor) + if idx != -1: + if idx > 0: + self.config_search_path.insert( + idx, SearchPathElement(provider, path) + ) + else: + self.prepend(provider, path, None) + else: + self.prepend(provider, path, None) + + def __str__(self) -> str: + return str(self.config_search_path) diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/__init__.py b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..168f9979a4623806934b0ff1102ac166704e7dec --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__init__.py @@ -0,0 +1 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/__init__.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b216d2163221e6c58e7c710b360761929ace431f Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/__init__.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/bash_completion.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/bash_completion.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..19234046dc1d81a48e401510c1ca0a39ca506f3d Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/bash_completion.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/basic_launcher.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/basic_launcher.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd9a71da9492169f1e916958942c6d40095f99a2 Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/basic_launcher.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/basic_sweeper.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/basic_sweeper.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a1ff32bd7e2ebe8fe3710b7039d070a29ed0723 Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/basic_sweeper.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/file_config_source.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/file_config_source.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fea9498ace855508669701f76c0db5e61ecf8f72 Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/file_config_source.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/fish_completion.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/fish_completion.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1cc55474bd7ea78aa26ddd6d0e2883cd4416f864 Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/fish_completion.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/importlib_resources_config_source.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/importlib_resources_config_source.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e436f5b2a054f7d50d4e7a6be954886acd38bcfa Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/importlib_resources_config_source.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/structured_config_source.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/structured_config_source.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..382958dfc97e01af3e172e8f3ce7e8744c81e55c Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/structured_config_source.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/zsh_completion.cpython-312.pyc b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/zsh_completion.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..054d53ffcbc398c5f4f01a253ae1516ba2969b3a Binary files /dev/null and b/lib/python3.12/site-packages/hydra/_internal/core_plugins/__pycache__/zsh_completion.cpython-312.pyc differ diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/bash_completion.py b/lib/python3.12/site-packages/hydra/_internal/core_plugins/bash_completion.py new file mode 100644 index 0000000000000000000000000000000000000000..6e59ac5db9a32ec6901f4a11fbcd2206b33c1b52 --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/core_plugins/bash_completion.py @@ -0,0 +1,98 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import logging +import os +import sys +from typing import Optional + +from hydra.plugins.completion_plugin import CompletionPlugin + +log = logging.getLogger(__name__) + + +class BashCompletion(CompletionPlugin): + def install(self) -> None: + # Record the old rule for uninstalling + script = ( + f"export _HYDRA_OLD_COMP=$(complete -p {self._get_exec()} 2> /dev/null)\n" + ) + script += """hydra_bash_completion() +{ + words=($COMP_LINE) + if [ "${words[0]}" == "python" ]; then + if (( ${#words[@]} < 2 )); then + return + fi + file_path=$(pwd)/${words[1]} + if [ ! -f "$file_path" ]; then + return + fi + grep "@hydra.main" $file_path -q + helper="${words[0]} ${words[1]}" + else + helper="${words[0]}" + true + fi + + EXECUTABLE=($(command -v $helper)) + if [ "$HYDRA_COMP_DEBUG" == "1" ]; then + printf "EXECUTABLE_FIRST='${EXECUTABLE[0]}'\\n" + fi + if ! [ -x "${EXECUTABLE[0]}" ]; then + false + fi + + if [ $? == 0 ]; then + choices=$( COMP_POINT=$COMP_POINT COMP_LINE=$COMP_LINE $helper -sc query=bash) + word=${words[$COMP_CWORD]} + + if [ "$HYDRA_COMP_DEBUG" == "1" ]; then + printf "\\n" + printf "COMP_LINE='$COMP_LINE'\\n" + printf "COMP_POINT='$COMP_POINT'\\n" + printf "Word='$word'\\n" + printf "Output suggestions:\\n" + printf "\\t%s\\n" ${choices[@]} + fi + COMPREPLY=($( compgen -o nospace -o default -W "$choices" -- "$word" )); + fi +} + +COMP_WORDBREAKS=${COMP_WORDBREAKS//=} +COMP_WORDBREAKS=$COMP_WORDBREAKS complete -o nospace -o default -F hydra_bash_completion """ + print(script + self._get_exec()) + + def uninstall(self) -> None: + print("unset hydra_bash_completion") + print(os.environ.get("_HYDRA_OLD_COMP", "")) + print("unset _HYDRA_OLD_COMP") + + @staticmethod + def provides() -> str: + return "bash" + + def query(self, config_name: Optional[str]) -> None: + line = os.environ["COMP_LINE"] + # key = os.environ["COMP_POINT "] if "COMP_POINT " in os.environ else len(line) + + # if key == "": + # key = 0 + # if isinstance(key, str): + # key = int(key) + + # currently key is ignored. + line = self.strip_python_or_app_name(line) + print(" ".join(self._query(config_name=config_name, line=line))) + + @staticmethod + def help(command: str) -> str: + assert command in ["install", "uninstall"] + return f'eval "$({{}} -sc {command}=bash)"' + + @staticmethod + def _get_exec() -> str: + if sys.argv[0].endswith(".py"): + return "python" + else: + # Running as an installed app (setuptools entry point) + executable = os.path.basename(sys.argv[0]) + return executable diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/basic_launcher.py b/lib/python3.12/site-packages/hydra/_internal/core_plugins/basic_launcher.py new file mode 100644 index 0000000000000000000000000000000000000000..af1c3493282c90e34b14df2ca961de7888d7e7b8 --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/core_plugins/basic_launcher.py @@ -0,0 +1,83 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import logging +from dataclasses import dataclass +from pathlib import Path +from typing import List, Optional, Sequence + +from omegaconf import DictConfig, open_dict + +from hydra.core.config_store import ConfigStore +from hydra.core.utils import ( + JobReturn, + configure_log, + filter_overrides, + run_job, + setup_globals, +) +from hydra.plugins.launcher import Launcher +from hydra.types import HydraContext, TaskFunction + +log = logging.getLogger(__name__) + + +@dataclass +class BasicLauncherConf: + _target_: str = "hydra._internal.core_plugins.basic_launcher.BasicLauncher" + + +ConfigStore.instance().store( + group="hydra/launcher", name="basic", node=BasicLauncherConf, provider="hydra" +) + + +class BasicLauncher(Launcher): + def __init__(self) -> None: + super().__init__() + self.config: Optional[DictConfig] = None + self.task_function: Optional[TaskFunction] = None + self.hydra_context: Optional[HydraContext] = None + + def setup( + self, + *, + hydra_context: HydraContext, + task_function: TaskFunction, + config: DictConfig, + ) -> None: + self.config = config + self.hydra_context = hydra_context + self.task_function = task_function + + def launch( + self, job_overrides: Sequence[Sequence[str]], initial_job_idx: int + ) -> Sequence[JobReturn]: + setup_globals() + assert self.hydra_context is not None + assert self.config is not None + assert self.task_function is not None + + configure_log(self.config.hydra.hydra_logging, self.config.hydra.verbose) + sweep_dir = self.config.hydra.sweep.dir + Path(str(sweep_dir)).mkdir(parents=True, exist_ok=True) + log.info(f"Launching {len(job_overrides)} jobs locally") + runs: List[JobReturn] = [] + for idx, overrides in enumerate(job_overrides): + idx = initial_job_idx + idx + lst = " ".join(filter_overrides(overrides)) + log.info(f"\t#{idx} : {lst}") + sweep_config = self.hydra_context.config_loader.load_sweep_config( + self.config, list(overrides) + ) + with open_dict(sweep_config): + sweep_config.hydra.job.id = idx + sweep_config.hydra.job.num = idx + ret = run_job( + hydra_context=self.hydra_context, + task_function=self.task_function, + config=sweep_config, + job_dir_key="hydra.sweep.dir", + job_subdir_key="hydra.sweep.subdir", + ) + runs.append(ret) + configure_log(self.config.hydra.hydra_logging, self.config.hydra.verbose) + return runs diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/basic_sweeper.py b/lib/python3.12/site-packages/hydra/_internal/core_plugins/basic_sweeper.py new file mode 100644 index 0000000000000000000000000000000000000000..afa2b506045c0fadd0bf9dbc5727227217bb8f3b --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/core_plugins/basic_sweeper.py @@ -0,0 +1,199 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +""" +Basic sweeper can generate cartesian products of multiple input commands, each with a +comma separated list of values. +for example, for: +python foo.py a=1,2,3 b=10,20 +Basic Sweeper would generate 6 jobs: +1,10 +1,20 +2,10 +2,20 +3,10 +3,20 + +The Basic Sweeper also support, the following is equivalent to the above. +python foo.py a=range(1,4) b=10,20 +""" +import itertools +import logging +import time +from collections import OrderedDict +from dataclasses import dataclass +from pathlib import Path +from typing import Any, Dict, Iterable, List, Optional, Sequence + +from omegaconf import DictConfig, OmegaConf + +from hydra.core.config_store import ConfigStore +from hydra.core.override_parser.overrides_parser import OverridesParser +from hydra.core.override_parser.types import Override +from hydra.core.utils import JobReturn +from hydra.errors import HydraException +from hydra.plugins.launcher import Launcher +from hydra.plugins.sweeper import Sweeper +from hydra.types import HydraContext, TaskFunction + + +@dataclass +class BasicSweeperConf: + _target_: str = "hydra._internal.core_plugins.basic_sweeper.BasicSweeper" + max_batch_size: Optional[int] = None + params: Optional[Dict[str, str]] = None + + +ConfigStore.instance().store( + group="hydra/sweeper", name="basic", node=BasicSweeperConf, provider="hydra" +) + + +log = logging.getLogger(__name__) + + +class BasicSweeper(Sweeper): + """ + Basic sweeper + """ + + def __init__( + self, max_batch_size: Optional[int], params: Optional[Dict[str, str]] = None + ) -> None: + """ + Instantiates + """ + super(BasicSweeper, self).__init__() + + if params is None: + params = {} + self.overrides: Optional[Sequence[Sequence[Sequence[str]]]] = None + self.batch_index = 0 + self.max_batch_size = max_batch_size + self.params = params + + self.hydra_context: Optional[HydraContext] = None + self.config: Optional[DictConfig] = None + self.launcher: Optional[Launcher] = None + + def setup( + self, + *, + hydra_context: HydraContext, + task_function: TaskFunction, + config: DictConfig, + ) -> None: + from hydra.core.plugins import Plugins + + self.hydra_context = hydra_context + self.config = config + + self.launcher = Plugins.instance().instantiate_launcher( + hydra_context=hydra_context, + task_function=task_function, + config=config, + ) + + @staticmethod + def split_overrides_to_chunks( + lst: List[List[str]], n: Optional[int] + ) -> Iterable[List[List[str]]]: + if n is None or n == -1: + n = len(lst) + assert n > 0 + for i in range(0, len(lst), n): + yield lst[i : i + n] + + @staticmethod + def split_arguments( + overrides: List[Override], max_batch_size: Optional[int] + ) -> List[List[List[str]]]: + lists = [] + final_overrides = OrderedDict() + for override in overrides: + if override.is_sweep_override(): + if override.is_discrete_sweep(): + key = override.get_key_element() + sweep = [f"{key}={val}" for val in override.sweep_string_iterator()] + final_overrides[key] = sweep + else: + assert override.value_type is not None + raise HydraException( + f"{BasicSweeper.__name__} does not support sweep type : {override.value_type.name}" + ) + else: + key = override.get_key_element() + value = override.get_value_element_as_str() + final_overrides[key] = [f"{key}={value}"] + + for _, v in final_overrides.items(): + lists.append(v) + + all_batches = [list(x) for x in itertools.product(*lists)] + assert max_batch_size is None or max_batch_size > 0 + if max_batch_size is None: + return [all_batches] + else: + chunks_iter = BasicSweeper.split_overrides_to_chunks( + all_batches, max_batch_size + ) + return [x for x in chunks_iter] + + def _parse_config(self) -> List[str]: + params_conf = [] + for k, v in self.params.items(): + params_conf.append(f"{k}={v}") + return params_conf + + def sweep(self, arguments: List[str]) -> Any: + assert self.config is not None + assert self.launcher is not None + assert self.hydra_context is not None + + params_conf = self._parse_config() + params_conf.extend(arguments) + + parser = OverridesParser.create(config_loader=self.hydra_context.config_loader) + overrides = parser.parse_overrides(params_conf) + + self.overrides = self.split_arguments(overrides, self.max_batch_size) + returns: List[Sequence[JobReturn]] = [] + + # Save sweep run config in top level sweep working directory + sweep_dir = Path(self.config.hydra.sweep.dir) + sweep_dir.mkdir(parents=True, exist_ok=True) + OmegaConf.save(self.config, sweep_dir / "multirun.yaml") + + initial_job_idx = 0 + while not self.is_done(): + batch = self.get_job_batch() + tic = time.perf_counter() + # Validate that jobs can be safely composed. This catches composition errors early. + # This can be a bit slow for large jobs. can potentially allow disabling from the config. + self.validate_batch_is_legal(batch) + elapsed = time.perf_counter() - tic + log.debug( + f"Validated configs of {len(batch)} jobs in {elapsed:0.2f} seconds, {len(batch)/elapsed:.2f} / second)" + ) + results = self.launcher.launch(batch, initial_job_idx=initial_job_idx) + + for r in results: + # access the result to trigger an exception in case the job failed. + _ = r.return_value + + initial_job_idx += len(batch) + returns.append(results) + + return returns + + def get_job_batch(self) -> Sequence[Sequence[str]]: + """ + :return: A list of lists of strings, each inner list is the overrides for a single job + that should be executed. + """ + assert self.overrides is not None + self.batch_index += 1 + return self.overrides[self.batch_index - 1] + + def is_done(self) -> bool: + assert self.overrides is not None + return self.batch_index >= len(self.overrides) diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/file_config_source.py b/lib/python3.12/site-packages/hydra/_internal/core_plugins/file_config_source.py new file mode 100644 index 0000000000000000000000000000000000000000..c630555a08fed4fe975871940143e75dbbc0026f --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/core_plugins/file_config_source.py @@ -0,0 +1,63 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import os +from typing import List, Optional + +from omegaconf import OmegaConf + +from hydra.core.object_type import ObjectType +from hydra.plugins.config_source import ConfigLoadError, ConfigResult, ConfigSource + + +class FileConfigSource(ConfigSource): + def __init__(self, provider: str, path: str) -> None: + if path.find("://") == -1: + path = f"{self.scheme()}://{path}" + super().__init__(provider=provider, path=path) + + @staticmethod + def scheme() -> str: + return "file" + + def load_config(self, config_path: str) -> ConfigResult: + normalized_config_path = self._normalize_file_name(config_path) + full_path = os.path.realpath(os.path.join(self.path, normalized_config_path)) + if not os.path.exists(full_path): + raise ConfigLoadError(f"Config not found : {full_path}") + + with open(full_path, encoding="utf-8") as f: + header_text = f.read(512) + header = ConfigSource._get_header_dict(header_text) + f.seek(0) + cfg = OmegaConf.load(f) + return ConfigResult( + config=cfg, + path=f"{self.scheme()}://{self.path}", + provider=self.provider, + header=header, + ) + + def available(self) -> bool: + return self.is_group("") + + def is_group(self, config_path: str) -> bool: + full_path = os.path.realpath(os.path.join(self.path, config_path)) + return os.path.isdir(full_path) + + def is_config(self, config_path: str) -> bool: + config_path = self._normalize_file_name(config_path) + full_path = os.path.realpath(os.path.join(self.path, config_path)) + return os.path.isfile(full_path) + + def list(self, config_path: str, results_filter: Optional[ObjectType]) -> List[str]: + files: List[str] = [] + full_path = os.path.realpath(os.path.join(self.path, config_path)) + for file in os.listdir(full_path): + file_path = os.path.join(config_path, file) + self._list_add_result( + files=files, + file_path=file_path, + file_name=file, + results_filter=results_filter, + ) + + return sorted(list(set(files))) diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/fish_completion.py b/lib/python3.12/site-packages/hydra/_internal/core_plugins/fish_completion.py new file mode 100644 index 0000000000000000000000000000000000000000..96b0ca5d92f50e09bded437e721cb487bc6a7378 --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/core_plugins/fish_completion.py @@ -0,0 +1,81 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import logging +import os +import sys +from typing import List, Optional, Tuple + +from hydra.plugins.completion_plugin import CompletionPlugin + +log = logging.getLogger(__name__) + + +class FishCompletion(CompletionPlugin): + def install(self) -> None: + script = """function hydra_fish_completion + # Hydra will access COMP_LINE to generate completion candidates + set -lx COMP_LINE (commandline -cp) + + # Find out how to call the underlying script + set -l parts (commandline -cpo) + if test "$parts[1]" = "python" -o "$parts[1]" = "python3" + set cmd "$parts[1] $parts[2]" + if not grep -q "@hydra.main" $parts[2] + return + end + else + set cmd "$parts[1]" + end + + # Generate candidates + eval "$cmd -sc query=fish" +end + """ + output = self._get_exec() + reg_cmd = [] + for name, cond in output: + reg_cmd.append( + f"complete -c {name} {cond}-x -a '(hydra_fish_completion)'\n" + ) + print(script) + print("".join(reg_cmd)) + + def uninstall(self) -> None: + name = self._get_uninstall_exec() + print(f"complete -e -c {name}") + print("function hydra_fish_completion\nend") + + @staticmethod + def provides() -> str: + return "fish" + + def query(self, config_name: Optional[str]) -> None: + line = os.environ["COMP_LINE"] + line = self.strip_python_or_app_name(line) + print("\n".join(self._query(config_name=config_name, line=line))) + + @staticmethod + def help(command: str) -> str: + assert command in ["install", "uninstall"] + return f"{{}} -sc {command}=fish | source" + + @staticmethod + def _get_exec() -> List[Tuple[str, str]]: + # Running as an installed app (setuptools entry point) + output = [] + # User scenario 1: python script.py + name = os.path.basename(sys.executable) + cond = f"-n '__fish_seen_subcommand_from {sys.argv[0]}' " + output.append((name, cond)) + + # User scenario 2: ./script.py or src/script.py or script.py + name = os.path.basename(sys.argv[0]) + cond = "" + output.append((name, cond)) + + return output + + @staticmethod + def _get_uninstall_exec() -> str: + name = os.path.basename(sys.argv[0]) + + return name diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/importlib_resources_config_source.py b/lib/python3.12/site-packages/hydra/_internal/core_plugins/importlib_resources_config_source.py new file mode 100644 index 0000000000000000000000000000000000000000..efd894bfc3b939e7ce0fa909030d3724afb05cbc --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/core_plugins/importlib_resources_config_source.py @@ -0,0 +1,103 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import os +import sys +import zipfile +from typing import TYPE_CHECKING, Any, List, Optional + +from omegaconf import OmegaConf + +from hydra.core.object_type import ObjectType +from hydra.plugins.config_source import ConfigLoadError, ConfigResult, ConfigSource + +if TYPE_CHECKING or (sys.version_info < (3, 9)): + import importlib_resources as resources +else: + from importlib import resources + + # Relevant issue: https://github.com/python/mypy/issues/1153 + # Use importlib backport for Python older than 3.9 + + +class ImportlibResourcesConfigSource(ConfigSource): + def __init__(self, provider: str, path: str) -> None: + super().__init__(provider=provider, path=path) + # normalize to pkg format + self.path = self.path.replace("/", ".").rstrip(".") + + @staticmethod + def scheme() -> str: + return "pkg" + + def _read_config(self, res: Any) -> ConfigResult: + try: + if sys.version_info[0:2] >= (3, 8) and isinstance(res, zipfile.Path): + # zipfile does not support encoding, read() calls returns bytes. + f = res.open() + else: + f = res.open(encoding="utf-8") + header_text = f.read(512) + if isinstance(header_text, bytes): + # if header is bytes, utf-8 decode (zipfile path) + header_text = header_text.decode("utf-8") + header = ConfigSource._get_header_dict(header_text) + f.seek(0) + cfg = OmegaConf.load(f) + return ConfigResult( + config=cfg, + path=f"{self.scheme()}://{self.path}", + provider=self.provider, + header=header, + ) + finally: + f.close() + + def load_config(self, config_path: str) -> ConfigResult: + normalized_config_path = self._normalize_file_name(config_path) + res = resources.files(self.path).joinpath(normalized_config_path) + if not res.exists(): + raise ConfigLoadError(f"Config not found : {normalized_config_path}") + + return self._read_config(res) + + def available(self) -> bool: + try: + files = resources.files(self.path) + except (ValueError, ModuleNotFoundError, TypeError): + return False + return any(f.name == "__init__.py" and f.is_file() for f in files.iterdir()) + + def is_group(self, config_path: str) -> bool: + try: + files = resources.files(self.path) + except (ValueError, ModuleNotFoundError, TypeError): + return False + + res = files.joinpath(config_path) + ret = res.exists() and res.is_dir() + assert isinstance(ret, bool) + return ret + + def is_config(self, config_path: str) -> bool: + config_path = self._normalize_file_name(config_path) + try: + files = resources.files(self.path) + except (ValueError, ModuleNotFoundError, TypeError): + return False + res = files.joinpath(config_path) + ret = res.exists() and res.is_file() + assert isinstance(ret, bool) + return ret + + def list(self, config_path: str, results_filter: Optional[ObjectType]) -> List[str]: + files: List[str] = [] + for file in resources.files(self.path).joinpath(config_path).iterdir(): + fname = file.name + fpath = os.path.join(config_path, fname) + self._list_add_result( + files=files, + file_path=fpath, + file_name=fname, + results_filter=results_filter, + ) + + return sorted(list(set(files))) diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/structured_config_source.py b/lib/python3.12/site-packages/hydra/_internal/core_plugins/structured_config_source.py new file mode 100644 index 0000000000000000000000000000000000000000..1817032b4088628c91afe50007cdcf805d7b431c --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/core_plugins/structured_config_source.py @@ -0,0 +1,66 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import importlib +import warnings +from typing import List, Optional + +from hydra.core.config_store import ConfigStore +from hydra.core.object_type import ObjectType +from hydra.plugins.config_source import ConfigResult, ConfigSource + + +class StructuredConfigSource(ConfigSource): + store: ConfigStore + + def __init__(self, provider: str, path: str) -> None: + super().__init__(provider=provider, path=path) + # Import the module, the __init__ there is expected to register the configs. + self.store = ConfigStore.instance() + if self.path != "": + try: + importlib.import_module(self.path) + except Exception as e: + warnings.warn( + f"Error importing {self.path} : some configs may not be available\n\n\tRoot cause: {e}\n" + ) + raise e + + @staticmethod + def scheme() -> str: + return "structured" + + def load_config(self, config_path: str) -> ConfigResult: + normalized_config_path = self._normalize_file_name(config_path) + ret = self.store.load(config_path=normalized_config_path) + provider = ret.provider if ret.provider is not None else self.provider + header = {"package": ret.package} + return ConfigResult( + config=ret.node, + path=f"{self.scheme()}://{self.path}", + provider=provider, + header=header, + ) + + def available(self) -> bool: + return True + + def is_group(self, config_path: str) -> bool: + type_ = self.store.get_type(config_path.rstrip("/")) + return type_ == ObjectType.GROUP + + def is_config(self, config_path: str) -> bool: + filename = self._normalize_file_name(config_path.rstrip("/")) + type_ = self.store.get_type(filename) + return type_ == ObjectType.CONFIG + + def list(self, config_path: str, results_filter: Optional[ObjectType]) -> List[str]: + ret: List[str] = [] + files = self.store.list(config_path) + + for file in files: + self._list_add_result( + files=ret, + file_path=f"{config_path}/{file}", + file_name=file, + results_filter=results_filter, + ) + return sorted(list(set(ret))) diff --git a/lib/python3.12/site-packages/hydra/_internal/core_plugins/zsh_completion.py b/lib/python3.12/site-packages/hydra/_internal/core_plugins/zsh_completion.py new file mode 100644 index 0000000000000000000000000000000000000000..af5d35aa7f8afeec65d1e9a15a846dd79a72c221 --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/core_plugins/zsh_completion.py @@ -0,0 +1,48 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved +import logging +from typing import Optional + +from hydra.core.config_loader import ConfigLoader +from hydra.plugins.completion_plugin import CompletionPlugin + +log = logging.getLogger(__name__) + + +class ZshCompletion(CompletionPlugin): + def __init__(self, config_loader: ConfigLoader): + super(ZshCompletion, self).__init__(config_loader) + from hydra._internal.core_plugins.bash_completion import BashCompletion + + self.delegate = BashCompletion(config_loader) + + def install(self) -> None: + self.delegate.install() + + def uninstall(self) -> None: + self.delegate.uninstall() + + @staticmethod + def provides() -> str: + return "zsh" + + def query(self, config_name: Optional[str]) -> None: + self.delegate.query(config_name) + + @staticmethod + def help(command: str) -> str: + assert command in ["install", "uninstall"] + extra_description = ( + "Zsh is compatible with the Bash shell completion, see the [documentation]" + "(https://hydra.cc/docs/1.2/tutorials/basic/running_your_app/tab_completion#zsh-instructions)" + " for details.\n " + ) + command_text = f'eval "$({{}} -sc {command}=bash)"' + if command == "install": + return extra_description + command_text + return command_text + + @staticmethod + def _get_exec() -> str: + from hydra._internal.core_plugins.bash_completion import BashCompletion + + return BashCompletion._get_exec() diff --git a/lib/python3.12/site-packages/hydra/_internal/defaults_list.py b/lib/python3.12/site-packages/hydra/_internal/defaults_list.py new file mode 100644 index 0000000000000000000000000000000000000000..b4b0d92c9503f28f6954a021cd9cf43c0b9ac8c5 --- /dev/null +++ b/lib/python3.12/site-packages/hydra/_internal/defaults_list.py @@ -0,0 +1,803 @@ +# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved + +import copy +import os +import warnings +from dataclasses import dataclass, field +from textwrap import dedent +from typing import Callable, Dict, List, Optional, Set, Tuple, Union + +from omegaconf import DictConfig, OmegaConf + +from hydra import MissingConfigException, version +from hydra._internal.config_repository import IConfigRepository +from hydra.core.config_store import ConfigStore +from hydra.core.default_element import ( + ConfigDefault, + DefaultsTreeNode, + GroupDefault, + InputDefault, + ResultDefault, + VirtualRoot, +) +from hydra.core.object_type import ObjectType +from hydra.core.override_parser.types import Override +from hydra.errors import ConfigCompositionException + +from .deprecation_warning import deprecation_warning + +cs = ConfigStore.instance() + +cs.store(name="_dummy_empty_config_", node={}, provider="hydra") + + +@dataclass +class Deletion: + name: Optional[str] + used: bool = field(default=False, compare=False) + + +@dataclass +class OverrideMetadata: + external_override: bool + containing_config_path: Optional[str] = None + used: bool = False + relative_key: Optional[str] = None + + +@dataclass +class Overrides: + override_choices: Dict[str, Optional[Union[str, List[str]]]] + override_metadata: Dict[str, OverrideMetadata] + + append_group_defaults: List[GroupDefault] + config_overrides: List[Override] + + known_choices: Dict[str, Optional[str]] + known_choices_per_group: Dict[str, Set[str]] + + deletions: Dict[str, Deletion] + + def __init__(self, repo: IConfigRepository, overrides_list: List[Override]) -> None: + self.override_choices = {} + self.override_metadata = {} + self.append_group_defaults = [] + self.config_overrides = [] + self.deletions = {} + + self.known_choices = {} + self.known_choices_per_group = {} + + for override in overrides_list: + if override.is_sweep_override(): + continue + is_group = repo.group_exists(override.key_or_group) + value = override.value() + is_dict = isinstance(override.value(), dict) + if is_dict or not is_group: + self.config_overrides.append(override) + elif override.is_force_add(): + # This could probably be made to work if there is a compelling use case. + raise ConfigCompositionException( + f"force-add of config groups is not supported: '{override.input_line}'" + ) + elif override.is_delete(): + key = override.get_key_element()[1:] + value = override.value() + if value is not None and not isinstance(value, str): + raise ValueError( + f"Config group override deletion value must be a string : {override}" + ) + + self.deletions[key] = Deletion(name=value) + + elif not isinstance(value, (str, list)): + raise ValueError( + f"Config group override must be a string or a list. Got {type(value).__name__}" + ) + elif override.is_add(): + self.append_group_defaults.append( + GroupDefault( + group=override.key_or_group, + package=override.package, + value=value, + external_append=True, + ) + ) + else: + key = override.get_key_element() + self.override_choices[key] = value + self.override_metadata[key] = OverrideMetadata(external_override=True) + + def add_override(self, parent_config_path: str, default: GroupDefault) -> None: + assert default.override + key = default.get_override_key() + if key not in self.override_choices: + self.override_choices[key] = default.value + self.override_metadata[key] = OverrideMetadata( + external_override=False, + containing_config_path=parent_config_path, + relative_key=default.get_relative_override_key(), + ) + + def is_overridden(self, default: InputDefault) -> bool: + if isinstance(default, GroupDefault): + return default.get_override_key() in self.override_choices + + return False + + def override_default_option(self, default: GroupDefault) -> None: + key = default.get_override_key() + if key in self.override_choices: + if isinstance(default, GroupDefault): + default.value = self.override_choices[key] + default.config_name_overridden = True + self.override_metadata[key].used = True + + def ensure_overrides_used(self) -> None: + for key, meta in self.override_metadata.items(): + if not meta.used: + group = key.split("@")[0] + choices = ( + self.known_choices_per_group[group] + if group in self.known_choices_per_group + else set() + ) + + if len(choices) > 1: + msg = ( + f"Could not override '{key}'." + f"\nDid you mean to override one of {', '.join(sorted(list(choices)))}?" + ) + elif len(choices) == 1: + msg = ( + f"Could not override '{key}'." + f"\nDid you mean to override {copy.copy(choices).pop()}?" + ) + elif len(choices) == 0: + msg = f"Could not override '{key}'. No match in the defaults list." + else: + assert False + + if meta.containing_config_path is not None: + msg = f"In '{meta.containing_config_path}': {msg}" + + if meta.external_override: + msg += f"\nTo append to your default list use +{key}={self.override_choices[key]}" + + raise ConfigCompositionException(msg) + + def ensure_deletions_used(self) -> None: + for key, deletion in self.deletions.items(): + if not deletion.used: + desc = f"{key}={deletion.name}" if deletion.name is not None else key + msg = f"Could not delete '{desc}'. No match in the defaults list" + raise ConfigCompositionException(msg) + + def set_known_choice(self, default: InputDefault) -> None: + if isinstance(default, GroupDefault): + key = default.get_override_key() + if key not in self.known_choices: + self.known_choices[key] = default.get_name() + else: + prev = self.known_choices[key] + if default.get_name() != prev: + raise ConfigCompositionException( + f"Multiple values for {key}." + f" To override a value use 'override {key}: {prev}'" + ) + + group = default.get_group_path() + if group not in self.known_choices_per_group: + self.known_choices_per_group[group] = set() + self.known_choices_per_group[group].add(key) + + def is_deleted(self, default: InputDefault) -> bool: + if not isinstance(default, GroupDefault): + return False + key = default.get_override_key() + if key in self.deletions: + deletion = self.deletions[key] + if deletion.name is None: + return True + else: + return deletion.name == default.get_name() + return False + + def delete(self, default: InputDefault) -> None: + assert isinstance(default, GroupDefault) + default.deleted = True + + key = default.get_override_key() + self.deletions[key].used = True + + +@dataclass +class DefaultsList: + defaults: List[ResultDefault] + defaults_tree: DefaultsTreeNode + config_overrides: List[Override] + overrides: Overrides + + +def _validate_self( + containing_node: InputDefault, + defaults: List[InputDefault], + has_config_content: bool, +) -> bool: + # check that self is present only once + has_self = False + has_non_override = False + for d in defaults: + if not d.is_override(): + has_non_override = True + if d.is_self(): + if has_self: + raise ConfigCompositionException( + f"Duplicate _self_ defined in {containing_node.get_config_path()}" + ) + has_self = True + + if not has_self and has_non_override or len(defaults) == 0: + # This check is here to make the migration from Hydra 1.0 to Hydra 1.1 smoother and should be removed in 1.2 + # The warning should be removed in 1.2 + if containing_node.primary and has_config_content and has_non_override: + msg = ( + f"In '{containing_node.get_config_path()}': Defaults list is missing `_self_`. " + f"See https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/default_composition_order for more information" + ) + if os.environ.get("SELF_WARNING_AS_ERROR") == "1": + raise ConfigCompositionException(msg) + warnings.warn(msg, UserWarning) + defaults.append(ConfigDefault(path="_self_")) + + return not has_self + + +def update_package_header(repo: IConfigRepository, node: InputDefault) -> None: + if node.is_missing(): + return + # This loads the same config loaded in _create_defaults_tree + # To avoid loading it twice, the repo implementation is expected to cache loaded configs + loaded = repo.load_config(config_path=node.get_config_path()) + if loaded is not None: + node.set_package_header(loaded.header["package"]) + + +def _expand_virtual_root( + repo: IConfigRepository, + root: DefaultsTreeNode, + overrides: Overrides, + skip_missing: bool, +) -> DefaultsTreeNode: + children: List[Union[DefaultsTreeNode, InputDefault]] = [] + assert root.children is not None + for d in reversed(root.children): + assert isinstance(d, InputDefault) + new_root = DefaultsTreeNode(node=d, parent=root) + d.update_parent("", "") + + subtree = _create_defaults_tree_impl( + repo=repo, + root=new_root, + is_root_config=d.primary, + skip_missing=skip_missing, + interpolated_subtree=False, + overrides=overrides, + ) + if subtree.children is None: + children.append(d) + else: + children.append(subtree) + + if len(children) > 0: + root.children = list(reversed(children)) + + return root + + +def _check_not_missing( + repo: IConfigRepository, + default: InputDefault, + skip_missing: bool, +) -> bool: + path = default.get_config_path() + if path.endswith("???"): + if skip_missing: + return True + if isinstance(default, GroupDefault): + group_path = default.get_group_path() + override_key = default.get_override_key() + options = repo.get_group_options( + group_path, + results_filter=ObjectType.CONFIG, + ) + opt_list = "\n".join(["\t" + x for x in options]) + msg = dedent( + f"""\ + You must specify '{override_key}', e.g, {override_key}=