Spaces:
Paused
Paused
Deploy Sensorflow Studio (part 4)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/INSTALLERAdded+1
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/METADATAAdded+109
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/RECORDAdded+865
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/REQUESTEDAdded
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/WHEELAdded+4
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/entry_points.txtAdded+4
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/AUTHORS.txtAdded+867
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/LICENSE.txtAdded+20
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/cachecontrol/LICENSE.txtAdded+13
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/certifi/LICENSEAdded+20
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/distlib/LICENSE.txtAdded+284
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/distro/LICENSEAdded+202
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/idna/LICENSE.mdAdded+31
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/msgpack/COPYINGAdded+14
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/packaging/LICENSEAdded+3
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/packaging/LICENSE.APACHEAdded+177
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/packaging/LICENSE.BSDAdded+23
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/pkg_resources/LICENSEAdded+17
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/platformdirs/LICENSEAdded+21
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/pygments/LICENSEAdded+25
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/pyproject_hooks/LICENSEAdded+21
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/requests/LICENSEAdded+175
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/resolvelib/LICENSEAdded+13
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/rich/LICENSEAdded+19
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/tomli/LICENSEAdded+21
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/tomli_w/LICENSEAdded+21
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/truststore/LICENSEAdded+21
- .venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/urllib3/LICENSE.txtAdded+21
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/errors.pyAdded+94
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/licenses/__init__.pyAdded+186
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/licenses/_spdx.pyAdded+799
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/markers.pyAdded+492
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/metadata.pyAdded+964
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/py.typedAdded
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/pylock.pyAdded+905
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/requirements.pyAdded+129
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/specifiers.pyAdded+1943
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/tags.pyAdded+932
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/utils.pyAdded+296
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/version.pyAdded+1231
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/pkg_resources/LICENSEAdded+17
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/pkg_resources/__init__.pyAdded
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/LICENSEAdded+21
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/__init__.pyAdded+631
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/__main__.pyAdded+55
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/android.pyAdded+249
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/api.pyAdded+299
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/macos.pyAdded+146
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/py.typedAdded
- .venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/unix.pyAdded+272
1pip123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109Metadata-Version: 2.4Name: pipVersion: 26.1.1Summary: The PyPA recommended tool for installing Python packages.Author-email: The pip developers <distutils-sig@python.org>Requires-Python: >=3.10Description-Content-Type: text/x-rstLicense-Expression: MITClassifier: Development Status :: 5 - Production/StableClassifier: Intended Audience :: DevelopersClassifier: Topic :: Software Development :: Build ToolsClassifier: Programming Language :: PythonClassifier: Programming Language :: Python :: 3Classifier: Programming Language :: Python :: 3 :: OnlyClassifier: Programming Language :: Python :: 3.10Classifier: Programming Language :: Python :: 3.11Classifier: Programming Language :: Python :: 3.12Classifier: Programming Language :: Python :: 3.13Classifier: Programming Language :: Python :: 3.14Classifier: Programming Language :: Python :: Implementation :: CPythonClassifier: Programming Language :: Python :: Implementation :: PyPyLicense-File: AUTHORS.txtLicense-File: LICENSE.txtLicense-File: src/pip/_vendor/cachecontrol/LICENSE.txtLicense-File: src/pip/_vendor/certifi/LICENSELicense-File: src/pip/_vendor/distlib/LICENSE.txtLicense-File: src/pip/_vendor/distro/LICENSELicense-File: src/pip/_vendor/idna/LICENSE.mdLicense-File: src/pip/_vendor/msgpack/COPYINGLicense-File: src/pip/_vendor/packaging/LICENSELicense-File: src/pip/_vendor/packaging/LICENSE.APACHELicense-File: src/pip/_vendor/packaging/LICENSE.BSDLicense-File: src/pip/_vendor/pkg_resources/LICENSELicense-File: src/pip/_vendor/platformdirs/LICENSELicense-File: src/pip/_vendor/pygments/LICENSELicense-File: src/pip/_vendor/pyproject_hooks/LICENSELicense-File: src/pip/_vendor/requests/LICENSELicense-File: src/pip/_vendor/resolvelib/LICENSELicense-File: src/pip/_vendor/rich/LICENSELicense-File: src/pip/_vendor/tomli/LICENSELicense-File: src/pip/_vendor/tomli_w/LICENSELicense-File: src/pip/_vendor/truststore/LICENSELicense-File: src/pip/_vendor/urllib3/LICENSE.txtProject-URL: Changelog, https://pip.pypa.io/en/stable/news/Project-URL: Documentation, https://pip.pypa.ioProject-URL: Homepage, https://pip.pypa.io/Project-URL: Source, https://github.com/pypa/pip
pip - The Python Package Installer==================================
.. |pypi-version| image:: https://img.shields.io/pypi/v/pip.svg :target: https://pypi.org/project/pip/ :alt: PyPI
.. |python-versions| image:: https://img.shields.io/pypi/pyversions/pip :target: https://pypi.org/project/pip :alt: PyPI - Python Version
.. |docs-badge| image:: https://readthedocs.org/projects/pip/badge/?version=latest :target: https://pip.pypa.io/en/latest :alt: Documentation
|pypi-version| |python-versions| |docs-badge|
pip is the `package installer`_ for Python. You can use pip to install packages from the `Python Package Index`_ and other indexes.
Please take a look at our documentation for how to install and use pip:
* `Installation`_* `Usage`_
We release updates regularly, with a new version every 3 months. Find more details in our documentation:
* `Release notes`_* `Release process`_
If you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:
* `Issue tracking`_* `Discourse channel`_* `User IRC`_
If you want to get involved, head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms:
* `GitHub page`_* `Development documentation`_* `Development IRC`_
Code of Conduct---------------
Everyone interacting in the pip project's codebases, issue trackers, chatrooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.
.. _package installer: https://packaging.python.org/guides/tool-recommendations/.. _Python Package Index: https://pypi.org.. _Installation: https://pip.pypa.io/en/stable/installation/.. _Usage: https://pip.pypa.io/en/stable/.. _Release notes: https://pip.pypa.io/en/stable/news.html.. _Release process: https://pip.pypa.io/en/latest/development/release-process/.. _GitHub page: https://github.com/pypa/pip.. _Development documentation: https://pip.pypa.io/en/latest/development.. _Issue tracking: https://github.com/pypa/pip/issues.. _Discourse channel: https://discuss.python.org/c/packaging.. _User IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa.. _Development IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa-dev.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865../../../bin/pip,sha256=d7IiwiGuKT13oGWyxw84SkewFVae7rwShIlBP6Ssw7M,311
../../../bin/pip3,sha256=d7IiwiGuKT13oGWyxw84SkewFVae7rwShIlBP6Ssw7M,311
../../../bin/pip3.14,sha256=d7IiwiGuKT13oGWyxw84SkewFVae7rwShIlBP6Ssw7M,311
pip-26.1.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
pip-26.1.1.dist-info/METADATA,sha256=2g9CrQU5mpjv7Pv68xdtKRIPZxJCVQH36zTG9s3xqtk,4566
pip-26.1.1.dist-info/RECORD,,
pip-26.1.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip-26.1.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
pip-26.1.1.dist-info/entry_points.txt,sha256=Vhf8s0IYgX37mtd4vGL73BPcxdKnqeCFPzB5-d30x8o,84
pip-26.1.1.dist-info/licenses/AUTHORS.txt,sha256=sE0bcE_9PMRlDzzb-q8bjfhKXYTEQm3IxLLMDr2nfJM,11852
pip-26.1.1.dist-info/licenses/LICENSE.txt,sha256=Y0MApmnUmurmWxLGxIySTFGkzfPR_whtw0VtyLyqIQQ,1093
pip-26.1.1.dist-info/licenses/src/pip/_vendor/cachecontrol/LICENSE.txt,sha256=hu7uh74qQ_P_H1ZJb0UfaSQ5JvAl_tuwM2ZsMExMFhs,558
pip-26.1.1.dist-info/licenses/src/pip/_vendor/certifi/LICENSE,sha256=6TcW2mucDVpKHfYP5pWzcPBpVgPSH2-D8FPkLPwQyvc,989
pip-26.1.1.dist-info/licenses/src/pip/_vendor/distlib/LICENSE.txt,sha256=gI4QyKarjesUn_mz-xn0R6gICUYG1xKpylf-rTVSWZ0,14531
pip-26.1.1.dist-info/licenses/src/pip/_vendor/distro/LICENSE,sha256=y16Ofl9KOYjhBjwULGDcLfdWBfTEZRXnduOspt-XbhQ,11325
pip-26.1.1.dist-info/licenses/src/pip/_vendor/idna/LICENSE.md,sha256=t6M2q_OwThgOwGXN0W5wXQeeHMehT5EKpukYfza5zYc,1541
pip-26.1.1.dist-info/licenses/src/pip/_vendor/msgpack/COPYING,sha256=SS3tuoXaWHL3jmCRvNH-pHTWYNNay03ulkuKqz8AdCc,614
pip-26.1.1.dist-info/licenses/src/pip/_vendor/packaging/LICENSE,sha256=ytHvW9NA1z4HS6YU0m996spceUDD2MNIUuZcSQlobEg,197
pip-26.1.1.dist-info/licenses/src/pip/_vendor/packaging/LICENSE.APACHE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
pip-26.1.1.dist-info/licenses/src/pip/_vendor/packaging/LICENSE.BSD,sha256=tw5-m3QvHMb5SLNMFqo5_-zpQZY2S8iP8NIYDwAo-sU,1344
pip-26.1.1.dist-info/licenses/src/pip/_vendor/pkg_resources/LICENSE,sha256=htoPAa6uRjSKPD1GUZXcHOzN55956HdppkuNoEsqR0E,1023
pip-26.1.1.dist-info/licenses/src/pip/_vendor/platformdirs/LICENSE,sha256=KeD9YukphQ6G6yjD_czwzv30-pSHkBHP-z0NS-1tTbY,1089
pip-26.1.1.dist-info/licenses/src/pip/_vendor/pygments/LICENSE,sha256=qdZvHVJt8C4p3Oc0NtNOVuhjL0bCdbvf_HBWnogvnxc,1331
pip-26.1.1.dist-info/licenses/src/pip/_vendor/pyproject_hooks/LICENSE,sha256=GyKwSbUmfW38I6Z79KhNjsBLn9-xpR02DkK0NCyLQVQ,1081
pip-26.1.1.dist-info/licenses/src/pip/_vendor/requests/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
pip-26.1.1.dist-info/licenses/src/pip/_vendor/resolvelib/LICENSE,sha256=84j9OMrRMRLB3A9mm76A5_hFQe26-3LzAw0sp2QsPJ0,751
pip-26.1.1.dist-info/licenses/src/pip/_vendor/rich/LICENSE,sha256=3u18F6QxgVgZCj6iOcyHmlpQJxzruYrnAl9I--WNyhU,1056
pip-26.1.1.dist-info/licenses/src/pip/_vendor/tomli/LICENSE,sha256=uAgWsNUwuKzLTCIReDeQmEpuO2GSLCte6S8zcqsnQv4,1072
pip-26.1.1.dist-info/licenses/src/pip/_vendor/tomli_w/LICENSE,sha256=uAgWsNUwuKzLTCIReDeQmEpuO2GSLCte6S8zcqsnQv4,1072
pip-26.1.1.dist-info/licenses/src/pip/_vendor/truststore/LICENSE,sha256=M757fo-k_Rmxdg4ajtimaL2rhSyRtpLdQUJLy3Jan8o,1086
pip-26.1.1.dist-info/licenses/src/pip/_vendor/urllib3/LICENSE.txt,sha256=Ew46ZNX91dCWp1JpRjSn2d8oRGnehuVzIQAmgEHj1oY,1093
pip/__init__.py,sha256=D-SKDnJXnZSVdwb4PTrC_Udxb3L0zdsgGQnAvhc1JqI,355
pip/__main__.py,sha256=rOZRtrXjDBzY24niaxTnd9ZHHWL7B0EawVdLoJ3nI6c,874
pip/__pip-runner__.py,sha256=720Mt6h07Uce52v80EOF__JYauoLw9b7Pfs_5B91isg,1451
pip/__pycache__/__init__.cpython-314.pyc,,
pip/__pycache__/__main__.cpython-314.pyc,,
pip/__pycache__/__pip-runner__.cpython-314.pyc,,
pip/_internal/__init__.py,sha256=S7i9Dn9aSZS0MG-2Wrve3dV9TImPzvQn5jjhp9t_uf0,511
pip/_internal/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/__pycache__/build_env.cpython-314.pyc,,
pip/_internal/__pycache__/cache.cpython-314.pyc,,
pip/_internal/__pycache__/configuration.cpython-314.pyc,,
pip/_internal/__pycache__/exceptions.cpython-314.pyc,,
pip/_internal/__pycache__/main.cpython-314.pyc,,
pip/_internal/__pycache__/pyproject.cpython-314.pyc,,
pip/_internal/__pycache__/self_outdated_check.cpython-314.pyc,,
pip/_internal/__pycache__/wheel_builder.cpython-314.pyc,,
pip/_internal/build_env.py,sha256=XpgOIlTQLgz3PvDT2n7j2NzX_rVFZLCIG7t7b2ddhcM,21911
pip/_internal/cache.py,sha256=nMh48Yv3yu1HS1yCdscouu6B6B5zYBWdV6bhqs7gL-E,10345
pip/_internal/cli/__init__.py,sha256=Iqg_tKA771XuMO1P4t_sDHnSKPzkUb9D0DqunAmw_ko,131
pip/_internal/cli/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/cli/__pycache__/autocompletion.cpython-314.pyc,,
pip/_internal/cli/__pycache__/base_command.cpython-314.pyc,,
pip/_internal/cli/__pycache__/cmdoptions.cpython-314.pyc,,
pip/_internal/cli/__pycache__/command_context.cpython-314.pyc,,
pip/_internal/cli/__pycache__/index_command.cpython-314.pyc,,
pip/_internal/cli/__pycache__/main.cpython-314.pyc,,
pip/_internal/cli/__pycache__/main_parser.cpython-314.pyc,,
pip/_internal/cli/__pycache__/parser.cpython-314.pyc,,
pip/_internal/cli/__pycache__/progress_bars.cpython-314.pyc,,
pip/_internal/cli/__pycache__/req_command.cpython-314.pyc,,
pip/_internal/cli/__pycache__/spinners.cpython-314.pyc,,
pip/_internal/cli/__pycache__/status_codes.cpython-314.pyc,,
pip/_internal/cli/autocompletion.py,sha256=ZG2cM03nlcNrs-WG_SFTW46isx9s2Go5lUD_8-iv70o,7193
pip/_internal/cli/base_command.py,sha256=-oJs5lKaPD2RXBuByBfKvumAa1XNYVthv0Pm0RXwGgA,9579
pip/_internal/cli/cmdoptions.py,sha256=xbTSw40piYzeuhqdG4cWtxmPthh1ye0aGz0fyqiNMG8,37592
pip/_internal/cli/command_context.py,sha256=kmu3EWZbfBega1oDamnGJTA_UaejhIQNuMj2CVmMXu0,817
pip/_internal/cli/index_command.py,sha256=PTcKSd-J3bUalzDO9kNvZ3mEGiJXix32Q4fPwkxSXIc,7094
pip/_internal/cli/main.py,sha256=ljDQBkvBtC8xTjOdb6rDJzJUNi1s-PnVR_W5C-Mq0Dk,3137
pip/_internal/cli/main_parser.py,sha256=YjzJAjqf78ARNsLlnJT9l6fNbpyDPJA-arOIXYsK5Ik,4403
pip/_internal/cli/parser.py,sha256=EIFExrWX_1nrl1Ib--GOor70WYqLtduHByenb1u9xH4,13827
pip/_internal/cli/progress_bars.py,sha256=IW1PH5n2FPqUBTP7ULQ5Yu-wyNNO9XGY3g1PT4RMu44,4706
pip/_internal/cli/req_command.py,sha256=KmCppnkf7M6SvJIVrds0ng83HFMZ2z4Y6pg1yCnyjDM,17484
pip/_internal/cli/spinners.py,sha256=EJzZIZNyUtJljp3-WjcsyIrqxW-HUsfWzhuW84n_Tqw,7362
pip/_internal/cli/status_codes.py,sha256=sEFHUaUJbqv8iArL3HAtcztWZmGOFX01hTesSytDEh0,116
pip/_internal/commands/__init__.py,sha256=aNeCbQurGWihfhQq7BqaLXHqWDQ0i3I04OS7kxK6plQ,4026
pip/_internal/commands/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/commands/__pycache__/cache.cpython-314.pyc,,
pip/_internal/commands/__pycache__/check.cpython-314.pyc,,
pip/_internal/commands/__pycache__/completion.cpython-314.pyc,,
pip/_internal/commands/__pycache__/configuration.cpython-314.pyc,,
pip/_internal/commands/__pycache__/debug.cpython-314.pyc,,
pip/_internal/commands/__pycache__/download.cpython-314.pyc,,
pip/_internal/commands/__pycache__/freeze.cpython-314.pyc,,
pip/_internal/commands/__pycache__/hash.cpython-314.pyc,,
pip/_internal/commands/__pycache__/help.cpython-314.pyc,,
pip/_internal/commands/__pycache__/index.cpython-314.pyc,,
pip/_internal/commands/__pycache__/inspect.cpython-314.pyc,,
pip/_internal/commands/__pycache__/install.cpython-314.pyc,,
pip/_internal/commands/__pycache__/list.cpython-314.pyc,,
pip/_internal/commands/__pycache__/lock.cpython-314.pyc,,
pip/_internal/commands/__pycache__/search.cpython-314.pyc,,
pip/_internal/commands/__pycache__/show.cpython-314.pyc,,
pip/_internal/commands/__pycache__/uninstall.cpython-314.pyc,,
pip/_internal/commands/__pycache__/wheel.cpython-314.pyc,,
pip/_internal/commands/cache.py,sha256=XjT7kjY8GSISMksFHsLvjS9Ogfi5extNlUUv-dUoWCM,9142
pip/_internal/commands/check.py,sha256=hVFBQezQ3zj4EydoWbFQj_afPUppMt7r9JPAlY22U6Y,2244
pip/_internal/commands/completion.py,sha256=LjvRIZ6QUiDXJL3IOMFeD-_J97HfjMGgEk0j2tWGu1U,4565
pip/_internal/commands/configuration.py,sha256=6gNOGrVWnOLU15zUnAiNuOMhf76RRIZvCdVD0degPRk,10105
pip/_internal/commands/debug.py,sha256=EvBLsRjcTRMrOuyHkLlJS6XODLBbasNlvVzce7cbRvo,6543
pip/_internal/commands/download.py,sha256=LUNVobuvCdagjLBuPBaxHeBiHEiIe03fTO2m6ahC8qw,5178
pip/_internal/commands/freeze.py,sha256=fxoW8AAc-bAqB_fXdNq2VnZ3JfWkFMg-bR6LcdDVO7A,3099
pip/_internal/commands/hash.py,sha256=GO9pRN3wXC2kQaovK57TaLYBMc3IltOH92O6QEw6YE0,1679
pip/_internal/commands/help.py,sha256=Bz3LcjNQXkz4Cu__pL4CZ86o4-HNLZj1NZWdlJhjuu0,1108
pip/_internal/commands/index.py,sha256=ZhvgaAu6mkyts25L33mdBw8dfi50rTNJOYLO8GNgM7Y,5514
pip/_internal/commands/inspect.py,sha256=Lmy7-WHZ7juHp-txjK7U74X3jr5cfvgOMDICyKitriM,3184
pip/_internal/commands/install.py,sha256=wwtHYQ3UoDxXcMysjTRnbWO8Zeg_C-_Nk9SgMfDHAgo,33733
pip/_internal/commands/list.py,sha256=7_YwtPHN-RbWPHhCp1hajXN_zNxR9UdsHGUuVJzAVNQ,13638
pip/_internal/commands/lock.py,sha256=145ihjUK_-7gP8O65XPDi_xMhlh5hne1ptkHdfnbAnQ,6027
pip/_internal/commands/search.py,sha256=zbMsX_YASj6kXA6XIBgTDv0bGK51xG-CV3IynZJcE-c,5782
pip/_internal/commands/show.py,sha256=oLVJIfKWmDKm0SsQGEi3pozNiqrXjTras_fbBSYKpBA,8066
pip/_internal/commands/uninstall.py,sha256=CsOihqvb6ZA6O67L70oXeoLHeOfNzMM88H9g-9aocgw,3868
pip/_internal/commands/wheel.py,sha256=L9vEzJ_E42scF_Hgh5X4Hk39nqJDKxGg4u7glDYbNWc,5880
pip/_internal/configuration.py,sha256=WxwwSwY_Bm6QzDgf32BsujEyO8dgRedegCpgbUfDvM8,14568
pip/_internal/distributions/__init__.py,sha256=Hq6kt6gXBgjNit5hTTWLAzeCNOKoB-N0pGYSqehrli8,858
pip/_internal/distributions/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/distributions/__pycache__/base.cpython-314.pyc,,
pip/_internal/distributions/__pycache__/installed.cpython-314.pyc,,
pip/_internal/distributions/__pycache__/sdist.cpython-314.pyc,,
pip/_internal/distributions/__pycache__/wheel.cpython-314.pyc,,
pip/_internal/distributions/base.py,sha256=l-OTCAIs25lsapejA6IYpPZxSM5-BET4sdZDkql8jiY,1830
pip/_internal/distributions/installed.py,sha256=kgIEE_1NzjZxLBSC-v5s64uOFZlVEt3aPrjTtL6x2XY,929
pip/_internal/distributions/sdist.py,sha256=RYwQIbuxpKy6OjlBZCAefxpMDaoocUQ4dFtheGsiTOQ,6627
pip/_internal/distributions/wheel.py,sha256=_HbG0OehF8dwj4UX-xV__tXLwgPus9OjMEf2NTRqBbE,1364
pip/_internal/exceptions.py,sha256=PXzGfBmUF3rKQQjCAMcJ1fszBw6naL1nTK8CXhIi7zo,32166
pip/_internal/index/__init__.py,sha256=tzwMH_fhQeubwMqHdSivasg1cRgTSbNg2CiMVnzMmyU,29
pip/_internal/index/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/index/__pycache__/collector.cpython-314.pyc,,
pip/_internal/index/__pycache__/package_finder.cpython-314.pyc,,
pip/_internal/index/__pycache__/sources.cpython-314.pyc,,
pip/_internal/index/collector.py,sha256=R7Gcx_4GEoSEI-iazfAZVEPG3Lp6mbZT4lbAD6NjAc0,16144
pip/_internal/index/package_finder.py,sha256=fX9lRlfiUkoC96rIiYg4M_bDWVNUpaX2TzXx_FP-aoI,41347
pip/_internal/index/sources.py,sha256=nXJkOjhLy-O2FsrKU9RIqCOqgY2PsoKWybtZjjRgqU0,8639
pip/_internal/locations/__init__.py,sha256=iP9yVZn_4iPuNcaUNh2A_vJLcvUZ-8y4zvKLDVEqaM0,14022
pip/_internal/locations/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/locations/__pycache__/_distutils.cpython-314.pyc,,
pip/_internal/locations/__pycache__/_sysconfig.cpython-314.pyc,,
pip/_internal/locations/__pycache__/base.cpython-314.pyc,,
pip/_internal/locations/_distutils.py,sha256=jpFj4V00rD9IR3vA9TqrGkwcdNVFc58LsChZavge9JY,5975
pip/_internal/locations/_sysconfig.py,sha256=8CpTjtxaCzHSCrKpaxWnHE7aKcJrRJRmntR1ZLVysLk,7779
pip/_internal/locations/base.py,sha256=AImjYJWxOtDkc0KKc6Y4Gz677cg91caMA4L94B9FZEg,2550
pip/_internal/main.py,sha256=1cHqjsfFCrMFf3B5twzocxTJUdHMLoXUpy5lJoFqUi8,338
pip/_internal/metadata/__init__.py,sha256=vp-JAxiWg_-l5F8AT0Jcey72uUnh8CDwwol9-KktHZ8,5824
pip/_internal/metadata/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/metadata/__pycache__/_json.cpython-314.pyc,,
pip/_internal/metadata/__pycache__/base.cpython-314.pyc,,
pip/_internal/metadata/__pycache__/pkg_resources.cpython-314.pyc,,
pip/_internal/metadata/_json.py,sha256=hNvnMHOXLAyNlzirWhPL9Nx2CvCqa1iRma6Osq1YfV8,2711
pip/_internal/metadata/base.py,sha256=BGuMenlcQT8i7j9iclrfdC3vSwgvhr8gjn955cCy16s,25420
pip/_internal/metadata/importlib/__init__.py,sha256=jUUidoxnHcfITHHaAWG1G2i5fdBYklv_uJcjo2x7VYE,135
pip/_internal/metadata/importlib/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/metadata/importlib/__pycache__/_compat.cpython-314.pyc,,
pip/_internal/metadata/importlib/__pycache__/_dists.cpython-314.pyc,,
pip/_internal/metadata/importlib/__pycache__/_envs.cpython-314.pyc,,
pip/_internal/metadata/importlib/_compat.py,sha256=sneVh4_6WxQZK4ljdl3ylVuP-q0ttSqbgl9mWt0HnOg,2804
pip/_internal/metadata/importlib/_dists.py,sha256=c738sVAKF_zhhyFOIKmLlMadRvGOfEdqcoKjznwpYUI,8711
pip/_internal/metadata/importlib/_envs.py,sha256=H3qVLXVh4LWvrPvu_ekXf3dfbtwnlhNJQP2pxXpccfU,5333
pip/_internal/metadata/pkg_resources.py,sha256=NO76ZrfR2-LKJTyaXrmQoGhmJMArALvacrlZHViSDT8,10544
pip/_internal/models/__init__.py,sha256=AjmCEBxX_MH9f_jVjIGNCFJKYCYeSEe18yyvNx4uRKQ,62
pip/_internal/models/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/models/__pycache__/candidate.cpython-314.pyc,,
pip/_internal/models/__pycache__/direct_url.cpython-314.pyc,,
pip/_internal/models/__pycache__/format_control.cpython-314.pyc,,
pip/_internal/models/__pycache__/index.cpython-314.pyc,,
pip/_internal/models/__pycache__/installation_report.cpython-314.pyc,,
pip/_internal/models/__pycache__/link.cpython-314.pyc,,
pip/_internal/models/__pycache__/release_control.cpython-314.pyc,,
pip/_internal/models/__pycache__/scheme.cpython-314.pyc,,
pip/_internal/models/__pycache__/search_scope.cpython-314.pyc,,
pip/_internal/models/__pycache__/selection_prefs.cpython-314.pyc,,
pip/_internal/models/__pycache__/target_python.cpython-314.pyc,,
pip/_internal/models/__pycache__/wheel.cpython-314.pyc,,
pip/_internal/models/candidate.py,sha256=5TqwJU0YOogo3EsIPohaqQ3Z4hfU4BNNyBYBEJs6Wxw,720
pip/_internal/models/direct_url.py,sha256=9RS3TQAXknwLd8JOOZWlbBV6WZFs9qn-YAYk0VQ8R_Q,944
pip/_internal/models/format_control.py,sha256=PwemYG1L27BM0f1KP61rm24wShENFyxqlD1TWu34alc,2471
pip/_internal/models/index.py,sha256=tYnL8oxGi4aSNWur0mG8DAP7rC6yuha_MwJO8xw0crI,1030
pip/_internal/models/installation_report.py,sha256=U4MlXWFB-8ev_yheuMO9T2m_y5b4C-hOzVaoHVobl38,2846
pip/_internal/models/link.py,sha256=zti5UCx1hT03etYqm6MCqFd714clmTgX8rTZT9CKZDQ,21992
pip/_internal/models/release_control.py,sha256=31Jh-ZHsTIBZLe-7uPNoYLiRSWXAjEI1jGNxwqLKd4A,3365
pip/_internal/models/scheme.py,sha256=G-O9KElabcXqbPwfE_66lzX5fGahh3Gu6DAkz_9ZhJw,558
pip/_internal/models/search_scope.py,sha256=_i-Gj_w_FwZAvTs7WhjslBDD70J-8hmIdjXByI8uEZQ,4461
pip/_internal/models/selection_prefs.py,sha256=0teekwSVxW5MOk0WPG5Novw5q_XJjxijcd75kZO6E9g,1503
pip/_internal/models/target_python.py,sha256=I0eFS-eia3kwhrOvgsphFZtNAB2IwXZ9Sr9fp6IjBP4,4243
pip/_internal/models/wheel.py,sha256=1SdfDvN7ALTsbyZ9EOsNy1GPirP1n6EjHyzPrZyLSh8,2920
pip/_internal/network/__init__.py,sha256=FMy06P__y6jMjUc8z3ZcQdKF-pmZ2zM14_vBeHPGhUI,49
pip/_internal/network/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/network/__pycache__/auth.cpython-314.pyc,,
pip/_internal/network/__pycache__/cache.cpython-314.pyc,,
pip/_internal/network/__pycache__/download.cpython-314.pyc,,
pip/_internal/network/__pycache__/lazy_wheel.cpython-314.pyc,,
pip/_internal/network/__pycache__/session.cpython-314.pyc,,
pip/_internal/network/__pycache__/utils.cpython-314.pyc,,
pip/_internal/network/__pycache__/xmlrpc.cpython-314.pyc,,
pip/_internal/network/auth.py,sha256=ITcuLus7666whNVJSINuNMRZzNoGHwmqhRnP6hEu0ok,20846
pip/_internal/network/cache.py,sha256=kmRXKQrG9E26xQRj211LHeEGpDg_SlYU9Dn1fJ-AMeI,4862
pip/_internal/network/download.py,sha256=8ilZxTWBm9J1TEpupFE56VQ5js3L81rv3X0rZwfBPTg,12625
pip/_internal/network/lazy_wheel.py,sha256=y9gVksdJCSjnLfYzs_m3DYUAtl3hc_k-xFPDBd9DgOs,7646
pip/_internal/network/session.py,sha256=7zK7EeQCSRFipu4ZzcWl1V3AMKkiXdtGqFr7GvU2LrY,19555
pip/_internal/network/utils.py,sha256=ACsXd1msqNCidHVXsu7LHUSr8NgaypcOKQ4KG-Z_wJM,4091
pip/_internal/network/xmlrpc.py,sha256=_-Rnk3vOff8uF9hAGmT6SLALflY1gMBcbGwS12fb_Y4,1830
pip/_internal/operations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_internal/operations/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/operations/__pycache__/check.cpython-314.pyc,,
pip/_internal/operations/__pycache__/freeze.cpython-314.pyc,,
pip/_internal/operations/__pycache__/prepare.cpython-314.pyc,,
pip/_internal/operations/build/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_internal/operations/build/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/operations/build/__pycache__/build_tracker.cpython-314.pyc,,
pip/_internal/operations/build/__pycache__/metadata.cpython-314.pyc,,
pip/_internal/operations/build/__pycache__/metadata_editable.cpython-314.pyc,,
pip/_internal/operations/build/__pycache__/wheel.cpython-314.pyc,,
pip/_internal/operations/build/__pycache__/wheel_editable.cpython-314.pyc,,
pip/_internal/operations/build/build_tracker.py,sha256=W3b5cmkMWPaE6QIwfzsTayJo7-OlxFHWDxfPuax1KcE,4771
pip/_internal/operations/build/metadata.py,sha256=INHaeiRfOiLYCXApfDNRo9Cw2xI4VwTc0KItvfdfOjk,1421
pip/_internal/operations/build/metadata_editable.py,sha256=oWudMsnjy4loO_Jy7g4N9nxsnaEX_iDlVRgCy7pu1rs,1509
pip/_internal/operations/build/wheel.py,sha256=3bP-nNiJ4S8JvMaBnyessXQUBhxTqt1GBx6DQ1iPJDY,1136
pip/_internal/operations/build/wheel_editable.py,sha256=q3kfElclM6FutVbFwE87JOTpVWt5ixDf3_UkHAIVfz4,1478
pip/_internal/operations/check.py,sha256=yC2XWth6iehGGE_fj7XRJLjVKBsTIG3ZoWRkFi3rOwc,5894
pip/_internal/operations/freeze.py,sha256=PDdY-y_ZtZZJLAKcaWPIGRKAGW7DXR48f0aMRU0j7BA,9854
pip/_internal/operations/install/__init__.py,sha256=ak-UETcQPKlFZaWoYKWu5QVXbpFBvg0sXc3i0O4vSYY,50
pip/_internal/operations/install/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/operations/install/__pycache__/wheel.cpython-314.pyc,,
pip/_internal/operations/install/wheel.py,sha256=FQIl2AnNadHV5YGGOVEmOHtUUNO8lpzj3Icoo4S2xis,27923
pip/_internal/operations/prepare.py,sha256=Gx6r57LG_guvAYGqKUdu_68rHPPkO7CQ_qc2wKnYyss,29046
pip/_internal/pyproject.py,sha256=J-sTWqC-XfsKQgz9m1bypMWZPHItsSHzIN_NWeIRmhM,4555
pip/_internal/req/__init__.py,sha256=WcY9z7D3rlIKX1QY8_tRnAsS_poebiGGdtQ7EJ5JQQo,3041
pip/_internal/req/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/req/__pycache__/constructors.cpython-314.pyc,,
pip/_internal/req/__pycache__/pep723.cpython-314.pyc,,
pip/_internal/req/__pycache__/req_dependency_group.cpython-314.pyc,,
pip/_internal/req/__pycache__/req_file.cpython-314.pyc,,
pip/_internal/req/__pycache__/req_install.cpython-314.pyc,,
pip/_internal/req/__pycache__/req_set.cpython-314.pyc,,
pip/_internal/req/__pycache__/req_uninstall.cpython-314.pyc,,
pip/_internal/req/constructors.py,sha256=EXgbMUcAtBaNj6cYms0ZweIxNOSoOPcQG8EqXl9HYhM,22918
pip/_internal/req/pep723.py,sha256=JsG1p3CaVcW8cjclD2kDj7d9qtVrNQaevY_UnKh00tk,1242
pip/_internal/req/req_dependency_group.py,sha256=PrWKtlwI8xbWnWEKjXs9RkrpQx2_h02ABefYT0ZdeQg,3145
pip/_internal/req/req_file.py,sha256=idVj4uVd8yQIBQojoulL1ceXGr1Qk8ongXzwI4vTTss,20521
pip/_internal/req/req_install.py,sha256=VVzO8UIp6TOU_QCEoSxYdkG39z54pKPQjg8Z6z4WbNM,31845
pip/_internal/req/req_set.py,sha256=awkqIXnYA4Prmsj0Qb3zhqdbYUmXd-1o0P-KZ3mvRQs,2828
pip/_internal/req/req_uninstall.py,sha256=dCmOHt-9RaJBq921L4tMH3PmIBDetGplnbjRKXmGt00,24099
pip/_internal/resolution/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_internal/resolution/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/resolution/__pycache__/base.cpython-314.pyc,,
pip/_internal/resolution/base.py,sha256=RIsqSP79olPdOgtPKW-oOQ364ICVopehA6RfGkRfe2s,577
pip/_internal/resolution/legacy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_internal/resolution/legacy/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/resolution/legacy/__pycache__/resolver.cpython-314.pyc,,
pip/_internal/resolution/legacy/resolver.py,sha256=pMwU11FO1jeWB2vX-wvA5fdyDBPWH6Dccj9qEdh1Z3M,24061
pip/_internal/resolution/resolvelib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_internal/resolution/resolvelib/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/base.cpython-314.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/candidates.cpython-314.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/factory.cpython-314.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/found_candidates.cpython-314.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/provider.cpython-314.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/reporter.cpython-314.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/requirements.cpython-314.pyc,,
pip/_internal/resolution/resolvelib/__pycache__/resolver.cpython-314.pyc,,
pip/_internal/resolution/resolvelib/base.py,sha256=g3qtckAh3E34y-5HrYLlYnOZ9SiPGDISzsqhaRDUAqQ,5903
pip/_internal/resolution/resolvelib/candidates.py,sha256=4v3A2Q7gS1a1tbMbpho9HliFW4fRmHFuzj8fa7ThZ6c,20912
pip/_internal/resolution/resolvelib/factory.py,sha256=gWRrcgr64br0ecF_PPxKfneXEzr0k-Solv2X9z3Goj0,36771
pip/_internal/resolution/resolvelib/found_candidates.py,sha256=8bZYDCZLXSdLHy_s1o5f4r15HmKvqFUhzBUQOF21Lr4,6018
pip/_internal/resolution/resolvelib/provider.py,sha256=X3nrCcVTer3mZSEy-13KiPFBJYmhfWJdA1cr-Gn1q7M,12150
pip/_internal/resolution/resolvelib/reporter.py,sha256=tEC7MF8IqGU4Ww9t61YVfNFKtoaQpb6-AwLZptJz1VE,3918
pip/_internal/resolution/resolvelib/requirements.py,sha256=Izl9n8nc188lA1BSPS8QxfudfDQPHgngw-ij6hXt0nQ,8239
pip/_internal/resolution/resolvelib/resolver.py,sha256=wQ94Hkep-7kWEHAc-NbMJhmzeEzgEAtxeBxyKVzZoeo,13437
pip/_internal/self_outdated_check.py,sha256=9XxOXPqsZlKceTP2tZS7I7rXjodnqd3GrIQ8U0_L8BM,8097
pip/_internal/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_internal/utils/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/utils/__pycache__/_jaraco_text.cpython-314.pyc,,
pip/_internal/utils/__pycache__/_log.cpython-314.pyc,,
pip/_internal/utils/__pycache__/appdirs.cpython-314.pyc,,
pip/_internal/utils/__pycache__/compat.cpython-314.pyc,,
pip/_internal/utils/__pycache__/compatibility_tags.cpython-314.pyc,,
pip/_internal/utils/__pycache__/datetime.cpython-314.pyc,,
pip/_internal/utils/__pycache__/deprecation.cpython-314.pyc,,
pip/_internal/utils/__pycache__/direct_url_helpers.cpython-314.pyc,,
pip/_internal/utils/__pycache__/egg_link.cpython-314.pyc,,
pip/_internal/utils/__pycache__/entrypoints.cpython-314.pyc,,
pip/_internal/utils/__pycache__/filesystem.cpython-314.pyc,,
pip/_internal/utils/__pycache__/filetypes.cpython-314.pyc,,
pip/_internal/utils/__pycache__/glibc.cpython-314.pyc,,
pip/_internal/utils/__pycache__/hashes.cpython-314.pyc,,
pip/_internal/utils/__pycache__/logging.cpython-314.pyc,,
pip/_internal/utils/__pycache__/misc.cpython-314.pyc,,
pip/_internal/utils/__pycache__/packaging.cpython-314.pyc,,
pip/_internal/utils/__pycache__/pylock.cpython-314.pyc,,
pip/_internal/utils/__pycache__/retry.cpython-314.pyc,,
pip/_internal/utils/__pycache__/subprocess.cpython-314.pyc,,
pip/_internal/utils/__pycache__/temp_dir.cpython-314.pyc,,
pip/_internal/utils/__pycache__/unpacking.cpython-314.pyc,,
pip/_internal/utils/__pycache__/urls.cpython-314.pyc,,
pip/_internal/utils/__pycache__/virtualenv.cpython-314.pyc,,
pip/_internal/utils/__pycache__/wheel.cpython-314.pyc,,
pip/_internal/utils/_jaraco_text.py,sha256=M15uUPIh5NpP1tdUGBxRau6q1ZAEtI8-XyLEETscFfE,3350
pip/_internal/utils/_log.py,sha256=-jHLOE_THaZz5BFcCnoSL9EYAtJ0nXem49s9of4jvKw,1015
pip/_internal/utils/appdirs.py,sha256=LrzDPZMKVh0rubtCx9vu3XlZbLCSug6VSj4Qsvt66BA,1681
pip/_internal/utils/compat.py,sha256=C9LHXJAKkwAH8Hn3nPkz9EYK3rqPBeO_IXkOG2zzsdQ,2514
pip/_internal/utils/compatibility_tags.py,sha256=DiNSLqpuruXUamGQwOJ2WZByDGLTGaXi9O-Xf8fOi34,6630
pip/_internal/utils/datetime.py,sha256=kuJOf1mW8G5tRFN6jWardddS-9qSaR53lK1jmx3NTZY,868
pip/_internal/utils/deprecation.py,sha256=oEQltmCq44LQ6EP7NF5bZySMf-wCifoyy9jl361BnVM,4319
pip/_internal/utils/direct_url_helpers.py,sha256=WCCPJnmoPHz7kiYePrEcVAen2lDpCT9WQVImoHHWCO8,3363
pip/_internal/utils/egg_link.py,sha256=YWfsrbmfcrfWgqQYy6OuIjsyb9IfL1q_2v4zsms1WjI,2459
pip/_internal/utils/entrypoints.py,sha256=uPjAyShKObdotjQjJUzprQ6r3xQvDIZwUYfHHqZ7Dok,3324
pip/_internal/utils/filesystem.py,sha256=GBB42pbxmUgdRAbSgLTRrWQEapyLCDSjxT21DN4QjU8,6812
pip/_internal/utils/filetypes.py,sha256=sEMa38qaqjvx1Zid3OCAUja31BOBU-USuSMPBvU3yjo,689
pip/_internal/utils/glibc.py,sha256=sEh8RJJLYSdRvTqAO4THVPPA-YSDVLD4SI9So-bxX1U,3726
pip/_internal/utils/hashes.py,sha256=38-bCOJSHippQ7r9RttrMHxb2mv3EARt1Gw8kFmW73g,5040
pip/_internal/utils/logging.py,sha256=6lJWMC6c7_aD_i4sdgaaeb-Tm3kWpYg0hba_V1-OLnE,13414
pip/_internal/utils/misc.py,sha256=-fF_rOhxBxp57kwGlNl3XziBcs0gCf6D05wxZ-mkoTc,23704
pip/_internal/utils/packaging.py,sha256=s5tpUmFumwV0H9JSTzryrIY4JwQM8paGt7Sm7eNwt2Y,1601
pip/_internal/utils/pylock.py,sha256=T4qyd-TWb54wIO5_DdwASATtU7gi08IGEa_-pdFR7HE,9358
pip/_internal/utils/retry.py,sha256=83wReEB2rcntMZ5VLd7ascaYSjn_kLdlQCqxILxWkPM,1461
pip/_internal/utils/subprocess.py,sha256=r4-Ba_Yc3uZXQpi0K4pZFsCT_QqdSvtF3XJ-204QWaA,8983
pip/_internal/utils/temp_dir.py,sha256=D9c8D7WOProOO8GGDqpBeVSj10NGFmunG0o2TodjjIU,9307
pip/_internal/utils/unpacking.py,sha256=62qpFOlxRl5wjbeIYSrF-GE-NA1Ko7mAYjyweZx9MWs,13537
pip/_internal/utils/urls.py,sha256=aF_eg9ul5d8bMCxfSSSxQcfs-OpJdbStYqZHoy2K1RE,1601
pip/_internal/utils/virtualenv.py,sha256=mX-UPyw1MPxhwUxKhbqWWX70J6PHXAJjVVrRnG0h9mc,3455
pip/_internal/utils/wheel.py,sha256=YdRuj6MicG-Q9Mg03FbUv1WTLam6Lc7AgijY4voVyis,4468
pip/_internal/vcs/__init__.py,sha256=UAqvzpbi0VbZo3Ub6skEeZAw-ooIZR-zX_WpCbxyCoU,596
pip/_internal/vcs/__pycache__/__init__.cpython-314.pyc,,
pip/_internal/vcs/__pycache__/bazaar.cpython-314.pyc,,
pip/_internal/vcs/__pycache__/git.cpython-314.pyc,,
pip/_internal/vcs/__pycache__/mercurial.cpython-314.pyc,,
pip/_internal/vcs/__pycache__/subversion.cpython-314.pyc,,
pip/_internal/vcs/__pycache__/versioncontrol.cpython-314.pyc,,
pip/_internal/vcs/bazaar.py,sha256=3W1eHjkYx2vc6boeb2NBh4I_rlGAXM-vrzfNhLm1Rxg,3734
pip/_internal/vcs/git.py,sha256=TTeqDuzS-_BFSNuUStVWmE2nGDpKuvUhBBJk_CCQXV0,19144
pip/_internal/vcs/mercurial.py,sha256=w1ZJWLKqNP1onEjkfjlwBVnMqPZNSIER8ayjQcnTq4w,5575
pip/_internal/vcs/subversion.py,sha256=uUgdPvxmvEB8Qwtjr0Hc0XgFjbiNi5cbvI4vARLOJXo,11787
pip/_internal/vcs/versioncontrol.py,sha256=Ma_HMZBVveSkeYvxacvqeujnkSIaF1XjxTsS3BwcJ8E,22599
pip/_internal/wheel_builder.py,sha256=yvEULStZtty9Kplp89tDis3hGdyKQ-2BUbFLmJ_5ink,9010
pip/_vendor/README.rst,sha256=t7IinjaiuwUh812XmVApQHJb8pTw33U8A9URqy6GlF4,9222
pip/_vendor/__init__.py,sha256=WzusPTGWIMeQQWSVJ0h2rafGkVTa9WKJ2HT-2-EoZrU,4907
pip/_vendor/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/cachecontrol/LICENSE.txt,sha256=hu7uh74qQ_P_H1ZJb0UfaSQ5JvAl_tuwM2ZsMExMFhs,558
pip/_vendor/cachecontrol/__init__.py,sha256=GxwRkm_TQBtPZpfpVK9r6S9dAy2DVnVgDVHJKTiPZ1k,820
pip/_vendor/cachecontrol/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/cachecontrol/__pycache__/_cmd.cpython-314.pyc,,
pip/_vendor/cachecontrol/__pycache__/adapter.cpython-314.pyc,,
pip/_vendor/cachecontrol/__pycache__/cache.cpython-314.pyc,,
pip/_vendor/cachecontrol/__pycache__/controller.cpython-314.pyc,,
pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-314.pyc,,
pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-314.pyc,,
pip/_vendor/cachecontrol/__pycache__/serialize.cpython-314.pyc,,
pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-314.pyc,,
pip/_vendor/cachecontrol/_cmd.py,sha256=iist2EpzJvDVIhMAxXq8iFnTBsiZAd6iplxfmNboNyk,1737
pip/_vendor/cachecontrol/adapter.py,sha256=W-HW-l01gyCsnxkOyCbqx7sxrWYoBbKrDsKkVVQN6NE,6586
pip/_vendor/cachecontrol/cache.py,sha256=OXwv7Fn2AwnKNiahJHnjtvaKLndvVLv_-zO-ltlV9qI,1953
pip/_vendor/cachecontrol/caches/__init__.py,sha256=dtrrroK5BnADR1GWjCZ19aZ0tFsMfvFBtLQQU1sp_ag,303
pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-314.pyc,,
pip/_vendor/cachecontrol/caches/__pycache__/redis_cache.cpython-314.pyc,,
pip/_vendor/cachecontrol/caches/file_cache.py,sha256=d8upFmy_zwaCmlbWEVBlLXFddt8Zw8c5SFpxeOZsdfw,4117
pip/_vendor/cachecontrol/caches/redis_cache.py,sha256=9rmqwtYu_ljVkW6_oLqbC7EaX_a8YT_yLuna-eS0dgo,1386
pip/_vendor/cachecontrol/controller.py,sha256=xBauC-vUSu5GsJsxD4-W-JaKqqbBz0MN6Zv8PA2N8hI,19102
pip/_vendor/cachecontrol/filewrapper.py,sha256=DhxC_rSk-beKdbsYhfvBUDovQHX9r3gHH_jP9-q_mKk,4354
pip/_vendor/cachecontrol/heuristics.py,sha256=gqMXU8w0gQuEQiSdu3Yg-0vd9kW7nrWKbLca75rheGE,4881
pip/_vendor/cachecontrol/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/cachecontrol/serialize.py,sha256=HQd2IllQ05HzPkVLMXTF2uX5mjEQjDBkxCqUJUODpZk,5163
pip/_vendor/cachecontrol/wrapper.py,sha256=hsGc7g8QGQTT-4f8tgz3AM5qwScg6FO0BSdLSRdEvpU,1417
pip/_vendor/certifi/LICENSE,sha256=6TcW2mucDVpKHfYP5pWzcPBpVgPSH2-D8FPkLPwQyvc,989
pip/_vendor/certifi/__init__.py,sha256=c9eaYufv1pSLl0Q8QNcMiMLLH4WquDcxdPyKjmI4opY,94
pip/_vendor/certifi/__main__.py,sha256=1k3Cr95vCxxGRGDljrW3wMdpZdL3Nhf0u1n-k2qdsCY,255
pip/_vendor/certifi/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/certifi/__pycache__/__main__.cpython-314.pyc,,
pip/_vendor/certifi/__pycache__/core.cpython-314.pyc,,
pip/_vendor/certifi/cacert.pem,sha256=_JFloSQDJj5-v72te-ej6sD6XTJdPHBGXyjTaQByyig,272441
pip/_vendor/certifi/core.py,sha256=gu_ECVI1m3Rq0ytpsNE61hgQGcKaOAt9Rs9G8KsTCOI,3442
pip/_vendor/certifi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/distlib/LICENSE.txt,sha256=gI4QyKarjesUn_mz-xn0R6gICUYG1xKpylf-rTVSWZ0,14531
pip/_vendor/distlib/__init__.py,sha256=Deo3uo98aUyIfdKJNqofeSEFWwDzrV2QeGLXLsgq0Ag,625
pip/_vendor/distlib/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/distlib/__pycache__/compat.cpython-314.pyc,,
pip/_vendor/distlib/__pycache__/resources.cpython-314.pyc,,
pip/_vendor/distlib/__pycache__/scripts.cpython-314.pyc,,
pip/_vendor/distlib/__pycache__/util.cpython-314.pyc,,
pip/_vendor/distlib/compat.py,sha256=2jRSjRI4o-vlXeTK2BCGIUhkc6e9ZGhSsacRM5oseTw,41467
pip/_vendor/distlib/resources.py,sha256=LwbPksc0A1JMbi6XnuPdMBUn83X7BPuFNWqPGEKI698,10820
pip/_vendor/distlib/scripts.py,sha256=Qvp76E9Jc3IgyYubnpqI9fS7eseGOe4FjpeVKqKt9Iw,18612
pip/_vendor/distlib/t32.exe,sha256=a0GV5kCoWsMutvliiCKmIgV98eRZ33wXoS-XrqvJQVs,97792
pip/_vendor/distlib/t64-arm.exe,sha256=68TAa32V504xVBnufojh0PcenpR3U4wAqTqf-MZqbPw,182784
pip/_vendor/distlib/t64.exe,sha256=gaYY8hy4fbkHYTTnA4i26ct8IQZzkBG2pRdy0iyuBrc,108032
pip/_vendor/distlib/util.py,sha256=vMPGvsS4j9hF6Y9k3Tyom1aaHLb0rFmZAEyzeAdel9w,66682
pip/_vendor/distlib/w32.exe,sha256=R4csx3-OGM9kL4aPIzQKRo5TfmRSHZo6QWyLhDhNBks,91648
pip/_vendor/distlib/w64-arm.exe,sha256=xdyYhKj0WDcVUOCb05blQYvzdYIKMbmJn2SZvzkcey4,168448
pip/_vendor/distlib/w64.exe,sha256=ejGf-rojoBfXseGLpya6bFTFPWRG21X5KvU8J5iU-K0,101888
pip/_vendor/distro/LICENSE,sha256=y16Ofl9KOYjhBjwULGDcLfdWBfTEZRXnduOspt-XbhQ,11325
pip/_vendor/distro/__init__.py,sha256=2fHjF-SfgPvjyNZ1iHh_wjqWdR_Yo5ODHwZC0jLBPhc,981
pip/_vendor/distro/__main__.py,sha256=bu9d3TifoKciZFcqRBuygV3GSuThnVD_m2IK4cz96Vs,64
pip/_vendor/distro/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/distro/__pycache__/__main__.cpython-314.pyc,,
pip/_vendor/distro/__pycache__/distro.cpython-314.pyc,,
pip/_vendor/distro/distro.py,sha256=XqbefacAhDT4zr_trnbA15eY8vdK4GTghgmvUGrEM_4,49430
pip/_vendor/distro/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/idna/LICENSE.md,sha256=t6M2q_OwThgOwGXN0W5wXQeeHMehT5EKpukYfza5zYc,1541
pip/_vendor/idna/__init__.py,sha256=MPqNDLZbXqGaNdXxAFhiqFPKEQXju2jNQhCey6-5eJM,868
pip/_vendor/idna/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/idna/__pycache__/codec.cpython-314.pyc,,
pip/_vendor/idna/__pycache__/compat.cpython-314.pyc,,
pip/_vendor/idna/__pycache__/core.cpython-314.pyc,,
pip/_vendor/idna/__pycache__/idnadata.cpython-314.pyc,,
pip/_vendor/idna/__pycache__/intranges.cpython-314.pyc,,
pip/_vendor/idna/__pycache__/package_data.cpython-314.pyc,,
pip/_vendor/idna/__pycache__/uts46data.cpython-314.pyc,,
pip/_vendor/idna/codec.py,sha256=M2SGWN7cs_6B32QmKTyTN6xQGZeYQgQ2wiX3_DR6loE,3438
pip/_vendor/idna/compat.py,sha256=RzLy6QQCdl9784aFhb2EX9EKGCJjg0P3PilGdeXXcx8,316
pip/_vendor/idna/core.py,sha256=P26_XVycuMTZ1R2mNK1ZREVzM5mvTzdabBXfyZVU1Lc,13246
pip/_vendor/idna/idnadata.py,sha256=SG8jhaGE53iiD6B49pt2pwTv_UvClciWE-N54oR2p4U,79623
pip/_vendor/idna/intranges.py,sha256=amUtkdhYcQG8Zr-CoMM_kVRacxkivC1WgxN1b63KKdU,1898
pip/_vendor/idna/package_data.py,sha256=_CUavOxobnbyNG2FLyHoN8QHP3QM9W1tKuw7eq9QwBk,21
pip/_vendor/idna/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/idna/uts46data.py,sha256=H9J35VkD0F9L9mKOqjeNGd2A-Va6FlPoz6Jz4K7h-ps,243725
pip/_vendor/msgpack/COPYING,sha256=SS3tuoXaWHL3jmCRvNH-pHTWYNNay03ulkuKqz8AdCc,614
pip/_vendor/msgpack/__init__.py,sha256=RA8gcqK17YpkxBnNwXJVa1oa2LygWDgfF1nA1NPw3mo,1109
pip/_vendor/msgpack/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/msgpack/__pycache__/exceptions.cpython-314.pyc,,
pip/_vendor/msgpack/__pycache__/ext.cpython-314.pyc,,
pip/_vendor/msgpack/__pycache__/fallback.cpython-314.pyc,,
pip/_vendor/msgpack/exceptions.py,sha256=dCTWei8dpkrMsQDcjQk74ATl9HsIBH0ybt8zOPNqMYc,1081
pip/_vendor/msgpack/ext.py,sha256=kteJv03n9tYzd5oo3xYopVTo4vRaAxonBQQJhXohZZo,5726
pip/_vendor/msgpack/fallback.py,sha256=0g1Pzp0vtmBEmJ5w9F3s_-JMVURP8RS4G1cc5TRaAsI,32390
pip/_vendor/packaging/LICENSE,sha256=ytHvW9NA1z4HS6YU0m996spceUDD2MNIUuZcSQlobEg,197
pip/_vendor/packaging/LICENSE.APACHE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
pip/_vendor/packaging/LICENSE.BSD,sha256=tw5-m3QvHMb5SLNMFqo5_-zpQZY2S8iP8NIYDwAo-sU,1344
pip/_vendor/packaging/__init__.py,sha256=QhMEdPu2XogrJzV3S0KWS6t7l0I9k8EeDRJl4fnw87s,494
pip/_vendor/packaging/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/_elffile.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/_manylinux.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/_musllinux.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/_parser.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/_structures.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/_tokenizer.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/dependency_groups.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/direct_url.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/errors.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/markers.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/metadata.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/pylock.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/requirements.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/specifiers.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/tags.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/utils.cpython-314.pyc,,
pip/_vendor/packaging/__pycache__/version.cpython-314.pyc,,
pip/_vendor/packaging/_elffile.py,sha256=-sKkptYqzYw2-x3QByJa5mB4rfPWu1pxkZHRx1WAFCY,3211
pip/_vendor/packaging/_manylinux.py,sha256=Hf6nB0cOrayEs96-p3oIXAgGnFquv20DO5l-o2_Xnv0,9559
pip/_vendor/packaging/_musllinux.py,sha256=Z6swjH3MA7XS3qXnmMN7QPhqP3fnoYI0eQ18e9-HgAE,2707
pip/_vendor/packaging/_parser.py,sha256=Kf2nsDw4c54X82pY8ba4F02Bve6OygGMAjL-Begqcew,11698
pip/_vendor/packaging/_structures.py,sha256=60jRbF78p8z5MKnNd6cAprgOadCJHV0DlmUmRBqFZcs,1109
pip/_vendor/packaging/_tokenizer.py,sha256=tFU2Wr-ZZJdAbkXLEJo7qUQDJaIkfft9DqaifiEND7A,5391
pip/_vendor/packaging/dependency_groups.py,sha256=XZIAVFK9uHG4RCGprmJn3VInUWMesxha_kytJuMO9eY,10218
pip/_vendor/packaging/direct_url.py,sha256=eKmbDiPP1sLV4Mj_kCSZqqknrIyVO9Sr7JpF8KCjp4U,10917
pip/_vendor/packaging/errors.py,sha256=6hfEYXAf8v_IF65-lFadJOMIieBP2xIKtyEXjG1nGIs,2680
pip/_vendor/packaging/licenses/__init__.py,sha256=_Jx0XRiD_58palsWnyLrLuh59ZpGCPIPXLKdZo9OJvQ,7293
pip/_vendor/packaging/licenses/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/packaging/licenses/__pycache__/_spdx.cpython-314.pyc,,
pip/_vendor/packaging/licenses/_spdx.py,sha256=WW7DXiyg68up_YND_wpRYlr1SHhiV4FfJLQffghhMxQ,51122
pip/_vendor/packaging/markers.py,sha256=QixBVcb9D2HjwEYiuhpNkbqk9znPRbU8zNX0kR1RIrU,17067
pip/_vendor/packaging/metadata.py,sha256=crAh0E3GVGVqPlu6EdRFsaG-Y6UYznTUqjuGKRGPv6c,38770
pip/_vendor/packaging/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/packaging/pylock.py,sha256=G_1gncTmDbRLY1jo4VDI9Uw-b5IErh_Q9V_BbVJTmD8,33890
pip/_vendor/packaging/requirements.py,sha256=Q-BdEHVW5K785GBXt7RcP4UEsdIKWoWFqlrHjR4WV50,4395
pip/_vendor/packaging/specifiers.py,sha256=3XBcSslm-YQEEEO_zrv4F6dR5wRxs4ErJvJ0vjNBfGM,71550
pip/_vendor/packaging/tags.py,sha256=ANYHZxYQVp9BlOQYOHU5ArDNVIpTFl4KlbocYVBWnFs,34236
pip/_vendor/packaging/utils.py,sha256=M7-JMKic2sP1YtV_8aW7eVGB-x3ADuKCiSrsVeCd2Uo,9848
pip/_vendor/packaging/version.py,sha256=Mcu7Tf6Y1i0gQ4FXv4t0g8cbL5joAEshjgIpz_2vISI,38393
pip/_vendor/pkg_resources/LICENSE,sha256=htoPAa6uRjSKPD1GUZXcHOzN55956HdppkuNoEsqR0E,1023
pip/_vendor/pkg_resources/__init__.py,sha256=vbTJ0_ruUgGxQjlEqsruFmiNPVyh2t9q-zyTDT053xI,124451
pip/_vendor/pkg_resources/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/platformdirs/LICENSE,sha256=KeD9YukphQ6G6yjD_czwzv30-pSHkBHP-z0NS-1tTbY,1089
pip/_vendor/platformdirs/__init__.py,sha256=UfeSHWl8AeTtbOBOoHAxK4dODOWkZtfy-m_i7cWdJ8c,22344
pip/_vendor/platformdirs/__main__.py,sha256=jBJ8zb7Mpx5ebcqF83xrpO94MaeCpNGHVf9cvDN2JLg,1505
pip/_vendor/platformdirs/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/platformdirs/__pycache__/__main__.cpython-314.pyc,,
pip/_vendor/platformdirs/__pycache__/android.cpython-314.pyc,,
pip/_vendor/platformdirs/__pycache__/api.cpython-314.pyc,,
pip/_vendor/platformdirs/__pycache__/macos.cpython-314.pyc,,
pip/_vendor/platformdirs/__pycache__/unix.cpython-314.pyc,,
pip/_vendor/platformdirs/__pycache__/version.cpython-314.pyc,,
pip/_vendor/platformdirs/__pycache__/windows.cpython-314.pyc,,
pip/_vendor/platformdirs/android.py,sha256=r0DshVBf-RO1jXJGX8C4Til7F1XWt-bkdWMgmvEiaYg,9013
pip/_vendor/platformdirs/api.py,sha256=wPHOlwOsfz2oqQZ6A2FcCu5kEAj-JondzoNOHYFQ0h8,9281
pip/_vendor/platformdirs/macos.py,sha256=0XoOgin1NK7Qki7iskD-oS8xKxw6bXgoKEgdqpCRAFQ,6322
pip/_vendor/platformdirs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/platformdirs/unix.py,sha256=WZmkUA--L3JNRGmz32s35YfoD3ica6xKIPdCV_HhLcs,10458
pip/_vendor/platformdirs/version.py,sha256=BI_dKLSMwlkl57vlxZnT8oVjPiUC2W_sdx_8_h99HeQ,704
pip/_vendor/platformdirs/windows.py,sha256=XvCfklGUMVxJbXit51jpYMN-lNeScPB82qS1CAeplL0,10362
pip/_vendor/pygments/LICENSE,sha256=qdZvHVJt8C4p3Oc0NtNOVuhjL0bCdbvf_HBWnogvnxc,1331
pip/_vendor/pygments/__init__.py,sha256=8uNqJCCwXqbEx5aSsBr0FykUQOBDKBihO5mPqiw1aqo,2983
pip/_vendor/pygments/__main__.py,sha256=WrndpSe6i1ckX_SQ1KaxD9CTKGzD0EuCOFxcbwFpoLU,353
pip/_vendor/pygments/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/__main__.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/console.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/filter.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/formatter.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/lexer.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/modeline.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/plugin.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/regexopt.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/scanner.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/sphinxext.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/style.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/token.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/unistring.cpython-314.pyc,,
pip/_vendor/pygments/__pycache__/util.cpython-314.pyc,,
pip/_vendor/pygments/console.py,sha256=AagDWqwea2yBWf10KC9ptBgMpMjxKp8yABAmh-NQOVk,1718
pip/_vendor/pygments/filter.py,sha256=YLtpTnZiu07nY3oK9nfR6E9Y1FBHhP5PX8gvkJWcfag,1910
pip/_vendor/pygments/filters/__init__.py,sha256=4U4jtA0X3iP83uQnB9-TI-HDSw8E8y8zMYHa0UjbbaI,40392
pip/_vendor/pygments/filters/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/pygments/formatter.py,sha256=KZQMmyo_xkOIkQG8g66LYEkBh1bx7a0HyGCBcvhI9Ew,4390
pip/_vendor/pygments/formatters/__init__.py,sha256=KTwBmnXlaopJhQDOemVHYHskiDghuq-08YtP6xPNJPg,5385
pip/_vendor/pygments/formatters/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/pygments/formatters/__pycache__/_mapping.cpython-314.pyc,,
pip/_vendor/pygments/formatters/_mapping.py,sha256=1Cw37FuQlNacnxRKmtlPX4nyLoX9_ttko5ZwscNUZZ4,4176
pip/_vendor/pygments/lexer.py,sha256=_kBrOJ_NT5Tl0IVM0rA9c8eysP6_yrlGzEQI0eVYB-A,35349
pip/_vendor/pygments/lexers/__init__.py,sha256=wbIME35GH7bI1B9rNPJFqWT-ij_RApZDYPUlZycaLzA,12115
pip/_vendor/pygments/lexers/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/pygments/lexers/__pycache__/_mapping.cpython-314.pyc,,
pip/_vendor/pygments/lexers/__pycache__/python.cpython-314.pyc,,
pip/_vendor/pygments/lexers/_mapping.py,sha256=l4tCXM8e9aPC2BD6sjIr0deT-J-z5tHgCwL-p1fS0PE,77602
pip/_vendor/pygments/lexers/python.py,sha256=vxjn1cOHclIKJKxoyiBsQTY65GHbkZtZRuKQ2AVCKaw,53853
pip/_vendor/pygments/modeline.py,sha256=K5eSkR8GS1r5OkXXTHOcV0aM_6xpk9eWNEIAW-OOJ2g,1005
pip/_vendor/pygments/plugin.py,sha256=tPx0rJCTIZ9ioRgLNYG4pifCbAwTRUZddvLw-NfAk2w,1891
pip/_vendor/pygments/regexopt.py,sha256=wXaP9Gjp_hKAdnICqoDkRxAOQJSc4v3X6mcxx3z-TNs,3072
pip/_vendor/pygments/scanner.py,sha256=nNcETRR1tRuiTaHmHSTTECVYFPcLf6mDZu1e4u91A9E,3092
pip/_vendor/pygments/sphinxext.py,sha256=5x7Zh9YlU6ISJ31dMwduiaanb5dWZnKg3MyEQsseNnQ,7981
pip/_vendor/pygments/style.py,sha256=PlOZqlsnTVd58RGy50vkA2cXQ_lP5bF5EGMEBTno6DA,6420
pip/_vendor/pygments/styles/__init__.py,sha256=x9ebctfyvCAFpMTlMJ5YxwcNYBzjgq6zJaKkNm78r4M,2042
pip/_vendor/pygments/styles/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/pygments/styles/__pycache__/_mapping.cpython-314.pyc,,
pip/_vendor/pygments/styles/_mapping.py,sha256=6lovFUE29tz6EsV3XYY4hgozJ7q1JL7cfO3UOlgnS8w,3312
pip/_vendor/pygments/token.py,sha256=WbdWGhYm_Vosb0DDxW9lHNPgITXfWTsQmHt6cy9RbcM,6226
pip/_vendor/pygments/unistring.py,sha256=al-_rBemRuGvinsrM6atNsHTmJ6DUbw24q2O2Ru1cBc,63208
pip/_vendor/pygments/util.py,sha256=oRtSpiAo5jM9ulntkvVbgXUdiAW57jnuYGB7t9fYuhc,10031
pip/_vendor/pyproject_hooks/LICENSE,sha256=GyKwSbUmfW38I6Z79KhNjsBLn9-xpR02DkK0NCyLQVQ,1081
pip/_vendor/pyproject_hooks/__init__.py,sha256=cPB_a9LXz5xvsRbX1o2qyAdjLatZJdQ_Lc5McNX-X7Y,691
pip/_vendor/pyproject_hooks/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/pyproject_hooks/__pycache__/_impl.cpython-314.pyc,,
pip/_vendor/pyproject_hooks/_impl.py,sha256=jY-raxnmyRyB57ruAitrJRUzEexuAhGTpgMygqx67Z4,14936
pip/_vendor/pyproject_hooks/_in_process/__init__.py,sha256=MJNPpfIxcO-FghxpBbxkG1rFiQf6HOUbV4U5mq0HFns,557
pip/_vendor/pyproject_hooks/_in_process/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/pyproject_hooks/_in_process/__pycache__/_in_process.cpython-314.pyc,,
pip/_vendor/pyproject_hooks/_in_process/_in_process.py,sha256=qcXMhmx__MIJq10gGHW3mA4Tl8dy8YzHMccwnNoKlw0,12216
pip/_vendor/pyproject_hooks/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/requests/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
pip/_vendor/requests/__init__.py,sha256=b6rlXPyuiLAd-s-pEPX7IejJnmIH1epCOFo_mLJrAck,5029
pip/_vendor/requests/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/__version__.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/_internal_utils.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/adapters.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/api.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/auth.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/certs.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/compat.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/cookies.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/exceptions.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/help.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/hooks.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/models.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/packages.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/sessions.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/status_codes.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/structures.cpython-314.pyc,,
pip/_vendor/requests/__pycache__/utils.cpython-314.pyc,,
pip/_vendor/requests/__version__.py,sha256=nZ3xT2HoQjEOL4OW7CM2tBWtrpfclaxuSz3bQZf_mbI,435
pip/_vendor/requests/_internal_utils.py,sha256=9_7fcdYfMFDfyK4hD2OsRgiGiq8kDwdZcGuRqkP5R1g,1502
pip/_vendor/requests/adapters.py,sha256=VahmpDjZCd8ERe4FfTci9NHXvtIOF7ds06gX0kWZfpo,26292
pip/_vendor/requests/api.py,sha256=_Zb9Oa7tzVIizTKwFrPjDEY9ejtm_OnSRERnADxGsQs,6449
pip/_vendor/requests/auth.py,sha256=KHXfnbNH2Fe4rdGJK3raL4O3nxkXyUlLizJJBEguhSc,10170
pip/_vendor/requests/certs.py,sha256=eD1G0RoMZ3kA0lydkw7oo0lmcKqvD1hhz6yOlgSKm8w,442
pip/_vendor/requests/compat.py,sha256=QfbmdTFiZzjSHMXiMrd4joCRU6RabtQ9zIcPoVaHIus,1822
pip/_vendor/requests/cookies.py,sha256=bNi-iqEj4NPZ00-ob-rHvzkvObzN3lEpgw3g6paS3Xw,18590
pip/_vendor/requests/exceptions.py,sha256=fz5n2nffa7Q30Ho9AnCuNekOo0S3BDIS7Vk4HQlakWs,4273
pip/_vendor/requests/help.py,sha256=lREO92zUuXe0gnkptnlWRtNVqdJ3SeNwSbHgAzqMa0Q,3740
pip/_vendor/requests/hooks.py,sha256=9frYhALsLBkHH76G-HYqvAvssSlu1C1b7L68cAs-E5g,734
pip/_vendor/requests/models.py,sha256=tvq5Hri4ZuW2oyQYHfoZ5oc688k8DzskE2au5sZWCUE,35530
pip/_vendor/requests/packages.py,sha256=_ZQDCJTJ8SP3kVWunSqBsRZNPzj2c1WFVqbdr08pz3U,1057
pip/_vendor/requests/sessions.py,sha256=gbmlsNSi96sIig0mrtHzZAZT_fOIWToe-YnW7v5ptKI,30645
pip/_vendor/requests/status_codes.py,sha256=iJUAeA25baTdw-6PfD0eF4qhpINDJRJI-yaMqxs4LEI,4322
pip/_vendor/requests/structures.py,sha256=-IbmhVz06S-5aPSZuUthZ6-6D9XOjRuTXHOabY041XM,2912
pip/_vendor/requests/utils.py,sha256=xpNppxOSoknLCd_nYKRM-80QrhxkZluQfiH5zOUMji8,32978
pip/_vendor/resolvelib/LICENSE,sha256=84j9OMrRMRLB3A9mm76A5_hFQe26-3LzAw0sp2QsPJ0,751
pip/_vendor/resolvelib/__init__.py,sha256=yoX-d4STvwGGCiQRE5cJC9Cter69SgVgqClxOCvSP7M,541
pip/_vendor/resolvelib/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/resolvelib/__pycache__/providers.cpython-314.pyc,,
pip/_vendor/resolvelib/__pycache__/reporters.cpython-314.pyc,,
pip/_vendor/resolvelib/__pycache__/structs.cpython-314.pyc,,
pip/_vendor/resolvelib/providers.py,sha256=pIWJbIdJJ9GFtNbtwTH0Ia43Vj6hYCEJj2DOLue15FM,8914
pip/_vendor/resolvelib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/resolvelib/reporters.py,sha256=pNJf4nFxLpAeKxlBUi2GEj0a2Ij1nikY0UabTKXesT4,2037
pip/_vendor/resolvelib/resolvers/__init__.py,sha256=728M3EvmnPbVXS7ExXlv2kMu6b7wEsoPutEfl-uVk_I,640
pip/_vendor/resolvelib/resolvers/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/resolvelib/resolvers/__pycache__/abstract.cpython-314.pyc,,
pip/_vendor/resolvelib/resolvers/__pycache__/criterion.cpython-314.pyc,,
pip/_vendor/resolvelib/resolvers/__pycache__/exceptions.cpython-314.pyc,,
pip/_vendor/resolvelib/resolvers/__pycache__/resolution.cpython-314.pyc,,
pip/_vendor/resolvelib/resolvers/abstract.py,sha256=CNeQPnpAudY77nmzOkONSmAgRlzIf06X-X9mvRYODms,1543
pip/_vendor/resolvelib/resolvers/criterion.py,sha256=lcmZGv5sKHOnFD_RzZwvlGSj19MeA-5rCMpdf2Sgw7Y,1768
pip/_vendor/resolvelib/resolvers/exceptions.py,sha256=ln_jaQtgLlRUSFY627yiHG2gD7AgaXzRKaElFVh7fDQ,1768
pip/_vendor/resolvelib/resolvers/resolution.py,sha256=3J_zkW-sD3EY-BlNXjyln__njpyH5n0UZJT6uV7CheA,24212
pip/_vendor/resolvelib/structs.py,sha256=pu-EJiR2IBITr2SQeNPRa0rXhjlStfmO_GEgAhr3004,6420
pip/_vendor/rich/LICENSE,sha256=3u18F6QxgVgZCj6iOcyHmlpQJxzruYrnAl9I--WNyhU,1056
pip/_vendor/rich/__init__.py,sha256=dRxjIL-SbFVY0q3IjSMrfgBTHrm1LZDgLOygVBwiYZc,6090
pip/_vendor/rich/__main__.py,sha256=e_aVC-tDzarWQW9SuZMuCgBr6ODV_iDNV2Wh2xkxOlw,7896
pip/_vendor/rich/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/__main__.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_cell_widths.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_emoji_codes.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_emoji_replace.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_export_format.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_extension.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_fileno.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_inspect.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_log_render.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_loop.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_null_file.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_palettes.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_pick.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_ratio.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_spinners.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_stack.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_timer.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_win32_console.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_windows.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_windows_renderer.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/_wrap.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/abc.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/align.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/ansi.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/bar.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/box.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/cells.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/color.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/color_triplet.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/columns.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/console.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/constrain.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/containers.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/control.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/default_styles.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/diagnose.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/emoji.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/errors.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/file_proxy.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/filesize.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/highlighter.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/json.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/jupyter.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/layout.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/live.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/live_render.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/logging.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/markup.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/measure.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/padding.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/pager.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/palette.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/panel.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/pretty.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/progress.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/progress_bar.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/prompt.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/protocol.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/region.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/repr.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/rule.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/scope.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/screen.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/segment.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/spinner.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/status.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/style.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/styled.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/syntax.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/table.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/terminal_theme.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/text.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/theme.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/themes.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/traceback.cpython-314.pyc,,
pip/_vendor/rich/__pycache__/tree.cpython-314.pyc,,
pip/_vendor/rich/_cell_widths.py,sha256=fbmeyetEdHjzE_Vx2l1uK7tnPOhMs2X1lJfO3vsKDpA,10209
pip/_vendor/rich/_emoji_codes.py,sha256=hu1VL9nbVdppJrVoijVshRlcRRe_v3dju3Mmd2sKZdY,140235
pip/_vendor/rich/_emoji_replace.py,sha256=n-kcetsEUx2ZUmhQrfeMNc-teeGhpuSQ5F8VPBsyvDo,1064
pip/_vendor/rich/_export_format.py,sha256=RI08pSrm5tBSzPMvnbTqbD9WIalaOoN5d4M1RTmLq1Y,2128
pip/_vendor/rich/_extension.py,sha256=Xt47QacCKwYruzjDi-gOBq724JReDj9Cm9xUi5fr-34,265
pip/_vendor/rich/_fileno.py,sha256=HWZxP5C2ajMbHryvAQZseflVfQoGzsKOHzKGsLD8ynQ,799
pip/_vendor/rich/_inspect.py,sha256=ROT0PLC2GMWialWZkqJIjmYq7INRijQQkoSokWTaAiI,9656
pip/_vendor/rich/_log_render.py,sha256=1ByI0PA1ZpxZY3CGJOK54hjlq4X-Bz_boIjIqCd8Kns,3225
pip/_vendor/rich/_loop.py,sha256=hV_6CLdoPm0va22Wpw4zKqM0RYsz3TZxXj0PoS-9eDQ,1236
pip/_vendor/rich/_null_file.py,sha256=ADGKp1yt-k70FMKV6tnqCqecB-rSJzp-WQsD7LPL-kg,1394
pip/_vendor/rich/_palettes.py,sha256=cdev1JQKZ0JvlguV9ipHgznTdnvlIzUFDBb0It2PzjI,7063
pip/_vendor/rich/_pick.py,sha256=evDt8QN4lF5CiwrUIXlOJCntitBCOsI3ZLPEIAVRLJU,423
pip/_vendor/rich/_ratio.py,sha256=IOtl78sQCYZsmHyxhe45krkb68u9xVz7zFsXVJD-b2Y,5325
pip/_vendor/rich/_spinners.py,sha256=U2r1_g_1zSjsjiUdAESc2iAMc3i4ri_S8PYP6kQ5z1I,19919
pip/_vendor/rich/_stack.py,sha256=-C8OK7rxn3sIUdVwxZBBpeHhIzX0eI-VM3MemYfaXm0,351
pip/_vendor/rich/_timer.py,sha256=zelxbT6oPFZnNrwWPpc1ktUeAT-Vc4fuFcRZLQGLtMI,417
pip/_vendor/rich/_win32_console.py,sha256=BSaDRIMwBLITn_m0mTRLPqME5q-quGdSMuYMpYeYJwc,22755
pip/_vendor/rich/_windows.py,sha256=aBwaD_S56SbgopIvayVmpk0Y28uwY2C5Bab1wl3Bp-I,1925
pip/_vendor/rich/_windows_renderer.py,sha256=t74ZL3xuDCP3nmTp9pH1L5LiI2cakJuQRQleHCJerlk,2783
pip/_vendor/rich/_wrap.py,sha256=FlSsom5EX0LVkA3KWy34yHnCfLtqX-ZIepXKh-70rpc,3404
pip/_vendor/rich/abc.py,sha256=ON-E-ZqSSheZ88VrKX2M3PXpFbGEUUZPMa_Af0l-4f0,890
pip/_vendor/rich/align.py,sha256=dg-7uY0ukMLLlUEsBDRLva22_sQgIJD4BK0dmZHFHug,10324
pip/_vendor/rich/ansi.py,sha256=Avs1LHbSdcyOvDOdpELZUoULcBiYewY76eNBp6uFBhs,6921
pip/_vendor/rich/bar.py,sha256=ldbVHOzKJOnflVNuv1xS7g6dLX2E3wMnXkdPbpzJTcs,3263
pip/_vendor/rich/box.py,sha256=kmavBc_dn73L_g_8vxWSwYJD2uzBXOUFTtJOfpbczcM,10686
pip/_vendor/rich/cells.py,sha256=KrQkj5-LghCCpJLSNQIyAZjndc4bnEqOEmi5YuZ9UCY,5130
pip/_vendor/rich/color.py,sha256=3HSULVDj7qQkXUdFWv78JOiSZzfy5y1nkcYhna296V0,18211
pip/_vendor/rich/color_triplet.py,sha256=3lhQkdJbvWPoLDO-AnYImAWmJvV5dlgYNCVZ97ORaN4,1054
pip/_vendor/rich/columns.py,sha256=HUX0KcMm9dsKNi11fTbiM_h2iDtl8ySCaVcxlalEzq8,7131
pip/_vendor/rich/console.py,sha256=t9azZpmRMVU5cphVBZSShNsmBxd2-IAWcTTlhor-E1s,100849
pip/_vendor/rich/constrain.py,sha256=1VIPuC8AgtKWrcncQrjBdYqA3JVWysu6jZo1rrh7c7Q,1288
pip/_vendor/rich/containers.py,sha256=c_56TxcedGYqDepHBMTuZdUIijitAQgnox-Qde0Z1qo,5502
pip/_vendor/rich/control.py,sha256=EUTSUFLQbxY6Zmo_sdM-5Ls323vIHTBfN8TPulqeHUY,6487
pip/_vendor/rich/default_styles.py,sha256=khQFqqaoDs3bprMqWpHw8nO5UpG2DN6QtuTd6LzZwYc,8257
pip/_vendor/rich/diagnose.py,sha256=fJl1TItRn19gGwouqTg-8zPUW3YqQBqGltrfPQs1H9w,1025
pip/_vendor/rich/emoji.py,sha256=Wd4bQubZdSy6-PyrRQNuMHtn2VkljK9uPZPVlu2cmx0,2367
pip/_vendor/rich/errors.py,sha256=5pP3Kc5d4QJ_c0KFsxrfyhjiPVe7J1zOqSFbFAzcV-Y,642
pip/_vendor/rich/file_proxy.py,sha256=Tl9THMDZ-Pk5Wm8sI1gGg_U5DhusmxD-FZ0fUbcU0W0,1683
pip/_vendor/rich/filesize.py,sha256=_iz9lIpRgvW7MNSeCZnLg-HwzbP4GETg543WqD8SFs0,2484
pip/_vendor/rich/highlighter.py,sha256=G_sn-8DKjM1sEjLG_oc4ovkWmiUpWvj8bXi0yed2LnY,9586
pip/_vendor/rich/json.py,sha256=vVEoKdawoJRjAFayPwXkMBPLy7RSTs-f44wSQDR2nJ0,5031
pip/_vendor/rich/jupyter.py,sha256=QyoKoE_8IdCbrtiSHp9TsTSNyTHY0FO5whE7jOTd9UE,3252
pip/_vendor/rich/layout.py,sha256=ajkSFAtEVv9EFTcFs-w4uZfft7nEXhNzL7ZVdgrT5rI,14004
pip/_vendor/rich/live.py,sha256=tF3ukAAJZ_N2ZbGclqZ-iwLoIoZ8f0HHUz79jAyJqj8,15180
pip/_vendor/rich/live_render.py,sha256=It_39YdzrBm8o3LL0kaGorPFg-BfZWAcrBjLjFokbx4,3521
pip/_vendor/rich/logging.py,sha256=5KaPPSMP9FxcXPBcKM4cGd_zW78PMgf-YbMVnvfSw0o,12468
pip/_vendor/rich/markup.py,sha256=3euGKP5s41NCQwaSjTnJxus5iZMHjxpIM0W6fCxra38,8451
pip/_vendor/rich/measure.py,sha256=HmrIJX8sWRTHbgh8MxEay_83VkqNW_70s8aKP5ZcYI8,5305
pip/_vendor/rich/padding.py,sha256=KVEI3tOwo9sgK1YNSuH__M1_jUWmLZwRVV_KmOtVzyM,4908
pip/_vendor/rich/pager.py,sha256=SO_ETBFKbg3n_AgOzXm41Sv36YxXAyI3_R-KOY2_uSc,828
pip/_vendor/rich/palette.py,sha256=lInvR1ODDT2f3UZMfL1grq7dY_pDdKHw4bdUgOGaM4Y,3396
pip/_vendor/rich/panel.py,sha256=9sQl00hPIqH5G2gALQo4NepFwpP0k9wT-s_gOms5pIc,11157
pip/_vendor/rich/pretty.py,sha256=gy3S72u4FRg2ytoo7N1ZDWDIvB4unbzd5iUGdgm-8fc,36391
pip/_vendor/rich/progress.py,sha256=CUc2lkU-X59mVdGfjMCBkZeiGPL3uxdONjhNJF2T7wY,60408
pip/_vendor/rich/progress_bar.py,sha256=mZTPpJUwcfcdgQCTTz3kyY-fc79ddLwtx6Ghhxfo064,8162
pip/_vendor/rich/prompt.py,sha256=l0RhQU-0UVTV9e08xW1BbIj0Jq2IXyChX4lC0lFNzt4,12447
pip/_vendor/rich/protocol.py,sha256=5hHHDDNHckdk8iWH5zEbi-zuIVSF5hbU2jIo47R7lTE,1391
pip/_vendor/rich/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/rich/region.py,sha256=rNT9xZrVZTYIXZC0NYn41CJQwYNbR-KecPOxTgQvB8Y,166
pip/_vendor/rich/repr.py,sha256=5MZJZmONgC6kud-QW-_m1okXwL2aR6u6y-pUcUCJz28,4431
pip/_vendor/rich/rule.py,sha256=0fNaS_aERa3UMRc3T5WMpN_sumtDxfaor2y3of1ftBk,4602
pip/_vendor/rich/scope.py,sha256=TMUU8qo17thyqQCPqjDLYpg_UU1k5qVd-WwiJvnJVas,2843
pip/_vendor/rich/screen.py,sha256=YoeReESUhx74grqb0mSSb9lghhysWmFHYhsbMVQjXO8,1591
pip/_vendor/rich/segment.py,sha256=otnKeKGEV-WRlQVosfJVeFDcDxAKHpvJ_hLzSu5lumM,24743
pip/_vendor/rich/spinner.py,sha256=onIhpKlljRHppTZasxO8kXgtYyCHUkpSgKglRJ3o51g,4214
pip/_vendor/rich/status.py,sha256=kkPph3YeAZBo-X-4wPp8gTqZyU466NLwZBA4PZTTewo,4424
pip/_vendor/rich/style.py,sha256=W9Ccy8Py8lNICtlfcp-ryzMTuQaGxAU3av7-g5fHu0s,26990
pip/_vendor/rich/styled.py,sha256=eZNnzGrI4ki_54pgY3Oj0T-x3lxdXTYh4_ryDB24wBU,1258
pip/_vendor/rich/syntax.py,sha256=eDKIRwl--eZ0Lwo2da2RRtfutXGavrJO61Cl5OkS59U,36371
pip/_vendor/rich/table.py,sha256=ZmT7V7MMCOYKw7TGY9SZLyYDf6JdM-WVf07FdVuVhTI,40049
pip/_vendor/rich/terminal_theme.py,sha256=1j5-ufJfnvlAo5Qsi_ACZiXDmwMXzqgmFByObT9-yJY,3370
pip/_vendor/rich/text.py,sha256=AO7JPCz6-gaN1thVLXMBntEmDPVYFgFNG1oM61_sanU,47552
pip/_vendor/rich/theme.py,sha256=oNyhXhGagtDlbDye3tVu3esWOWk0vNkuxFw-_unlaK0,3771
pip/_vendor/rich/themes.py,sha256=0xgTLozfabebYtcJtDdC5QkX5IVUEaviqDUJJh4YVFk,102
pip/_vendor/rich/traceback.py,sha256=c0WmB_L04_UfZbLaoH982_U_s7eosxKMUiAVmDPdRYU,35861
pip/_vendor/rich/tree.py,sha256=yWnQ6rAvRGJ3qZGqBrxS2SW2TKBTNrP0SdY8QxOFPuw,9451
pip/_vendor/tomli/LICENSE,sha256=uAgWsNUwuKzLTCIReDeQmEpuO2GSLCte6S8zcqsnQv4,1072
pip/_vendor/tomli/__init__.py,sha256=qs0S40oJfkXIQkncdYZzP8xYf0pUJb180xGS3jQPXtc,314
pip/_vendor/tomli/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/tomli/__pycache__/_parser.cpython-314.pyc,,
pip/_vendor/tomli/__pycache__/_re.cpython-314.pyc,,
pip/_vendor/tomli/__pycache__/_types.cpython-314.pyc,,
pip/_vendor/tomli/_parser.py,sha256=3FFi5lACz9ef4mjYKW4Sw48e15hvdgAOIEvFANUcft8,26232
pip/_vendor/tomli/_re.py,sha256=n8-Io8ZK1U-F6jzlg7Pabc40hLFJsawE2uNLKH9w7iU,3235
pip/_vendor/tomli/_types.py,sha256=-GTG2VUqkpxwMqzmVO4F7ybKddIbAnuAHXfmWQcTi3Q,254
pip/_vendor/tomli/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
pip/_vendor/tomli_w/LICENSE,sha256=uAgWsNUwuKzLTCIReDeQmEpuO2GSLCte6S8zcqsnQv4,1072
pip/_vendor/tomli_w/__init__.py,sha256=0F8yDtXx3Uunhm874KrAcP76srsM98y7WyHQwCulZbo,169
pip/_vendor/tomli_w/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/tomli_w/__pycache__/_writer.cpython-314.pyc,,
pip/_vendor/tomli_w/_writer.py,sha256=dsifFS2xYf1i76mmRyfz9y125xC7Z_HQ845ZKhJsYXs,6961
pip/_vendor/tomli_w/py.typed,sha256=8PjyZ1aVoQpRVvt71muvuq5qE-jTFZkK-GLHkhdebmc,26
pip/_vendor/truststore/LICENSE,sha256=M757fo-k_Rmxdg4ajtimaL2rhSyRtpLdQUJLy3Jan8o,1086
pip/_vendor/truststore/__init__.py,sha256=Bu7kqkmpunhLsj5xCu8gT_25ktoPXcSnwe8VHk1GmJo,1320
pip/_vendor/truststore/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/truststore/__pycache__/_api.cpython-314.pyc,,
pip/_vendor/truststore/__pycache__/_macos.cpython-314.pyc,,
pip/_vendor/truststore/__pycache__/_openssl.cpython-314.pyc,,
pip/_vendor/truststore/__pycache__/_ssl_constants.cpython-314.pyc,,
pip/_vendor/truststore/__pycache__/_windows.cpython-314.pyc,,
pip/_vendor/truststore/_api.py,sha256=CYJCV5BTfttZYfqY3movdMBE-8az7uhET_LYbKT2Nn4,11413
pip/_vendor/truststore/_macos.py,sha256=nZlLkOmszUE0g6ryRwBVGY5COzPyudcsiJtDWarM5LQ,20503
pip/_vendor/truststore/_openssl.py,sha256=zB-SQvJydks7tQ0yIwrP6GD3fQNSSaPiq7zw4yF5T40,2412
pip/_vendor/truststore/_ssl_constants.py,sha256=NUD4fVKdSD02ri7-db0tnO0VqLP9aHuzmStcW7tAl08,1130
pip/_vendor/truststore/_windows.py,sha256=rAHyKYD8M7t-bXfG8VgOVa3TpfhVhbt4rZQlO45YuP8,17993
pip/_vendor/truststore/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/urllib3/LICENSE.txt,sha256=Ew46ZNX91dCWp1JpRjSn2d8oRGnehuVzIQAmgEHj1oY,1093
pip/_vendor/urllib3/__init__.py,sha256=JMo1tg1nIV1AeJ2vENC_Txfl0e5h6Gzl9DGVk1rWRbo,6979
pip/_vendor/urllib3/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/urllib3/__pycache__/_base_connection.cpython-314.pyc,,
pip/_vendor/urllib3/__pycache__/_collections.cpython-314.pyc,,
pip/_vendor/urllib3/__pycache__/_request_methods.cpython-314.pyc,,
pip/_vendor/urllib3/__pycache__/_version.cpython-314.pyc,,
pip/_vendor/urllib3/__pycache__/connection.cpython-314.pyc,,
pip/_vendor/urllib3/__pycache__/connectionpool.cpython-314.pyc,,
pip/_vendor/urllib3/__pycache__/exceptions.cpython-314.pyc,,
pip/_vendor/urllib3/__pycache__/fields.cpython-314.pyc,,
pip/_vendor/urllib3/__pycache__/filepost.cpython-314.pyc,,
pip/_vendor/urllib3/__pycache__/poolmanager.cpython-314.pyc,,
pip/_vendor/urllib3/__pycache__/response.cpython-314.pyc,,
pip/_vendor/urllib3/_base_connection.py,sha256=T1cwH3RhzsrBh6Bz3AOGVDboRsE7veijqZPXXQTR2Rg,5568
pip/_vendor/urllib3/_collections.py,sha256=UvV7UqtGTSKdvw8N_LxWuEikZLm5gB1zFfTZYH9KhAk,17595
pip/_vendor/urllib3/_request_methods.py,sha256=gCeF85SO_UU4WoPwYHIoz_tw-eM_EVOkLFp8OFsC7DA,9931
pip/_vendor/urllib3/_version.py,sha256=vKE8or0mmqgsFpVb7FYms-nNOVCPPAEifgxVrTaPByw,704
pip/_vendor/urllib3/connection.py,sha256=1ZR2gqfFdIzTYIUwF0K5nftg26hLqU5nr1yHTdKb7WA,42800
pip/_vendor/urllib3/connectionpool.py,sha256=ZEhudsa8BIubD2M0XoxBBsjxbsXwMgUScH7oQ9i-j1Y,43371
pip/_vendor/urllib3/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
pip/_vendor/urllib3/contrib/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/urllib3/contrib/__pycache__/pyopenssl.cpython-314.pyc,,
pip/_vendor/urllib3/contrib/__pycache__/socks.cpython-314.pyc,,
pip/_vendor/urllib3/contrib/emscripten/__init__.py,sha256=ZruXaWKVzAEJdqNH3NEh0mrHrw--2VZYb0zX0RonNZA,870
pip/_vendor/urllib3/contrib/emscripten/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/urllib3/contrib/emscripten/__pycache__/connection.cpython-314.pyc,,
pip/_vendor/urllib3/contrib/emscripten/__pycache__/fetch.cpython-314.pyc,,
pip/_vendor/urllib3/contrib/emscripten/__pycache__/request.cpython-314.pyc,,
pip/_vendor/urllib3/contrib/emscripten/__pycache__/response.cpython-314.pyc,,
pip/_vendor/urllib3/contrib/emscripten/connection.py,sha256=giElsBoUsKVURbZzb8GCrJmqW23Xnvj2aNyQVF42slg,8960
pip/_vendor/urllib3/contrib/emscripten/emscripten_fetch_worker.js,sha256=z1k3zZ4_hDKd3-tN7wzz8LHjHC2pxN_uu8B3k9D9A3c,3677
pip/_vendor/urllib3/contrib/emscripten/fetch.py,sha256=5xcd--viFxZd2nBy0aK73dtJ9Tsh1yYZU_SUXwnwibk,23520
pip/_vendor/urllib3/contrib/emscripten/request.py,sha256=mL28szy1KvE3NJhWor5jNmarp8gwplDU-7gwGZY5g0Q,566
pip/_vendor/urllib3/contrib/emscripten/response.py,sha256=7oVPENYZHuzEGRtG40HonpH5tAIYHsGcHPbJt2Z0U-Y,9507
pip/_vendor/urllib3/contrib/pyopenssl.py,sha256=nXZKMoHsi4mPP5K3rh0OdIbxNIf8AZ0mFUEe46G2kec,19750
pip/_vendor/urllib3/contrib/socks.py,sha256=eB2eWfu8Wz1fn-qvr_qE_dZAceck2Ncv7XQ15DlvVbU,7547
pip/_vendor/urllib3/exceptions.py,sha256=eeQ77nJjF97bP6SvCK4gmx6BpQZKU8yjvM-AIDwZdX8,9952
pip/_vendor/urllib3/fields.py,sha256=FCf7UULSkf10cuTRUWTQESzxgl1WT8e2aCy3kfyZins,10829
pip/_vendor/urllib3/filepost.py,sha256=U8eNZ-mpKKHhrlbHEEiTxxgK16IejhEa7uz42yqA_dI,2388
pip/_vendor/urllib3/http2/__init__.py,sha256=xzrASH7R5ANRkPJOot5lGnATOq3KKuyXzI42rcnwmqs,1741
pip/_vendor/urllib3/http2/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/urllib3/http2/__pycache__/connection.cpython-314.pyc,,
pip/_vendor/urllib3/http2/__pycache__/probe.cpython-314.pyc,,
pip/_vendor/urllib3/http2/connection.py,sha256=bHMH6fNvatwXPrKqrcn74yA3pUWcqPDppnK1LcKCbP8,12578
pip/_vendor/urllib3/http2/probe.py,sha256=nnAkqbhAakOiF75rz7W0udZ38Eeh_uD8fjV74N73FEI,3014
pip/_vendor/urllib3/poolmanager.py,sha256=2pkDujt-6CTSerSwXfkxTvcM93E2lsNHHb4J_Ae6NNM,23845
pip/_vendor/urllib3/py.typed,sha256=UaCuPFa3H8UAakbt-5G8SPacldTOGvJv18pPjUJ5gDY,93
pip/_vendor/urllib3/response.py,sha256=eEj6tX98Zp21lgRC8xAHPdiI5bRdHlkuKUcAjrUyU78,52743
pip/_vendor/urllib3/util/__init__.py,sha256=-qeS0QceivazvBEKDNFCAI-6ACcdDOE4TMvo7SLNlAQ,1001
pip/_vendor/urllib3/util/__pycache__/__init__.cpython-314.pyc,,
pip/_vendor/urllib3/util/__pycache__/connection.cpython-314.pyc,,
pip/_vendor/urllib3/util/__pycache__/proxy.cpython-314.pyc,,
pip/_vendor/urllib3/util/__pycache__/request.cpython-314.pyc,,
pip/_vendor/urllib3/util/__pycache__/response.cpython-314.pyc,,
pip/_vendor/urllib3/util/__pycache__/retry.cpython-314.pyc,,
pip/_vendor/urllib3/util/__pycache__/ssl_.cpython-314.pyc,,
pip/_vendor/urllib3/util/__pycache__/ssl_match_hostname.cpython-314.pyc,,
pip/_vendor/urllib3/util/__pycache__/ssltransport.cpython-314.pyc,,
pip/_vendor/urllib3/util/__pycache__/timeout.cpython-314.pyc,,
pip/_vendor/urllib3/util/__pycache__/url.cpython-314.pyc,,
pip/_vendor/urllib3/util/__pycache__/util.cpython-314.pyc,,
pip/_vendor/urllib3/util/__pycache__/wait.cpython-314.pyc,,
pip/_vendor/urllib3/util/connection.py,sha256=JjO722lzHlzLXPTkr9ZWBdhseXnMVjMSb1DJLVrXSnQ,4444
pip/_vendor/urllib3/util/proxy.py,sha256=seP8-Q5B6bB0dMtwPj-YcZZQ30vHuLqRu-tI0JZ2fzs,1148
pip/_vendor/urllib3/util/request.py,sha256=p9Ki9eo1tFBO-jqV_7KmmJ60RKqoY2r4ao0SmaHLyOs,8086
pip/_vendor/urllib3/util/response.py,sha256=vQE639uoEhj1vpjEdxu5lNIhJCSUZkd7pqllUI0BZOA,3374
pip/_vendor/urllib3/util/retry.py,sha256=WOcIHVaxKf-dVb89lUbpvcpeM7rNYF_vsKsCOKw10Z8,19235
pip/_vendor/urllib3/util/ssl_.py,sha256=Y9RNkWCIehDxIRvyFnHUjiMlPolm368GYMya2YdDOag,19929
pip/_vendor/urllib3/util/ssl_match_hostname.py,sha256=Di7DU7zokoltapT_F0Sj21ffYxwaS_cE5apOtwueeyA,5845
pip/_vendor/urllib3/util/ssltransport.py,sha256=Ez4O8pR_vT8dan_FvqBYS6dgDfBXEMfVfrzcdUoWfi4,8847
pip/_vendor/urllib3/util/timeout.py,sha256=vsUJRpO0nfKk-y1OKlgFGY1ONJGPgkaZ7B7kruEpVYw,10363
pip/_vendor/urllib3/util/url.py,sha256=PEDQMypidude0nAZctLLiFK9epN-LPnSH7KpOLLwqH0,15256
pip/_vendor/urllib3/util/util.py,sha256=j3lbZK1jPyiwD34T8IgJzdWEZVT-4E-0vYIJi9UjeNA,1146
pip/_vendor/urllib3/util/wait.py,sha256=_ph8IrUR3sqPqi0OopQgJUlH4wzkGeM5CiyA7XGGtmI,4423
pip/_vendor/vendor.txt,sha256=52c7zlghmshnINutv0knkh1sIT8jY7epMMHgFZTuowI,316
pip/py.typed,sha256=EBVvvPRTn_eIpz5e5QztSCdrMX7Qwd7VP93RSoIlZ2I,2861234Wheel-Version: 1.0Generator: flit 3.12.0Root-Is-Purelib: trueTag: py3-none-any1234[console_scripts]pip=pip._internal.cli.main:mainpip3=pip._internal.cli.main:main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867@Switch01A_RogAakanksha AgrawalAarni KoskelaAbhinav SagarABHYUDAY PRATAP SINGHabs51295AceGentileAdam ChainzAdam TseAdam TurnerAdam WentzadminAdolfo OchagavíaAdrien MorisonAgusahayrapetyanAhilyaAinsworthKAkash SrivastavaAlan YeeAlbert TugushevAlbert-GuanalbertgAlberto SottileAleks BuninAles ErjavecAlessandro MolinaAlethea FlowersAlex GaynorAlex GrönholmAlex HedgesAlex LoosleyAlex MoregaAlex StachowiakAlexander RegueiroAlexander ShtyrovAlexandre ConradAlexey PopravkaAleš ErjavecAlliAmanAmi FischmanAnanya MaitiAnatoly TechtonikAnders KaseorgAndre AguiarAndreas LutroAndrei GeacarAndrew GaulAndrew ShymanelAndrey BienkowskiAndrey BulgakovAndrés DelfinoAndy FreelandAndy KlugerAni HayrapetyanAniruddha BasakAnish TambeAnrs HuAnthony SottileAntoine LambertAntoine MussoAnton OvchinnikovAnton PatrushevAnton ZelenovAntonio Alvarado HernandezAntony LeeAntti KaiholaAnubhav PatelAnudit NagarAnuj GodaseAQNOUCH MohammedAraHaanarenaarenasysArindam ChoudhuryArmin RonacherArnon YaariArtemArun Babu NeelicattuAshley MantonAshwin RamaswamiatseAtsushi OdagiriAvinash KarhanaAvner CohenAwit (Ah-Wit) GhirmaiBaptiste MispelonBarney GalebarneygaleBartek OgryczakBastian VenthurBen BodenmillerBen DarnellBen HoytBen MaresBen RosserBence NagyBenjamin PetersonBenjamin VanEveryBenoit PierreBerker PeksagBernardBernard TyersBernardo B. MarquesBernhard M. WiedemannBertil HattBhavam VidyarthiBlazej MichalikBogdan OpanchukBorisZZZBrad EricksonBradley AyersBradley ReynoldsBranch VincentBrandon L. ReissBrandt BucherBrannon DorseyBrett RandallBrett RosenBrian CristanteBrian RosnerbriantracyBrownTruckBruno OliveiraBruno ReniéBruno SBstrdsmkrBuck GolemonburrowsBussonnier Matthiasbwoodsendc22Caleb BrownCaleb MartinezCalvin SmithCarl MeyerCarlos LiamCarol WillingCarter ThayerCassChandrasekhar AtinaCharlie MarshcharwickChih-Hsuan YenChris BrinkerChris HuntChris JerdonekChris KuehlChris MarkiewiczChris McDonoughChris PawleyChris PryerChris WolfeChristian ClaussChristian HeimesChristian OudardChristoph ReiterChristopher HuntChristopher Snyderchryslecjc7373Clark BoylanClaudio JolowiczClay McClureCodyCody SoylandColin WatsonCollin AndersonConnor OsbornCooper LeesCooper Ry LeesCory BenfieldCory WrightCraig KerstiensCristian SorinelCristinaCristina Muñozctg123Curtis DotycytolentinoDaan De MeyerDaleDamianDamian QuirogaDamian ShawDan BlackDan SavilonisDan SullyDane HillarddanielDaniel CollinsDaniel HahlerDaniel HollasDaniel HolthDaniel JostDaniel KatzDaniel ShaulovDaniele EspostiDaniele NicolodiDaniele ProcidaDaniil KonovalenkoDanny HermesDanny McClanahanDarren KavanaghDav ClarkDave AbrahamsDave JonesDavid AguilarDavid BlackDavid BordeynikDavid CaroDavid D LoweDavid EvansDavid HewittDavid LinkeDavid PoggiDavid PoznikDavid PursehouseDavid RungeDavid TuckerDavid WalesDavidovichddelangeDeepak SharmaDeepyaman DattaDenis Roussel (ACSONE)Denise Yudependabot[bot]derwolfeDesetudedeveloperDevesh KumarDevesh Kumar SinghdevsagulDiego CaraballoDiego RamirezDiegoCaraballoDimitri MerejkowskyDimitri PapadopoulosDimitri Papadopoulos OrfanosDirk StolledkjsoneDmitrii SutiaginDmitry GladkovDmitry VolodinDomen KožarDominic Davis-FosterDonald StufftDongweimingdoron zarhiDos MoonenDouglas ThorDrFeathersDustin IngramDustin RodriguesDwayne BaileyEd MorleyEdgar RamírezEdgar Ramírez MondragónEe DurbinEfflam LemailletefflamlemailletEitan AdlerekristinaelainechanEli SchwartzElisha HollanderEllen Marie DashEmil BurzoEmil StyrkeEmmanuel AriasEndoh TakanaoenochErdinc MutluEric CousineauEric GillinghamEric HanchrowEric HopperErik M. BrayErik RoseErwin JanssenEugene VereshchagineverdimensionFedericoFelipe PeterFelix Yanfiber-spaceFilip KokosińskiFilipe LaínsFinn WomackfinnaginFlavio AmurrioFlorian BriandFlorian RathgeberFrancescoFrancesco MontesanoFredrik OrderudFredrik RoubertFrost MingGabriel CurioGabriel de PerthuisGarry PolleygavingdanielsonGene WoodGeoffrey SneddonGeorge MargaritisGeorge SongGeorgi ValkovGeorgy PchelkinGertjan van ZwietenghostGiancarlo Cicellyn ComnenoGiftlin Rajaiahgizmoguy1gkdocGodefroid ChapelleGopinath MGOTO HayatogousaiyanggpiksGreg RoodtGreg WardGuido DiepenGuilherme EspadaGuillaume SeguingutsytechsterGuy RozendornGuy Tuvalgzpan123Hanjun KimHari CharanHarsh VardhanHarsha SaiharupyHarutaka KawamuraHasan-8326hauntsaninjaHenrich HartzerHenry SchreinerHerbert PfennigHolly StotelmyerHonnixHsiaoming YangHugo Lopes TavaresHugo van KemenadeHugues BruantHynek Schlawackiamsrp-deshawIan BickingIan CordascoIan LeeIan Stapleton CordascoIan WienandIgor KuzmitshovIgor SobreiraIkko AshimineIlan SchnellIllia VolochiiIlya AbdolmanafiIlya BaryshevInada NaokiIonel Cristian MărieșIonel Maries CristianItamar Turner-TrauringiTroozIvan PozdeevJ. Nick KostonJacob KimJacob WallsJaime SanzJake LishmanjakirkhamJakub KuczysJakub StasiakJakub VysokyJakub WilkJamesJames ClevelandJames CurtinJames FirthJames GerityJames PolleyJan PokornýJannis LeidelJarek PotiukjarondlJason CurtisJason R. CoombsJasonMoJasonMo1Jay GravesJean Abou SamraJean-Christophe Fillion-RobinJeff BarberJeff DairikiJeff WidmanJelmer Vernooijjenix21Jeremy FleischmanJeremy StanleyJeremy ZafranJesse RittnerJiashuo LiJim FisherJim GarrisonJinzhe ZengJiun BaeJivan AmaraJoaJoe BylundJoe MicheliniJohannes AltmanningerJohn PatonJohn SiroisJohn T. Wodder IIJohn-Scott AtlaksonjohnthagenJon BanafatoJon DufresneJon PariseJonas NockertJonathan HerbertJoonatan PartanenJoost MolenaarJorge NiedbalskiJoseph BylundJoseph LongJosh BronsonJosh CannonJosh HansenJosh SchneierJoshuaJoshuaPerdueJost MigendaJuan Luis Cano RodríguezJuanjo BazánJudah RandJulian BermanJulian GethmannJulien DemoorJulien StephanJuly TikhonovJussi KukkonenJustin van Heekjwg4Jyrki PulliainenKai ChenKai MuellerKamal Bin MustafaKarolina Surmakasiumkaustav haldarKaz NishimurakeanemindKeith MaxwellKelsey HightowerKenneth BelitzkyKenneth ReitzKevin BurkeKevin CarterKevin FrommeltKevin R PattersonKevin TurciosKexuan SunKit RandelKlaas van SchelvenKOLANICHkonstinkpincKrishan BhasinKrishna OzaKumar McMillanKuntal MajumderKurt McKeeKyle PersohnlakshmanaramLaszlo Kiss-KollarLaurent BristielLaurent LAPORTELaurie OLaurie OppermanlaydayLeon SassonLev GivonLincoln de SousaLipislorddavidiiiLoren CarvalhoLucas CimonLudovic GascLuis MedelLukas GeigerLukas JuhrichLuke MackenLuo Jiebinluojiebinluz.pazLászló Kiss KollárM00nL1ghtMajorTanyaMalcolm SmithMarc AbramowitzMarc TamlynMarcus SmithMariattaMark KohlerMark McLoughlinMark WilliamsMarkus HametnerMartey DodooMartin FischerMartin HäckerMartin PavlasekMasakiMasklinnMatej StuchlikMateusz SokółMathew JenningsMathieu BridonMathieu KniewallnerMatt BacchiMatt GoodMatt MakerMatt RobenoltMatt WozniskimatthewMatthew EinhornMatthew FeickertMatthew GilliardMatthew HughesMatthew IversenMatthew TreinishMatthew TrumbellMatthew WillsonMatthias BussonniermattipMaurits van ReesMax W ChaseMaxim KurnikovMaxime RouyrremayeutmbalunaMd Sujauddin SekhmdebiMeet VasitamemoselykmeowmeowcatMichaelMichael AquilinaMichael E. KarpelesMichael KlichMichael MintzMichael WilliamsonmichaelpacerMichał GórnyMickaël SchoentgenMiguel Araujo PerezMihir SinghMikeMike HendricksMin RKMinRKMiro HrončokMonica BalunamontefraMonty TaylormorottimrKazzilaMuha AjjanMUTHUSRIHEMADHARSHINI S ANadav WexlerNahuel AmbrosiniNate CoraorNate PrewittNathan HoughtonNathaniel J. SmithNehal J WaniNeil BotelhoNguyễn Gia PhongNicholas SerraNick CoghlanNick StenningNick TimkovichNicolas BockNicole HarrisNikhil BeneschNikhil LadhaNikita ChepanovNikolay KorolevNipunn KoorapatiNitesh SharmaNiyas SaitNoahNoah GornyNorbert MantheyNothing-991Nowell StriteNtaleGreynuccccnvdvOBITORASUOfek LevofrinevoOleg BurnaevOliver FreundOliver JeevesOliver MannionOliver TonnhoferOlivier GirardotOlivier GriselOllie RutherfurdOMOTO KenjiOmry Yadanonlinejudge95Oren HeldOscar Benjaminoxygen dioxideOz N TiramPachwenkoParesh JoshiPatrick DubroyPatrick JenkinsPatrick LawsonpatricktokeeffePatrik KopkanPaul GansslePaul KehrerPaul MoorePaul NasratPaul OswaldPaul van der LindenPaulus SchoutsenPavel SafronovPavithra EswaramoorthyPawel JasinskiPaweł SzramowskiPekka KlärckPeter GesslerPeter LisákPeter ShenPeter WallerPetr Viktorinpetr-tikPhaneendra ChiruvellaPhil ElsonPhil FreoPhil PennockPhil WhelanPhilip JägenstedtPhilip MolloyPhilippe OmbredannePi DelportPierre-Yves RofesPieter DegrootepipPrabakaran KumaresshanPrabhjyotsing Surjit Singh SodhiPrabhu MarappanPradyun GedamPrashant SharmaPratik Mallyapre-commit-ci[bot]Preet ThakkarPreston HolmesPrzemek WrzosPulkit Goyalq0wQiangning HongQiming XuqraqrasQuentin LeeQuentin PradetR. David MurrayRafael CaricioRalf SchmittRan BenitaRandy DöringRazzi AbuissardbReece DunhamRemi RampinRene DudfieldRiccardo MagliocchettiRiccardo SchironeRichard JonesRichard SiRicky Ng-AdamRishirmorottiRobberPhexRobert CollinsRobert McGibbonRobert PollakRobert T. McGibbonrobin elisha robinsonRodney, TiaraRoey BermanRohan JainRoman BogorodskiyRoman DonchenkoRomuald BrunetronaudinhoRonny PfannschmidtRory McCannRoss BrattainRoy Wellington ⅣRuairidh MacLeodRussell Keith-MageeRyan ShepherdRyan WoodenryneeverettRyuma AsaiS. GuliaevSachi KingSalvatore Rinchierasandeepkiran-jsSander Van BalenSavio JomtonschlamarScott KittermanSeanseanjSebastian JordanSebastian SchaetzSegev FinerSeongSoo ChoSepehr RasoulisepehrrasooliSergey VasilyevSeth Michael LarsonSeth WoodworthShahar EpsteinShantanushenxianpengshireenraoShivansh-007Shixian ShengShlomi FishShovan MaityShubham NagureSimeon VisserSimon CrossSimon Pichuginsinorocsinscarysnook92socketubsSorin SbarneaSrinivas NyayapatiSrishti HegdeStavros KorokithakisStefan ScherfkeStefano RiveraStephan ErbStephane ChazelasStephen PayneStephen RosenstepshalSteve (Gadget) BarnesSteve BarnesSteve DowerSteve KowalikSteven MyintSteven SilvesterstonebigstudiojStéphane BidoulStéphane Bidoul (ACSONE)Stéphane KleinSumana HarihareswaraSurbhi SharmaSviatoslav SydorenkoSviatoslav Sydorenko (Святослав Сидоренко)Swat009SylvainTakayuki SHIMIZUKAWATaneli HukkinentbeswickTerranceThiagoThijs TriemstraThomas FenzlThomas GraingerThomas GuettlerThomas JohanssonThomas KluyverThomas SmithThomas VINCENTTim D. SmithTim GatesTim HarderTim Heaptim smithtinruufuTobias HermannTom ForbesTom FreudenheimTom VTomas HrnciarTomas OrsavaTomer ChachamuTommi Enenkel | AnBTomáš HrnčiarTony BeswickTony NarlockTony Zhaocheng TanTonyBeswicktoonarmycaptainToshio KuratomitoxinuTravis SwicegoodTushar SadhwaniTzu-ping ChungValentin HaenelVictor StinnervictorvpauloVikram - GoogleViktor SzépeVille SkyttäVinay SajipVincent FazioVincent PhilipponVinicyus MacedoVipul KumarVitaly BabiyVladimir FokowVladimir RutskyW. Trevor KingWeida HongWil TanWilfred HughesWilliam EdwardsWilliam ML LeslieWilliam T OlsonWilliam WoodruffWilson Mowim glennWinson LukWolfgang MaierWu ZhenyuXAMES3Xavier FernandezXianpeng ShenxoviatxtreakYAMAMOTO TakashiYashYashrajYen Chi HsuanYeray Diaz DiazYoval PYu JianYuan Jing Vincent YanYuki KobayashiYusuke HayashiZachary Warezackzack38ZearinZhiping DengziebamZvezdan PetkovicŁukasz LangaРоман ДонченкоСемён Марьясин1234567891011121314151617181920Copyright (c) 2008-present The pip developers (see AUTHORS.txt file)
Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:
The above copyright notice and this permission notice shall beincluded 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 OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BELIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIONOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTIONWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.12345678910111213Copyright 2012-2021 Eric Larson
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, softwaredistributed 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 andlimitations under the License.1234567891011121314151617181920This package contains a modified version of ca-bundle.crt:
ca-bundle.crt -- Bundle of CA Root Certificates
This is a bundle of X.509 certificates of public Certificate Authorities(CA). These were automatically extracted from Mozilla's root certificatesfile (certdata.txt). This file can be found in the mozilla source tree:https://hg.mozilla.org/mozilla-central/file/tip/security/nss/lib/ckfw/builtins/certdata.txtIt contains the certificates in PEM format and thereforecan be directly used with curl / libcurl / php_curl, or withan Apache+mod_ssl webserver for SSL client authentication.Just configure this file as the SSLCACertificateFile.#
***** BEGIN LICENSE BLOCK *****This Source Code Form is subject to the terms of the Mozilla Public License,v. 2.0. If a copy of the MPL was not distributed with this file, You can obtainone at http://mozilla.org/MPL/2.0/.
***** END LICENSE BLOCK *****@(#) $RCSfile: certdata.txt,v $ $Revision: 1.80 $ $Date: 2011/11/03 15:11:58 $123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284A. HISTORY OF THE SOFTWARE==========================
Python was created in the early 1990s by Guido van Rossum at StichtingMathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlandsas a successor of a language called ABC. Guido remains Python'sprincipal author, although it includes many contributions from others.
In 1995, Guido continued his work on Python at the Corporation forNational Research Initiatives (CNRI, see http://www.cnri.reston.va.us)in Reston, Virginia where he released several versions of thesoftware.
In May 2000, Guido and the Python core development team moved toBeOpen.com to form the BeOpen PythonLabs team. In October of the sameyear, the PythonLabs team moved to Digital Creations (now ZopeCorporation, see http://www.zope.com). In 2001, the Python SoftwareFoundation (PSF, see http://www.python.org/psf/) was formed, anon-profit organization created specifically to own Python-relatedIntellectual Property. Zope Corporation is a sponsoring member ofthe PSF.
All Python releases are Open Source (see http://www.opensource.org forthe Open Source Definition). Historically, most, but not all, Pythonreleases have also been GPL-compatible; the table below summarizesthe various releases.
Release Derived Year Owner GPL- from compatible? (1)
0.9.0 thru 1.2 1991-1995 CWI yes 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes 1.6 1.5.2 2000 CNRI no 2.0 1.6 2000 BeOpen.com no 1.6.1 1.6 2001 CNRI yes (2) 2.1 2.0+1.6.1 2001 PSF no 2.0.1 2.0+1.6.1 2001 PSF yes 2.1.1 2.1+2.0.1 2001 PSF yes 2.2 2.1.1 2001 PSF yes 2.1.2 2.1.1 2002 PSF yes 2.1.3 2.1.2 2002 PSF yes 2.2.1 2.2 2002 PSF yes 2.2.2 2.2.1 2002 PSF yes 2.2.3 2.2.2 2003 PSF yes 2.3 2.2.2 2002-2003 PSF yes 2.3.1 2.3 2002-2003 PSF yes 2.3.2 2.3.1 2002-2003 PSF yes 2.3.3 2.3.2 2002-2003 PSF yes 2.3.4 2.3.3 2004 PSF yes 2.3.5 2.3.4 2005 PSF yes 2.4 2.3 2004 PSF yes 2.4.1 2.4 2005 PSF yes 2.4.2 2.4.1 2005 PSF yes 2.4.3 2.4.2 2006 PSF yes 2.4.4 2.4.3 2006 PSF yes 2.5 2.4 2006 PSF yes 2.5.1 2.5 2007 PSF yes 2.5.2 2.5.1 2008 PSF yes 2.5.3 2.5.2 2008 PSF yes 2.6 2.5 2008 PSF yes 2.6.1 2.6 2008 PSF yes 2.6.2 2.6.1 2009 PSF yes 2.6.3 2.6.2 2009 PSF yes 2.6.4 2.6.3 2009 PSF yes 2.6.5 2.6.4 2010 PSF yes 3.0 2.6 2008 PSF yes 3.0.1 3.0 2009 PSF yes 3.1 3.0.1 2009 PSF yes 3.1.1 3.1 2009 PSF yes 3.1.2 3.1 2010 PSF yes 3.2 3.1 2010 PSF yes
Footnotes:
(1) GPL-compatible doesn't mean that we're distributing Python under the GPL. All Python licenses, unlike the GPL, let you distribute a modified version without making your changes open source. The GPL-compatible licenses make it possible to combine Python with other software that is released under the GPL; the others don't.
(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, because its license has a choice of law clause. According to CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 is "not incompatible" with the GPL.
Thanks to the many outside volunteers who have worked under Guido'sdirection to make these releases possible.
B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON===============================================================
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation("PSF"), and the Individual or Organization ("Licensee") accessing andotherwise using this software ("Python") in source or binary form andits associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF herebygrants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,analyze, test, perform and/or display publicly, prepare derivative works,distribute, and otherwise use Python alone or in any derivative version,provided, however, that PSF's License Agreement and PSF's notice of copyright,i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010Python Software Foundation; All Rights Reserved" are retained in Python alone orin any derivative version prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based onor incorporates Python or any part thereof, and wants to makethe derivative work available to others as provided herein, thenLicensee hereby agrees to include in any such work a brief summary ofthe changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS ORIMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO ANDDISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESSFOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOTINFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHONFOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS ASA RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a materialbreach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create anyrelationship of agency, partnership, or joint venture between PSF andLicensee. This License Agreement does not grant permission to use PSFtrademarks or trade name in a trademark sense to endorse or promoteproducts or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licenseeagrees to be bound by the terms and conditions of this LicenseAgreement.
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0-------------------------------------------
BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having anoffice at 160 Saratoga Avenue, Santa Clara, CA 95051, and theIndividual or Organization ("Licensee") accessing and otherwise usingthis software in source or binary form and its associateddocumentation ("the Software").
2. Subject to the terms and conditions of this BeOpen Python LicenseAgreement, BeOpen hereby grants Licensee a non-exclusive,royalty-free, world-wide license to reproduce, analyze, test, performand/or display publicly, prepare derivative works, distribute, andotherwise use the Software alone or in any derivative version,provided, however, that the BeOpen Python License is retained in theSoftware, alone or in any derivative version prepared by Licensee.
3. BeOpen is making the Software available to Licensee on an "AS IS"basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS ORIMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO ANDDISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESSFOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOTINFRINGE ANY THIRD PARTY RIGHTS.
4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THESOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSSAS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANYDERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
5. This License Agreement will automatically terminate upon a materialbreach of its terms and conditions.
6. This License Agreement shall be governed by and interpreted in allrespects by the law of the State of California, excluding conflict oflaw provisions. Nothing in this License Agreement shall be deemed tocreate any relationship of agency, partnership, or joint venturebetween BeOpen and Licensee. This License Agreement does not grantpermission to use BeOpen trademarks or trade names in a trademarksense to endorse or promote products or services of Licensee, or anythird party. As an exception, the "BeOpen Python" logos available athttp://www.pythonlabs.com/logos.html may be used according to thepermissions granted on that web page.
7. By copying, installing or otherwise using the software, Licenseeagrees to be bound by the terms and conditions of this LicenseAgreement.
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1---------------------------------------
1. This LICENSE AGREEMENT is between the Corporation for NationalResearch Initiatives, having an office at 1895 Preston White Drive,Reston, VA 20191 ("CNRI"), and the Individual or Organization("Licensee") accessing and otherwise using Python 1.6.1 software insource or binary form and its associated documentation.
2. Subject to the terms and conditions of this License Agreement, CNRIhereby grants Licensee a nonexclusive, royalty-free, world-widelicense to reproduce, analyze, test, perform and/or display publicly,prepare derivative works, distribute, and otherwise use Python 1.6.1alone or in any derivative version, provided, however, that CNRI'sLicense Agreement and CNRI's notice of copyright, i.e., "Copyright (c)1995-2001 Corporation for National Research Initiatives; All RightsReserved" are retained in Python 1.6.1 alone or in any derivativeversion prepared by Licensee. Alternately, in lieu of CNRI's LicenseAgreement, Licensee may substitute the following text (omitting thequotes): "Python 1.6.1 is made available subject to the terms andconditions in CNRI's License Agreement. This Agreement together withPython 1.6.1 may be located on the Internet using the followingunique, persistent identifier (known as a handle): 1895.22/1013. ThisAgreement may also be obtained from a proxy server on the Internetusing the following URL: http://hdl.handle.net/1895.22/1013".
3. In the event Licensee prepares a derivative work that is based onor incorporates Python 1.6.1 or any part thereof, and wants to makethe derivative work available to others as provided herein, thenLicensee hereby agrees to include in any such work a brief summary ofthe changes made to Python 1.6.1.
4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS ORIMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO ANDDISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESSFOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOTINFRINGE ANY THIRD PARTY RIGHTS.
5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS ASA RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a materialbreach of its terms and conditions.
7. This License Agreement shall be governed by the federalintellectual property law of the United States, including withoutlimitation the federal copyright law, and, to the extent suchU.S. federal law does not apply, by the law of the Commonwealth ofVirginia, excluding Virginia's conflict of law provisions.Notwithstanding the foregoing, with regard to derivative works basedon Python 1.6.1 that incorporate non-separable material that waspreviously distributed under the GNU General Public License (GPL), thelaw of the Commonwealth of Virginia shall govern this LicenseAgreement only as to issues arising under or with respect toParagraphs 4, 5, and 7 of this License Agreement. Nothing in thisLicense Agreement shall be deemed to create any relationship ofagency, partnership, or joint venture between CNRI and Licensee. ThisLicense Agreement does not grant permission to use CNRI trademarks ortrade name in a trademark sense to endorse or promote products orservices of Licensee, or any third party.
8. By clicking on the "ACCEPT" button where indicated, or by copying,installing or otherwise using Python 1.6.1, Licensee agrees to bebound by the terms and conditions of this License Agreement.
ACCEPT
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2--------------------------------------------------
Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,The Netherlands. All rights reserved.
Permission to use, copy, modify, and distribute this software and itsdocumentation for any purpose and without fee is hereby granted,provided that the above copyright notice appear in all copies and thatboth that copyright notice and this permission notice appear insupporting documentation, and that the name of Stichting MathematischCentrum or CWI not be used in advertising or publicity pertaining todistribution of the software without specific, written priorpermission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TOTHIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY ANDFITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLEFOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGESWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ANACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUTOF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright {yyyy} {name of copyright owner}
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.
12345678910111213141516171819202122232425262728293031BSD 3-Clause License
Copyright (c) 2013-2025, Kim Davies and contributors.All rights reserved.
Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions aremet:
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 NOTLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FORA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHTHOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITEDTO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, ORPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDINGNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.1234567891011121314Copyright (C) 2008-2011 INADA Naoki <songofacandy@gmail.com>
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.
123This software is made available under the terms of *either* of the licensesfound in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is madeunder the terms of *both* these licenses.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS1234567891011121314151617181920212223Copyright (c) Donald Stufft and individual contributors.All rights reserved.
Redistribution and use in source and binary forms, with or withoutmodification, 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.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLEFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIALDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.1234567891011121314151617Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), todeal in the Software without restriction, including without limitation therights to use, copy, modify, merge, publish, distribute, sublicense, and/orsell copies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGSIN THE SOFTWARE.123456789101112131415161718192021MIT License
Copyright (c) 2010-202x The platformdirs developers
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 THESOFTWARE.12345678910111213141516171819202122232425Copyright (c) 2006-2022 by the respective authors (see AUTHORS file).All rights reserved.
Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions aremet:
* 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.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOTLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FORA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHTOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANYTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.123456789101112131415161718192021The MIT License (MIT)
Copyright (c) 2017 Thomas Kluyver
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 INTHE SOFTWARE.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.12345678910111213Copyright (c) 2018, Tzu-ping Chung <uranusjr@gmail.com>
Permission to use, copy, modify, and distribute this software for anypurpose with or without fee is hereby granted, provided that the abovecopyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIESWITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FORANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGESWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN ANACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OFOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.12345678910111213141516171819Copyright (c) 2020 Will McGugan
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 THESOFTWARE.123456789101112131415161718192021MIT License
Copyright (c) 2021 Taneli Hukkinen
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 THESOFTWARE.123456789101112131415161718192021MIT License
Copyright (c) 2021 Taneli Hukkinen
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 THESOFTWARE.123456789101112131415161718192021The MIT License (MIT)
Copyright (c) 2022 Seth Michael Larson
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 INTHE SOFTWARE.123456789101112131415161718192021MIT License
Copyright (c) 2008-2020 Andrey Petrov and contributors.
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 THESOFTWARE.12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394from __future__ import annotations
import contextlibimport dataclassesimport sysimport typing
__all__ = ["ExceptionGroup"]
def __dir__() -> list[str]: return __all__
if sys.version_info >= (3, 11): # pragma: no cover from builtins import ExceptionGroupelse: # pragma: no cover
class ExceptionGroup(Exception): """A minimal implementation of :external:exc:`ExceptionGroup` from Python 3.11.
If :external:exc:`ExceptionGroup` is already defined by Python itself, that version is used instead. """
message: str exceptions: list[Exception]
def __init__(self, message: str, exceptions: list[Exception]) -> None: self.message = message self.exceptions = exceptions
def __repr__(self) -> str: return f"{self.__class__.__name__}({self.message!r}, {self.exceptions!r})"
@dataclasses.dataclassclass _ErrorCollector: """ Collect errors into ExceptionGroups.
Used like this:
collector = _ErrorCollector() # Add a single exception collector.error(ValueError("one"))
# Supports nesting, including combining ExceptionGroups with collector.collect(): raise ValueError("two") collector.finalize("Found some errors")
Since making a collector and then calling finalize later is a common pattern, a convenience method ``on_exit`` is provided. """
errors: list[Exception] = dataclasses.field(default_factory=list, init=False)
def finalize(self, msg: str) -> None: """Raise a group exception if there are any errors.""" if self.errors: raise ExceptionGroup(msg, self.errors)
@contextlib.contextmanager def on_exit(self, msg: str) -> typing.Generator[_ErrorCollector, None, None]: """ Calls finalize if no uncollected errors were present.
Uncollected errors are raised normally. """ yield self self.finalize(msg)
@contextlib.contextmanager def collect(self, *err_cls: type[Exception]) -> typing.Generator[None, None, None]: """ Context manager to collect errors into the error list.
Must be inside loops, as only one error can be collected at a time. """ error_classes = err_cls or (Exception,) try: yield except ExceptionGroup as error: self.errors.extend(error.exceptions) except error_classes as error: self.errors.append(error)
def error( self, error: Exception, ) -> None: """Add an error to the list.""" self.errors.append(error)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186######################################################################################### Adapted from:# https://github.com/pypa/hatch/blob/5352e44/backend/src/hatchling/licenses/parse.py## MIT License## Copyright (c) 2017-present Ofek Lev <oss@ofek.dev>## 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.### With additional allowance of arbitrary `LicenseRef-` identifiers, not just# `LicenseRef-Public-Domain` and `LicenseRef-Proprietary`.########################################################################################from __future__ import annotations
import refrom typing import NewType, cast
from ._spdx import EXCEPTIONS, LICENSES
__all__ = [ "InvalidLicenseExpression", "NormalizedLicenseExpression", "canonicalize_license_expression",]
# Simple __dir__ implementation since there are no public submodulesdef __dir__() -> list[str]: return __all__
license_ref_allowed = re.compile("^[A-Za-z0-9.-]*$")
NormalizedLicenseExpression = NewType("NormalizedLicenseExpression", str)"""A :class:`typing.NewType` of :class:`str`, representing a normalizedLicense-Expression."""
class InvalidLicenseExpression(ValueError): """Raised when a license-expression string is invalid
>>> from packaging.licenses import canonicalize_license_expression >>> canonicalize_license_expression("invalid") Traceback (most recent call last): ... packaging.licenses.InvalidLicenseExpression: Invalid license expression: 'invalid' """
def canonicalize_license_expression( raw_license_expression: str,) -> NormalizedLicenseExpression: """ This function takes a valid License-Expression, and returns the normalized form of it.
The return type is typed as :class:`NormalizedLicenseExpression`. This allows type checkers to help require that a string has passed through this function before use.
:param str raw_license_expression: The License-Expression to canonicalize. :raises InvalidLicenseExpression: If the License-Expression is invalid due to an invalid/unknown license identifier or invalid syntax.
.. doctest::
>>> from packaging.licenses import canonicalize_license_expression >>> canonicalize_license_expression("mit") 'MIT' >>> canonicalize_license_expression("mit and (apache-2.0 or bsd-2-clause)") 'MIT AND (Apache-2.0 OR BSD-2-Clause)' >>> canonicalize_license_expression("(mit") Traceback (most recent call last): ... InvalidLicenseExpression: Invalid license expression: '(mit' >>> canonicalize_license_expression("Use-it-after-midnight") Traceback (most recent call last): ... InvalidLicenseExpression: Unknown license: 'Use-it-after-midnight' """ if not raw_license_expression: message = f"Invalid license expression: {raw_license_expression!r}" raise InvalidLicenseExpression(message)
# Pad any parentheses so tokenization can be achieved by merely splitting on # whitespace. license_expression = raw_license_expression.replace("(", " ( ").replace(")", " ) ") licenseref_prefix = "LicenseRef-" license_refs = { ref.lower(): "LicenseRef-" + ref[len(licenseref_prefix) :] for ref in license_expression.split() if ref.lower().startswith(licenseref_prefix.lower()) }
# Normalize to lower case so we can look up licenses/exceptions # and so boolean operators are Python-compatible. license_expression = license_expression.lower()
tokens = license_expression.split()
# Rather than implementing a parenthesis/boolean logic parser, create an # expression that Python can parse. Everything that is not involved with the # grammar itself is replaced with the placeholder `False` and the resultant # expression should become a valid Python expression. python_tokens = [] for token in tokens: if token not in {"or", "and", "with", "(", ")"}: python_tokens.append("False") elif token == "with": python_tokens.append("or") elif ( token == "(" and python_tokens and python_tokens[-1] not in {"or", "and", "("} ) or (token == ")" and python_tokens and python_tokens[-1] == "("): message = f"Invalid license expression: {raw_license_expression!r}" raise InvalidLicenseExpression(message) else: python_tokens.append(token)
python_expression = " ".join(python_tokens) try: compile(python_expression, "", "eval") except SyntaxError: message = f"Invalid license expression: {raw_license_expression!r}" raise InvalidLicenseExpression(message) from None
# Take a final pass to check for unknown licenses/exceptions. normalized_tokens = [] for token in tokens: if token in {"or", "and", "with", "(", ")"}: normalized_tokens.append(token.upper()) continue
if normalized_tokens and normalized_tokens[-1] == "WITH": if token not in EXCEPTIONS: message = f"Unknown license exception: {token!r}" raise InvalidLicenseExpression(message)
normalized_tokens.append(EXCEPTIONS[token]["id"]) else: if token.endswith("+"): final_token = token[:-1] suffix = "+" else: final_token = token suffix = ""
if final_token.startswith("licenseref-"): if not license_ref_allowed.match(final_token): message = f"Invalid licenseref: {final_token!r}" raise InvalidLicenseExpression(message) normalized_tokens.append(license_refs[final_token] + suffix) else: if final_token not in LICENSES: message = f"Unknown license: {final_token!r}" raise InvalidLicenseExpression(message) normalized_tokens.append(LICENSES[final_token]["id"] + suffix)
normalized_expression = " ".join(normalized_tokens)
return cast( "NormalizedLicenseExpression", normalized_expression.replace("( ", "(").replace(" )", ")"), )123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
from __future__ import annotations
from typing import TypedDict
class SPDXLicense(TypedDict): id: str deprecated: bool
class SPDXException(TypedDict): id: str deprecated: bool
VERSION = '3.27.0'
LICENSES: dict[str, SPDXLicense] = { '0bsd': {'id': '0BSD', 'deprecated': False}, '3d-slicer-1.0': {'id': '3D-Slicer-1.0', 'deprecated': False}, 'aal': {'id': 'AAL', 'deprecated': False}, 'abstyles': {'id': 'Abstyles', 'deprecated': False}, 'adacore-doc': {'id': 'AdaCore-doc', 'deprecated': False}, 'adobe-2006': {'id': 'Adobe-2006', 'deprecated': False}, 'adobe-display-postscript': {'id': 'Adobe-Display-PostScript', 'deprecated': False}, 'adobe-glyph': {'id': 'Adobe-Glyph', 'deprecated': False}, 'adobe-utopia': {'id': 'Adobe-Utopia', 'deprecated': False}, 'adsl': {'id': 'ADSL', 'deprecated': False}, 'afl-1.1': {'id': 'AFL-1.1', 'deprecated': False}, 'afl-1.2': {'id': 'AFL-1.2', 'deprecated': False}, 'afl-2.0': {'id': 'AFL-2.0', 'deprecated': False}, 'afl-2.1': {'id': 'AFL-2.1', 'deprecated': False}, 'afl-3.0': {'id': 'AFL-3.0', 'deprecated': False}, 'afmparse': {'id': 'Afmparse', 'deprecated': False}, 'agpl-1.0': {'id': 'AGPL-1.0', 'deprecated': True}, 'agpl-1.0-only': {'id': 'AGPL-1.0-only', 'deprecated': False}, 'agpl-1.0-or-later': {'id': 'AGPL-1.0-or-later', 'deprecated': False}, 'agpl-3.0': {'id': 'AGPL-3.0', 'deprecated': True}, 'agpl-3.0-only': {'id': 'AGPL-3.0-only', 'deprecated': False}, 'agpl-3.0-or-later': {'id': 'AGPL-3.0-or-later', 'deprecated': False}, 'aladdin': {'id': 'Aladdin', 'deprecated': False}, 'amd-newlib': {'id': 'AMD-newlib', 'deprecated': False}, 'amdplpa': {'id': 'AMDPLPA', 'deprecated': False}, 'aml': {'id': 'AML', 'deprecated': False}, 'aml-glslang': {'id': 'AML-glslang', 'deprecated': False}, 'ampas': {'id': 'AMPAS', 'deprecated': False}, 'antlr-pd': {'id': 'ANTLR-PD', 'deprecated': False}, 'antlr-pd-fallback': {'id': 'ANTLR-PD-fallback', 'deprecated': False}, 'any-osi': {'id': 'any-OSI', 'deprecated': False}, 'any-osi-perl-modules': {'id': 'any-OSI-perl-modules', 'deprecated': False}, 'apache-1.0': {'id': 'Apache-1.0', 'deprecated': False}, 'apache-1.1': {'id': 'Apache-1.1', 'deprecated': False}, 'apache-2.0': {'id': 'Apache-2.0', 'deprecated': False}, 'apafml': {'id': 'APAFML', 'deprecated': False}, 'apl-1.0': {'id': 'APL-1.0', 'deprecated': False}, 'app-s2p': {'id': 'App-s2p', 'deprecated': False}, 'apsl-1.0': {'id': 'APSL-1.0', 'deprecated': False}, 'apsl-1.1': {'id': 'APSL-1.1', 'deprecated': False}, 'apsl-1.2': {'id': 'APSL-1.2', 'deprecated': False}, 'apsl-2.0': {'id': 'APSL-2.0', 'deprecated': False}, 'arphic-1999': {'id': 'Arphic-1999', 'deprecated': False}, 'artistic-1.0': {'id': 'Artistic-1.0', 'deprecated': False}, 'artistic-1.0-cl8': {'id': 'Artistic-1.0-cl8', 'deprecated': False}, 'artistic-1.0-perl': {'id': 'Artistic-1.0-Perl', 'deprecated': False}, 'artistic-2.0': {'id': 'Artistic-2.0', 'deprecated': False}, 'artistic-dist': {'id': 'Artistic-dist', 'deprecated': False}, 'aspell-ru': {'id': 'Aspell-RU', 'deprecated': False}, 'aswf-digital-assets-1.0': {'id': 'ASWF-Digital-Assets-1.0', 'deprecated': False}, 'aswf-digital-assets-1.1': {'id': 'ASWF-Digital-Assets-1.1', 'deprecated': False}, 'baekmuk': {'id': 'Baekmuk', 'deprecated': False}, 'bahyph': {'id': 'Bahyph', 'deprecated': False}, 'barr': {'id': 'Barr', 'deprecated': False}, 'bcrypt-solar-designer': {'id': 'bcrypt-Solar-Designer', 'deprecated': False}, 'beerware': {'id': 'Beerware', 'deprecated': False}, 'bitstream-charter': {'id': 'Bitstream-Charter', 'deprecated': False}, 'bitstream-vera': {'id': 'Bitstream-Vera', 'deprecated': False}, 'bittorrent-1.0': {'id': 'BitTorrent-1.0', 'deprecated': False}, 'bittorrent-1.1': {'id': 'BitTorrent-1.1', 'deprecated': False}, 'blessing': {'id': 'blessing', 'deprecated': False}, 'blueoak-1.0.0': {'id': 'BlueOak-1.0.0', 'deprecated': False}, 'boehm-gc': {'id': 'Boehm-GC', 'deprecated': False}, 'boehm-gc-without-fee': {'id': 'Boehm-GC-without-fee', 'deprecated': False}, 'borceux': {'id': 'Borceux', 'deprecated': False}, 'brian-gladman-2-clause': {'id': 'Brian-Gladman-2-Clause', 'deprecated': False}, 'brian-gladman-3-clause': {'id': 'Brian-Gladman-3-Clause', 'deprecated': False}, 'bsd-1-clause': {'id': 'BSD-1-Clause', 'deprecated': False}, 'bsd-2-clause': {'id': 'BSD-2-Clause', 'deprecated': False}, 'bsd-2-clause-darwin': {'id': 'BSD-2-Clause-Darwin', 'deprecated': False}, 'bsd-2-clause-first-lines': {'id': 'BSD-2-Clause-first-lines', 'deprecated': False}, 'bsd-2-clause-freebsd': {'id': 'BSD-2-Clause-FreeBSD', 'deprecated': True}, 'bsd-2-clause-netbsd': {'id': 'BSD-2-Clause-NetBSD', 'deprecated': True}, 'bsd-2-clause-patent': {'id': 'BSD-2-Clause-Patent', 'deprecated': False}, 'bsd-2-clause-pkgconf-disclaimer': {'id': 'BSD-2-Clause-pkgconf-disclaimer', 'deprecated': False}, 'bsd-2-clause-views': {'id': 'BSD-2-Clause-Views', 'deprecated': False}, 'bsd-3-clause': {'id': 'BSD-3-Clause', 'deprecated': False}, 'bsd-3-clause-acpica': {'id': 'BSD-3-Clause-acpica', 'deprecated': False}, 'bsd-3-clause-attribution': {'id': 'BSD-3-Clause-Attribution', 'deprecated': False}, 'bsd-3-clause-clear': {'id': 'BSD-3-Clause-Clear', 'deprecated': False}, 'bsd-3-clause-flex': {'id': 'BSD-3-Clause-flex', 'deprecated': False}, 'bsd-3-clause-hp': {'id': 'BSD-3-Clause-HP', 'deprecated': False}, 'bsd-3-clause-lbnl': {'id': 'BSD-3-Clause-LBNL', 'deprecated': False}, 'bsd-3-clause-modification': {'id': 'BSD-3-Clause-Modification', 'deprecated': False}, 'bsd-3-clause-no-military-license': {'id': 'BSD-3-Clause-No-Military-License', 'deprecated': False}, 'bsd-3-clause-no-nuclear-license': {'id': 'BSD-3-Clause-No-Nuclear-License', 'deprecated': False}, 'bsd-3-clause-no-nuclear-license-2014': {'id': 'BSD-3-Clause-No-Nuclear-License-2014', 'deprecated': False}, 'bsd-3-clause-no-nuclear-warranty': {'id': 'BSD-3-Clause-No-Nuclear-Warranty', 'deprecated': False}, 'bsd-3-clause-open-mpi': {'id': 'BSD-3-Clause-Open-MPI', 'deprecated': False}, 'bsd-3-clause-sun': {'id': 'BSD-3-Clause-Sun', 'deprecated': False}, 'bsd-4-clause': {'id': 'BSD-4-Clause', 'deprecated': False}, 'bsd-4-clause-shortened': {'id': 'BSD-4-Clause-Shortened', 'deprecated': False}, 'bsd-4-clause-uc': {'id': 'BSD-4-Clause-UC', 'deprecated': False}, 'bsd-4.3reno': {'id': 'BSD-4.3RENO', 'deprecated': False}, 'bsd-4.3tahoe': {'id': 'BSD-4.3TAHOE', 'deprecated': False}, 'bsd-advertising-acknowledgement': {'id': 'BSD-Advertising-Acknowledgement', 'deprecated': False}, 'bsd-attribution-hpnd-disclaimer': {'id': 'BSD-Attribution-HPND-disclaimer', 'deprecated': False}, 'bsd-inferno-nettverk': {'id': 'BSD-Inferno-Nettverk', 'deprecated': False}, 'bsd-protection': {'id': 'BSD-Protection', 'deprecated': False}, 'bsd-source-beginning-file': {'id': 'BSD-Source-beginning-file', 'deprecated': False}, 'bsd-source-code': {'id': 'BSD-Source-Code', 'deprecated': False}, 'bsd-systemics': {'id': 'BSD-Systemics', 'deprecated': False}, 'bsd-systemics-w3works': {'id': 'BSD-Systemics-W3Works', 'deprecated': False}, 'bsl-1.0': {'id': 'BSL-1.0', 'deprecated': False}, 'busl-1.1': {'id': 'BUSL-1.1', 'deprecated': False}, 'bzip2-1.0.5': {'id': 'bzip2-1.0.5', 'deprecated': True}, 'bzip2-1.0.6': {'id': 'bzip2-1.0.6', 'deprecated': False}, 'c-uda-1.0': {'id': 'C-UDA-1.0', 'deprecated': False}, 'cal-1.0': {'id': 'CAL-1.0', 'deprecated': False}, 'cal-1.0-combined-work-exception': {'id': 'CAL-1.0-Combined-Work-Exception', 'deprecated': False}, 'caldera': {'id': 'Caldera', 'deprecated': False}, 'caldera-no-preamble': {'id': 'Caldera-no-preamble', 'deprecated': False}, 'catharon': {'id': 'Catharon', 'deprecated': False}, 'catosl-1.1': {'id': 'CATOSL-1.1', 'deprecated': False}, 'cc-by-1.0': {'id': 'CC-BY-1.0', 'deprecated': False}, 'cc-by-2.0': {'id': 'CC-BY-2.0', 'deprecated': False}, 'cc-by-2.5': {'id': 'CC-BY-2.5', 'deprecated': False}, 'cc-by-2.5-au': {'id': 'CC-BY-2.5-AU', 'deprecated': False}, 'cc-by-3.0': {'id': 'CC-BY-3.0', 'deprecated': False}, 'cc-by-3.0-at': {'id': 'CC-BY-3.0-AT', 'deprecated': False}, 'cc-by-3.0-au': {'id': 'CC-BY-3.0-AU', 'deprecated': False}, 'cc-by-3.0-de': {'id': 'CC-BY-3.0-DE', 'deprecated': False}, 'cc-by-3.0-igo': {'id': 'CC-BY-3.0-IGO', 'deprecated': False}, 'cc-by-3.0-nl': {'id': 'CC-BY-3.0-NL', 'deprecated': False}, 'cc-by-3.0-us': {'id': 'CC-BY-3.0-US', 'deprecated': False}, 'cc-by-4.0': {'id': 'CC-BY-4.0', 'deprecated': False}, 'cc-by-nc-1.0': {'id': 'CC-BY-NC-1.0', 'deprecated': False}, 'cc-by-nc-2.0': {'id': 'CC-BY-NC-2.0', 'deprecated': False}, 'cc-by-nc-2.5': {'id': 'CC-BY-NC-2.5', 'deprecated': False}, 'cc-by-nc-3.0': {'id': 'CC-BY-NC-3.0', 'deprecated': False}, 'cc-by-nc-3.0-de': {'id': 'CC-BY-NC-3.0-DE', 'deprecated': False}, 'cc-by-nc-4.0': {'id': 'CC-BY-NC-4.0', 'deprecated': False}, 'cc-by-nc-nd-1.0': {'id': 'CC-BY-NC-ND-1.0', 'deprecated': False}, 'cc-by-nc-nd-2.0': {'id': 'CC-BY-NC-ND-2.0', 'deprecated': False}, 'cc-by-nc-nd-2.5': {'id': 'CC-BY-NC-ND-2.5', 'deprecated': False}, 'cc-by-nc-nd-3.0': {'id': 'CC-BY-NC-ND-3.0', 'deprecated': False}, 'cc-by-nc-nd-3.0-de': {'id': 'CC-BY-NC-ND-3.0-DE', 'deprecated': False}, 'cc-by-nc-nd-3.0-igo': {'id': 'CC-BY-NC-ND-3.0-IGO', 'deprecated': False}, 'cc-by-nc-nd-4.0': {'id': 'CC-BY-NC-ND-4.0', 'deprecated': False}, 'cc-by-nc-sa-1.0': {'id': 'CC-BY-NC-SA-1.0', 'deprecated': False}, 'cc-by-nc-sa-2.0': {'id': 'CC-BY-NC-SA-2.0', 'deprecated': False}, 'cc-by-nc-sa-2.0-de': {'id': 'CC-BY-NC-SA-2.0-DE', 'deprecated': False}, 'cc-by-nc-sa-2.0-fr': {'id': 'CC-BY-NC-SA-2.0-FR', 'deprecated': False}, 'cc-by-nc-sa-2.0-uk': {'id': 'CC-BY-NC-SA-2.0-UK', 'deprecated': False}, 'cc-by-nc-sa-2.5': {'id': 'CC-BY-NC-SA-2.5', 'deprecated': False}, 'cc-by-nc-sa-3.0': {'id': 'CC-BY-NC-SA-3.0', 'deprecated': False}, 'cc-by-nc-sa-3.0-de': {'id': 'CC-BY-NC-SA-3.0-DE', 'deprecated': False}, 'cc-by-nc-sa-3.0-igo': {'id': 'CC-BY-NC-SA-3.0-IGO', 'deprecated': False}, 'cc-by-nc-sa-4.0': {'id': 'CC-BY-NC-SA-4.0', 'deprecated': False}, 'cc-by-nd-1.0': {'id': 'CC-BY-ND-1.0', 'deprecated': False}, 'cc-by-nd-2.0': {'id': 'CC-BY-ND-2.0', 'deprecated': False}, 'cc-by-nd-2.5': {'id': 'CC-BY-ND-2.5', 'deprecated': False}, 'cc-by-nd-3.0': {'id': 'CC-BY-ND-3.0', 'deprecated': False}, 'cc-by-nd-3.0-de': {'id': 'CC-BY-ND-3.0-DE', 'deprecated': False}, 'cc-by-nd-4.0': {'id': 'CC-BY-ND-4.0', 'deprecated': False}, 'cc-by-sa-1.0': {'id': 'CC-BY-SA-1.0', 'deprecated': False}, 'cc-by-sa-2.0': {'id': 'CC-BY-SA-2.0', 'deprecated': False}, 'cc-by-sa-2.0-uk': {'id': 'CC-BY-SA-2.0-UK', 'deprecated': False}, 'cc-by-sa-2.1-jp': {'id': 'CC-BY-SA-2.1-JP', 'deprecated': False}, 'cc-by-sa-2.5': {'id': 'CC-BY-SA-2.5', 'deprecated': False}, 'cc-by-sa-3.0': {'id': 'CC-BY-SA-3.0', 'deprecated': False}, 'cc-by-sa-3.0-at': {'id': 'CC-BY-SA-3.0-AT', 'deprecated': False}, 'cc-by-sa-3.0-de': {'id': 'CC-BY-SA-3.0-DE', 'deprecated': False}, 'cc-by-sa-3.0-igo': {'id': 'CC-BY-SA-3.0-IGO', 'deprecated': False}, 'cc-by-sa-4.0': {'id': 'CC-BY-SA-4.0', 'deprecated': False}, 'cc-pddc': {'id': 'CC-PDDC', 'deprecated': False}, 'cc-pdm-1.0': {'id': 'CC-PDM-1.0', 'deprecated': False}, 'cc-sa-1.0': {'id': 'CC-SA-1.0', 'deprecated': False}, 'cc0-1.0': {'id': 'CC0-1.0', 'deprecated': False}, 'cddl-1.0': {'id': 'CDDL-1.0', 'deprecated': False}, 'cddl-1.1': {'id': 'CDDL-1.1', 'deprecated': False}, 'cdl-1.0': {'id': 'CDL-1.0', 'deprecated': False}, 'cdla-permissive-1.0': {'id': 'CDLA-Permissive-1.0', 'deprecated': False}, 'cdla-permissive-2.0': {'id': 'CDLA-Permissive-2.0', 'deprecated': False}, 'cdla-sharing-1.0': {'id': 'CDLA-Sharing-1.0', 'deprecated': False}, 'cecill-1.0': {'id': 'CECILL-1.0', 'deprecated': False}, 'cecill-1.1': {'id': 'CECILL-1.1', 'deprecated': False}, 'cecill-2.0': {'id': 'CECILL-2.0', 'deprecated': False}, 'cecill-2.1': {'id': 'CECILL-2.1', 'deprecated': False}, 'cecill-b': {'id': 'CECILL-B', 'deprecated': False}, 'cecill-c': {'id': 'CECILL-C', 'deprecated': False}, 'cern-ohl-1.1': {'id': 'CERN-OHL-1.1', 'deprecated': False}, 'cern-ohl-1.2': {'id': 'CERN-OHL-1.2', 'deprecated': False}, 'cern-ohl-p-2.0': {'id': 'CERN-OHL-P-2.0', 'deprecated': False}, 'cern-ohl-s-2.0': {'id': 'CERN-OHL-S-2.0', 'deprecated': False}, 'cern-ohl-w-2.0': {'id': 'CERN-OHL-W-2.0', 'deprecated': False}, 'cfitsio': {'id': 'CFITSIO', 'deprecated': False}, 'check-cvs': {'id': 'check-cvs', 'deprecated': False}, 'checkmk': {'id': 'checkmk', 'deprecated': False}, 'clartistic': {'id': 'ClArtistic', 'deprecated': False}, 'clips': {'id': 'Clips', 'deprecated': False}, 'cmu-mach': {'id': 'CMU-Mach', 'deprecated': False}, 'cmu-mach-nodoc': {'id': 'CMU-Mach-nodoc', 'deprecated': False}, 'cnri-jython': {'id': 'CNRI-Jython', 'deprecated': False}, 'cnri-python': {'id': 'CNRI-Python', 'deprecated': False}, 'cnri-python-gpl-compatible': {'id': 'CNRI-Python-GPL-Compatible', 'deprecated': False}, 'coil-1.0': {'id': 'COIL-1.0', 'deprecated': False}, 'community-spec-1.0': {'id': 'Community-Spec-1.0', 'deprecated': False}, 'condor-1.1': {'id': 'Condor-1.1', 'deprecated': False}, 'copyleft-next-0.3.0': {'id': 'copyleft-next-0.3.0', 'deprecated': False}, 'copyleft-next-0.3.1': {'id': 'copyleft-next-0.3.1', 'deprecated': False}, 'cornell-lossless-jpeg': {'id': 'Cornell-Lossless-JPEG', 'deprecated': False}, 'cpal-1.0': {'id': 'CPAL-1.0', 'deprecated': False}, 'cpl-1.0': {'id': 'CPL-1.0', 'deprecated': False}, 'cpol-1.02': {'id': 'CPOL-1.02', 'deprecated': False}, 'cronyx': {'id': 'Cronyx', 'deprecated': False}, 'crossword': {'id': 'Crossword', 'deprecated': False}, 'cryptoswift': {'id': 'CryptoSwift', 'deprecated': False}, 'crystalstacker': {'id': 'CrystalStacker', 'deprecated': False}, 'cua-opl-1.0': {'id': 'CUA-OPL-1.0', 'deprecated': False}, 'cube': {'id': 'Cube', 'deprecated': False}, 'curl': {'id': 'curl', 'deprecated': False}, 'cve-tou': {'id': 'cve-tou', 'deprecated': False}, 'd-fsl-1.0': {'id': 'D-FSL-1.0', 'deprecated': False}, 'dec-3-clause': {'id': 'DEC-3-Clause', 'deprecated': False}, 'diffmark': {'id': 'diffmark', 'deprecated': False}, 'dl-de-by-2.0': {'id': 'DL-DE-BY-2.0', 'deprecated': False}, 'dl-de-zero-2.0': {'id': 'DL-DE-ZERO-2.0', 'deprecated': False}, 'doc': {'id': 'DOC', 'deprecated': False}, 'docbook-dtd': {'id': 'DocBook-DTD', 'deprecated': False}, 'docbook-schema': {'id': 'DocBook-Schema', 'deprecated': False}, 'docbook-stylesheet': {'id': 'DocBook-Stylesheet', 'deprecated': False}, 'docbook-xml': {'id': 'DocBook-XML', 'deprecated': False}, 'dotseqn': {'id': 'Dotseqn', 'deprecated': False}, 'drl-1.0': {'id': 'DRL-1.0', 'deprecated': False}, 'drl-1.1': {'id': 'DRL-1.1', 'deprecated': False}, 'dsdp': {'id': 'DSDP', 'deprecated': False}, 'dtoa': {'id': 'dtoa', 'deprecated': False}, 'dvipdfm': {'id': 'dvipdfm', 'deprecated': False}, 'ecl-1.0': {'id': 'ECL-1.0', 'deprecated': False}, 'ecl-2.0': {'id': 'ECL-2.0', 'deprecated': False}, 'ecos-2.0': {'id': 'eCos-2.0', 'deprecated': True}, 'efl-1.0': {'id': 'EFL-1.0', 'deprecated': False}, 'efl-2.0': {'id': 'EFL-2.0', 'deprecated': False}, 'egenix': {'id': 'eGenix', 'deprecated': False}, 'elastic-2.0': {'id': 'Elastic-2.0', 'deprecated': False}, 'entessa': {'id': 'Entessa', 'deprecated': False}, 'epics': {'id': 'EPICS', 'deprecated': False}, 'epl-1.0': {'id': 'EPL-1.0', 'deprecated': False}, 'epl-2.0': {'id': 'EPL-2.0', 'deprecated': False}, 'erlpl-1.1': {'id': 'ErlPL-1.1', 'deprecated': False}, 'etalab-2.0': {'id': 'etalab-2.0', 'deprecated': False}, 'eudatagrid': {'id': 'EUDatagrid', 'deprecated': False}, 'eupl-1.0': {'id': 'EUPL-1.0', 'deprecated': False}, 'eupl-1.1': {'id': 'EUPL-1.1', 'deprecated': False}, 'eupl-1.2': {'id': 'EUPL-1.2', 'deprecated': False}, 'eurosym': {'id': 'Eurosym', 'deprecated': False}, 'fair': {'id': 'Fair', 'deprecated': False}, 'fbm': {'id': 'FBM', 'deprecated': False}, 'fdk-aac': {'id': 'FDK-AAC', 'deprecated': False}, 'ferguson-twofish': {'id': 'Ferguson-Twofish', 'deprecated': False}, 'frameworx-1.0': {'id': 'Frameworx-1.0', 'deprecated': False}, 'freebsd-doc': {'id': 'FreeBSD-DOC', 'deprecated': False}, 'freeimage': {'id': 'FreeImage', 'deprecated': False}, 'fsfap': {'id': 'FSFAP', 'deprecated': False}, 'fsfap-no-warranty-disclaimer': {'id': 'FSFAP-no-warranty-disclaimer', 'deprecated': False}, 'fsful': {'id': 'FSFUL', 'deprecated': False}, 'fsfullr': {'id': 'FSFULLR', 'deprecated': False}, 'fsfullrsd': {'id': 'FSFULLRSD', 'deprecated': False}, 'fsfullrwd': {'id': 'FSFULLRWD', 'deprecated': False}, 'fsl-1.1-alv2': {'id': 'FSL-1.1-ALv2', 'deprecated': False}, 'fsl-1.1-mit': {'id': 'FSL-1.1-MIT', 'deprecated': False}, 'ftl': {'id': 'FTL', 'deprecated': False}, 'furuseth': {'id': 'Furuseth', 'deprecated': False}, 'fwlw': {'id': 'fwlw', 'deprecated': False}, 'game-programming-gems': {'id': 'Game-Programming-Gems', 'deprecated': False}, 'gcr-docs': {'id': 'GCR-docs', 'deprecated': False}, 'gd': {'id': 'GD', 'deprecated': False}, 'generic-xts': {'id': 'generic-xts', 'deprecated': False}, 'gfdl-1.1': {'id': 'GFDL-1.1', 'deprecated': True}, 'gfdl-1.1-invariants-only': {'id': 'GFDL-1.1-invariants-only', 'deprecated': False}, 'gfdl-1.1-invariants-or-later': {'id': 'GFDL-1.1-invariants-or-later', 'deprecated': False}, 'gfdl-1.1-no-invariants-only': {'id': 'GFDL-1.1-no-invariants-only', 'deprecated': False}, 'gfdl-1.1-no-invariants-or-later': {'id': 'GFDL-1.1-no-invariants-or-later', 'deprecated': False}, 'gfdl-1.1-only': {'id': 'GFDL-1.1-only', 'deprecated': False}, 'gfdl-1.1-or-later': {'id': 'GFDL-1.1-or-later', 'deprecated': False}, 'gfdl-1.2': {'id': 'GFDL-1.2', 'deprecated': True}, 'gfdl-1.2-invariants-only': {'id': 'GFDL-1.2-invariants-only', 'deprecated': False}, 'gfdl-1.2-invariants-or-later': {'id': 'GFDL-1.2-invariants-or-later', 'deprecated': False}, 'gfdl-1.2-no-invariants-only': {'id': 'GFDL-1.2-no-invariants-only', 'deprecated': False}, 'gfdl-1.2-no-invariants-or-later': {'id': 'GFDL-1.2-no-invariants-or-later', 'deprecated': False}, 'gfdl-1.2-only': {'id': 'GFDL-1.2-only', 'deprecated': False}, 'gfdl-1.2-or-later': {'id': 'GFDL-1.2-or-later', 'deprecated': False}, 'gfdl-1.3': {'id': 'GFDL-1.3', 'deprecated': True}, 'gfdl-1.3-invariants-only': {'id': 'GFDL-1.3-invariants-only', 'deprecated': False}, 'gfdl-1.3-invariants-or-later': {'id': 'GFDL-1.3-invariants-or-later', 'deprecated': False}, 'gfdl-1.3-no-invariants-only': {'id': 'GFDL-1.3-no-invariants-only', 'deprecated': False}, 'gfdl-1.3-no-invariants-or-later': {'id': 'GFDL-1.3-no-invariants-or-later', 'deprecated': False}, 'gfdl-1.3-only': {'id': 'GFDL-1.3-only', 'deprecated': False}, 'gfdl-1.3-or-later': {'id': 'GFDL-1.3-or-later', 'deprecated': False}, 'giftware': {'id': 'Giftware', 'deprecated': False}, 'gl2ps': {'id': 'GL2PS', 'deprecated': False}, 'glide': {'id': 'Glide', 'deprecated': False}, 'glulxe': {'id': 'Glulxe', 'deprecated': False}, 'glwtpl': {'id': 'GLWTPL', 'deprecated': False}, 'gnuplot': {'id': 'gnuplot', 'deprecated': False}, 'gpl-1.0': {'id': 'GPL-1.0', 'deprecated': True}, 'gpl-1.0+': {'id': 'GPL-1.0+', 'deprecated': True}, 'gpl-1.0-only': {'id': 'GPL-1.0-only', 'deprecated': False}, 'gpl-1.0-or-later': {'id': 'GPL-1.0-or-later', 'deprecated': False}, 'gpl-2.0': {'id': 'GPL-2.0', 'deprecated': True}, 'gpl-2.0+': {'id': 'GPL-2.0+', 'deprecated': True}, 'gpl-2.0-only': {'id': 'GPL-2.0-only', 'deprecated': False}, 'gpl-2.0-or-later': {'id': 'GPL-2.0-or-later', 'deprecated': False}, 'gpl-2.0-with-autoconf-exception': {'id': 'GPL-2.0-with-autoconf-exception', 'deprecated': True}, 'gpl-2.0-with-bison-exception': {'id': 'GPL-2.0-with-bison-exception', 'deprecated': True}, 'gpl-2.0-with-classpath-exception': {'id': 'GPL-2.0-with-classpath-exception', 'deprecated': True}, 'gpl-2.0-with-font-exception': {'id': 'GPL-2.0-with-font-exception', 'deprecated': True}, 'gpl-2.0-with-gcc-exception': {'id': 'GPL-2.0-with-GCC-exception', 'deprecated': True}, 'gpl-3.0': {'id': 'GPL-3.0', 'deprecated': True}, 'gpl-3.0+': {'id': 'GPL-3.0+', 'deprecated': True}, 'gpl-3.0-only': {'id': 'GPL-3.0-only', 'deprecated': False}, 'gpl-3.0-or-later': {'id': 'GPL-3.0-or-later', 'deprecated': False}, 'gpl-3.0-with-autoconf-exception': {'id': 'GPL-3.0-with-autoconf-exception', 'deprecated': True}, 'gpl-3.0-with-gcc-exception': {'id': 'GPL-3.0-with-GCC-exception', 'deprecated': True}, 'graphics-gems': {'id': 'Graphics-Gems', 'deprecated': False}, 'gsoap-1.3b': {'id': 'gSOAP-1.3b', 'deprecated': False}, 'gtkbook': {'id': 'gtkbook', 'deprecated': False}, 'gutmann': {'id': 'Gutmann', 'deprecated': False}, 'haskellreport': {'id': 'HaskellReport', 'deprecated': False}, 'hdf5': {'id': 'HDF5', 'deprecated': False}, 'hdparm': {'id': 'hdparm', 'deprecated': False}, 'hidapi': {'id': 'HIDAPI', 'deprecated': False}, 'hippocratic-2.1': {'id': 'Hippocratic-2.1', 'deprecated': False}, 'hp-1986': {'id': 'HP-1986', 'deprecated': False}, 'hp-1989': {'id': 'HP-1989', 'deprecated': False}, 'hpnd': {'id': 'HPND', 'deprecated': False}, 'hpnd-dec': {'id': 'HPND-DEC', 'deprecated': False}, 'hpnd-doc': {'id': 'HPND-doc', 'deprecated': False}, 'hpnd-doc-sell': {'id': 'HPND-doc-sell', 'deprecated': False}, 'hpnd-export-us': {'id': 'HPND-export-US', 'deprecated': False}, 'hpnd-export-us-acknowledgement': {'id': 'HPND-export-US-acknowledgement', 'deprecated': False}, 'hpnd-export-us-modify': {'id': 'HPND-export-US-modify', 'deprecated': False}, 'hpnd-export2-us': {'id': 'HPND-export2-US', 'deprecated': False}, 'hpnd-fenneberg-livingston': {'id': 'HPND-Fenneberg-Livingston', 'deprecated': False}, 'hpnd-inria-imag': {'id': 'HPND-INRIA-IMAG', 'deprecated': False}, 'hpnd-intel': {'id': 'HPND-Intel', 'deprecated': False}, 'hpnd-kevlin-henney': {'id': 'HPND-Kevlin-Henney', 'deprecated': False}, 'hpnd-markus-kuhn': {'id': 'HPND-Markus-Kuhn', 'deprecated': False}, 'hpnd-merchantability-variant': {'id': 'HPND-merchantability-variant', 'deprecated': False}, 'hpnd-mit-disclaimer': {'id': 'HPND-MIT-disclaimer', 'deprecated': False}, 'hpnd-netrek': {'id': 'HPND-Netrek', 'deprecated': False}, 'hpnd-pbmplus': {'id': 'HPND-Pbmplus', 'deprecated': False}, 'hpnd-sell-mit-disclaimer-xserver': {'id': 'HPND-sell-MIT-disclaimer-xserver', 'deprecated': False}, 'hpnd-sell-regexpr': {'id': 'HPND-sell-regexpr', 'deprecated': False}, 'hpnd-sell-variant': {'id': 'HPND-sell-variant', 'deprecated': False}, 'hpnd-sell-variant-mit-disclaimer': {'id': 'HPND-sell-variant-MIT-disclaimer', 'deprecated': False}, 'hpnd-sell-variant-mit-disclaimer-rev': {'id': 'HPND-sell-variant-MIT-disclaimer-rev', 'deprecated': False}, 'hpnd-uc': {'id': 'HPND-UC', 'deprecated': False}, 'hpnd-uc-export-us': {'id': 'HPND-UC-export-US', 'deprecated': False}, 'htmltidy': {'id': 'HTMLTIDY', 'deprecated': False}, 'ibm-pibs': {'id': 'IBM-pibs', 'deprecated': False}, 'icu': {'id': 'ICU', 'deprecated': False}, 'iec-code-components-eula': {'id': 'IEC-Code-Components-EULA', 'deprecated': False}, 'ijg': {'id': 'IJG', 'deprecated': False}, 'ijg-short': {'id': 'IJG-short', 'deprecated': False}, 'imagemagick': {'id': 'ImageMagick', 'deprecated': False}, 'imatix': {'id': 'iMatix', 'deprecated': False}, 'imlib2': {'id': 'Imlib2', 'deprecated': False}, 'info-zip': {'id': 'Info-ZIP', 'deprecated': False}, 'inner-net-2.0': {'id': 'Inner-Net-2.0', 'deprecated': False}, 'innosetup': {'id': 'InnoSetup', 'deprecated': False}, 'intel': {'id': 'Intel', 'deprecated': False}, 'intel-acpi': {'id': 'Intel-ACPI', 'deprecated': False}, 'interbase-1.0': {'id': 'Interbase-1.0', 'deprecated': False}, 'ipa': {'id': 'IPA', 'deprecated': False}, 'ipl-1.0': {'id': 'IPL-1.0', 'deprecated': False}, 'isc': {'id': 'ISC', 'deprecated': False}, 'isc-veillard': {'id': 'ISC-Veillard', 'deprecated': False}, 'jam': {'id': 'Jam', 'deprecated': False}, 'jasper-2.0': {'id': 'JasPer-2.0', 'deprecated': False}, 'jove': {'id': 'jove', 'deprecated': False}, 'jpl-image': {'id': 'JPL-image', 'deprecated': False}, 'jpnic': {'id': 'JPNIC', 'deprecated': False}, 'json': {'id': 'JSON', 'deprecated': False}, 'kastrup': {'id': 'Kastrup', 'deprecated': False}, 'kazlib': {'id': 'Kazlib', 'deprecated': False}, 'knuth-ctan': {'id': 'Knuth-CTAN', 'deprecated': False}, 'lal-1.2': {'id': 'LAL-1.2', 'deprecated': False}, 'lal-1.3': {'id': 'LAL-1.3', 'deprecated': False}, 'latex2e': {'id': 'Latex2e', 'deprecated': False}, 'latex2e-translated-notice': {'id': 'Latex2e-translated-notice', 'deprecated': False}, 'leptonica': {'id': 'Leptonica', 'deprecated': False}, 'lgpl-2.0': {'id': 'LGPL-2.0', 'deprecated': True}, 'lgpl-2.0+': {'id': 'LGPL-2.0+', 'deprecated': True}, 'lgpl-2.0-only': {'id': 'LGPL-2.0-only', 'deprecated': False}, 'lgpl-2.0-or-later': {'id': 'LGPL-2.0-or-later', 'deprecated': False}, 'lgpl-2.1': {'id': 'LGPL-2.1', 'deprecated': True}, 'lgpl-2.1+': {'id': 'LGPL-2.1+', 'deprecated': True}, 'lgpl-2.1-only': {'id': 'LGPL-2.1-only', 'deprecated': False}, 'lgpl-2.1-or-later': {'id': 'LGPL-2.1-or-later', 'deprecated': False}, 'lgpl-3.0': {'id': 'LGPL-3.0', 'deprecated': True}, 'lgpl-3.0+': {'id': 'LGPL-3.0+', 'deprecated': True}, 'lgpl-3.0-only': {'id': 'LGPL-3.0-only', 'deprecated': False}, 'lgpl-3.0-or-later': {'id': 'LGPL-3.0-or-later', 'deprecated': False}, 'lgpllr': {'id': 'LGPLLR', 'deprecated': False}, 'libpng': {'id': 'Libpng', 'deprecated': False}, 'libpng-1.6.35': {'id': 'libpng-1.6.35', 'deprecated': False}, 'libpng-2.0': {'id': 'libpng-2.0', 'deprecated': False}, 'libselinux-1.0': {'id': 'libselinux-1.0', 'deprecated': False}, 'libtiff': {'id': 'libtiff', 'deprecated': False}, 'libutil-david-nugent': {'id': 'libutil-David-Nugent', 'deprecated': False}, 'liliq-p-1.1': {'id': 'LiLiQ-P-1.1', 'deprecated': False}, 'liliq-r-1.1': {'id': 'LiLiQ-R-1.1', 'deprecated': False}, 'liliq-rplus-1.1': {'id': 'LiLiQ-Rplus-1.1', 'deprecated': False}, 'linux-man-pages-1-para': {'id': 'Linux-man-pages-1-para', 'deprecated': False}, 'linux-man-pages-copyleft': {'id': 'Linux-man-pages-copyleft', 'deprecated': False}, 'linux-man-pages-copyleft-2-para': {'id': 'Linux-man-pages-copyleft-2-para', 'deprecated': False}, 'linux-man-pages-copyleft-var': {'id': 'Linux-man-pages-copyleft-var', 'deprecated': False}, 'linux-openib': {'id': 'Linux-OpenIB', 'deprecated': False}, 'loop': {'id': 'LOOP', 'deprecated': False}, 'lpd-document': {'id': 'LPD-document', 'deprecated': False}, 'lpl-1.0': {'id': 'LPL-1.0', 'deprecated': False}, 'lpl-1.02': {'id': 'LPL-1.02', 'deprecated': False}, 'lppl-1.0': {'id': 'LPPL-1.0', 'deprecated': False}, 'lppl-1.1': {'id': 'LPPL-1.1', 'deprecated': False}, 'lppl-1.2': {'id': 'LPPL-1.2', 'deprecated': False}, 'lppl-1.3a': {'id': 'LPPL-1.3a', 'deprecated': False}, 'lppl-1.3c': {'id': 'LPPL-1.3c', 'deprecated': False}, 'lsof': {'id': 'lsof', 'deprecated': False}, 'lucida-bitmap-fonts': {'id': 'Lucida-Bitmap-Fonts', 'deprecated': False}, 'lzma-sdk-9.11-to-9.20': {'id': 'LZMA-SDK-9.11-to-9.20', 'deprecated': False}, 'lzma-sdk-9.22': {'id': 'LZMA-SDK-9.22', 'deprecated': False}, 'mackerras-3-clause': {'id': 'Mackerras-3-Clause', 'deprecated': False}, 'mackerras-3-clause-acknowledgment': {'id': 'Mackerras-3-Clause-acknowledgment', 'deprecated': False}, 'magaz': {'id': 'magaz', 'deprecated': False}, 'mailprio': {'id': 'mailprio', 'deprecated': False}, 'makeindex': {'id': 'MakeIndex', 'deprecated': False}, 'man2html': {'id': 'man2html', 'deprecated': False}, 'martin-birgmeier': {'id': 'Martin-Birgmeier', 'deprecated': False}, 'mcphee-slideshow': {'id': 'McPhee-slideshow', 'deprecated': False}, 'metamail': {'id': 'metamail', 'deprecated': False}, 'minpack': {'id': 'Minpack', 'deprecated': False}, 'mips': {'id': 'MIPS', 'deprecated': False}, 'miros': {'id': 'MirOS', 'deprecated': False}, 'mit': {'id': 'MIT', 'deprecated': False}, 'mit-0': {'id': 'MIT-0', 'deprecated': False}, 'mit-advertising': {'id': 'MIT-advertising', 'deprecated': False}, 'mit-click': {'id': 'MIT-Click', 'deprecated': False}, 'mit-cmu': {'id': 'MIT-CMU', 'deprecated': False}, 'mit-enna': {'id': 'MIT-enna', 'deprecated': False}, 'mit-feh': {'id': 'MIT-feh', 'deprecated': False}, 'mit-festival': {'id': 'MIT-Festival', 'deprecated': False}, 'mit-khronos-old': {'id': 'MIT-Khronos-old', 'deprecated': False}, 'mit-modern-variant': {'id': 'MIT-Modern-Variant', 'deprecated': False}, 'mit-open-group': {'id': 'MIT-open-group', 'deprecated': False}, 'mit-testregex': {'id': 'MIT-testregex', 'deprecated': False}, 'mit-wu': {'id': 'MIT-Wu', 'deprecated': False}, 'mitnfa': {'id': 'MITNFA', 'deprecated': False}, 'mmixware': {'id': 'MMIXware', 'deprecated': False}, 'motosoto': {'id': 'Motosoto', 'deprecated': False}, 'mpeg-ssg': {'id': 'MPEG-SSG', 'deprecated': False}, 'mpi-permissive': {'id': 'mpi-permissive', 'deprecated': False}, 'mpich2': {'id': 'mpich2', 'deprecated': False}, 'mpl-1.0': {'id': 'MPL-1.0', 'deprecated': False}, 'mpl-1.1': {'id': 'MPL-1.1', 'deprecated': False}, 'mpl-2.0': {'id': 'MPL-2.0', 'deprecated': False}, 'mpl-2.0-no-copyleft-exception': {'id': 'MPL-2.0-no-copyleft-exception', 'deprecated': False}, 'mplus': {'id': 'mplus', 'deprecated': False}, 'ms-lpl': {'id': 'MS-LPL', 'deprecated': False}, 'ms-pl': {'id': 'MS-PL', 'deprecated': False}, 'ms-rl': {'id': 'MS-RL', 'deprecated': False}, 'mtll': {'id': 'MTLL', 'deprecated': False}, 'mulanpsl-1.0': {'id': 'MulanPSL-1.0', 'deprecated': False}, 'mulanpsl-2.0': {'id': 'MulanPSL-2.0', 'deprecated': False}, 'multics': {'id': 'Multics', 'deprecated': False}, 'mup': {'id': 'Mup', 'deprecated': False}, 'naist-2003': {'id': 'NAIST-2003', 'deprecated': False}, 'nasa-1.3': {'id': 'NASA-1.3', 'deprecated': False}, 'naumen': {'id': 'Naumen', 'deprecated': False}, 'nbpl-1.0': {'id': 'NBPL-1.0', 'deprecated': False}, 'ncbi-pd': {'id': 'NCBI-PD', 'deprecated': False}, 'ncgl-uk-2.0': {'id': 'NCGL-UK-2.0', 'deprecated': False}, 'ncl': {'id': 'NCL', 'deprecated': False}, 'ncsa': {'id': 'NCSA', 'deprecated': False}, 'net-snmp': {'id': 'Net-SNMP', 'deprecated': True}, 'netcdf': {'id': 'NetCDF', 'deprecated': False}, 'newsletr': {'id': 'Newsletr', 'deprecated': False}, 'ngpl': {'id': 'NGPL', 'deprecated': False}, 'ngrep': {'id': 'ngrep', 'deprecated': False}, 'nicta-1.0': {'id': 'NICTA-1.0', 'deprecated': False}, 'nist-pd': {'id': 'NIST-PD', 'deprecated': False}, 'nist-pd-fallback': {'id': 'NIST-PD-fallback', 'deprecated': False}, 'nist-software': {'id': 'NIST-Software', 'deprecated': False}, 'nlod-1.0': {'id': 'NLOD-1.0', 'deprecated': False}, 'nlod-2.0': {'id': 'NLOD-2.0', 'deprecated': False}, 'nlpl': {'id': 'NLPL', 'deprecated': False}, 'nokia': {'id': 'Nokia', 'deprecated': False}, 'nosl': {'id': 'NOSL', 'deprecated': False}, 'noweb': {'id': 'Noweb', 'deprecated': False}, 'npl-1.0': {'id': 'NPL-1.0', 'deprecated': False}, 'npl-1.1': {'id': 'NPL-1.1', 'deprecated': False}, 'nposl-3.0': {'id': 'NPOSL-3.0', 'deprecated': False}, 'nrl': {'id': 'NRL', 'deprecated': False}, 'ntia-pd': {'id': 'NTIA-PD', 'deprecated': False}, 'ntp': {'id': 'NTP', 'deprecated': False}, 'ntp-0': {'id': 'NTP-0', 'deprecated': False}, 'nunit': {'id': 'Nunit', 'deprecated': True}, 'o-uda-1.0': {'id': 'O-UDA-1.0', 'deprecated': False}, 'oar': {'id': 'OAR', 'deprecated': False}, 'occt-pl': {'id': 'OCCT-PL', 'deprecated': False}, 'oclc-2.0': {'id': 'OCLC-2.0', 'deprecated': False}, 'odbl-1.0': {'id': 'ODbL-1.0', 'deprecated': False}, 'odc-by-1.0': {'id': 'ODC-By-1.0', 'deprecated': False}, 'offis': {'id': 'OFFIS', 'deprecated': False}, 'ofl-1.0': {'id': 'OFL-1.0', 'deprecated': False}, 'ofl-1.0-no-rfn': {'id': 'OFL-1.0-no-RFN', 'deprecated': False}, 'ofl-1.0-rfn': {'id': 'OFL-1.0-RFN', 'deprecated': False}, 'ofl-1.1': {'id': 'OFL-1.1', 'deprecated': False}, 'ofl-1.1-no-rfn': {'id': 'OFL-1.1-no-RFN', 'deprecated': False}, 'ofl-1.1-rfn': {'id': 'OFL-1.1-RFN', 'deprecated': False}, 'ogc-1.0': {'id': 'OGC-1.0', 'deprecated': False}, 'ogdl-taiwan-1.0': {'id': 'OGDL-Taiwan-1.0', 'deprecated': False}, 'ogl-canada-2.0': {'id': 'OGL-Canada-2.0', 'deprecated': False}, 'ogl-uk-1.0': {'id': 'OGL-UK-1.0', 'deprecated': False}, 'ogl-uk-2.0': {'id': 'OGL-UK-2.0', 'deprecated': False}, 'ogl-uk-3.0': {'id': 'OGL-UK-3.0', 'deprecated': False}, 'ogtsl': {'id': 'OGTSL', 'deprecated': False}, 'oldap-1.1': {'id': 'OLDAP-1.1', 'deprecated': False}, 'oldap-1.2': {'id': 'OLDAP-1.2', 'deprecated': False}, 'oldap-1.3': {'id': 'OLDAP-1.3', 'deprecated': False}, 'oldap-1.4': {'id': 'OLDAP-1.4', 'deprecated': False}, 'oldap-2.0': {'id': 'OLDAP-2.0', 'deprecated': False}, 'oldap-2.0.1': {'id': 'OLDAP-2.0.1', 'deprecated': False}, 'oldap-2.1': {'id': 'OLDAP-2.1', 'deprecated': False}, 'oldap-2.2': {'id': 'OLDAP-2.2', 'deprecated': False}, 'oldap-2.2.1': {'id': 'OLDAP-2.2.1', 'deprecated': False}, 'oldap-2.2.2': {'id': 'OLDAP-2.2.2', 'deprecated': False}, 'oldap-2.3': {'id': 'OLDAP-2.3', 'deprecated': False}, 'oldap-2.4': {'id': 'OLDAP-2.4', 'deprecated': False}, 'oldap-2.5': {'id': 'OLDAP-2.5', 'deprecated': False}, 'oldap-2.6': {'id': 'OLDAP-2.6', 'deprecated': False}, 'oldap-2.7': {'id': 'OLDAP-2.7', 'deprecated': False}, 'oldap-2.8': {'id': 'OLDAP-2.8', 'deprecated': False}, 'olfl-1.3': {'id': 'OLFL-1.3', 'deprecated': False}, 'oml': {'id': 'OML', 'deprecated': False}, 'openpbs-2.3': {'id': 'OpenPBS-2.3', 'deprecated': False}, 'openssl': {'id': 'OpenSSL', 'deprecated': False}, 'openssl-standalone': {'id': 'OpenSSL-standalone', 'deprecated': False}, 'openvision': {'id': 'OpenVision', 'deprecated': False}, 'opl-1.0': {'id': 'OPL-1.0', 'deprecated': False}, 'opl-uk-3.0': {'id': 'OPL-UK-3.0', 'deprecated': False}, 'opubl-1.0': {'id': 'OPUBL-1.0', 'deprecated': False}, 'oset-pl-2.1': {'id': 'OSET-PL-2.1', 'deprecated': False}, 'osl-1.0': {'id': 'OSL-1.0', 'deprecated': False}, 'osl-1.1': {'id': 'OSL-1.1', 'deprecated': False}, 'osl-2.0': {'id': 'OSL-2.0', 'deprecated': False}, 'osl-2.1': {'id': 'OSL-2.1', 'deprecated': False}, 'osl-3.0': {'id': 'OSL-3.0', 'deprecated': False}, 'padl': {'id': 'PADL', 'deprecated': False}, 'parity-6.0.0': {'id': 'Parity-6.0.0', 'deprecated': False}, 'parity-7.0.0': {'id': 'Parity-7.0.0', 'deprecated': False}, 'pddl-1.0': {'id': 'PDDL-1.0', 'deprecated': False}, 'php-3.0': {'id': 'PHP-3.0', 'deprecated': False}, 'php-3.01': {'id': 'PHP-3.01', 'deprecated': False}, 'pixar': {'id': 'Pixar', 'deprecated': False}, 'pkgconf': {'id': 'pkgconf', 'deprecated': False}, 'plexus': {'id': 'Plexus', 'deprecated': False}, 'pnmstitch': {'id': 'pnmstitch', 'deprecated': False}, 'polyform-noncommercial-1.0.0': {'id': 'PolyForm-Noncommercial-1.0.0', 'deprecated': False}, 'polyform-small-business-1.0.0': {'id': 'PolyForm-Small-Business-1.0.0', 'deprecated': False}, 'postgresql': {'id': 'PostgreSQL', 'deprecated': False}, 'ppl': {'id': 'PPL', 'deprecated': False}, 'psf-2.0': {'id': 'PSF-2.0', 'deprecated': False}, 'psfrag': {'id': 'psfrag', 'deprecated': False}, 'psutils': {'id': 'psutils', 'deprecated': False}, 'python-2.0': {'id': 'Python-2.0', 'deprecated': False}, 'python-2.0.1': {'id': 'Python-2.0.1', 'deprecated': False}, 'python-ldap': {'id': 'python-ldap', 'deprecated': False}, 'qhull': {'id': 'Qhull', 'deprecated': False}, 'qpl-1.0': {'id': 'QPL-1.0', 'deprecated': False}, 'qpl-1.0-inria-2004': {'id': 'QPL-1.0-INRIA-2004', 'deprecated': False}, 'radvd': {'id': 'radvd', 'deprecated': False}, 'rdisc': {'id': 'Rdisc', 'deprecated': False}, 'rhecos-1.1': {'id': 'RHeCos-1.1', 'deprecated': False}, 'rpl-1.1': {'id': 'RPL-1.1', 'deprecated': False}, 'rpl-1.5': {'id': 'RPL-1.5', 'deprecated': False}, 'rpsl-1.0': {'id': 'RPSL-1.0', 'deprecated': False}, 'rsa-md': {'id': 'RSA-MD', 'deprecated': False}, 'rscpl': {'id': 'RSCPL', 'deprecated': False}, 'ruby': {'id': 'Ruby', 'deprecated': False}, 'ruby-pty': {'id': 'Ruby-pty', 'deprecated': False}, 'sax-pd': {'id': 'SAX-PD', 'deprecated': False}, 'sax-pd-2.0': {'id': 'SAX-PD-2.0', 'deprecated': False}, 'saxpath': {'id': 'Saxpath', 'deprecated': False}, 'scea': {'id': 'SCEA', 'deprecated': False}, 'schemereport': {'id': 'SchemeReport', 'deprecated': False}, 'sendmail': {'id': 'Sendmail', 'deprecated': False}, 'sendmail-8.23': {'id': 'Sendmail-8.23', 'deprecated': False}, 'sendmail-open-source-1.1': {'id': 'Sendmail-Open-Source-1.1', 'deprecated': False}, 'sgi-b-1.0': {'id': 'SGI-B-1.0', 'deprecated': False}, 'sgi-b-1.1': {'id': 'SGI-B-1.1', 'deprecated': False}, 'sgi-b-2.0': {'id': 'SGI-B-2.0', 'deprecated': False}, 'sgi-opengl': {'id': 'SGI-OpenGL', 'deprecated': False}, 'sgp4': {'id': 'SGP4', 'deprecated': False}, 'shl-0.5': {'id': 'SHL-0.5', 'deprecated': False}, 'shl-0.51': {'id': 'SHL-0.51', 'deprecated': False}, 'simpl-2.0': {'id': 'SimPL-2.0', 'deprecated': False}, 'sissl': {'id': 'SISSL', 'deprecated': False}, 'sissl-1.2': {'id': 'SISSL-1.2', 'deprecated': False}, 'sl': {'id': 'SL', 'deprecated': False}, 'sleepycat': {'id': 'Sleepycat', 'deprecated': False}, 'smail-gpl': {'id': 'SMAIL-GPL', 'deprecated': False}, 'smlnj': {'id': 'SMLNJ', 'deprecated': False}, 'smppl': {'id': 'SMPPL', 'deprecated': False}, 'snia': {'id': 'SNIA', 'deprecated': False}, 'snprintf': {'id': 'snprintf', 'deprecated': False}, 'sofa': {'id': 'SOFA', 'deprecated': False}, 'softsurfer': {'id': 'softSurfer', 'deprecated': False}, 'soundex': {'id': 'Soundex', 'deprecated': False}, 'spencer-86': {'id': 'Spencer-86', 'deprecated': False}, 'spencer-94': {'id': 'Spencer-94', 'deprecated': False}, 'spencer-99': {'id': 'Spencer-99', 'deprecated': False}, 'spl-1.0': {'id': 'SPL-1.0', 'deprecated': False}, 'ssh-keyscan': {'id': 'ssh-keyscan', 'deprecated': False}, 'ssh-openssh': {'id': 'SSH-OpenSSH', 'deprecated': False}, 'ssh-short': {'id': 'SSH-short', 'deprecated': False}, 'ssleay-standalone': {'id': 'SSLeay-standalone', 'deprecated': False}, 'sspl-1.0': {'id': 'SSPL-1.0', 'deprecated': False}, 'standardml-nj': {'id': 'StandardML-NJ', 'deprecated': True}, 'sugarcrm-1.1.3': {'id': 'SugarCRM-1.1.3', 'deprecated': False}, 'sul-1.0': {'id': 'SUL-1.0', 'deprecated': False}, 'sun-ppp': {'id': 'Sun-PPP', 'deprecated': False}, 'sun-ppp-2000': {'id': 'Sun-PPP-2000', 'deprecated': False}, 'sunpro': {'id': 'SunPro', 'deprecated': False}, 'swl': {'id': 'SWL', 'deprecated': False}, 'swrule': {'id': 'swrule', 'deprecated': False}, 'symlinks': {'id': 'Symlinks', 'deprecated': False}, 'tapr-ohl-1.0': {'id': 'TAPR-OHL-1.0', 'deprecated': False}, 'tcl': {'id': 'TCL', 'deprecated': False}, 'tcp-wrappers': {'id': 'TCP-wrappers', 'deprecated': False}, 'termreadkey': {'id': 'TermReadKey', 'deprecated': False}, 'tgppl-1.0': {'id': 'TGPPL-1.0', 'deprecated': False}, 'thirdeye': {'id': 'ThirdEye', 'deprecated': False}, 'threeparttable': {'id': 'threeparttable', 'deprecated': False}, 'tmate': {'id': 'TMate', 'deprecated': False}, 'torque-1.1': {'id': 'TORQUE-1.1', 'deprecated': False}, 'tosl': {'id': 'TOSL', 'deprecated': False}, 'tpdl': {'id': 'TPDL', 'deprecated': False}, 'tpl-1.0': {'id': 'TPL-1.0', 'deprecated': False}, 'trustedqsl': {'id': 'TrustedQSL', 'deprecated': False}, 'ttwl': {'id': 'TTWL', 'deprecated': False}, 'ttyp0': {'id': 'TTYP0', 'deprecated': False}, 'tu-berlin-1.0': {'id': 'TU-Berlin-1.0', 'deprecated': False}, 'tu-berlin-2.0': {'id': 'TU-Berlin-2.0', 'deprecated': False}, 'ubuntu-font-1.0': {'id': 'Ubuntu-font-1.0', 'deprecated': False}, 'ucar': {'id': 'UCAR', 'deprecated': False}, 'ucl-1.0': {'id': 'UCL-1.0', 'deprecated': False}, 'ulem': {'id': 'ulem', 'deprecated': False}, 'umich-merit': {'id': 'UMich-Merit', 'deprecated': False}, 'unicode-3.0': {'id': 'Unicode-3.0', 'deprecated': False}, 'unicode-dfs-2015': {'id': 'Unicode-DFS-2015', 'deprecated': False}, 'unicode-dfs-2016': {'id': 'Unicode-DFS-2016', 'deprecated': False}, 'unicode-tou': {'id': 'Unicode-TOU', 'deprecated': False}, 'unixcrypt': {'id': 'UnixCrypt', 'deprecated': False}, 'unlicense': {'id': 'Unlicense', 'deprecated': False}, 'unlicense-libtelnet': {'id': 'Unlicense-libtelnet', 'deprecated': False}, 'unlicense-libwhirlpool': {'id': 'Unlicense-libwhirlpool', 'deprecated': False}, 'upl-1.0': {'id': 'UPL-1.0', 'deprecated': False}, 'urt-rle': {'id': 'URT-RLE', 'deprecated': False}, 'vim': {'id': 'Vim', 'deprecated': False}, 'vostrom': {'id': 'VOSTROM', 'deprecated': False}, 'vsl-1.0': {'id': 'VSL-1.0', 'deprecated': False}, 'w3c': {'id': 'W3C', 'deprecated': False}, 'w3c-19980720': {'id': 'W3C-19980720', 'deprecated': False}, 'w3c-20150513': {'id': 'W3C-20150513', 'deprecated': False}, 'w3m': {'id': 'w3m', 'deprecated': False}, 'watcom-1.0': {'id': 'Watcom-1.0', 'deprecated': False}, 'widget-workshop': {'id': 'Widget-Workshop', 'deprecated': False}, 'wsuipa': {'id': 'Wsuipa', 'deprecated': False}, 'wtfpl': {'id': 'WTFPL', 'deprecated': False}, 'wwl': {'id': 'wwl', 'deprecated': False}, 'wxwindows': {'id': 'wxWindows', 'deprecated': True}, 'x11': {'id': 'X11', 'deprecated': False}, 'x11-distribute-modifications-variant': {'id': 'X11-distribute-modifications-variant', 'deprecated': False}, 'x11-swapped': {'id': 'X11-swapped', 'deprecated': False}, 'xdebug-1.03': {'id': 'Xdebug-1.03', 'deprecated': False}, 'xerox': {'id': 'Xerox', 'deprecated': False}, 'xfig': {'id': 'Xfig', 'deprecated': False}, 'xfree86-1.1': {'id': 'XFree86-1.1', 'deprecated': False}, 'xinetd': {'id': 'xinetd', 'deprecated': False}, 'xkeyboard-config-zinoviev': {'id': 'xkeyboard-config-Zinoviev', 'deprecated': False}, 'xlock': {'id': 'xlock', 'deprecated': False}, 'xnet': {'id': 'Xnet', 'deprecated': False}, 'xpp': {'id': 'xpp', 'deprecated': False}, 'xskat': {'id': 'XSkat', 'deprecated': False}, 'xzoom': {'id': 'xzoom', 'deprecated': False}, 'ypl-1.0': {'id': 'YPL-1.0', 'deprecated': False}, 'ypl-1.1': {'id': 'YPL-1.1', 'deprecated': False}, 'zed': {'id': 'Zed', 'deprecated': False}, 'zeeff': {'id': 'Zeeff', 'deprecated': False}, 'zend-2.0': {'id': 'Zend-2.0', 'deprecated': False}, 'zimbra-1.3': {'id': 'Zimbra-1.3', 'deprecated': False}, 'zimbra-1.4': {'id': 'Zimbra-1.4', 'deprecated': False}, 'zlib': {'id': 'Zlib', 'deprecated': False}, 'zlib-acknowledgement': {'id': 'zlib-acknowledgement', 'deprecated': False}, 'zpl-1.1': {'id': 'ZPL-1.1', 'deprecated': False}, 'zpl-2.0': {'id': 'ZPL-2.0', 'deprecated': False}, 'zpl-2.1': {'id': 'ZPL-2.1', 'deprecated': False},}
EXCEPTIONS: dict[str, SPDXException] = { '389-exception': {'id': '389-exception', 'deprecated': False}, 'asterisk-exception': {'id': 'Asterisk-exception', 'deprecated': False}, 'asterisk-linking-protocols-exception': {'id': 'Asterisk-linking-protocols-exception', 'deprecated': False}, 'autoconf-exception-2.0': {'id': 'Autoconf-exception-2.0', 'deprecated': False}, 'autoconf-exception-3.0': {'id': 'Autoconf-exception-3.0', 'deprecated': False}, 'autoconf-exception-generic': {'id': 'Autoconf-exception-generic', 'deprecated': False}, 'autoconf-exception-generic-3.0': {'id': 'Autoconf-exception-generic-3.0', 'deprecated': False}, 'autoconf-exception-macro': {'id': 'Autoconf-exception-macro', 'deprecated': False}, 'bison-exception-1.24': {'id': 'Bison-exception-1.24', 'deprecated': False}, 'bison-exception-2.2': {'id': 'Bison-exception-2.2', 'deprecated': False}, 'bootloader-exception': {'id': 'Bootloader-exception', 'deprecated': False}, 'cgal-linking-exception': {'id': 'CGAL-linking-exception', 'deprecated': False}, 'classpath-exception-2.0': {'id': 'Classpath-exception-2.0', 'deprecated': False}, 'clisp-exception-2.0': {'id': 'CLISP-exception-2.0', 'deprecated': False}, 'cryptsetup-openssl-exception': {'id': 'cryptsetup-OpenSSL-exception', 'deprecated': False}, 'digia-qt-lgpl-exception-1.1': {'id': 'Digia-Qt-LGPL-exception-1.1', 'deprecated': False}, 'digirule-foss-exception': {'id': 'DigiRule-FOSS-exception', 'deprecated': False}, 'ecos-exception-2.0': {'id': 'eCos-exception-2.0', 'deprecated': False}, 'erlang-otp-linking-exception': {'id': 'erlang-otp-linking-exception', 'deprecated': False}, 'fawkes-runtime-exception': {'id': 'Fawkes-Runtime-exception', 'deprecated': False}, 'fltk-exception': {'id': 'FLTK-exception', 'deprecated': False}, 'fmt-exception': {'id': 'fmt-exception', 'deprecated': False}, 'font-exception-2.0': {'id': 'Font-exception-2.0', 'deprecated': False}, 'freertos-exception-2.0': {'id': 'freertos-exception-2.0', 'deprecated': False}, 'gcc-exception-2.0': {'id': 'GCC-exception-2.0', 'deprecated': False}, 'gcc-exception-2.0-note': {'id': 'GCC-exception-2.0-note', 'deprecated': False}, 'gcc-exception-3.1': {'id': 'GCC-exception-3.1', 'deprecated': False}, 'gmsh-exception': {'id': 'Gmsh-exception', 'deprecated': False}, 'gnat-exception': {'id': 'GNAT-exception', 'deprecated': False}, 'gnome-examples-exception': {'id': 'GNOME-examples-exception', 'deprecated': False}, 'gnu-compiler-exception': {'id': 'GNU-compiler-exception', 'deprecated': False}, 'gnu-javamail-exception': {'id': 'gnu-javamail-exception', 'deprecated': False}, 'gpl-3.0-389-ds-base-exception': {'id': 'GPL-3.0-389-ds-base-exception', 'deprecated': False}, 'gpl-3.0-interface-exception': {'id': 'GPL-3.0-interface-exception', 'deprecated': False}, 'gpl-3.0-linking-exception': {'id': 'GPL-3.0-linking-exception', 'deprecated': False}, 'gpl-3.0-linking-source-exception': {'id': 'GPL-3.0-linking-source-exception', 'deprecated': False}, 'gpl-cc-1.0': {'id': 'GPL-CC-1.0', 'deprecated': False}, 'gstreamer-exception-2005': {'id': 'GStreamer-exception-2005', 'deprecated': False}, 'gstreamer-exception-2008': {'id': 'GStreamer-exception-2008', 'deprecated': False}, 'harbour-exception': {'id': 'harbour-exception', 'deprecated': False}, 'i2p-gpl-java-exception': {'id': 'i2p-gpl-java-exception', 'deprecated': False}, 'independent-modules-exception': {'id': 'Independent-modules-exception', 'deprecated': False}, 'kicad-libraries-exception': {'id': 'KiCad-libraries-exception', 'deprecated': False}, 'lgpl-3.0-linking-exception': {'id': 'LGPL-3.0-linking-exception', 'deprecated': False}, 'libpri-openh323-exception': {'id': 'libpri-OpenH323-exception', 'deprecated': False}, 'libtool-exception': {'id': 'Libtool-exception', 'deprecated': False}, 'linux-syscall-note': {'id': 'Linux-syscall-note', 'deprecated': False}, 'llgpl': {'id': 'LLGPL', 'deprecated': False}, 'llvm-exception': {'id': 'LLVM-exception', 'deprecated': False}, 'lzma-exception': {'id': 'LZMA-exception', 'deprecated': False}, 'mif-exception': {'id': 'mif-exception', 'deprecated': False}, 'mxml-exception': {'id': 'mxml-exception', 'deprecated': False}, 'nokia-qt-exception-1.1': {'id': 'Nokia-Qt-exception-1.1', 'deprecated': True}, 'ocaml-lgpl-linking-exception': {'id': 'OCaml-LGPL-linking-exception', 'deprecated': False}, 'occt-exception-1.0': {'id': 'OCCT-exception-1.0', 'deprecated': False}, 'openjdk-assembly-exception-1.0': {'id': 'OpenJDK-assembly-exception-1.0', 'deprecated': False}, 'openvpn-openssl-exception': {'id': 'openvpn-openssl-exception', 'deprecated': False}, 'pcre2-exception': {'id': 'PCRE2-exception', 'deprecated': False}, 'polyparse-exception': {'id': 'polyparse-exception', 'deprecated': False}, 'ps-or-pdf-font-exception-20170817': {'id': 'PS-or-PDF-font-exception-20170817', 'deprecated': False}, 'qpl-1.0-inria-2004-exception': {'id': 'QPL-1.0-INRIA-2004-exception', 'deprecated': False}, 'qt-gpl-exception-1.0': {'id': 'Qt-GPL-exception-1.0', 'deprecated': False}, 'qt-lgpl-exception-1.1': {'id': 'Qt-LGPL-exception-1.1', 'deprecated': False}, 'qwt-exception-1.0': {'id': 'Qwt-exception-1.0', 'deprecated': False}, 'romic-exception': {'id': 'romic-exception', 'deprecated': False}, 'rrdtool-floss-exception-2.0': {'id': 'RRDtool-FLOSS-exception-2.0', 'deprecated': False}, 'sane-exception': {'id': 'SANE-exception', 'deprecated': False}, 'shl-2.0': {'id': 'SHL-2.0', 'deprecated': False}, 'shl-2.1': {'id': 'SHL-2.1', 'deprecated': False}, 'stunnel-exception': {'id': 'stunnel-exception', 'deprecated': False}, 'swi-exception': {'id': 'SWI-exception', 'deprecated': False}, 'swift-exception': {'id': 'Swift-exception', 'deprecated': False}, 'texinfo-exception': {'id': 'Texinfo-exception', 'deprecated': False}, 'u-boot-exception-2.0': {'id': 'u-boot-exception-2.0', 'deprecated': False}, 'ubdl-exception': {'id': 'UBDL-exception', 'deprecated': False}, 'universal-foss-exception-1.0': {'id': 'Universal-FOSS-exception-1.0', 'deprecated': False}, 'vsftpd-openssl-exception': {'id': 'vsftpd-openssl-exception', 'deprecated': False}, 'wxwindows-exception-3.1': {'id': 'WxWindows-exception-3.1', 'deprecated': False}, 'x11vnc-openssl-exception': {'id': 'x11vnc-openssl-exception', 'deprecated': False},}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492# This file is dual licensed under the terms of the Apache License, Version# 2.0, and the BSD License. See the LICENSE file in the root of this repository# for complete details.
from __future__ import annotations
import operatorimport osimport platformimport sysfrom typing import AbstractSet, Callable, Literal, Mapping, TypedDict, Union, cast
from ._parser import MarkerAtom, MarkerList, Op, Value, Variablefrom ._parser import parse_marker as _parse_markerfrom ._tokenizer import ParserSyntaxErrorfrom .specifiers import InvalidSpecifier, Specifierfrom .utils import canonicalize_name
__all__ = [ "Environment", "EvaluateContext", "InvalidMarker", "Marker", "UndefinedComparison", "UndefinedEnvironmentName", "default_environment",]
def __dir__() -> list[str]: return __all__
Operator = Callable[[str, Union[str, AbstractSet[str]]], bool]EvaluateContext = Literal["metadata", "lock_file", "requirement"]"""A ``typing.Literal`` enumerating valid marker evaluation contexts.
Valid values for the ``context`` passed to :meth:`Marker.evaluate` are:
* ``"metadata"`` (for core metadata; default)* ``"lock_file"`` (for lock files)* ``"requirement"`` (i.e. all other situations)"""
MARKERS_ALLOWING_SET = {"extras", "dependency_groups"}MARKERS_REQUIRING_VERSION = { "implementation_version", "platform_release", "python_full_version", "python_version",}
class InvalidMarker(ValueError): """Raised when attempting to create a :class:`Marker` from invalid input.
This error indicates that the given marker string does not conform to the :ref:`specification of dependency specifiers <pypug:dependency-specifiers>`. """
class UndefinedComparison(ValueError): """Raised when evaluating an unsupported marker comparison.
This can happen when marker values are compared as versions but do not conform to the :ref:`specification of version specifiers <pypug:version-specifiers>`. """
class UndefinedEnvironmentName(ValueError): """Raised when evaluating a marker that references a missing environment key."""
class Environment(TypedDict): """ A dictionary that represents a Python environment as captured by :func:`default_environment`. All fields are required. """
implementation_name: str """The implementation's identifier, e.g. ``'cpython'``."""
implementation_version: str """ The implementation's version, e.g. ``'3.13.0a2'`` for CPython 3.13.0a2, or ``'7.3.13'`` for PyPy3.10 v7.3.13. """
os_name: str """ The value of :py:data:`os.name`. The name of the operating system dependent module imported, e.g. ``'posix'``. """
platform_machine: str """ Returns the machine type, e.g. ``'i386'``.
An empty string if the value cannot be determined. """
platform_release: str """ The system's release, e.g. ``'2.2.0'`` or ``'NT'``.
An empty string if the value cannot be determined. """
platform_system: str """ The system/OS name, e.g. ``'Linux'``, ``'Windows'`` or ``'Java'``.
An empty string if the value cannot be determined. """
platform_version: str """ The system's release version, e.g. ``'#3 on degas'``.
An empty string if the value cannot be determined. """
python_full_version: str """ The Python version as string ``'major.minor.patchlevel'``.
Note that unlike the Python :py:data:`sys.version`, this value will always include the patchlevel (it defaults to 0). """
platform_python_implementation: str """ A string identifying the Python implementation, e.g. ``'CPython'``. """
python_version: str """The Python version as string ``'major.minor'``."""
sys_platform: str """ This string contains a platform identifier that can be used to append platform-specific components to :py:data:`sys.path`, for instance.
For Unix systems, except on Linux and AIX, this is the lowercased OS name as returned by ``uname -s`` with the first part of the version as returned by ``uname -r`` appended, e.g. ``'sunos5'`` or ``'freebsd8'``, at the time when Python was built. """
def _normalize_extras( result: MarkerList | MarkerAtom | str,) -> MarkerList | MarkerAtom | str: if not isinstance(result, tuple): return result
lhs, op, rhs = result if isinstance(lhs, Variable) and lhs.value == "extra": normalized_extra = canonicalize_name(rhs.value) rhs = Value(normalized_extra) elif isinstance(rhs, Variable) and rhs.value == "extra": normalized_extra = canonicalize_name(lhs.value) lhs = Value(normalized_extra) return lhs, op, rhs
def _normalize_extra_values(results: MarkerList) -> MarkerList: """ Normalize extra values. """
return [_normalize_extras(r) for r in results]
def _format_marker( marker: list[str] | MarkerAtom | str, first: bool | None = True) -> str: assert isinstance(marker, (list, tuple, str))
# Sometimes we have a structure like [[...]] which is a single item list # where the single item is itself it's own list. In that case we want skip # the rest of this function so that we don't get extraneous () on the # outside. if ( isinstance(marker, list) and len(marker) == 1 and isinstance(marker[0], (list, tuple)) ): return _format_marker(marker[0])
if isinstance(marker, list): inner = (_format_marker(m, first=False) for m in marker) if first: return " ".join(inner) else: return "(" + " ".join(inner) + ")" elif isinstance(marker, tuple): return " ".join([m.serialize() for m in marker]) else: return marker
_operators: dict[str, Operator] = { "in": lambda lhs, rhs: lhs in rhs, "not in": lambda lhs, rhs: lhs not in rhs, "<": lambda _lhs, _rhs: False, "<=": operator.eq, "==": operator.eq, "!=": operator.ne, ">=": operator.eq, ">": lambda _lhs, _rhs: False,}
def _eval_op(lhs: str, op: Op, rhs: str | AbstractSet[str], *, key: str) -> bool: op_str = op.serialize() if key in MARKERS_REQUIRING_VERSION: try: spec = Specifier(f"{op_str}{rhs}") except InvalidSpecifier: pass else: return spec.contains(lhs, prereleases=True)
oper: Operator | None = _operators.get(op_str) if oper is None: raise UndefinedComparison(f"Undefined {op!r} on {lhs!r} and {rhs!r}.")
return oper(lhs, rhs)
def _normalize( lhs: str, rhs: str | AbstractSet[str], key: str) -> tuple[str, str | AbstractSet[str]]: # PEP 685 - Comparison of extra names for optional distribution dependencies # https://peps.python.org/pep-0685/ # > When comparing extra names, tools MUST normalize the names being # > compared using the semantics outlined in PEP 503 for names if key == "extra": assert isinstance(rhs, str), "extra value must be a string" # Both sides are normalized at this point already return (lhs, rhs) if key in MARKERS_ALLOWING_SET: if isinstance(rhs, str): # pragma: no cover return (canonicalize_name(lhs), canonicalize_name(rhs)) else: return (canonicalize_name(lhs), {canonicalize_name(v) for v in rhs})
# other environment markers don't have such standards return lhs, rhs
def _evaluate_markers( markers: MarkerList, environment: dict[str, str | AbstractSet[str]]) -> bool: groups: list[list[bool]] = [[]]
for marker in markers: if isinstance(marker, list): groups[-1].append(_evaluate_markers(marker, environment)) elif isinstance(marker, tuple): lhs, op, rhs = marker
if isinstance(lhs, Variable): environment_key = lhs.value lhs_value = environment[environment_key] rhs_value = rhs.value else: lhs_value = lhs.value environment_key = rhs.value rhs_value = environment[environment_key]
assert isinstance(lhs_value, str), "lhs must be a string" lhs_value, rhs_value = _normalize(lhs_value, rhs_value, key=environment_key) groups[-1].append(_eval_op(lhs_value, op, rhs_value, key=environment_key)) elif marker == "or": groups.append([]) elif marker == "and": pass else: # pragma: nocover raise TypeError(f"Unexpected marker {marker!r}")
return any(all(item) for item in groups)
def _format_full_version(info: sys._version_info) -> str: version = f"{info.major}.{info.minor}.{info.micro}" kind = info.releaselevel if kind != "final": version += kind[0] + str(info.serial) return version
def default_environment() -> Environment: """Return the default marker environment for the current Python process.
This is the base environment used by :meth:`Marker.evaluate`. """ iver = _format_full_version(sys.implementation.version) implementation_name = sys.implementation.name return { "implementation_name": implementation_name, "implementation_version": iver, "os_name": os.name, "platform_machine": platform.machine(), "platform_release": platform.release(), "platform_system": platform.system(), "platform_version": platform.version(), "python_full_version": platform.python_version(), "platform_python_implementation": platform.python_implementation(), "python_version": ".".join(platform.python_version_tuple()[:2]), "sys_platform": sys.platform, }
class Marker: """Represents a parsed dependency marker expression.
Marker expressions are parsed according to the :ref:`specification of dependency specifiers <pypug:dependency-specifiers>`.
:param marker: The string representation of a marker expression. :raises InvalidMarker: If ``marker`` cannot be parsed.
Instances are safe to serialize with :mod:`pickle`. They use a stable format so the same pickle can be loaded in future packaging releases.
.. versionchanged:: 26.2
Added a stable pickle format. Pickles created with packaging 26.2+ can be unpickled with future releases. Backward compatibility with pickles from pip._vendor.packaging < 26.2 is supported but may be removed in a future release. """
__slots__ = ("_markers",)
def __init__(self, marker: str) -> None: # Note: We create a Marker object without calling this constructor in # packaging.requirements.Requirement. If any additional logic is # added here, make sure to mirror/adapt Requirement.
# If this fails and throws an error, the repr still expects _markers to # be defined. self._markers: MarkerList = []
try: self._markers = _normalize_extra_values(_parse_marker(marker)) # The attribute `_markers` can be described in terms of a recursive type: # MarkerList = List[Union[Tuple[Node, ...], str, MarkerList]] # # For example, the following expression: # python_version > "3.6" or (python_version == "3.6" and os_name == "unix") # # is parsed into: # [ # (<Variable('python_version')>, <Op('>')>, <Value('3.6')>), # 'and', # [ # (<Variable('python_version')>, <Op('==')>, <Value('3.6')>), # 'or', # (<Variable('os_name')>, <Op('==')>, <Value('unix')>) # ] # ] except ParserSyntaxError as e: raise InvalidMarker(str(e)) from e
@classmethod def _from_markers(cls, markers: MarkerList) -> Marker: """Create a Marker instance from a pre-parsed marker tree.
This avoids re-parsing serialised marker strings when combining markers. """ new = cls.__new__(cls) new._markers = markers return new
def __str__(self) -> str: return _format_marker(self._markers)
def __repr__(self) -> str: return f"<{self.__class__.__name__}({str(self)!r})>"
def __hash__(self) -> int: return hash(str(self))
def __eq__(self, other: object) -> bool: if not isinstance(other, Marker): return NotImplemented
return str(self) == str(other)
def __getstate__(self) -> str: # Return the marker expression string for compactness and stability. # Internal Node objects are excluded; the string is re-parsed on load. return str(self)
def __setstate__(self, state: object) -> None: if isinstance(state, str): # New format (26.2+): just the marker expression string. try: self._markers = _normalize_extra_values(_parse_marker(state)) except ParserSyntaxError as exc: raise TypeError(f"Cannot restore Marker from {state!r}") from exc return if isinstance(state, dict) and "_markers" in state: # Old format (packaging <= 26.1, no __slots__): plain __dict__. markers = state["_markers"] if isinstance(markers, list): self._markers = markers return if isinstance(state, tuple) and len(state) == 2: # Old format (packaging <= 26.1, __slots__): (None, {slot: value}). _, slot_dict = state if isinstance(slot_dict, dict) and "_markers" in slot_dict: markers = slot_dict["_markers"] if isinstance(markers, list): self._markers = markers return raise TypeError(f"Cannot restore Marker from {state!r}")
def __and__(self, other: Marker) -> Marker: if not isinstance(other, Marker): return NotImplemented return self._from_markers([self._markers, "and", other._markers])
def __or__(self, other: Marker) -> Marker: if not isinstance(other, Marker): return NotImplemented return self._from_markers([self._markers, "or", other._markers])
def evaluate( self, environment: Mapping[str, str | AbstractSet[str]] | None = None, context: EvaluateContext = "metadata", ) -> bool: """Evaluate a marker.
Return the boolean from evaluating this marker against the environment. The environment is determined from the current Python process unless passed in explicitly.
:param environment: Mapping containing keys and values to override the detected environment. :param EvaluateContext context: The context in which the marker is evaluated, which influences what marker names are considered valid. Accepted values are ``"metadata"`` (for core metadata; default), ``"lock_file"``, and ``"requirement"`` (i.e. all other situations). :raises UndefinedComparison: If the marker uses a comparison on values that are not valid versions per the :ref:`specification of version specifiers <pypug:version-specifiers>`. :raises UndefinedEnvironmentName: If the marker references a value that is missing from the evaluation environment. :returns: ``True`` if the marker matches, otherwise ``False``.
""" current_environment = cast( "dict[str, str | AbstractSet[str]]", default_environment() ) if context == "lock_file": current_environment.update( extras=frozenset(), dependency_groups=frozenset() ) elif context == "metadata": current_environment["extra"] = ""
if environment is not None: current_environment.update(environment) if "extra" in current_environment: # The API used to allow setting extra to None. We need to handle # this case for backwards compatibility. Also skip running # normalize name if extra is empty. extra = cast("str | None", current_environment["extra"]) current_environment["extra"] = canonicalize_name(extra) if extra else ""
return _evaluate_markers( self._markers, _repair_python_full_version(current_environment) )
def _repair_python_full_version( env: dict[str, str | AbstractSet[str]],) -> dict[str, str | AbstractSet[str]]: """ Work around platform.python_version() returning something that is not PEP 440 compliant for non-tagged Python builds. """ python_full_version = cast("str", env["python_full_version"]) if python_full_version.endswith("+"): env["python_full_version"] = f"{python_full_version}local" return env123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964from __future__ import annotations
import email.headerimport email.messageimport email.parserimport email.policyimport keywordimport pathlibimport typingfrom typing import ( Any, Callable, Generic, Literal, TypedDict, cast,)
from . import licenses, requirements, specifiers, utilsfrom . import version as version_modulefrom .errors import ExceptionGroup, _ErrorCollector
if typing.TYPE_CHECKING: from .licenses import NormalizedLicenseExpression
T = typing.TypeVar("T")
__all__ = [ "ExceptionGroup", # Keep this for a bit (makes mypy happy w/ 26.0 compat) "InvalidMetadata", "Metadata", "RFC822Message", "RFC822Policy", "RawMetadata", "parse_email",]
def __dir__() -> list[str]: return __all__
class InvalidMetadata(ValueError): """A metadata field contains invalid data."""
field: str """The name of the field that contains invalid data."""
def __init__(self, field: str, message: str) -> None: self.field = field super().__init__(message)
# The RawMetadata class attempts to make as few assumptions about the underlying# serialization formats as possible. The idea is that as long as a serialization# formats offer some very basic primitives in *some* way then we can support# serializing to and from that format.class RawMetadata(TypedDict, total=False): """A dictionary of raw core metadata.
Each field in core metadata maps to a key of this dictionary (when data is provided). The key is lower-case and underscores are used instead of dashes compared to the equivalent core metadata field. Any core metadata field that can be specified multiple times or can hold multiple values in a single field have a key with a plural name. See :class:`Metadata` whose attributes match the keys of this dictionary.
Core metadata fields that can be specified multiple times are stored as a list or dict depending on which is appropriate for the field. Any fields which hold multiple values in a single field are stored as a list. All fields are considered optional. """
# Metadata 1.0 - PEP 241 metadata_version: str name: str version: str platforms: list[str] summary: str description: str keywords: list[str] home_page: str author: str author_email: str license: str
# Metadata 1.1 - PEP 314 supported_platforms: list[str] download_url: str classifiers: list[str] requires: list[str] provides: list[str] obsoletes: list[str]
# Metadata 1.2 - PEP 345 maintainer: str maintainer_email: str requires_dist: list[str] provides_dist: list[str] obsoletes_dist: list[str] requires_python: str requires_external: list[str] project_urls: dict[str, str]
# Metadata 2.0 # PEP 426 attempted to completely revamp the metadata format # but got stuck without ever being able to build consensus on # it and ultimately ended up withdrawn. # # However, a number of tools had started emitting METADATA with # `2.0` Metadata-Version, so for historical reasons, this version # was skipped.
# Metadata 2.1 - PEP 566 description_content_type: str provides_extra: list[str]
# Metadata 2.2 - PEP 643 dynamic: list[str]
# Metadata 2.3 - PEP 685 # No new fields were added in PEP 685, just some edge case were # tightened up to provide better interoperability.
# Metadata 2.4 - PEP 639 license_expression: str license_files: list[str]
# Metadata 2.5 - PEP 794 import_names: list[str] import_namespaces: list[str]
# 'keywords' is special as it's a string in the core metadata spec, but we# represent it as a list._STRING_FIELDS = { "author", "author_email", "description", "description_content_type", "download_url", "home_page", "license", "license_expression", "maintainer", "maintainer_email", "metadata_version", "name", "requires_python", "summary", "version",}
_LIST_FIELDS = { "classifiers", "dynamic", "license_files", "obsoletes", "obsoletes_dist", "platforms", "provides", "provides_dist", "provides_extra", "requires", "requires_dist", "requires_external", "supported_platforms", "import_names", "import_namespaces",}
_DICT_FIELDS = { "project_urls",}
def _parse_keywords(data: str) -> list[str]: """Split a string of comma-separated keywords into a list of keywords.""" return [k.strip() for k in data.split(",")]
def _parse_project_urls(data: list[str]) -> dict[str, str]: """Parse a list of label/URL string pairings separated by a comma.""" urls = {} for pair in data: # Our logic is slightly tricky here as we want to try and do # *something* reasonable with malformed data. # # The main thing that we have to worry about, is data that does # not have a ',' at all to split the label from the Value. There # isn't a singular right answer here, and we will fail validation # later on (if the caller is validating) so it doesn't *really* # matter, but since the missing value has to be an empty str # and our return value is dict[str, str], if we let the key # be the missing value, then they'd have multiple '' values that # overwrite each other in a accumulating dict. # # The other potential issue is that it's possible to have the # same label multiple times in the metadata, with no solid "right" # answer with what to do in that case. As such, we'll do the only # thing we can, which is treat the field as unparsable and add it # to our list of unparsed fields. # # TODO: The spec doesn't say anything about if the keys should be # considered case sensitive or not... logically they should # be case-preserving and case-insensitive, but doing that # would open up more cases where we might have duplicate # entries. label, _, url = (s.strip() for s in pair.partition(","))
if label in urls: # The label already exists in our set of urls, so this field # is unparsable, and we can just add the whole thing to our # unparsable data and stop processing it. raise KeyError("duplicate labels in project urls") urls[label] = url
return urls
def _get_payload(msg: email.message.Message, source: bytes | str) -> str: """Get the body of the message.""" # If our source is a str, then our caller has managed encodings for us, # and we don't need to deal with it. if isinstance(source, str): payload = msg.get_payload() assert isinstance(payload, str) return payload # If our source is a bytes, then we're managing the encoding and we need # to deal with it. else: bpayload = msg.get_payload(decode=True) assert isinstance(bpayload, bytes) try: return bpayload.decode("utf8", "strict") except UnicodeDecodeError as exc: raise ValueError("payload in an invalid encoding") from exc
# The various parse_FORMAT functions here are intended to be as lenient as# possible in their parsing, while still returning a correctly typed# RawMetadata.## To aid in this, we also generally want to do as little touching of the# data as possible, except where there are possibly some historic holdovers# that make valid data awkward to work with.## While this is a lower level, intermediate format than our ``Metadata``# class, some light touch ups can make a massive difference in usability.
# Map METADATA fields to RawMetadata._EMAIL_TO_RAW_MAPPING = { "author": "author", "author-email": "author_email", "classifier": "classifiers", "description": "description", "description-content-type": "description_content_type", "download-url": "download_url", "dynamic": "dynamic", "home-page": "home_page", "import-name": "import_names", "import-namespace": "import_namespaces", "keywords": "keywords", "license": "license", "license-expression": "license_expression", "license-file": "license_files", "maintainer": "maintainer", "maintainer-email": "maintainer_email", "metadata-version": "metadata_version", "name": "name", "obsoletes": "obsoletes", "obsoletes-dist": "obsoletes_dist", "platform": "platforms", "project-url": "project_urls", "provides": "provides", "provides-dist": "provides_dist", "provides-extra": "provides_extra", "requires": "requires", "requires-dist": "requires_dist", "requires-external": "requires_external", "requires-python": "requires_python", "summary": "summary", "supported-platform": "supported_platforms", "version": "version",}_RAW_TO_EMAIL_MAPPING = {raw: email for email, raw in _EMAIL_TO_RAW_MAPPING.items()}
# This class is for writing RFC822 messagesclass RFC822Policy(email.policy.EmailPolicy): """ This is :class:`email.policy.EmailPolicy`, but with a simple ``header_store_parse`` implementation that handles multi-line values, and some nice defaults. """
utf8 = True mangle_from_ = False max_line_length = 0
def header_store_parse(self, name: str, value: str) -> tuple[str, str]: size = len(name) + 2 value = value.replace("\n", "\n" + " " * size) return (name, value)
# This class is for writing RFC822 messagesclass RFC822Message(email.message.EmailMessage): """ This is :class:`email.message.EmailMessage` with two small changes: it defaults to our `RFC822Policy`, and it correctly writes unicode when being called with `bytes()`. """
def __init__(self) -> None: super().__init__(policy=RFC822Policy())
def as_bytes( self, unixfrom: bool = False, policy: email.policy.Policy | None = None ) -> bytes: """ Return the bytes representation of the message.
This handles unicode encoding. """ return self.as_string(unixfrom, policy=policy).encode("utf-8")
def parse_email(data: bytes | str) -> tuple[RawMetadata, dict[str, list[str]]]: """Parse a distribution's metadata stored as email headers (e.g. from ``METADATA``).
This function returns a two-item tuple of dicts. The first dict is of recognized fields from the core metadata specification. Fields that can be parsed and translated into Python's built-in types are converted appropriately. All other fields are left as-is. Fields that are allowed to appear multiple times are stored as lists.
The second dict contains all other fields from the metadata. This includes any unrecognized fields. It also includes any fields which are expected to be parsed into a built-in type but were not formatted appropriately. Finally, any fields that are expected to appear only once but are repeated are included in this dict.
""" raw: dict[str, str | list[str] | dict[str, str]] = {} unparsed: dict[str, list[str]] = {}
if isinstance(data, str): parsed = email.parser.Parser(policy=email.policy.compat32).parsestr(data) else: parsed = email.parser.BytesParser(policy=email.policy.compat32).parsebytes(data)
# We have to wrap parsed.keys() in a set, because in the case of multiple # values for a key (a list), the key will appear multiple times in the # list of keys, but we're avoiding that by using get_all(). for name_with_case in frozenset(parsed.keys()): # Header names in RFC are case insensitive, so we'll normalize to all # lower case to make comparisons easier. name = name_with_case.lower()
# We use get_all() here, even for fields that aren't multiple use, # because otherwise someone could have e.g. two Name fields, and we # would just silently ignore it rather than doing something about it. headers = parsed.get_all(name) or []
# The way the email module works when parsing bytes is that it # unconditionally decodes the bytes as ascii using the surrogateescape # handler. When you pull that data back out (such as with get_all() ), # it looks to see if the str has any surrogate escapes, and if it does # it wraps it in a Header object instead of returning the string. # # As such, we'll look for those Header objects, and fix up the encoding. value = [] # Flag if we have run into any issues processing the headers, thus # signalling that the data belongs in 'unparsed'. valid_encoding = True for h in headers: # It's unclear if this can return more types than just a Header or # a str, so we'll just assert here to make sure. assert isinstance(h, (email.header.Header, str))
# If it's a header object, we need to do our little dance to get # the real data out of it. In cases where there is invalid data # we're going to end up with mojibake, but there's no obvious, good # way around that without reimplementing parts of the Header object # ourselves. # # That should be fine since, if mojibacked happens, this key is # going into the unparsed dict anyways. if isinstance(h, email.header.Header): # The Header object stores it's data as chunks, and each chunk # can be independently encoded, so we'll need to check each # of them. chunks: list[tuple[bytes, str | None]] = [] for binary, _encoding in email.header.decode_header(h): try: binary.decode("utf8", "strict") except UnicodeDecodeError: # Enable mojibake. encoding = "latin1" valid_encoding = False else: encoding = "utf8" chunks.append((binary, encoding))
# Turn our chunks back into a Header object, then let that # Header object do the right thing to turn them into a # string for us. value.append(str(email.header.make_header(chunks))) # This is already a string, so just add it. else: value.append(h)
# We've processed all of our values to get them into a list of str, # but we may have mojibake data, in which case this is an unparsed # field. if not valid_encoding: unparsed[name] = value continue
raw_name = _EMAIL_TO_RAW_MAPPING.get(name) if raw_name is None: # This is a bit of a weird situation, we've encountered a key that # we don't know what it means, so we don't know whether it's meant # to be a list or not. # # Since we can't really tell one way or another, we'll just leave it # as a list, even though it may be a single item list, because that's # what makes the most sense for email headers. unparsed[name] = value continue
# If this is one of our string fields, then we'll check to see if our # value is a list of a single item. If it is then we'll assume that # it was emitted as a single string, and unwrap the str from inside # the list. # # If it's any other kind of data, then we haven't the faintest clue # what we should parse it as, and we have to just add it to our list # of unparsed stuff. if raw_name in _STRING_FIELDS and len(value) == 1: raw[raw_name] = value[0] # If this is import_names, we need to special case the empty field # case, which converts to an empty list instead of None. We can't let # the empty case slip through, as it will fail validation. elif raw_name == "import_names" and value == [""]: raw[raw_name] = [] # If this is one of our list of string fields, then we can just assign # the value, since email *only* has strings, and our get_all() call # above ensures that this is a list. elif raw_name in _LIST_FIELDS: raw[raw_name] = value # Special Case: Keywords # The keywords field is implemented in the metadata spec as a str, # but it conceptually is a list of strings, and is serialized using # ", ".join(keywords), so we'll do some light data massaging to turn # this into what it logically is. elif raw_name == "keywords" and len(value) == 1: raw[raw_name] = _parse_keywords(value[0]) # Special Case: Project-URL # The project urls is implemented in the metadata spec as a list of # specially-formatted strings that represent a key and a value, which # is fundamentally a mapping, however the email format doesn't support # mappings in a sane way, so it was crammed into a list of strings # instead. # # We will do a little light data massaging to turn this into a map as # it logically should be. elif raw_name == "project_urls": try: raw[raw_name] = _parse_project_urls(value) except KeyError: unparsed[name] = value # Nothing that we've done has managed to parse this, so it'll just # throw it in our unparsable data and move on. else: unparsed[name] = value
# We need to support getting the Description from the message payload in # addition to getting it from the the headers. This does mean, though, there # is the possibility of it being set both ways, in which case we put both # in 'unparsed' since we don't know which is right. try: payload = _get_payload(parsed, data) except ValueError: unparsed.setdefault("description", []).append( parsed.get_payload(decode=isinstance(data, bytes)) # type: ignore[call-overload] ) else: if payload: # Check to see if we've already got a description, if so then both # it, and this body move to unparsable. if "description" in raw: description_header = cast("str", raw.pop("description")) unparsed.setdefault("description", []).extend( [description_header, payload] ) elif "description" in unparsed: unparsed["description"].append(payload) else: raw["description"] = payload
# We need to cast our `raw` to a metadata, because a TypedDict only support # literal key names, but we're computing our key names on purpose, but the # way this function is implemented, our `TypedDict` can only have valid key # names. return cast("RawMetadata", raw), unparsed
_NOT_FOUND = object()
# Keep the two values in sync._VALID_METADATA_VERSIONS = ["1.0", "1.1", "1.2", "2.1", "2.2", "2.3", "2.4", "2.5"]_MetadataVersion = Literal["1.0", "1.1", "1.2", "2.1", "2.2", "2.3", "2.4", "2.5"]
_REQUIRED_ATTRS = frozenset(["metadata_version", "name", "version"])
class _Validator(Generic[T]): """Validate a metadata field.
All _process_*() methods correspond to a core metadata field. The method is called with the field's raw value. If the raw value is valid it is returned in its "enriched" form (e.g. ``version.Version`` for the ``Version`` field). If the raw value is invalid, :exc:`InvalidMetadata` is raised (with a cause as appropriate). """
name: str raw_name: str added: _MetadataVersion
def __init__( self, *, added: _MetadataVersion = "1.0", ) -> None: self.added = added
def __set_name__(self, _owner: Metadata, name: str) -> None: self.name = name self.raw_name = _RAW_TO_EMAIL_MAPPING[name]
def __get__(self, instance: Metadata, _owner: type[Metadata]) -> T: # With Python 3.8, the caching can be replaced with functools.cached_property(). # No need to check the cache as attribute lookup will resolve into the # instance's __dict__ before __get__ is called. cache = instance.__dict__ value = instance._raw.get(self.name)
# To make the _process_* methods easier, we'll check if the value is None # and if this field is NOT a required attribute, and if both of those # things are true, we'll skip the the converter. This will mean that the # converters never have to deal with the None union. if self.name in _REQUIRED_ATTRS or value is not None: try: converter: Callable[[Any], T] = getattr(self, f"_process_{self.name}") except AttributeError: pass else: value = converter(value)
cache[self.name] = value try: del instance._raw[self.name] # type: ignore[misc] except KeyError: pass
return cast("T", value)
def _invalid_metadata( self, msg: str, cause: Exception | None = None ) -> InvalidMetadata: exc = InvalidMetadata( self.raw_name, msg.format_map({"field": repr(self.raw_name)}) ) exc.__cause__ = cause return exc
def _process_metadata_version(self, value: str) -> _MetadataVersion: # Implicitly makes Metadata-Version required. if value not in _VALID_METADATA_VERSIONS: raise self._invalid_metadata(f"{value!r} is not a valid metadata version") return cast("_MetadataVersion", value)
def _process_name(self, value: str) -> str: if not value: raise self._invalid_metadata("{field} is a required field") # Validate the name as a side-effect. try: utils.canonicalize_name(value, validate=True) except utils.InvalidName as exc: raise self._invalid_metadata( f"{value!r} is invalid for {{field}}", cause=exc ) from exc else: return value
def _process_version(self, value: str) -> version_module.Version: if not value: raise self._invalid_metadata("{field} is a required field") try: return version_module.parse(value) except version_module.InvalidVersion as exc: raise self._invalid_metadata( f"{value!r} is invalid for {{field}}", cause=exc ) from exc
def _process_summary(self, value: str) -> str: """Check the field contains no newlines.""" if "\n" in value: raise self._invalid_metadata("{field} must be a single line") return value
def _process_description_content_type(self, value: str) -> str: content_types = {"text/plain", "text/x-rst", "text/markdown"} message = email.message.EmailMessage() message["content-type"] = value
content_type, parameters = ( # Defaults to `text/plain` if parsing failed. message.get_content_type().lower(), message["content-type"].params, ) # Check if content-type is valid or defaulted to `text/plain` and thus was # not parseable. if content_type not in content_types or content_type not in value.lower(): raise self._invalid_metadata( f"{{field}} must be one of {list(content_types)}, not {value!r}" )
charset = parameters.get("charset", "UTF-8") if charset != "UTF-8": raise self._invalid_metadata( f"{{field}} can only specify the UTF-8 charset, not {charset!r}" )
markdown_variants = {"GFM", "CommonMark"} variant = parameters.get("variant", "GFM") # Use an acceptable default. if content_type == "text/markdown" and variant not in markdown_variants: raise self._invalid_metadata( f"valid Markdown variants for {{field}} are {list(markdown_variants)}, " f"not {variant!r}", ) return value
def _process_dynamic(self, value: list[str]) -> list[str]: for dynamic_field in map(str.lower, value): if dynamic_field in {"name", "version", "metadata-version"}: raise self._invalid_metadata( f"{dynamic_field!r} is not allowed as a dynamic field" ) elif dynamic_field not in _EMAIL_TO_RAW_MAPPING: raise self._invalid_metadata( f"{dynamic_field!r} is not a valid dynamic field" ) return list(map(str.lower, value))
def _process_provides_extra( self, value: list[str], ) -> list[utils.NormalizedName]: normalized_names = [] try: for name in value: normalized_names.append(utils.canonicalize_name(name, validate=True)) except utils.InvalidName as exc: raise self._invalid_metadata( f"{name!r} is invalid for {{field}}", cause=exc ) from exc else: return normalized_names
def _process_requires_python(self, value: str) -> specifiers.SpecifierSet: try: return specifiers.SpecifierSet(value) except specifiers.InvalidSpecifier as exc: raise self._invalid_metadata( f"{value!r} is invalid for {{field}}", cause=exc ) from exc
def _process_requires_dist( self, value: list[str], ) -> list[requirements.Requirement]: reqs = [] try: for req in value: reqs.append(requirements.Requirement(req)) except requirements.InvalidRequirement as exc: raise self._invalid_metadata( f"{req!r} is invalid for {{field}}", cause=exc ) from exc else: return reqs
def _process_license_expression(self, value: str) -> NormalizedLicenseExpression: try: return licenses.canonicalize_license_expression(value) except ValueError as exc: raise self._invalid_metadata( f"{value!r} is invalid for {{field}}", cause=exc ) from exc
def _process_license_files(self, value: list[str]) -> list[str]: paths = [] for path in value: if ".." in path: raise self._invalid_metadata( f"{path!r} is invalid for {{field}}, " "parent directory indicators are not allowed" ) if "*" in path: raise self._invalid_metadata( f"{path!r} is invalid for {{field}}, paths must be resolved" ) if ( pathlib.PurePosixPath(path).is_absolute() or pathlib.PureWindowsPath(path).is_absolute() ): raise self._invalid_metadata( f"{path!r} is invalid for {{field}}, paths must be relative" ) if pathlib.PureWindowsPath(path).as_posix() != path: raise self._invalid_metadata( f"{path!r} is invalid for {{field}}, paths must use '/' delimiter" ) paths.append(path) return paths
def _process_import_names(self, value: list[str]) -> list[str]: for import_name in value: name, semicolon, private = import_name.partition(";") name = name.rstrip() for identifier in name.split("."): if not identifier.isidentifier(): raise self._invalid_metadata( f"{name!r} is invalid for {{field}}; " f"{identifier!r} is not a valid identifier" ) elif keyword.iskeyword(identifier): raise self._invalid_metadata( f"{name!r} is invalid for {{field}}; " f"{identifier!r} is a keyword" ) if semicolon and private.lstrip() != "private": raise self._invalid_metadata( f"{import_name!r} is invalid for {{field}}; " "the only valid option is 'private'" ) return value
_process_import_namespaces = _process_import_names
class Metadata: """Representation of distribution metadata.
Compared to :class:`RawMetadata`, this class provides objects representing metadata fields instead of only using built-in types. Any invalid metadata will cause :exc:`InvalidMetadata` to be raised (with a :py:attr:`~BaseException.__cause__` attribute as appropriate). """
_raw: RawMetadata
@classmethod def from_raw(cls, data: RawMetadata, *, validate: bool = True) -> Metadata: """Create an instance from :class:`RawMetadata`.
If *validate* is true, all metadata will be validated. All exceptions related to validation will be gathered and raised as an :class:`ExceptionGroup`. """ ins = cls() ins._raw = data.copy() # Mutations occur due to caching enriched values.
if validate: collector = _ErrorCollector() metadata_version = None with collector.collect(InvalidMetadata): metadata_version = ins.metadata_version metadata_age = _VALID_METADATA_VERSIONS.index(metadata_version)
# Make sure to check for the fields that are present, the required # fields (so their absence can be reported). fields_to_check = frozenset(ins._raw) | _REQUIRED_ATTRS # Remove fields that have already been checked. fields_to_check -= {"metadata_version"}
for key in fields_to_check: try: if metadata_version: # Can't use getattr() as that triggers descriptor protocol which # will fail due to no value for the instance argument. try: field_metadata_version = cls.__dict__[key].added except KeyError: exc = InvalidMetadata(key, f"unrecognized field: {key!r}") collector.error(exc) continue field_age = _VALID_METADATA_VERSIONS.index( field_metadata_version ) if field_age > metadata_age: field = _RAW_TO_EMAIL_MAPPING[key] exc = InvalidMetadata( field, f"{field} introduced in metadata version " f"{field_metadata_version}, not {metadata_version}", ) collector.error(exc) continue getattr(ins, key) except InvalidMetadata as exc: collector.error(exc)
collector.finalize("invalid metadata")
return ins
@classmethod def from_email(cls, data: bytes | str, *, validate: bool = True) -> Metadata: """Parse metadata from email headers.
If *validate* is true, the metadata will be validated. All exceptions related to validation will be gathered and raised as an :class:`ExceptionGroup`. """ raw, unparsed = parse_email(data)
if validate: with _ErrorCollector().on_exit("unparsed") as collector: for unparsed_key in unparsed: if unparsed_key in _EMAIL_TO_RAW_MAPPING: message = f"{unparsed_key!r} has invalid data" else: message = f"unrecognized field: {unparsed_key!r}" collector.error(InvalidMetadata(unparsed_key, message))
try: return cls.from_raw(raw, validate=validate) except ExceptionGroup as exc_group: raise ExceptionGroup( "invalid or unparsed metadata", exc_group.exceptions ) from None
metadata_version: _Validator[_MetadataVersion] = _Validator() """:external:ref:`core-metadata-metadata-version` (required; validated to be a valid metadata version)""" # `name` is not normalized/typed to NormalizedName so as to provide access to # the original/raw name. name: _Validator[str] = _Validator() """:external:ref:`core-metadata-name` (required; validated using :func:`~packaging.utils.canonicalize_name` and its *validate* parameter)""" version: _Validator[version_module.Version] = _Validator() """:external:ref:`core-metadata-version` (required)""" dynamic: _Validator[list[str] | None] = _Validator( added="2.2", ) """:external:ref:`core-metadata-dynamic` (validated against core metadata field names and lowercased)""" platforms: _Validator[list[str] | None] = _Validator() """:external:ref:`core-metadata-platform`""" supported_platforms: _Validator[list[str] | None] = _Validator(added="1.1") """:external:ref:`core-metadata-supported-platform`""" summary: _Validator[str | None] = _Validator() """:external:ref:`core-metadata-summary` (validated to contain no newlines)""" description: _Validator[str | None] = _Validator() # TODO 2.1: can be in body """:external:ref:`core-metadata-description`""" description_content_type: _Validator[str | None] = _Validator(added="2.1") """:external:ref:`core-metadata-description-content-type` (validated)""" keywords: _Validator[list[str] | None] = _Validator() """:external:ref:`core-metadata-keywords`""" home_page: _Validator[str | None] = _Validator() """:external:ref:`core-metadata-home-page`""" download_url: _Validator[str | None] = _Validator(added="1.1") """:external:ref:`core-metadata-download-url`""" author: _Validator[str | None] = _Validator() """:external:ref:`core-metadata-author`""" author_email: _Validator[str | None] = _Validator() """:external:ref:`core-metadata-author-email`""" maintainer: _Validator[str | None] = _Validator(added="1.2") """:external:ref:`core-metadata-maintainer`""" maintainer_email: _Validator[str | None] = _Validator(added="1.2") """:external:ref:`core-metadata-maintainer-email`""" license: _Validator[str | None] = _Validator() """:external:ref:`core-metadata-license`""" license_expression: _Validator[NormalizedLicenseExpression | None] = _Validator( added="2.4" ) """:external:ref:`core-metadata-license-expression`""" license_files: _Validator[list[str] | None] = _Validator(added="2.4") """:external:ref:`core-metadata-license-file`""" classifiers: _Validator[list[str] | None] = _Validator(added="1.1") """:external:ref:`core-metadata-classifier`""" requires_dist: _Validator[list[requirements.Requirement] | None] = _Validator( added="1.2" ) """:external:ref:`core-metadata-requires-dist`""" requires_python: _Validator[specifiers.SpecifierSet | None] = _Validator( added="1.2" ) """:external:ref:`core-metadata-requires-python`""" # Because `Requires-External` allows for non-PEP 440 version specifiers, we # don't do any processing on the values. requires_external: _Validator[list[str] | None] = _Validator(added="1.2") """:external:ref:`core-metadata-requires-external`""" project_urls: _Validator[dict[str, str] | None] = _Validator(added="1.2") """:external:ref:`core-metadata-project-url`""" # PEP 685 lets us raise an error if an extra doesn't pass `Name` validation # regardless of metadata version. provides_extra: _Validator[list[utils.NormalizedName] | None] = _Validator( added="2.1", ) """:external:ref:`core-metadata-provides-extra`""" provides_dist: _Validator[list[str] | None] = _Validator(added="1.2") """:external:ref:`core-metadata-provides-dist`""" obsoletes_dist: _Validator[list[str] | None] = _Validator(added="1.2") """:external:ref:`core-metadata-obsoletes-dist`""" import_names: _Validator[list[str] | None] = _Validator(added="2.5") """:external:ref:`core-metadata-import-name`""" import_namespaces: _Validator[list[str] | None] = _Validator(added="2.5") """:external:ref:`core-metadata-import-namespace`""" requires: _Validator[list[str] | None] = _Validator(added="1.1") """``Requires`` (deprecated)""" provides: _Validator[list[str] | None] = _Validator(added="1.1") """``Provides`` (deprecated)""" obsoletes: _Validator[list[str] | None] = _Validator(added="1.1") """``Obsoletes`` (deprecated)"""
def as_rfc822(self) -> RFC822Message: """ Return an RFC822 message with the metadata. """ message = RFC822Message() self._write_metadata(message) return message
def _write_metadata(self, message: RFC822Message) -> None: """ Return an RFC822 message with the metadata. """ for name, validator in self.__class__.__dict__.items(): if isinstance(validator, _Validator) and name != "description": value = getattr(self, name) email_name = _RAW_TO_EMAIL_MAPPING[name] if value is not None: if email_name == "project-url": for label, url in value.items(): message[email_name] = f"{label}, {url}" elif email_name == "keywords": message[email_name] = ",".join(value) elif email_name == "import-name" and value == []: message[email_name] = "" elif isinstance(value, list): for item in value: message[email_name] = str(item) else: message[email_name] = str(value)
# The description is a special case because it is in the body of the message. if self.description is not None: message.set_payload(self.description)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905from __future__ import annotations
import dataclassesimport loggingimport refrom collections.abc import Mapping, Sequencefrom dataclasses import dataclassfrom datetime import datetimefrom typing import ( TYPE_CHECKING, Any, Callable, Protocol, TypeVar, cast,)from urllib.parse import urlparse
from .markers import Environment, Marker, default_environmentfrom .specifiers import SpecifierSetfrom .tags import create_compatible_tags_selector, sys_tagsfrom .utils import ( NormalizedName, is_normalized_name, parse_sdist_filename, parse_wheel_filename,)from .version import Version
if TYPE_CHECKING: # pragma: no cover from collections.abc import Collection, Iterator from pathlib import Path
from typing_extensions import Self
from .tags import Tag
_logger = logging.getLogger(__name__)
__all__ = [ "Package", "PackageArchive", "PackageDirectory", "PackageSdist", "PackageVcs", "PackageWheel", "Pylock", "PylockUnsupportedVersionError", "PylockValidationError", "is_valid_pylock_path",]
def __dir__() -> list[str]: return __all__
_T = TypeVar("_T")_T2 = TypeVar("_T2")
class _FromMappingProtocol(Protocol): # pragma: no cover @classmethod def _from_dict(cls, d: Mapping[str, Any]) -> Self: ...
_FromMappingProtocolT = TypeVar("_FromMappingProtocolT", bound=_FromMappingProtocol)
_PYLOCK_FILE_NAME_RE = re.compile(r"^pylock\.([^.]+)\.toml$")
def is_valid_pylock_path(path: Path) -> bool: """Check if the given path is a valid pylock file path.""" return path.name == "pylock.toml" or bool(_PYLOCK_FILE_NAME_RE.match(path.name))
def _toml_key(key: str) -> str: return key.replace("_", "-")
def _toml_value(key: str, value: Any) -> Any: # noqa: ANN401 if isinstance(value, (Version, Marker, SpecifierSet)): return str(value) if isinstance(value, Sequence) and key == "environments": return [str(v) for v in value] return value
def _toml_dict_factory(data: list[tuple[str, Any]]) -> dict[str, Any]: return { _toml_key(key): _toml_value(key, value) for key, value in data if value is not None }
def _get(d: Mapping[str, Any], expected_type: type[_T], key: str) -> _T | None: """Get a value from the dictionary and verify it's the expected type.""" if (value := d.get(key)) is None: return None if not isinstance(value, expected_type): raise PylockValidationError( f"Unexpected type {type(value).__name__} " f"(expected {expected_type.__name__})", context=key, ) return value
def _get_required(d: Mapping[str, Any], expected_type: type[_T], key: str) -> _T: """Get a required value from the dictionary and verify it's the expected type.""" if (value := _get(d, expected_type, key)) is None: raise _PylockRequiredKeyError(key) return value
def _get_sequence( d: Mapping[str, Any], expected_item_type: type[_T], key: str) -> Sequence[_T] | None: """Get a list value from the dictionary and verify it's the expected items type.""" if (value := _get(d, Sequence, key)) is None: # type: ignore[type-abstract] return None if isinstance(value, (str, bytes)): # special case: str and bytes are Sequences, but we want to reject it raise PylockValidationError( f"Unexpected type {type(value).__name__} (expected Sequence)", context=key, ) for i, item in enumerate(value): if not isinstance(item, expected_item_type): raise PylockValidationError( f"Unexpected type {type(item).__name__} " f"(expected {expected_item_type.__name__})", context=f"{key}[{i}]", ) return value
def _get_as( d: Mapping[str, Any], expected_type: type[_T], target_type: Callable[[_T], _T2], key: str,) -> _T2 | None: """Get a value from the dictionary, verify it's the expected type, and convert to the target type.
This assumes the target_type constructor accepts the value. """ if (value := _get(d, expected_type, key)) is None: return None try: return target_type(value) except Exception as e: raise PylockValidationError(e, context=key) from e
def _get_required_as( d: Mapping[str, Any], expected_type: type[_T], target_type: Callable[[_T], _T2], key: str,) -> _T2: """Get a required value from the dict, verify it's the expected type, and convert to the target type.""" if (value := _get_as(d, expected_type, target_type, key)) is None: raise _PylockRequiredKeyError(key) return value
def _get_sequence_as( d: Mapping[str, Any], expected_item_type: type[_T], target_item_type: Callable[[_T], _T2], key: str,) -> list[_T2] | None: """Get list value from dictionary and verify expected items type.""" if (value := _get_sequence(d, expected_item_type, key)) is None: return None result = [] try: for item in value: typed_item = target_item_type(item) result.append(typed_item) except Exception as e: raise PylockValidationError(e, context=f"{key}[{len(result)}]") from e return result
def _get_object( d: Mapping[str, Any], target_type: type[_FromMappingProtocolT], key: str) -> _FromMappingProtocolT | None: """Get a dictionary value from the dictionary and convert it to a dataclass.""" if (value := _get(d, Mapping, key)) is None: # type: ignore[type-abstract] return None try: return target_type._from_dict(value) except Exception as e: raise PylockValidationError(e, context=key) from e
def _get_sequence_of_objects( d: Mapping[str, Any], target_item_type: type[_FromMappingProtocolT], key: str) -> list[_FromMappingProtocolT] | None: """Get a list value from the dictionary and convert its items to a dataclass.""" if (value := _get_sequence(d, Mapping, key)) is None: # type: ignore[type-abstract] return None result: list[_FromMappingProtocolT] = [] try: for item in value: typed_item = target_item_type._from_dict(item) result.append(typed_item) except Exception as e: raise PylockValidationError(e, context=f"{key}[{len(result)}]") from e return result
def _get_required_sequence_of_objects( d: Mapping[str, Any], target_item_type: type[_FromMappingProtocolT], key: str) -> Sequence[_FromMappingProtocolT]: """Get a required list value from the dictionary and convert its items to a dataclass.""" if (result := _get_sequence_of_objects(d, target_item_type, key)) is None: raise _PylockRequiredKeyError(key) return result
def _validate_normalized_name(name: str) -> NormalizedName: """Validate that a string is a NormalizedName.""" if not is_normalized_name(name): raise PylockValidationError(f"Name {name!r} is not normalized") return NormalizedName(name)
def _validate_path_url(path: str | None, url: str | None) -> None: if not path and not url: raise PylockValidationError("path or url must be provided")
def _path_name(path: str | None) -> str | None: if not path: return None # If the path is relative it MAY use POSIX-style path separators explicitly # for portability if "/" in path: return path.rsplit("/", 1)[-1] elif "\\" in path: return path.rsplit("\\", 1)[-1] else: return path
def _url_name(url: str | None) -> str | None: if not url: return None url_path = urlparse(url).path return url_path.rsplit("/", 1)[-1]
def _validate_hashes(hashes: Mapping[str, Any]) -> Mapping[str, Any]: if not hashes: raise PylockValidationError("At least one hash must be provided") if not all(isinstance(hash_val, str) for hash_val in hashes.values()): raise PylockValidationError("Hash values must be strings") return hashes
class PylockValidationError(Exception): """Raised when when input data is not spec-compliant."""
context: str | None = None message: str
def __init__( self, cause: str | Exception, *, context: str | None = None, ) -> None: if isinstance(cause, PylockValidationError): if cause.context: self.context = ( f"{context}.{cause.context}" if context else cause.context ) else: self.context = context self.message = cause.message else: self.context = context self.message = str(cause)
def __str__(self) -> str: if self.context: return f"{self.message} in {self.context!r}" return self.message
class _PylockRequiredKeyError(PylockValidationError): def __init__(self, key: str) -> None: super().__init__("Missing required value", context=key)
class PylockUnsupportedVersionError(PylockValidationError): """Raised when encountering an unsupported `lock_version`."""
class PylockSelectError(Exception): """Base exception for errors raised by :meth:`Pylock.select`."""
@dataclass(frozen=True, init=False)class PackageVcs: type: str url: str | None = None path: str | None = None requested_revision: str | None = None commit_id: str # type: ignore[misc] subdirectory: str | None = None
def __init__( self, *, type: str, url: str | None = None, path: str | None = None, requested_revision: str | None = None, commit_id: str, subdirectory: str | None = None, ) -> None: # In Python 3.10+ make dataclass kw_only=True and remove __init__ object.__setattr__(self, "type", type) object.__setattr__(self, "url", url) object.__setattr__(self, "path", path) object.__setattr__(self, "requested_revision", requested_revision) object.__setattr__(self, "commit_id", commit_id) object.__setattr__(self, "subdirectory", subdirectory)
@classmethod def _from_dict(cls, d: Mapping[str, Any]) -> Self: package_vcs = cls( type=_get_required(d, str, "type"), url=_get(d, str, "url"), path=_get(d, str, "path"), requested_revision=_get(d, str, "requested-revision"), commit_id=_get_required(d, str, "commit-id"), subdirectory=_get(d, str, "subdirectory"), ) _validate_path_url(package_vcs.path, package_vcs.url) return package_vcs
@dataclass(frozen=True, init=False)class PackageDirectory: path: str editable: bool | None = None subdirectory: str | None = None
def __init__( self, *, path: str, editable: bool | None = None, subdirectory: str | None = None, ) -> None: # In Python 3.10+ make dataclass kw_only=True and remove __init__ object.__setattr__(self, "path", path) object.__setattr__(self, "editable", editable) object.__setattr__(self, "subdirectory", subdirectory)
@classmethod def _from_dict(cls, d: Mapping[str, Any]) -> Self: return cls( path=_get_required(d, str, "path"), editable=_get(d, bool, "editable"), subdirectory=_get(d, str, "subdirectory"), )
@dataclass(frozen=True, init=False)class PackageArchive: url: str | None = None path: str | None = None size: int | None = None upload_time: datetime | None = None hashes: Mapping[str, str] # type: ignore[misc] subdirectory: str | None = None
def __init__( self, *, url: str | None = None, path: str | None = None, size: int | None = None, upload_time: datetime | None = None, hashes: Mapping[str, str], subdirectory: str | None = None, ) -> None: # In Python 3.10+ make dataclass kw_only=True and remove __init__ object.__setattr__(self, "url", url) object.__setattr__(self, "path", path) object.__setattr__(self, "size", size) object.__setattr__(self, "upload_time", upload_time) object.__setattr__(self, "hashes", hashes) object.__setattr__(self, "subdirectory", subdirectory)
@classmethod def _from_dict(cls, d: Mapping[str, Any]) -> Self: package_archive = cls( url=_get(d, str, "url"), path=_get(d, str, "path"), size=_get(d, int, "size"), upload_time=_get(d, datetime, "upload-time"), hashes=_get_required_as(d, Mapping, _validate_hashes, "hashes"), # type: ignore[type-abstract] subdirectory=_get(d, str, "subdirectory"), ) _validate_path_url(package_archive.path, package_archive.url) return package_archive
@dataclass(frozen=True, init=False)class PackageSdist: name: str | None = None upload_time: datetime | None = None url: str | None = None path: str | None = None size: int | None = None hashes: Mapping[str, str] # type: ignore[misc]
def __init__( self, *, name: str | None = None, upload_time: datetime | None = None, url: str | None = None, path: str | None = None, size: int | None = None, hashes: Mapping[str, str], ) -> None: # In Python 3.10+ make dataclass kw_only=True and remove __init__ object.__setattr__(self, "name", name) object.__setattr__(self, "upload_time", upload_time) object.__setattr__(self, "url", url) object.__setattr__(self, "path", path) object.__setattr__(self, "size", size) object.__setattr__(self, "hashes", hashes)
@classmethod def _from_dict(cls, d: Mapping[str, Any]) -> Self: package_sdist = cls( name=_get(d, str, "name"), upload_time=_get(d, datetime, "upload-time"), url=_get(d, str, "url"), path=_get(d, str, "path"), size=_get(d, int, "size"), hashes=_get_required_as(d, Mapping, _validate_hashes, "hashes"), # type: ignore[type-abstract] ) _validate_path_url(package_sdist.path, package_sdist.url) return package_sdist
@property def filename(self) -> str: """Get the filename of the sdist.""" filename = self.name or _path_name(self.path) or _url_name(self.url) if not filename: raise PylockValidationError("Cannot determine sdist filename") return filename
@dataclass(frozen=True, init=False)class PackageWheel: name: str | None = None upload_time: datetime | None = None url: str | None = None path: str | None = None size: int | None = None hashes: Mapping[str, str] # type: ignore[misc]
def __init__( self, *, name: str | None = None, upload_time: datetime | None = None, url: str | None = None, path: str | None = None, size: int | None = None, hashes: Mapping[str, str], ) -> None: # In Python 3.10+ make dataclass kw_only=True and remove __init__ object.__setattr__(self, "name", name) object.__setattr__(self, "upload_time", upload_time) object.__setattr__(self, "url", url) object.__setattr__(self, "path", path) object.__setattr__(self, "size", size) object.__setattr__(self, "hashes", hashes)
@classmethod def _from_dict(cls, d: Mapping[str, Any]) -> Self: package_wheel = cls( name=_get(d, str, "name"), upload_time=_get(d, datetime, "upload-time"), url=_get(d, str, "url"), path=_get(d, str, "path"), size=_get(d, int, "size"), hashes=_get_required_as(d, Mapping, _validate_hashes, "hashes"), # type: ignore[type-abstract] ) _validate_path_url(package_wheel.path, package_wheel.url) return package_wheel
@property def filename(self) -> str: """Get the filename of the wheel.""" filename = self.name or _path_name(self.path) or _url_name(self.url) if not filename: raise PylockValidationError("Cannot determine wheel filename") return filename
@dataclass(frozen=True, init=False)class Package: name: NormalizedName version: Version | None = None marker: Marker | None = None requires_python: SpecifierSet | None = None dependencies: Sequence[Mapping[str, Any]] | None = None vcs: PackageVcs | None = None directory: PackageDirectory | None = None archive: PackageArchive | None = None index: str | None = None sdist: PackageSdist | None = None wheels: Sequence[PackageWheel] | None = None attestation_identities: Sequence[Mapping[str, Any]] | None = None tool: Mapping[str, Any] | None = None
def __init__( self, *, name: NormalizedName, version: Version | None = None, marker: Marker | None = None, requires_python: SpecifierSet | None = None, dependencies: Sequence[Mapping[str, Any]] | None = None, vcs: PackageVcs | None = None, directory: PackageDirectory | None = None, archive: PackageArchive | None = None, index: str | None = None, sdist: PackageSdist | None = None, wheels: Sequence[PackageWheel] | None = None, attestation_identities: Sequence[Mapping[str, Any]] | None = None, tool: Mapping[str, Any] | None = None, ) -> None: # In Python 3.10+ make dataclass kw_only=True and remove __init__ object.__setattr__(self, "name", name) object.__setattr__(self, "version", version) object.__setattr__(self, "marker", marker) object.__setattr__(self, "requires_python", requires_python) object.__setattr__(self, "dependencies", dependencies) object.__setattr__(self, "vcs", vcs) object.__setattr__(self, "directory", directory) object.__setattr__(self, "archive", archive) object.__setattr__(self, "index", index) object.__setattr__(self, "sdist", sdist) object.__setattr__(self, "wheels", wheels) object.__setattr__(self, "attestation_identities", attestation_identities) object.__setattr__(self, "tool", tool)
@classmethod def _from_dict(cls, d: Mapping[str, Any]) -> Self: package = cls( name=_get_required_as(d, str, _validate_normalized_name, "name"), version=_get_as(d, str, Version, "version"), requires_python=_get_as(d, str, SpecifierSet, "requires-python"), dependencies=_get_sequence(d, Mapping, "dependencies"), # type: ignore[type-abstract] marker=_get_as(d, str, Marker, "marker"), vcs=_get_object(d, PackageVcs, "vcs"), directory=_get_object(d, PackageDirectory, "directory"), archive=_get_object(d, PackageArchive, "archive"), index=_get(d, str, "index"), sdist=_get_object(d, PackageSdist, "sdist"), wheels=_get_sequence_of_objects(d, PackageWheel, "wheels"), attestation_identities=_get_sequence(d, Mapping, "attestation-identities"), # type: ignore[type-abstract] tool=_get(d, Mapping, "tool"), # type: ignore[type-abstract] ) distributions = bool(package.sdist) + len(package.wheels or []) direct_urls = ( bool(package.vcs) + bool(package.directory) + bool(package.archive) ) if distributions > 0 and direct_urls > 0: raise PylockValidationError( "None of vcs, directory, archive must be set if sdist or wheels are set" ) if distributions == 0 and direct_urls != 1: raise PylockValidationError( "Exactly one of vcs, directory, archive must be set " "if sdist and wheels are not set" ) for i, wheel in enumerate(package.wheels or []): try: (name, version, _, _) = parse_wheel_filename(wheel.filename) except Exception as e: raise PylockValidationError( f"Invalid wheel filename {wheel.filename!r}", context=f"wheels[{i}]", ) from e if name != package.name: raise PylockValidationError( f"Name in {wheel.filename!r} is not consistent with " f"package name {package.name!r}", context=f"wheels[{i}]", ) if package.version and version != package.version: raise PylockValidationError( f"Version in {wheel.filename!r} is not consistent with " f"package version {str(package.version)!r}", context=f"wheels[{i}]", ) if package.sdist: try: name, version = parse_sdist_filename(package.sdist.filename) except Exception as e: raise PylockValidationError( f"Invalid sdist filename {package.sdist.filename!r}", context="sdist", ) from e if name != package.name: raise PylockValidationError( f"Name in {package.sdist.filename!r} is not consistent with " f"package name {package.name!r}", context="sdist", ) if package.version and version != package.version: raise PylockValidationError( f"Version in {package.sdist.filename!r} is not consistent with " f"package version {str(package.version)!r}", context="sdist", ) try: for i, attestation_identity in enumerate( # noqa: B007 package.attestation_identities or [] ): _get_required(attestation_identity, str, "kind") except Exception as e: raise PylockValidationError( e, context=f"attestation-identities[{i}]" ) from e return package
@property def is_direct(self) -> bool: return not (self.sdist or self.wheels)
@dataclass(frozen=True, init=False)class Pylock: """A class representing a pylock file."""
lock_version: Version environments: Sequence[Marker] | None = None requires_python: SpecifierSet | None = None extras: Sequence[NormalizedName] | None = None dependency_groups: Sequence[str] | None = None default_groups: Sequence[str] | None = None created_by: str # type: ignore[misc] packages: Sequence[Package] # type: ignore[misc] tool: Mapping[str, Any] | None = None
def __init__( self, *, lock_version: Version, environments: Sequence[Marker] | None = None, requires_python: SpecifierSet | None = None, extras: Sequence[NormalizedName] | None = None, dependency_groups: Sequence[str] | None = None, default_groups: Sequence[str] | None = None, created_by: str, packages: Sequence[Package], tool: Mapping[str, Any] | None = None, ) -> None: # In Python 3.10+ make dataclass kw_only=True and remove __init__ object.__setattr__(self, "lock_version", lock_version) object.__setattr__(self, "environments", environments) object.__setattr__(self, "requires_python", requires_python) object.__setattr__(self, "extras", extras) object.__setattr__(self, "dependency_groups", dependency_groups) object.__setattr__(self, "default_groups", default_groups) object.__setattr__(self, "created_by", created_by) object.__setattr__(self, "packages", packages) object.__setattr__(self, "tool", tool)
@classmethod def _from_dict(cls, d: Mapping[str, Any]) -> Self: pylock = cls( lock_version=_get_required_as(d, str, Version, "lock-version"), environments=_get_sequence_as(d, str, Marker, "environments"), extras=_get_sequence_as(d, str, _validate_normalized_name, "extras"), dependency_groups=_get_sequence(d, str, "dependency-groups"), default_groups=_get_sequence(d, str, "default-groups"), created_by=_get_required(d, str, "created-by"), requires_python=_get_as(d, str, SpecifierSet, "requires-python"), packages=_get_required_sequence_of_objects(d, Package, "packages"), tool=_get(d, Mapping, "tool"), # type: ignore[type-abstract] ) if not Version("1") <= pylock.lock_version < Version("2"): raise PylockUnsupportedVersionError( f"pylock version {pylock.lock_version} is not supported" ) if pylock.lock_version > Version("1.0"): _logger.warning( "pylock minor version %s is not supported", pylock.lock_version ) return pylock
@classmethod def from_dict(cls, d: Mapping[str, Any], /) -> Self: """Create and validate a Pylock instance from a TOML dictionary.
Raises :class:`PylockValidationError` if the input data is not spec-compliant. """ return cls._from_dict(d)
def to_dict(self) -> Mapping[str, Any]: """Convert the Pylock instance to a TOML dictionary.""" return dataclasses.asdict(self, dict_factory=_toml_dict_factory)
def validate(self) -> None: """Validate the Pylock instance against the specification.
Raises :class:`PylockValidationError` otherwise.""" self.from_dict(self.to_dict())
def select( self, *, environment: Environment | None = None, tags: Sequence[Tag] | None = None, extras: Collection[str] | None = None, dependency_groups: Collection[str] | None = None, ) -> Iterator[ tuple[ Package, PackageVcs | PackageDirectory | PackageArchive | PackageWheel | PackageSdist, ] ]: """Select what to install from the lock file.
The *environment* and *tags* parameters represent the environment being selected for. If unspecified, ``packaging.markers.default_environment()`` and ``packaging.tags.sys_tags()`` are used.
The *extras* parameter represents the extras to install.
The *dependency_groups* parameter represents the groups to install. If unspecified, the default groups are used.
This method must be used on valid Pylock instances (i.e. one obtained from :meth:`Pylock.from_dict` or if constructed manually, after calling :meth:`Pylock.validate`). """ compatible_tags_selector = create_compatible_tags_selector(tags or sys_tags())
# #. Gather the extras and dependency groups to install and set ``extras`` and # ``dependency_groups`` for marker evaluation, respectively. # # #. ``extras`` SHOULD be set to the empty set by default. # #. ``dependency_groups`` SHOULD be the set created from # :ref:`pylock-default-groups` by default. env = cast( "dict[str, str | frozenset[str]]", dict( environment or {}, # Marker.evaluate will fill-up extras=frozenset(extras or []), dependency_groups=frozenset( (self.default_groups or []) if dependency_groups is None # to allow selecting no group else dependency_groups ), ), ) env_python_full_version = ( environment["python_full_version"] if environment else default_environment()["python_full_version"] )
# #. Check if the metadata version specified by :ref:`pylock-lock-version` is # supported; an error or warning MUST be raised as appropriate. # Covered by lock.validate() which is a precondition for this method.
# #. If :ref:`pylock-requires-python` is specified, check that the environment # being installed for meets the requirement; an error MUST be raised if it is # not met. if self.requires_python and not self.requires_python.contains( env_python_full_version, ): raise PylockSelectError( f"python_full_version {env_python_full_version!r} " f"in provided environment does not satisfy the Python version " f"requirement {str(self.requires_python)!r}" )
# #. If :ref:`pylock-environments` is specified, check that at least one of the # environment marker expressions is satisfied; an error MUST be raised if no # expression is satisfied. if self.environments: for env_marker in self.environments: if env_marker.evaluate( cast("dict[str, str]", environment or {}), context="requirement" ): break else: raise PylockSelectError( "Provided environment does not satisfy any of the " "environments specified in the lock file" )
# #. For each package listed in :ref:`pylock-packages`: selected_packages_by_name: dict[str, tuple[int, Package]] = {} for package_index, package in enumerate(self.packages): # #. If :ref:`pylock-packages-marker` is specified, check if it is # satisfied;if it isn't, skip to the next package. if package.marker and not package.marker.evaluate(env, context="lock_file"): continue
# #. If :ref:`pylock-packages-requires-python` is specified, check if it is # satisfied; an error MUST be raised if it isn't. if package.requires_python and not package.requires_python.contains( env_python_full_version, ): raise PylockSelectError( f"python_full_version {env_python_full_version!r} " f"in provided environment does not satisfy the Python version " f"requirement {str(package.requires_python)!r} for package " f"{package.name!r} at packages[{package_index}]" )
# #. Check that no other conflicting instance of the package has been slated # to be installed; an error about the ambiguity MUST be raised otherwise. if package.name in selected_packages_by_name: raise PylockSelectError( f"Multiple packages with the name {package.name!r} are " f"selected at packages[{package_index}] and " f"packages[{selected_packages_by_name[package.name][0]}]" )
# #. Check that the source of the package is specified appropriately (i.e. # there are no conflicting sources in the package entry); # an error MUST be raised if any issues are found. # Covered by lock.validate() which is a precondition for this method.
# #. Add the package to the set of packages to install. selected_packages_by_name[package.name] = (package_index, package)
# #. For each package to be installed: for package_index, package in selected_packages_by_name.values(): # - If :ref:`pylock-packages-vcs` is set: if package.vcs is not None: yield package, package.vcs
# - Else if :ref:`pylock-packages-directory` is set: elif package.directory is not None: yield package, package.directory
# - Else if :ref:`pylock-packages-archive` is set: elif package.archive is not None: yield package, package.archive
# - Else if there are entries for :ref:`pylock-packages-wheels`: elif package.wheels: # #. Look for the appropriate wheel file based on # :ref:`pylock-packages-wheels-name`; if one is not found then move # on to :ref:`pylock-packages-sdist` or an error MUST be raised about # a lack of source for the project. best_wheel = next( compatible_tags_selector( (wheel, parse_wheel_filename(wheel.filename)[-1]) for wheel in package.wheels ), None, ) if best_wheel: yield package, best_wheel elif package.sdist is not None: yield package, package.sdist else: raise PylockSelectError( f"No wheel found matching the provided tags " f"for package {package.name!r} " f"at packages[{package_index}], " f"and no sdist available as a fallback" )
# - Else if no :ref:`pylock-packages-wheels` file is found or # :ref:`pylock-packages-sdist` is solely set: elif package.sdist is not None: yield package, package.sdist
else: # Covered by lock.validate() which is a precondition for this method. raise NotImplementedError # pragma: no cover123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129# This file is dual licensed under the terms of the Apache License, Version# 2.0, and the BSD License. See the LICENSE file in the root of this repository# for complete details.from __future__ import annotations
from typing import Iterator
from ._parser import parse_requirement as _parse_requirementfrom ._tokenizer import ParserSyntaxErrorfrom .markers import Marker, _normalize_extra_valuesfrom .specifiers import SpecifierSetfrom .utils import canonicalize_name
__all__ = [ "InvalidRequirement", "Requirement",]
def __dir__() -> list[str]: return __all__
class InvalidRequirement(ValueError): """ An invalid requirement was found, users should refer to PEP 508. """
class Requirement: """Parse a requirement.
Parse a given requirement string into its parts, such as name, specifier, URL, and extras. Raises InvalidRequirement on a badly-formed requirement string.
Instances are safe to serialize with :mod:`pickle`. They use a stable format so the same pickle can be loaded in future packaging releases.
.. versionchanged:: 26.2
Added a stable pickle format. Pickles created with packaging 26.2+ can be unpickled with future releases. Backward compatibility with pickles from pip._vendor.packaging < 26.2 is supported but may be removed in a future release. """
# TODO: Can we test whether something is contained within a requirement? # If so how do we do that? Do we need to test against the _name_ of # the thing as well as the version? What about the markers? # TODO: Can we normalize the name and extra name?
def __init__(self, requirement_string: str) -> None: try: parsed = _parse_requirement(requirement_string) except ParserSyntaxError as e: raise InvalidRequirement(str(e)) from e
self.name: str = parsed.name self.url: str | None = parsed.url or None self.extras: set[str] = set(parsed.extras or []) self.specifier: SpecifierSet = SpecifierSet(parsed.specifier) self.marker: Marker | None = None if parsed.marker is not None: self.marker = Marker.__new__(Marker) self.marker._markers = _normalize_extra_values(parsed.marker)
def _iter_parts(self, name: str) -> Iterator[str]: yield name
if self.extras: formatted_extras = ",".join(sorted(self.extras)) yield f"[{formatted_extras}]"
if self.specifier: yield str(self.specifier)
if self.url: yield f" @ {self.url}" if self.marker: yield " "
if self.marker: yield f"; {self.marker}"
def __getstate__(self) -> str: # Return the requirement string for compactness and stability. # Re-parsed on load to reconstruct all fields. return str(self)
def __setstate__(self, state: object) -> None: if isinstance(state, str): # New format (26.2+): just the requirement string. try: tmp = Requirement(state) except InvalidRequirement as exc: raise TypeError(f"Cannot restore Requirement from {state!r}") from exc self.name = tmp.name self.url = tmp.url self.extras = tmp.extras self.specifier = tmp.specifier self.marker = tmp.marker return if isinstance(state, dict): # Old format (packaging <= 26.1, no __slots__): plain __dict__. self.__dict__.update(state) return raise TypeError(f"Cannot restore Requirement from {state!r}")
def __str__(self) -> str: return "".join(self._iter_parts(self.name))
def __repr__(self) -> str: return f"<{self.__class__.__name__}({str(self)!r})>"
def __hash__(self) -> int: return hash(tuple(self._iter_parts(canonicalize_name(self.name))))
def __eq__(self, other: object) -> bool: if not isinstance(other, Requirement): return NotImplemented
return ( canonicalize_name(self.name) == canonicalize_name(other.name) and self.extras == other.extras and self.specifier == other.specifier and self.url == other.url and self.marker == other.marker )12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943# This file is dual licensed under the terms of the Apache License, Version# 2.0, and the BSD License. See the LICENSE file in the root of this repository# for complete details.""".. testsetup::
from pip._vendor.packaging.specifiers import Specifier, SpecifierSet, InvalidSpecifier from pip._vendor.packaging.version import Version"""
from __future__ import annotations
import abcimport enumimport functoolsimport itertoolsimport reimport sysimport typingfrom typing import ( TYPE_CHECKING, Any, Callable, Final, Iterable, Iterator, Sequence, TypeVar, Union,)
from .utils import canonicalize_versionfrom .version import InvalidVersion, Version
if sys.version_info >= (3, 10): from typing import TypeGuard # pragma: no coverelif TYPE_CHECKING: from typing_extensions import TypeGuard
__all__ = [ "BaseSpecifier", "InvalidSpecifier", "Specifier", "SpecifierSet",]
def __dir__() -> list[str]: return __all__
def _validate_spec(spec: object, /) -> TypeGuard[tuple[str, str]]: return ( isinstance(spec, tuple) and len(spec) == 2 and isinstance(spec[0], str) and isinstance(spec[1], str) )
def _validate_pre(pre: object, /) -> TypeGuard[bool | None]: return pre is None or isinstance(pre, bool)
T = TypeVar("T")UnparsedVersion = Union[Version, str]UnparsedVersionVar = TypeVar("UnparsedVersionVar", bound=UnparsedVersion)CallableOperator = Callable[[Version, str], bool]
# The smallest possible PEP 440 version. No valid version is less than this._MIN_VERSION: Final[Version] = Version("0.dev0")
def _trim_release(release: tuple[int, ...]) -> tuple[int, ...]: """Strip trailing zeros from a release tuple for normalized comparison.""" end = len(release) while end > 1 and release[end - 1] == 0: end -= 1 return release if end == len(release) else release[:end]
class _BoundaryKind(enum.Enum): """Where a boundary marker sits in the version ordering."""
AFTER_LOCALS = enum.auto() # after V+local, before V.post0 AFTER_POSTS = enum.auto() # after V.postN, before next release
@functools.total_orderingclass _BoundaryVersion: """A point on the version line between two real PEP 440 versions.
Some specifier semantics imply boundaries between real versions: ``<=1.0`` includes ``1.0+local`` and ``>1.0`` excludes ``1.0.post0``. No real :class:`Version` falls on those boundaries, so this class creates values that sort between the real versions on either side.
Two kinds exist, shown relative to a base version V::
V < V+local < AFTER_LOCALS(V) < V.post0 < AFTER_POSTS(V)
``AFTER_LOCALS`` sits after V and every V+local, but before V.post0. Upper bound of ``<=V``, ``==V``, ``!=V``.
``AFTER_POSTS`` sits after every V.postN, but before the next release segment. Lower bound of ``>V`` (final or pre-release V) to exclude post-releases per PEP 440. """
__slots__ = ("_kind", "_trimmed_release", "version")
def __init__(self, version: Version, kind: _BoundaryKind) -> None: self.version = version self._kind = kind self._trimmed_release = _trim_release(version.release)
def _is_family(self, other: Version) -> bool: """Is ``other`` a version that this boundary sorts above?""" v = self.version if not ( other.epoch == v.epoch and _trim_release(other.release) == self._trimmed_release and other.pre == v.pre ): return False if self._kind == _BoundaryKind.AFTER_LOCALS: # Local family: exact same public version (any local label). return other.post == v.post and other.dev == v.dev # Post family: same base + any post-release (or identical). return other.dev == v.dev or other.post is not None
def __eq__(self, other: object) -> bool: if isinstance(other, _BoundaryVersion): return self.version == other.version and self._kind == other._kind return NotImplemented
def __lt__(self, other: _BoundaryVersion | Version) -> bool: if isinstance(other, _BoundaryVersion): if self.version != other.version: return self.version < other.version return self._kind.value < other._kind.value return not self._is_family(other) and self.version < other
def __hash__(self) -> int: return hash((self.version, self._kind))
def __repr__(self) -> str: return f"{self.__class__.__name__}({self.version!r}, {self._kind.name})"
@functools.total_orderingclass _LowerBound: """Lower bound of a version range.
A version *v* of ``None`` means unbounded below (-inf). At equal versions, ``[v`` sorts before ``(v`` because an inclusive bound starts earlier. """
__slots__ = ("inclusive", "version")
def __init__(self, version: _VersionOrBoundary, inclusive: bool) -> None: self.version = version self.inclusive = inclusive
def __eq__(self, other: object) -> bool: if not isinstance(other, _LowerBound): return NotImplemented # pragma: no cover return self.version == other.version and self.inclusive == other.inclusive
def __lt__(self, other: _LowerBound) -> bool: if not isinstance(other, _LowerBound): # pragma: no cover return NotImplemented # -inf < anything (except -inf). if self.version is None: return other.version is not None if other.version is None: return False if self.version != other.version: return self.version < other.version # [v < (v: inclusive starts earlier. return self.inclusive and not other.inclusive
def __hash__(self) -> int: return hash((self.version, self.inclusive))
def __repr__(self) -> str: bracket = "[" if self.inclusive else "(" return f"<{self.__class__.__name__} {bracket}{self.version!r}>"
@functools.total_orderingclass _UpperBound: """Upper bound of a version range.
A version *v* of ``None`` means unbounded above (+inf). At equal versions, ``v)`` sorts before ``v]`` because an exclusive bound ends earlier. """
__slots__ = ("inclusive", "version")
def __init__(self, version: _VersionOrBoundary, inclusive: bool) -> None: self.version = version self.inclusive = inclusive
def __eq__(self, other: object) -> bool: if not isinstance(other, _UpperBound): return NotImplemented # pragma: no cover return self.version == other.version and self.inclusive == other.inclusive
def __lt__(self, other: _UpperBound) -> bool: if not isinstance(other, _UpperBound): # pragma: no cover return NotImplemented # Nothing < +inf (except +inf itself). if self.version is None: return False if other.version is None: return True if self.version != other.version: return self.version < other.version # v) < v]: exclusive ends earlier. return not self.inclusive and other.inclusive
def __hash__(self) -> int: return hash((self.version, self.inclusive))
def __repr__(self) -> str: bracket = "]" if self.inclusive else ")" return f"<{self.__class__.__name__} {self.version!r}{bracket}>"
if typing.TYPE_CHECKING: _VersionOrBoundary = Union[Version, _BoundaryVersion, None]
#: A single contiguous version range, represented as a #: (lower bound, upper bound) pair. _VersionRange = tuple[_LowerBound, _UpperBound]
_NEG_INF = _LowerBound(None, False)_POS_INF = _UpperBound(None, False)_FULL_RANGE: tuple[_VersionRange] = ((_NEG_INF, _POS_INF),)
def _range_is_empty(lower: _LowerBound, upper: _UpperBound) -> bool: """True when the range defined by *lower* and *upper* contains no versions.""" if lower.version is None or upper.version is None: return False if lower.version == upper.version: return not (lower.inclusive and upper.inclusive) return lower.version > upper.version
def _intersect_ranges( left: Sequence[_VersionRange], right: Sequence[_VersionRange],) -> list[_VersionRange]: """Intersect two sorted, non-overlapping range lists (two-pointer merge).""" result: list[_VersionRange] = [] left_index = right_index = 0 while left_index < len(left) and right_index < len(right): left_lower, left_upper = left[left_index] right_lower, right_upper = right[right_index]
lower = max(left_lower, right_lower) upper = min(left_upper, right_upper)
if not _range_is_empty(lower, upper): result.append((lower, upper))
# Advance whichever side has the smaller upper bound. if left_upper < right_upper: left_index += 1 else: right_index += 1
return result
def _next_prefix_dev0(version: Version) -> Version: """Smallest version in the next prefix: 1.2 -> 1.3.dev0.""" release = (*version.release[:-1], version.release[-1] + 1) return Version.from_parts(epoch=version.epoch, release=release, dev=0)
def _base_dev0(version: Version) -> Version: """The .dev0 of a version's base release: 1.2 -> 1.2.dev0.""" return Version.from_parts(epoch=version.epoch, release=version.release, dev=0)
def _coerce_version(version: UnparsedVersion) -> Version | None: if not isinstance(version, Version): try: version = Version(version) except InvalidVersion: return None return version
def _public_version(version: Version) -> Version: if version.local is None: return version return version.__replace__(local=None)
def _post_base(version: Version) -> Version: """The version that *version* is a post-release of.
1.0.post1 -> 1.0, 1.0a1.post0 -> 1.0a1, 1.0.post0.dev1 -> 1.0. """ return version.__replace__(post=None, dev=None, local=None)
def _earliest_prerelease(version: Version) -> Version: """Earliest pre-release of *version*.
1.2 -> 1.2.dev0, 1.2.post1 -> 1.2.post1.dev0. """ return version.__replace__(dev=0, local=None)
def _nearest_non_prerelease( v: _VersionOrBoundary,) -> Version | None: """Smallest non-pre-release version at or above *v*, or None.""" if v is None: return None if isinstance(v, _BoundaryVersion): inner = v.version if inner.is_prerelease: # AFTER_LOCALS(1.0a1) -> nearest non-pre is 1.0 return inner.__replace__(pre=None, dev=None, local=None) # AFTER_LOCALS(1.0) -> nearest non-pre is 1.0.post0 # AFTER_LOCALS(1.0.post0) -> nearest non-pre is 1.0.post1 k = (inner.post + 1) if inner.post is not None else 0 return inner.__replace__(post=k, local=None) if not v.is_prerelease: return v # Strip pre/dev to get the final or post-release form. return v.__replace__(pre=None, dev=None, local=None)
class InvalidSpecifier(ValueError): """ Raised when attempting to create a :class:`Specifier` with a specifier string that is invalid.
>>> Specifier("lolwat") Traceback (most recent call last): ... packaging.specifiers.InvalidSpecifier: Invalid specifier: 'lolwat' """
class BaseSpecifier(metaclass=abc.ABCMeta): __slots__ = () __match_args__ = ("_str",)
@property def _str(self) -> str: """Internal property for match_args""" return str(self)
@abc.abstractmethod def __str__(self) -> str: """ Returns the str representation of this Specifier-like object. This should be representative of the Specifier itself. """
@abc.abstractmethod def __hash__(self) -> int: """ Returns a hash value for this Specifier-like object. """
@abc.abstractmethod def __eq__(self, other: object) -> bool: """ Returns a boolean representing whether or not the two Specifier-like objects are equal.
:param other: The other object to check against. """
@property @abc.abstractmethod def prereleases(self) -> bool | None: """Whether or not pre-releases as a whole are allowed.
This can be set to either ``True`` or ``False`` to explicitly enable or disable prereleases or it can be set to ``None`` (the default) to use default semantics. """
@prereleases.setter # noqa: B027 def prereleases(self, value: bool) -> None: """Setter for :attr:`prereleases`.
:param value: The value to set. """
@abc.abstractmethod def contains(self, item: str, prereleases: bool | None = None) -> bool: """ Determines if the given item is contained within this specifier. """
@typing.overload def filter( self, iterable: Iterable[UnparsedVersionVar], prereleases: bool | None = None, key: None = ..., ) -> Iterator[UnparsedVersionVar]: ...
@typing.overload def filter( self, iterable: Iterable[T], prereleases: bool | None = None, key: Callable[[T], UnparsedVersion] = ..., ) -> Iterator[T]: ...
@abc.abstractmethod def filter( self, iterable: Iterable[Any], prereleases: bool | None = None, key: Callable[[Any], UnparsedVersion] | None = None, ) -> Iterator[Any]: """ Takes an iterable of items and filters them so that only items which are contained within this specifier are allowed in it. """
class Specifier(BaseSpecifier): """This class abstracts handling of version specifiers.
.. tip::
It is generally not required to instantiate this manually. You should instead prefer to work with :class:`SpecifierSet` instead, which can parse comma-separated version specifiers (which is what package metadata contains).
Instances are safe to serialize with :mod:`pickle`. They use a stable format so the same pickle can be loaded in future packaging releases.
.. versionchanged:: 26.2
Added a stable pickle format. Pickles created with packaging 26.2+ can be unpickled with future releases. Backward compatibility with pickles from pip._vendor.packaging < 26.2 is supported but may be removed in a future release. """
__slots__ = ( "_prereleases", "_ranges", "_spec", "_spec_version", "_wildcard_split", )
_specifier_regex_str = r""" (?: (?: # The identity operators allow for an escape hatch that will # do an exact string match of the version you wish to install. # This will not be parsed by PEP 440 and we cannot determine # any semantic meaning from it. This operator is discouraged # but included entirely as an escape hatch. === # Only match for the identity operator \s* [^\s;)]* # The arbitrary version can be just about anything, # we match everything except for whitespace, a # semi-colon for marker support, and a closing paren # since versions can be enclosed in them. ) | (?: # The (non)equality operators allow for wild card and local # versions to be specified so we have to define these two # operators separately to enable that. (?:==|!=) # Only match for equals and not equals
\s* v? (?:[0-9]+!)? # epoch [0-9]+(?:\.[0-9]+)* # release
# You cannot use a wild card and a pre-release, post-release, a dev or # local version together so group them with a | and make them optional. (?: \.\* # Wild card syntax of .* | (?a: # pre release [-_\.]? (alpha|beta|preview|pre|a|b|c|rc) [-_\.]? [0-9]* )? (?a: # post release (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*) )? (?a:[-_\.]?dev[-_\.]?[0-9]*)? # dev release (?a:\+[a-z0-9]+(?:[-_\.][a-z0-9]+)*)? # local )? ) | (?: # The compatible operator requires at least two digits in the # release segment. (?:~=) # Only match for the compatible operator
\s* v? (?:[0-9]+!)? # epoch [0-9]+(?:\.[0-9]+)+ # release (We have a + instead of a *) (?: # pre release [-_\.]? (alpha|beta|preview|pre|a|b|c|rc) [-_\.]? [0-9]* )? (?: # post release (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*) )? (?:[-_\.]?dev[-_\.]?[0-9]*)? # dev release ) | (?: # All other operators only allow a sub set of what the # (non)equality operators do. Specifically they do not allow # local versions to be specified nor do they allow the prefix # matching wild cards. (?:<=|>=|<|>)
\s* v? (?:[0-9]+!)? # epoch [0-9]+(?:\.[0-9]+)* # release (?a: # pre release [-_\.]? (alpha|beta|preview|pre|a|b|c|rc) [-_\.]? [0-9]* )? (?a: # post release (?:-[0-9]+)|(?:[-_\.]?(post|rev|r)[-_\.]?[0-9]*) )? (?a:[-_\.]?dev[-_\.]?[0-9]*)? # dev release ) ) """
_regex = re.compile( r"\s*" + _specifier_regex_str + r"\s*", re.VERBOSE | re.IGNORECASE )
_operators: Final = { "~=": "compatible", "==": "equal", "!=": "not_equal", "<=": "less_than_equal", ">=": "greater_than_equal", "<": "less_than", ">": "greater_than", "===": "arbitrary", }
def __init__(self, spec: str = "", prereleases: bool | None = None) -> None: """Initialize a Specifier instance.
:param spec: The string representation of a specifier which will be parsed and normalized before use. :param prereleases: This tells the specifier if it should accept prerelease versions if applicable or not. The default of ``None`` will autodetect it from the given specifiers. :raises InvalidSpecifier: If the given specifier is invalid (i.e. bad syntax). """ if not self._regex.fullmatch(spec): raise InvalidSpecifier(f"Invalid specifier: {spec!r}")
spec = spec.strip() if spec.startswith("==="): operator, version = spec[:3], spec[3:].strip() elif spec.startswith(("~=", "==", "!=", "<=", ">=")): operator, version = spec[:2], spec[2:].strip() else: operator, version = spec[:1], spec[1:].strip()
self._spec: tuple[str, str] = (operator, version)
# Store whether or not this Specifier should accept prereleases self._prereleases = prereleases
# Specifier version cache self._spec_version: tuple[str, Version] | None = None
# Populated on first wildcard (==X.*) comparison self._wildcard_split: tuple[list[str], int] | None = None
# Version range cache (populated by _to_ranges) self._ranges: Sequence[_VersionRange] | None = None
def _get_spec_version(self, version: str) -> Version | None: """One element cache, as only one spec Version is needed per Specifier.""" if self._spec_version is not None and self._spec_version[0] == version: return self._spec_version[1]
version_specifier = _coerce_version(version) if version_specifier is None: return None
self._spec_version = (version, version_specifier) return version_specifier
def _require_spec_version(self, version: str) -> Version: """Get spec version, asserting it's valid (not for === operator).
This method should only be called for operators where version strings are guaranteed to be valid PEP 440 versions (not ===). """ spec_version = self._get_spec_version(version) assert spec_version is not None return spec_version
def _to_ranges(self) -> Sequence[_VersionRange]: """Convert this specifier to sorted, non-overlapping version ranges.
Each standard operator maps to one or two ranges. ``===`` is modeled as full range (actual check done separately). Cached. """ if self._ranges is not None: return self._ranges
op = self.operator ver_str = self.version
if op == "===": self._ranges = _FULL_RANGE return _FULL_RANGE
if ver_str.endswith(".*"): result = self._wildcard_ranges(op, ver_str) else: result = self._standard_ranges(op, ver_str)
self._ranges = result return result
def _wildcard_ranges(self, op: str, ver_str: str) -> list[_VersionRange]: # ==1.2.* -> [1.2.dev0, 1.3.dev0); !=1.2.* -> complement. base = self._require_spec_version(ver_str[:-2]) lower = _base_dev0(base) upper = _next_prefix_dev0(base) if op == "==": return [(_LowerBound(lower, True), _UpperBound(upper, False))] # != return [ (_NEG_INF, _UpperBound(lower, False)), (_LowerBound(upper, True), _POS_INF), ]
def _standard_ranges(self, op: str, ver_str: str) -> list[_VersionRange]: v = self._require_spec_version(ver_str)
if op == ">=": return [(_LowerBound(v, True), _POS_INF)]
if op == "<=": return [ ( _NEG_INF, _UpperBound(_BoundaryVersion(v, _BoundaryKind.AFTER_LOCALS), True), ) ]
if op == ">": if v.dev is not None: # >V.devN: dev versions have no post-releases, so the # next real version is V.dev(N+1). lower_ver = v.__replace__(dev=v.dev + 1, local=None) return [(_LowerBound(lower_ver, True), _POS_INF)] if v.post is not None: # >V.postN: next real version is V.post(N+1).dev0. lower_ver = v.__replace__(post=v.post + 1, dev=0, local=None) return [(_LowerBound(lower_ver, True), _POS_INF)] # >V (final or pre-release): skip V+local and all V.postN. return [ ( _LowerBound(_BoundaryVersion(v, _BoundaryKind.AFTER_POSTS), False), _POS_INF, ) ]
if op == "<": # <V excludes prereleases of V when V is not a prerelease. # V.dev0 is the earliest prerelease of V (final, post, etc.). bound = v if v.is_prerelease else v.__replace__(dev=0, local=None) if bound <= _MIN_VERSION: return [] return [(_NEG_INF, _UpperBound(bound, False))]
# ==, !=: local versions of V match when spec has no local segment. has_local = "+" in ver_str after_locals = _BoundaryVersion(v, _BoundaryKind.AFTER_LOCALS) upper = v if has_local else after_locals
if op == "==": return [(_LowerBound(v, True), _UpperBound(upper, True))]
if op == "!=": return [ (_NEG_INF, _UpperBound(v, False)), (_LowerBound(upper, False), _POS_INF), ]
if op == "~=": prefix = v.__replace__(release=v.release[:-1]) return [ (_LowerBound(v, True), _UpperBound(_next_prefix_dev0(prefix), False)) ]
raise ValueError(f"Unknown operator: {op!r}") # pragma: no cover
@property def prereleases(self) -> bool | None: # If there is an explicit prereleases set for this, then we'll just # blindly use that. if self._prereleases is not None: return self._prereleases
# Only the "!=" operator does not imply prereleases when # the version in the specifier is a prerelease. operator, version_str = self._spec if operator == "!=": return False
# The == specifier with trailing .* cannot include prereleases # e.g. "==1.0a1.*" is not valid. if operator == "==" and version_str.endswith(".*"): return False
# "===" can have arbitrary string versions, so we cannot parse # those, we take prereleases as unknown (None) for those. version = self._get_spec_version(version_str) if version is None: return None
# For all other operators, use the check if spec Version # object implies pre-releases. return version.is_prerelease
@prereleases.setter def prereleases(self, value: bool | None) -> None: self._prereleases = value
def __getstate__(self) -> tuple[tuple[str, str], bool | None]: # Return state as a 2-item tuple for compactness: # ((operator, version), prereleases) # Cache members are excluded and will be recomputed on demand. return (self._spec, self._prereleases)
def __setstate__(self, state: object) -> None: # Always discard cached values - they will be recomputed on demand. self._spec_version = None self._wildcard_split = None self._ranges = None
if isinstance(state, tuple): if len(state) == 2: # New format (26.2+): ((operator, version), prereleases) spec, prereleases = state if _validate_spec(spec) and _validate_pre(prereleases): self._spec = spec self._prereleases = prereleases return if len(state) == 2 and isinstance(state[1], dict): # Format (packaging 26.0-26.1): (None, {slot: value}). _, slot_dict = state spec = slot_dict.get("_spec") prereleases = slot_dict.get("_prereleases", "invalid") if _validate_spec(spec) and _validate_pre(prereleases): self._spec = spec self._prereleases = prereleases return if isinstance(state, dict): # Old format (packaging <= 25.x, no __slots__): state is a plain dict. spec = state.get("_spec") prereleases = state.get("_prereleases", "invalid") if _validate_spec(spec) and _validate_pre(prereleases): self._spec = spec self._prereleases = prereleases return
raise TypeError(f"Cannot restore Specifier from {state!r}")
@property def operator(self) -> str: """The operator of this specifier.
>>> Specifier("==1.2.3").operator '==' """ return self._spec[0]
@property def version(self) -> str: """The version of this specifier.
>>> Specifier("==1.2.3").version '1.2.3' """ return self._spec[1]
def __repr__(self) -> str: """A representation of the Specifier that shows all internal state.
>>> Specifier('>=1.0.0') <Specifier('>=1.0.0')> >>> Specifier('>=1.0.0', prereleases=False) <Specifier('>=1.0.0', prereleases=False)> >>> Specifier('>=1.0.0', prereleases=True) <Specifier('>=1.0.0', prereleases=True)> """ pre = ( f", prereleases={self.prereleases!r}" if self._prereleases is not None else "" )
return f"<{self.__class__.__name__}({str(self)!r}{pre})>"
def __str__(self) -> str: """A string representation of the Specifier that can be round-tripped.
>>> str(Specifier('>=1.0.0')) '>=1.0.0' >>> str(Specifier('>=1.0.0', prereleases=False)) '>=1.0.0' """ return "{}{}".format(*self._spec)
@property def _canonical_spec(self) -> tuple[str, str]: operator, version = self._spec if operator == "===" or version.endswith(".*"): return operator, version
spec_version = self._require_spec_version(version)
canonical_version = canonicalize_version( spec_version, strip_trailing_zero=(operator != "~=") )
return operator, canonical_version
def __hash__(self) -> int: return hash(self._canonical_spec)
def __eq__(self, other: object) -> bool: """Whether or not the two Specifier-like objects are equal.
:param other: The other object to check against.
The value of :attr:`prereleases` is ignored.
>>> Specifier("==1.2.3") == Specifier("== 1.2.3.0") True >>> (Specifier("==1.2.3", prereleases=False) == ... Specifier("==1.2.3", prereleases=True)) True >>> Specifier("==1.2.3") == "==1.2.3" True >>> Specifier("==1.2.3") == Specifier("==1.2.4") False >>> Specifier("==1.2.3") == Specifier("~=1.2.3") False """ if isinstance(other, str): try: other = self.__class__(str(other)) except InvalidSpecifier: return NotImplemented elif not isinstance(other, self.__class__): return NotImplemented
return self._canonical_spec == other._canonical_spec
def _get_operator(self, op: str) -> CallableOperator: operator_callable: CallableOperator = getattr( self, f"_compare_{self._operators[op]}" ) return operator_callable
def _compare_compatible(self, prospective: Version, spec: str) -> bool: # Compatible releases have an equivalent combination of >= and ==. That # is that ~=2.2 is equivalent to >=2.2,==2.*. This allows us to # implement this in terms of the other specifiers instead of # implementing it ourselves. The only thing we need to do is construct # the other specifiers.
# We want everything but the last item in the version, but we want to # ignore suffix segments. prefix = _version_join( list(itertools.takewhile(_is_not_suffix, _version_split(spec)))[:-1] )
# Add the prefix notation to the end of our string prefix += ".*"
return (self._compare_greater_than_equal(prospective, spec)) and ( self._compare_equal(prospective, prefix) )
def _get_wildcard_split(self, spec: str) -> tuple[list[str], int]: """Cached split of a wildcard spec into components and numeric length.
>>> Specifier("==1.*")._get_wildcard_split("1.*") (['0', '1'], 2) >>> Specifier("==3.10.*")._get_wildcard_split("3.10.*") (['0', '3', '10'], 3) """ wildcard_split = self._wildcard_split if wildcard_split is None: normalized = canonicalize_version(spec[:-2], strip_trailing_zero=False) split_spec = _version_split(normalized) wildcard_split = (split_spec, _numeric_prefix_len(split_spec)) self._wildcard_split = wildcard_split return wildcard_split
def _compare_equal(self, prospective: Version, spec: str) -> bool: # We need special logic to handle prefix matching if spec.endswith(".*"): split_spec, spec_numeric_len = self._get_wildcard_split(spec)
# In the case of prefix matching we want to ignore local segment. normalized_prospective = canonicalize_version( _public_version(prospective), strip_trailing_zero=False ) # Split the prospective version out by bangs and dots, and pretend # that there is an implicit dot in between a release segment and # a pre-release segment. split_prospective = _version_split(normalized_prospective)
# 0-pad the prospective version before shortening it to get the correct # shortened version. padded_prospective = _left_pad(split_prospective, spec_numeric_len)
# Shorten the prospective version to be the same length as the spec # so that we can determine if the specifier is a prefix of the # prospective version or not. shortened_prospective = padded_prospective[: len(split_spec)]
return shortened_prospective == split_spec else: # Convert our spec string into a Version spec_version = self._require_spec_version(spec)
# If the specifier does not have a local segment, then we want to # act as if the prospective version also does not have a local # segment. if not spec_version.local: prospective = _public_version(prospective)
return prospective == spec_version
def _compare_not_equal(self, prospective: Version, spec: str) -> bool: return not self._compare_equal(prospective, spec)
def _compare_less_than_equal(self, prospective: Version, spec: str) -> bool: # NB: Local version identifiers are NOT permitted in the version # specifier, so local version labels can be universally removed from # the prospective version. return _public_version(prospective) <= self._require_spec_version(spec)
def _compare_greater_than_equal(self, prospective: Version, spec: str) -> bool: # NB: Local version identifiers are NOT permitted in the version # specifier, so local version labels can be universally removed from # the prospective version. return _public_version(prospective) >= self._require_spec_version(spec)
def _compare_less_than(self, prospective: Version, spec_str: str) -> bool: # Convert our spec to a Version instance, since we'll want to work with # it as a version. spec = self._require_spec_version(spec_str)
# Check to see if the prospective version is less than the spec # version. If it's not we can short circuit and just return False now # instead of doing extra unneeded work. if not prospective < spec: return False
# The spec says: "<V MUST NOT allow a pre-release of the specified # version unless the specified version is itself a pre-release." if ( not spec.is_prerelease and prospective.is_prerelease and prospective >= _earliest_prerelease(spec) ): return False
# If we've gotten to here, it means that prospective version is both # less than the spec version *and* it's not a pre-release of the same # version in the spec. return True
def _compare_greater_than(self, prospective: Version, spec_str: str) -> bool: # Convert our spec to a Version instance, since we'll want to work with # it as a version. spec = self._require_spec_version(spec_str)
# Check to see if the prospective version is greater than the spec # version. If it's not we can short circuit and just return False now # instead of doing extra unneeded work. if not prospective > spec: return False
# The spec says: ">V MUST NOT allow a post-release of the specified # version unless the specified version is itself a post-release." if ( not spec.is_postrelease and prospective.is_postrelease and _post_base(prospective) == spec ): return False
# Per the spec: ">V MUST NOT match a local version of the specified # version". A "local version of V" is any version whose public part # equals V. So >1.0a1 must not match 1.0a1+local, but must still # match 1.0a2+local. if prospective.local is not None and _public_version(prospective) == spec: return False
# If we've gotten to here, it means that prospective version is both # greater than the spec version *and* it's not a pre-release of the # same version in the spec. return True
def _compare_arbitrary(self, prospective: Version | str, spec: str) -> bool: return str(prospective).lower() == str(spec).lower()
def __contains__(self, item: str | Version) -> bool: """Return whether or not the item is contained in this specifier.
:param item: The item to check for.
This is used for the ``in`` operator and behaves the same as :meth:`contains` with no ``prereleases`` argument passed.
>>> "1.2.3" in Specifier(">=1.2.3") True >>> Version("1.2.3") in Specifier(">=1.2.3") True >>> "1.0.0" in Specifier(">=1.2.3") False >>> "1.3.0a1" in Specifier(">=1.2.3") True >>> "1.3.0a1" in Specifier(">=1.2.3", prereleases=True) True """ return self.contains(item)
def contains(self, item: UnparsedVersion, prereleases: bool | None = None) -> bool: """Return whether or not the item is contained in this specifier.
:param item: The item to check for, which can be a version string or a :class:`Version` instance. :param prereleases: Whether or not to match prereleases with this Specifier. If set to ``None`` (the default), it will follow the recommendation from :pep:`440` and match prereleases, as there are no other versions.
>>> Specifier(">=1.2.3").contains("1.2.3") True >>> Specifier(">=1.2.3").contains(Version("1.2.3")) True >>> Specifier(">=1.2.3").contains("1.0.0") False >>> Specifier(">=1.2.3").contains("1.3.0a1") True >>> Specifier(">=1.2.3", prereleases=False).contains("1.3.0a1") False >>> Specifier(">=1.2.3").contains("1.3.0a1") True """
return bool(list(self.filter([item], prereleases=prereleases)))
@typing.overload def filter( self, iterable: Iterable[UnparsedVersionVar], prereleases: bool | None = None, key: None = ..., ) -> Iterator[UnparsedVersionVar]: ...
@typing.overload def filter( self, iterable: Iterable[T], prereleases: bool | None = None, key: Callable[[T], UnparsedVersion] = ..., ) -> Iterator[T]: ...
def filter( self, iterable: Iterable[Any], prereleases: bool | None = None, key: Callable[[Any], UnparsedVersion] | None = None, ) -> Iterator[Any]: """Filter items in the given iterable, that match the specifier.
:param iterable: An iterable that can contain version strings and :class:`Version` instances. The items in the iterable will be filtered according to the specifier. :param prereleases: Whether or not to allow prereleases in the returned iterator. If set to ``None`` (the default), it will follow the recommendation from :pep:`440` and match prereleases if there are no other versions. :param key: A callable that takes a single argument (an item from the iterable) and returns a version string or :class:`Version` instance to be used for filtering.
>>> list(Specifier(">=1.2.3").filter(["1.2", "1.3", "1.5a1"])) ['1.3'] >>> list(Specifier(">=1.2.3").filter(["1.2", "1.2.3", "1.3", Version("1.4")])) ['1.2.3', '1.3', <Version('1.4')>] >>> list(Specifier(">=1.2.3").filter(["1.2", "1.5a1"])) ['1.5a1'] >>> list(Specifier(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True)) ['1.3', '1.5a1'] >>> list(Specifier(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"])) ['1.3', '1.5a1'] >>> list(Specifier(">=1.2.3").filter( ... [{"ver": "1.2"}, {"ver": "1.3"}], ... key=lambda x: x["ver"])) [{'ver': '1.3'}] """ prereleases_versions = [] found_non_prereleases = False
# Determine if to include prereleases by default include_prereleases = ( prereleases if prereleases is not None else self.prereleases )
# Get the matching operator operator_callable = self._get_operator(self.operator)
# Filter versions for version in iterable: parsed_version = _coerce_version(version if key is None else key(version)) match = False if parsed_version is None: # === operator can match arbitrary (non-version) strings if self.operator == "===" and self._compare_arbitrary( version, self.version ): yield version elif self.operator == "===": match = self._compare_arbitrary( version if key is None else key(version), self.version ) else: match = operator_callable(parsed_version, self.version)
if match and parsed_version is not None: # If it's not a prerelease or prereleases are allowed, yield it directly if not parsed_version.is_prerelease or include_prereleases: found_non_prereleases = True yield version # Otherwise collect prereleases for potential later use elif prereleases is None and self._prereleases is not False: prereleases_versions.append(version)
# If no non-prereleases were found and prereleases weren't # explicitly forbidden, yield the collected prereleases if ( not found_non_prereleases and prereleases is None and self._prereleases is not False ): yield from prereleases_versions
_prefix_regex = re.compile(r"([0-9]+)((?:a|b|c|rc)[0-9]+)")
def _pep440_filter_prereleases( iterable: Iterable[Any], key: Callable[[Any], UnparsedVersion] | None) -> Iterator[Any]: """Filter per PEP 440: exclude prereleases unless no finals exist.""" # Two lists used: # * all_nonfinal to preserve order if no finals exist # * arbitrary_strings for streaming when first final found all_nonfinal: list[Any] = [] arbitrary_strings: list[Any] = []
found_final = False for item in iterable: parsed = _coerce_version(item if key is None else key(item))
if parsed is None: # Arbitrary strings are always included as it is not # possible to determine if they are prereleases, # and they have already passed all specifiers. if found_final: yield item else: arbitrary_strings.append(item) all_nonfinal.append(item) continue
if not parsed.is_prerelease: # Final release found - flush arbitrary strings, then yield if not found_final: yield from arbitrary_strings found_final = True yield item continue
# Prerelease - buffer if no finals yet, otherwise skip if not found_final: all_nonfinal.append(item)
# No finals found - yield all buffered items if not found_final: yield from all_nonfinal
def _version_split(version: str) -> list[str]: """Split version into components.
The split components are intended for version comparison. The logic does not attempt to retain the original version string, so joining the components back with :func:`_version_join` may not produce the original version string. """ result: list[str] = []
epoch, _, rest = version.rpartition("!") result.append(epoch or "0")
for item in rest.split("."): match = _prefix_regex.fullmatch(item) if match: result.extend(match.groups()) else: result.append(item) return result
def _version_join(components: list[str]) -> str: """Join split version components into a version string.
This function assumes the input came from :func:`_version_split`, where the first component must be the epoch (either empty or numeric), and all other components numeric. """ epoch, *rest = components return f"{epoch}!{'.'.join(rest)}"
def _is_not_suffix(segment: str) -> bool: return not any( segment.startswith(prefix) for prefix in ("dev", "a", "b", "rc", "post") )
def _numeric_prefix_len(split: list[str]) -> int: """Count leading numeric components in a :func:`_version_split` result.
>>> _numeric_prefix_len(["0", "1", "2", "a1"]) 3 """ count = 0 for segment in split: if not segment.isdigit(): break count += 1 return count
def _left_pad(split: list[str], target_numeric_len: int) -> list[str]: """Pad a :func:`_version_split` result with ``"0"`` segments to reach ``target_numeric_len`` numeric components. Suffix segments are preserved.
>>> _left_pad(["0", "1", "a1"], 4) ['0', '1', '0', '0', 'a1'] """ numeric_len = _numeric_prefix_len(split) pad_needed = target_numeric_len - numeric_len if pad_needed <= 0: return split return [*split[:numeric_len], *(["0"] * pad_needed), *split[numeric_len:]]
def _operator_cost(op_entry: tuple[CallableOperator, str, str]) -> int: """Sort key for Cost Based Ordering of specifier operators in _filter_versions.
Operators run sequentially on a shrinking candidate set, so operators that reject the most versions should run first to minimize work for later ones.
Tier 0: Exact equality (==, ===), likely to narrow candidates to one version Tier 1: Range checks (>=, <=, >, <), cheap and usually reject a large portion Tier 2: Wildcard equality (==.*) and compatible release (~=), more expensive Tier 3: Exact !=, cheap but rarely rejects Tier 4: Wildcard !=.*, expensive and rarely rejects """ _, ver, op = op_entry if op == "==": return 0 if not ver.endswith(".*") else 2 if op in (">=", "<=", ">", "<"): return 1 if op == "~=": return 2 if op == "!=": return 3 if not ver.endswith(".*") else 4 if op == "===": return 0
raise ValueError(f"Unknown operator: {op!r}") # pragma: no cover
class SpecifierSet(BaseSpecifier): """This class abstracts handling of a set of version specifiers.
It can be passed a single specifier (``>=3.0``), a comma-separated list of specifiers (``>=3.0,!=3.1``), or no specifier at all.
Instances are safe to serialize with :mod:`pickle`. They use a stable format so the same pickle can be loaded in future packaging releases.
.. versionchanged:: 26.2
Added a stable pickle format. Pickles created with packaging 26.2+ can be unpickled with future releases. Backward compatibility with pickles from packaging < 26.2 is supported but may be removed in a future release. """
__slots__ = ( "_canonicalized", "_has_arbitrary", "_is_unsatisfiable", "_prereleases", "_resolved_ops", "_specs", )
def __init__( self, specifiers: str | Iterable[Specifier] = "", prereleases: bool | None = None, ) -> None: """Initialize a SpecifierSet instance.
:param specifiers: The string representation of a specifier or a comma-separated list of specifiers which will be parsed and normalized before use. May also be an iterable of ``Specifier`` instances, which will be used as is. :param prereleases: This tells the SpecifierSet if it should accept prerelease versions if applicable or not. The default of ``None`` will autodetect it from the given specifiers.
:raises InvalidSpecifier: If the given ``specifiers`` are not parseable than this exception will be raised. """
if isinstance(specifiers, str): # Split on `,` to break each individual specifier into its own item, and # strip each item to remove leading/trailing whitespace. split_specifiers = [s.strip() for s in specifiers.split(",") if s.strip()]
self._specs: tuple[Specifier, ...] = tuple(map(Specifier, split_specifiers)) # Fast substring check; avoids iterating parsed specs. self._has_arbitrary = "===" in specifiers else: self._specs = tuple(specifiers) # Substring check works for both Specifier objects and plain # strings (setuptools passes lists of strings). self._has_arbitrary = any("===" in str(s) for s in self._specs)
self._canonicalized = len(self._specs) <= 1 self._resolved_ops: list[tuple[CallableOperator, str, str]] | None = None
# Store our prereleases value so we can use it later to determine if # we accept prereleases or not. self._prereleases = prereleases
self._is_unsatisfiable: bool | None = None
def _canonical_specs(self) -> tuple[Specifier, ...]: """Deduplicate, sort, and cache specs for order-sensitive operations.""" if not self._canonicalized: self._specs = tuple(dict.fromkeys(sorted(self._specs, key=str))) self._canonicalized = True self._resolved_ops = None self._is_unsatisfiable = None return self._specs
@property def prereleases(self) -> bool | None: # If we have been given an explicit prerelease modifier, then we'll # pass that through here. if self._prereleases is not None: return self._prereleases
# If we don't have any specifiers, and we don't have a forced value, # then we'll just return None since we don't know if this should have # pre-releases or not. if not self._specs: return None
# Otherwise we'll see if any of the given specifiers accept # prereleases, if any of them do we'll return True, otherwise False. if any(s.prereleases for s in self._specs): return True
return None
@prereleases.setter def prereleases(self, value: bool | None) -> None: self._prereleases = value self._is_unsatisfiable = None
def __getstate__(self) -> tuple[tuple[Specifier, ...], bool | None]: # Return state as a 2-item tuple for compactness: # (specs, prereleases) # Cache members are excluded and will be recomputed on demand. return (self._specs, self._prereleases)
def __setstate__(self, state: object) -> None: # Always discard cached values - they will be recomputed on demand. self._resolved_ops = None self._is_unsatisfiable = None
if isinstance(state, tuple): if len(state) == 2: # New format (26.2+): (specs, prereleases) specs, prereleases = state if ( isinstance(specs, tuple) and all(isinstance(s, Specifier) for s in specs) and _validate_pre(prereleases) ): self._specs = specs self._prereleases = prereleases self._canonicalized = len(specs) <= 1 self._has_arbitrary = any("===" in str(s) for s in specs) return if len(state) == 2 and isinstance(state[1], dict): # Format (packaging 26.0-26.1): (None, {slot: value}). _, slot_dict = state specs = slot_dict.get("_specs", ()) prereleases = slot_dict.get("_prereleases") # Convert frozenset to tuple (26.0 stored as frozenset) if isinstance(specs, frozenset): specs = tuple(sorted(specs, key=str)) if ( isinstance(specs, tuple) and all(isinstance(s, Specifier) for s in specs) and _validate_pre(prereleases) ): self._specs = specs self._prereleases = prereleases self._canonicalized = len(self._specs) <= 1 self._has_arbitrary = any("===" in str(s) for s in self._specs) return if isinstance(state, dict): # Old format (packaging <= 25.x, no __slots__): state is a plain dict. specs = state.get("_specs", ()) prereleases = state.get("_prereleases") # Convert frozenset to tuple (26.0 stored as frozenset) if isinstance(specs, frozenset): specs = tuple(sorted(specs, key=str)) if ( isinstance(specs, tuple) and all(isinstance(s, Specifier) for s in specs) and _validate_pre(prereleases) ): self._specs = specs self._prereleases = prereleases self._canonicalized = len(self._specs) <= 1 self._has_arbitrary = any("===" in str(s) for s in self._specs) return
raise TypeError(f"Cannot restore SpecifierSet from {state!r}")
def __repr__(self) -> str: """A representation of the specifier set that shows all internal state.
Note that the ordering of the individual specifiers within the set may not match the input string.
>>> SpecifierSet('>=1.0.0,!=2.0.0') <SpecifierSet('!=2.0.0,>=1.0.0')> >>> SpecifierSet('>=1.0.0,!=2.0.0', prereleases=False) <SpecifierSet('!=2.0.0,>=1.0.0', prereleases=False)> >>> SpecifierSet('>=1.0.0,!=2.0.0', prereleases=True) <SpecifierSet('!=2.0.0,>=1.0.0', prereleases=True)> """ pre = ( f", prereleases={self.prereleases!r}" if self._prereleases is not None else "" )
return f"<{self.__class__.__name__}({str(self)!r}{pre})>"
def __str__(self) -> str: """A string representation of the specifier set that can be round-tripped.
Note that the ordering of the individual specifiers within the set may not match the input string.
>>> str(SpecifierSet(">=1.0.0,!=1.0.1")) '!=1.0.1,>=1.0.0' >>> str(SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False)) '!=1.0.1,>=1.0.0' """ return ",".join(str(s) for s in self._canonical_specs())
def __hash__(self) -> int: return hash(self._canonical_specs())
def __and__(self, other: SpecifierSet | str) -> SpecifierSet: """Return a SpecifierSet which is a combination of the two sets.
:param other: The other object to combine with.
>>> SpecifierSet(">=1.0.0,!=1.0.1") & '<=2.0.0,!=2.0.1' <SpecifierSet('!=1.0.1,!=2.0.1,<=2.0.0,>=1.0.0')> >>> SpecifierSet(">=1.0.0,!=1.0.1") & SpecifierSet('<=2.0.0,!=2.0.1') <SpecifierSet('!=1.0.1,!=2.0.1,<=2.0.0,>=1.0.0')> """ if isinstance(other, str): other = SpecifierSet(other) elif not isinstance(other, SpecifierSet): return NotImplemented
specifier = SpecifierSet() specifier._specs = self._specs + other._specs specifier._canonicalized = len(specifier._specs) <= 1 specifier._has_arbitrary = self._has_arbitrary or other._has_arbitrary specifier._resolved_ops = None
# Combine prerelease settings: use common or non-None value if self._prereleases is None or self._prereleases == other._prereleases: specifier._prereleases = other._prereleases elif other._prereleases is None: specifier._prereleases = self._prereleases else: raise ValueError( "Cannot combine SpecifierSets with True and False prerelease overrides." )
return specifier
def __eq__(self, other: object) -> bool: """Whether or not the two SpecifierSet-like objects are equal.
:param other: The other object to check against.
The value of :attr:`prereleases` is ignored.
>>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.1") True >>> (SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False) == ... SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True)) True >>> SpecifierSet(">=1.0.0,!=1.0.1") == ">=1.0.0,!=1.0.1" True >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0") False >>> SpecifierSet(">=1.0.0,!=1.0.1") == SpecifierSet(">=1.0.0,!=1.0.2") False """ if isinstance(other, (str, Specifier)): other = SpecifierSet(str(other)) elif not isinstance(other, SpecifierSet): return NotImplemented
return self._canonical_specs() == other._canonical_specs()
def __len__(self) -> int: """Returns the number of specifiers in this specifier set.""" return len(self._specs)
def __iter__(self) -> Iterator[Specifier]: """ Returns an iterator over all the underlying :class:`Specifier` instances in this specifier set.
>>> sorted(SpecifierSet(">=1.0.0,!=1.0.1"), key=str) [<Specifier('!=1.0.1')>, <Specifier('>=1.0.0')>] """ return iter(self._specs)
def _get_ranges(self) -> Sequence[_VersionRange]: """Intersect all specifiers into a single list of version ranges.
Returns an empty list when unsatisfiable. ``===`` specs are modeled as full range; string matching is checked separately by :meth:`_check_arbitrary_unsatisfiable`. """ specs = self._specs
result: Sequence[_VersionRange] | None = None for s in specs: if result is None: result = s._to_ranges() else: result = _intersect_ranges(result, s._to_ranges()) if not result: break
if result is None: # pragma: no cover raise RuntimeError("_get_ranges called with no specs") return result
def is_unsatisfiable(self) -> bool: """Check whether this specifier set can never be satisfied.
Returns True if no version can satisfy all specifiers simultaneously.
>>> SpecifierSet(">=2.0,<1.0").is_unsatisfiable() True >>> SpecifierSet(">=1.0,<2.0").is_unsatisfiable() False >>> SpecifierSet("").is_unsatisfiable() False >>> SpecifierSet("==1.0,!=1.0").is_unsatisfiable() True """ cached = self._is_unsatisfiable if cached is not None: return cached
if not self._specs: self._is_unsatisfiable = False return False
result = not self._get_ranges()
if not result: result = self._check_arbitrary_unsatisfiable()
if not result and self.prereleases is False: result = self._check_prerelease_only_ranges()
self._is_unsatisfiable = result return result
def _check_prerelease_only_ranges(self) -> bool: """With prereleases=False, check if every range contains only pre-release versions (which would be excluded from matching).""" for lower, upper in self._get_ranges(): nearest = _nearest_non_prerelease(lower.version) if nearest is None: return False if upper.version is None or nearest < upper.version: return False if nearest == upper.version and upper.inclusive: return False return True
def _check_arbitrary_unsatisfiable(self) -> bool: """Check === (arbitrary equality) specs for unsatisfiability.
=== uses case-insensitive string comparison, so the only candidate that can match ``===V`` is the literal string V. This method checks whether that candidate is excluded by other specifiers. """ arbitrary = [s for s in self._specs if s.operator == "==="] if not arbitrary: return False
# Multiple === must agree on the same string (case-insensitive). first = arbitrary[0].version.lower() if any(s.version.lower() != first for s in arbitrary[1:]): return True
# The sole candidate is the === version string. Check whether # it can satisfy every standard spec. candidate = _coerce_version(arbitrary[0].version)
# With prereleases=False, a prerelease candidate is excluded # by contains() before the === string check even runs. if ( self.prereleases is False and candidate is not None and candidate.is_prerelease ): return True
standard = [s for s in self._specs if s.operator != "==="] if not standard: return False
if candidate is None: # Unparsable string cannot satisfy any standard spec. return True
return not all(s.contains(candidate) for s in standard)
def __contains__(self, item: UnparsedVersion) -> bool: """Return whether or not the item is contained in this specifier.
:param item: The item to check for.
This is used for the ``in`` operator and behaves the same as :meth:`contains` with no ``prereleases`` argument passed.
>>> "1.2.3" in SpecifierSet(">=1.0.0,!=1.0.1") True >>> Version("1.2.3") in SpecifierSet(">=1.0.0,!=1.0.1") True >>> "1.0.1" in SpecifierSet(">=1.0.0,!=1.0.1") False >>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1") True >>> "1.3.0a1" in SpecifierSet(">=1.0.0,!=1.0.1", prereleases=True) True """ return self.contains(item)
def contains( self, item: UnparsedVersion, prereleases: bool | None = None, installed: bool | None = None, ) -> bool: """Return whether or not the item is contained in this SpecifierSet.
:param item: The item to check for, which can be a version string or a :class:`Version` instance. :param prereleases: Whether or not to match prereleases with this SpecifierSet. If set to ``None`` (the default), it will follow the recommendation from :pep:`440` and match prereleases, as there are no other versions. :param installed: Whether or not the item is installed. If set to ``True``, it will accept prerelease versions even if the specifier does not allow them.
>>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.2.3") True >>> SpecifierSet(">=1.0.0,!=1.0.1").contains(Version("1.2.3")) True >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.0.1") False >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1") True >>> SpecifierSet(">=1.0.0,!=1.0.1", prereleases=False).contains("1.3.0a1") False >>> SpecifierSet(">=1.0.0,!=1.0.1").contains("1.3.0a1", prereleases=True) True """ version = _coerce_version(item)
if version is not None and installed and version.is_prerelease: prereleases = True
# When item is a string and === is involved, keep it as-is # so the comparison isn't done against the normalized form. if version is None or (self._has_arbitrary and not isinstance(item, Version)): check_item = item else: check_item = version return bool(list(self.filter([check_item], prereleases=prereleases)))
@typing.overload def filter( self, iterable: Iterable[UnparsedVersionVar], prereleases: bool | None = None, key: None = ..., ) -> Iterator[UnparsedVersionVar]: ...
@typing.overload def filter( self, iterable: Iterable[T], prereleases: bool | None = None, key: Callable[[T], UnparsedVersion] = ..., ) -> Iterator[T]: ...
def filter( self, iterable: Iterable[Any], prereleases: bool | None = None, key: Callable[[Any], UnparsedVersion] | None = None, ) -> Iterator[Any]: """Filter items in the given iterable, that match the specifiers in this set.
:param iterable: An iterable that can contain version strings and :class:`Version` instances. The items in the iterable will be filtered according to the specifier. :param prereleases: Whether or not to allow prereleases in the returned iterator. If set to ``None`` (the default), it will follow the recommendation from :pep:`440` and match prereleases if there are no other versions. :param key: A callable that takes a single argument (an item from the iterable) and returns a version string or :class:`Version` instance to be used for filtering.
>>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", "1.5a1"])) ['1.3'] >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.3", Version("1.4")])) ['1.3', <Version('1.4')>] >>> list(SpecifierSet(">=1.2.3").filter(["1.2", "1.5a1"])) ['1.5a1'] >>> list(SpecifierSet(">=1.2.3").filter(["1.3", "1.5a1"], prereleases=True)) ['1.3', '1.5a1'] >>> list(SpecifierSet(">=1.2.3", prereleases=True).filter(["1.3", "1.5a1"])) ['1.3', '1.5a1'] >>> list(SpecifierSet(">=1.2.3").filter( ... [{"ver": "1.2"}, {"ver": "1.3"}], ... key=lambda x: x["ver"])) [{'ver': '1.3'}]
An "empty" SpecifierSet will filter items based on the presence of prerelease versions in the set.
>>> list(SpecifierSet("").filter(["1.3", "1.5a1"])) ['1.3'] >>> list(SpecifierSet("").filter(["1.5a1"])) ['1.5a1'] >>> list(SpecifierSet("", prereleases=True).filter(["1.3", "1.5a1"])) ['1.3', '1.5a1'] >>> list(SpecifierSet("").filter(["1.3", "1.5a1"], prereleases=True)) ['1.3', '1.5a1'] """ # Determine if we're forcing a prerelease or not, if we're not forcing # one for this particular filter call, then we'll use whatever the # SpecifierSet thinks for whether or not we should support prereleases. if prereleases is None and self.prereleases is not None: prereleases = self.prereleases
# Filter versions that match all specifiers using Cost Based Ordering. if self._specs: # When prereleases is None, we need to let all versions through # the individual filters, then decide about prereleases at the end # based on whether any non-prereleases matched ALL specs.
# Fast path: single specifier, delegate directly. if len(self._specs) == 1: filtered = self._specs[0].filter( iterable, prereleases=True if prereleases is None else prereleases, key=key, ) else: filtered = self._filter_versions( iterable, key, prereleases=True if prereleases is None else prereleases, )
if prereleases is not None: return filtered
return _pep440_filter_prereleases(filtered, key)
# Handle Empty SpecifierSet. if prereleases is True: return iter(iterable)
if prereleases is False: return ( item for item in iterable if ( (version := _coerce_version(item if key is None else key(item))) is None or not version.is_prerelease ) )
# PEP 440: exclude prereleases unless no final releases matched return _pep440_filter_prereleases(iterable, key)
def _filter_versions( self, iterable: Iterable[Any], key: Callable[[Any], UnparsedVersion] | None, prereleases: bool | None = None, ) -> Iterator[Any]: """Filter versions against all specifiers in a single pass.
Uses Cost Based Ordering: specifiers are sorted by _operator_cost so that cheap range operators reject versions early, avoiding expensive wildcard or compatible operators on versions that would have been rejected anyway. """ # Pre-resolve operators and sort (cached after first call). if self._resolved_ops is None: self._resolved_ops = sorted( ( (spec._get_operator(spec.operator), spec.version, spec.operator) for spec in self._specs ), key=_operator_cost, ) ops = self._resolved_ops exclude_prereleases = prereleases is False
for item in iterable: parsed = _coerce_version(item if key is None else key(item))
if parsed is None: # Only === can match non-parseable versions. if all( op == "===" and str(item).lower() == ver.lower() for _, ver, op in ops ): yield item elif exclude_prereleases and parsed.is_prerelease: pass elif all( str(item if key is None else key(item)).lower() == ver.lower() if op == "===" else op_fn(parsed, ver) for op_fn, ver, op in ops ): # Short-circuits on the first failing operator. yield item123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932# This file is dual licensed under the terms of the Apache License, Version# 2.0, and the BSD License. See the LICENSE file in the root of this repository# for complete details.
from __future__ import annotations
import loggingimport operatorimport platformimport reimport structimport subprocessimport sysimport sysconfigfrom importlib.machinery import EXTENSION_SUFFIXESfrom typing import ( TYPE_CHECKING, Iterable, Iterator, Sequence, Tuple, TypeVar, cast,)
from . import _manylinux, _musllinux
if TYPE_CHECKING: from collections.abc import Callable, Iterable from typing import AbstractSet
__all__ = [ "INTERPRETER_SHORT_NAMES", "AppleVersion", "PythonVersion", "Tag", "UnsortedTagsError", "android_platforms", "compatible_tags", "cpython_tags", "create_compatible_tags_selector", "generic_tags", "interpreter_name", "interpreter_version", "ios_platforms", "mac_platforms", "parse_tag", "platform_tags", "sys_tags",]
def __dir__() -> list[str]: return __all__
logger = logging.getLogger(__name__)
PythonVersion = Sequence[int]AppleVersion = Tuple[int, int]_T = TypeVar("_T")
INTERPRETER_SHORT_NAMES: dict[str, str] = { "python": "py", # Generic. "cpython": "cp", "pypy": "pp", "ironpython": "ip", "jython": "jy",}
# This function can be unit tested without reloading the module# (Unlike _32_BIT_INTERPRETER)def _compute_32_bit_interpreter() -> bool: return struct.calcsize("P") == 4
_32_BIT_INTERPRETER = _compute_32_bit_interpreter()
class UnsortedTagsError(ValueError): """ Raised when a tag component is not in sorted order per PEP 425. """
class Tag: """ A representation of the tag triple for a wheel.
Instances are considered immutable and thus are hashable. Equality checking is also supported.
Instances are safe to serialize with :mod:`pickle`. They use a stable format so the same pickle can be loaded in future packaging releases.
.. versionchanged:: 26.2
Added a stable pickle format. Pickles created with packaging 26.2+ can be unpickled with future releases. Backward compatibility with pickles from pip._vendor.packaging < 26.2 is supported but may be removed in a future release. """
__slots__ = ["_abi", "_hash", "_interpreter", "_platform"]
def __init__(self, interpreter: str, abi: str, platform: str) -> None: """ :param str interpreter: The interpreter name, e.g. ``"py"`` (see :attr:`INTERPRETER_SHORT_NAMES` for mapping well-known interpreter names to their short names). :param str abi: The ABI that a wheel supports, e.g. ``"cp37m"``. :param str platform: The OS/platform the wheel supports, e.g. ``"win_amd64"``. """ self._interpreter = interpreter.lower() self._abi = abi.lower() self._platform = platform.lower() # The __hash__ of every single element in a Set[Tag] will be evaluated each time # that a set calls its `.disjoint()` method, which may be called hundreds of # times when scanning a page of links for packages with tags matching that # Set[Tag]. Pre-computing the value here produces significant speedups for # downstream consumers. self._hash = hash((self._interpreter, self._abi, self._platform))
@property def interpreter(self) -> str: """ The interpreter name, e.g. ``"py"`` (see :attr:`INTERPRETER_SHORT_NAMES` for mapping well-known interpreter names to their short names). """ return self._interpreter
@property def abi(self) -> str: """ The supported ABI. """ return self._abi
@property def platform(self) -> str: """ The OS/platform. """ return self._platform
def __eq__(self, other: object) -> bool: if not isinstance(other, Tag): return NotImplemented
return ( (self._hash == other._hash) # Short-circuit ASAP for perf reasons. and (self._platform == other._platform) and (self._abi == other._abi) and (self._interpreter == other._interpreter) )
def __hash__(self) -> int: return self._hash
def __str__(self) -> str: return f"{self._interpreter}-{self._abi}-{self._platform}"
def __repr__(self) -> str: return f"<{self} @ {id(self)}>"
def __getstate__(self) -> tuple[str, str, str]: # Return state as a 3-item tuple: (interpreter, abi, platform). # Cache member _hash is excluded and will be recomputed. return (self._interpreter, self._abi, self._platform)
def __setstate__(self, state: object) -> None: if isinstance(state, tuple): if len(state) == 3 and all(isinstance(s, str) for s in state): # New format (26.2+): (interpreter, abi, platform) self._interpreter, self._abi, self._platform = state self._hash = hash((self._interpreter, self._abi, self._platform)) return if len(state) == 2 and isinstance(state[1], dict): # Old format (packaging <= 26.1, __slots__): (None, {slot: value}). _, slots = state try: interpreter = slots["_interpreter"] abi = slots["_abi"] platform = slots["_platform"] except KeyError: raise TypeError(f"Cannot restore Tag from {state!r}") from None if not all( isinstance(value, str) for value in (interpreter, abi, platform) ): raise TypeError(f"Cannot restore Tag from {state!r}") self._interpreter = interpreter.lower() self._abi = abi.lower() self._platform = platform.lower() self._hash = hash((self._interpreter, self._abi, self._platform)) return raise TypeError(f"Cannot restore Tag from {state!r}")
def parse_tag(tag: str, *, validate_order: bool = False) -> frozenset[Tag]: """ Parses the provided tag (e.g. `py3-none-any`) into a frozenset of :class:`Tag` instances.
Returning a set is required due to the possibility that the tag is a `compressed tag set`_, e.g. ``"py2.py3-none-any"`` which supports both Python 2 and Python 3.
If **validate_order** is true, compressed tag set components are checked to be in sorted order as required by PEP 425.
:param str tag: The tag to parse, e.g. ``"py3-none-any"``. :param bool validate_order: Check whether compressed tag set components are in sorted order. :raises UnsortedTagsError: If **validate_order** is true and any compressed tag set component is not in sorted order.
.. versionadded:: 26.1 The *validate_order* parameter. """ tags = set() interpreters, abis, platforms = tag.split("-") if validate_order: for component in (interpreters, abis, platforms): parts = component.split(".") if parts != sorted(parts): raise UnsortedTagsError( f"Tag component {component!r} is not in sorted order per PEP 425" ) for interpreter in interpreters.split("."): for abi in abis.split("."): for platform_ in platforms.split("."): tags.add(Tag(interpreter, abi, platform_)) return frozenset(tags)
def _get_config_var(name: str, warn: bool = False) -> int | str | None: value: int | str | None = sysconfig.get_config_var(name) if value is None and warn: logger.debug( "Config variable '%s' is unset, Python ABI tag may be incorrect", name ) return value
def _normalize_string(string: str) -> str: return string.replace(".", "_").replace("-", "_").replace(" ", "_")
def _is_threaded_cpython(abis: list[str]) -> bool: """ Determine if the ABI corresponds to a threaded (`--disable-gil`) build.
The threaded builds are indicated by a "t" in the abiflags. """ if len(abis) == 0: return False # expect e.g., cp313 m = re.match(r"cp\d+(.*)", abis[0]) if not m: return False abiflags = m.group(1) return "t" in abiflags
def _abi3_applies(python_version: PythonVersion, threading: bool) -> bool: """ Determine if the Python version supports abi3.
PEP 384 was first implemented in Python 3.2. The free-threaded builds do not support abi3. """ return len(python_version) > 1 and tuple(python_version) >= (3, 2) and not threading
def _abi3t_applies(python_version: PythonVersion, threading: bool) -> bool: """ Determine if the Python version supports abi3t.
PEP 803 was first implemented in Python 3.15 but, per PEP 803, this returns tags going back to Python 3.2 to mirror the abi3 implementation and leave open the possibility of abi3t wheels supporting older Python versions.
""" return len(python_version) > 1 and tuple(python_version) >= (3, 2) and threading
def _cpython_abis(py_version: PythonVersion, warn: bool = False) -> list[str]: py_version = tuple(py_version) # To allow for version comparison. abis = [] version = _version_nodot(py_version[:2]) threading = debug = pymalloc = ucs4 = "" with_debug = _get_config_var("Py_DEBUG", warn) has_refcount = hasattr(sys, "gettotalrefcount") # Windows doesn't set Py_DEBUG, so checking for support of debug-compiled # extension modules is the best option. # https://github.com/pypa/pip/issues/3383#issuecomment-173267692 has_ext = "_d.pyd" in EXTENSION_SUFFIXES if with_debug or (with_debug is None and (has_refcount or has_ext)): debug = "d" if py_version >= (3, 13) and _get_config_var("Py_GIL_DISABLED", warn): threading = "t" if py_version < (3, 8): with_pymalloc = _get_config_var("WITH_PYMALLOC", warn) if with_pymalloc or with_pymalloc is None: pymalloc = "m" if py_version < (3, 3): unicode_size = _get_config_var("Py_UNICODE_SIZE", warn) if unicode_size == 4 or ( unicode_size is None and sys.maxunicode == 0x10FFFF ): ucs4 = "u" elif debug: # Debug builds can also load "normal" extension modules. # We can also assume no UCS-4 or pymalloc requirement. abis.append(f"cp{version}{threading}") abis.insert(0, f"cp{version}{threading}{debug}{pymalloc}{ucs4}") return abis
def cpython_tags( python_version: PythonVersion | None = None, abis: Iterable[str] | None = None, platforms: Iterable[str] | None = None, *, warn: bool = False,) -> Iterator[Tag]: """ Yields the tags for the CPython interpreter.
The specific tags generated are:
- ``cp<python_version>-<abi>-<platform>`` - ``cp<python_version>-<stable_abi>-<platform>`` - ``cp<python_version>-none-<platform>`` - ``cp<older version>-<stable_abi>-<platform>`` where "older version" is all older minor versions down to Python 3.2 (when ``abi3`` was introduced)
If ``python_version`` only provides a major-only version then only user-provided ABIs via ``abis`` and the ``none`` ABI will be used.
The ``stable_abi`` will be either ``abi3`` or ``abi3t`` if `abi` is a GIL-enabled ABI like `"cp315"` or a free-threaded ABI like `"cp315t"`, respectively.
:param Sequence python_version: A one- or two-item sequence representing the targeted Python version. Defaults to ``sys.version_info[:2]``. :param Iterable abis: Iterable of compatible ABIs. Defaults to the ABIs compatible with the current system. :param Iterable platforms: Iterable of compatible platforms. Defaults to the platforms compatible with the current system. :param bool warn: Whether warnings should be logged. Defaults to ``False``. """ if not python_version: python_version = sys.version_info[:2]
interpreter = f"cp{_version_nodot(python_version[:2])}"
if abis is None: abis = _cpython_abis(python_version, warn) if len(python_version) > 1 else [] abis = list(abis) # 'abi3' and 'none' are explicitly handled later. for explicit_abi in ("abi3", "none"): try: abis.remove(explicit_abi) except ValueError: # noqa: PERF203 pass
platforms = list(platforms or platform_tags()) for abi in abis: for platform_ in platforms: yield Tag(interpreter, abi, platform_)
threading = _is_threaded_cpython(abis) use_abi3 = _abi3_applies(python_version, threading) use_abi3t = _abi3t_applies(python_version, threading)
if use_abi3: yield from (Tag(interpreter, "abi3", platform_) for platform_ in platforms) if use_abi3t: yield from (Tag(interpreter, "abi3t", platform_) for platform_ in platforms)
yield from (Tag(interpreter, "none", platform_) for platform_ in platforms)
if use_abi3 or use_abi3t: for minor_version in range(python_version[1] - 1, 1, -1): for platform_ in platforms: version = _version_nodot((python_version[0], minor_version)) interpreter = f"cp{version}" if use_abi3: yield Tag(interpreter, "abi3", platform_) if use_abi3t: # Support for abi3t was introduced in Python 3.15, but in # principle abi3t wheels are possible for older limited API # versions, so allow things like ("cp37", "abi3t", "platform") yield Tag(interpreter, "abi3t", platform_)
def _generic_abi() -> list[str]: """ Return the ABI tag based on EXT_SUFFIX. """ # The following are examples of `EXT_SUFFIX`. # We want to keep the parts which are related to the ABI and remove the # parts which are related to the platform: # - linux: '.cpython-310-x86_64-linux-gnu.so' => cp310 # - mac: '.cpython-310-darwin.so' => cp310 # - win: '.cp310-win_amd64.pyd' => cp310 # - win: '.pyd' => cp37 (uses _cpython_abis()) # - pypy: '.pypy38-pp73-x86_64-linux-gnu.so' => pypy38_pp73 # - graalpy: '.graalpy-38-native-x86_64-darwin.dylib' # => graalpy_38_native
ext_suffix = _get_config_var("EXT_SUFFIX", warn=True) if not isinstance(ext_suffix, str) or ext_suffix[0] != ".": raise SystemError("invalid sysconfig.get_config_var('EXT_SUFFIX')") parts = ext_suffix.split(".") if len(parts) < 3: # CPython3.7 and earlier uses ".pyd" on Windows. return _cpython_abis(sys.version_info[:2]) soabi = parts[1] if soabi.startswith("cpython"): # non-windows abi = "cp" + soabi.split("-")[1] elif soabi.startswith("cp"): # windows abi = soabi.split("-")[0] elif soabi.startswith("pypy"): abi = "-".join(soabi.split("-")[:2]) elif soabi.startswith("graalpy"): abi = "-".join(soabi.split("-")[:3]) elif soabi: # pyston, ironpython, others? abi = soabi else: return [] return [_normalize_string(abi)]
def generic_tags( interpreter: str | None = None, abis: Iterable[str] | None = None, platforms: Iterable[str] | None = None, *, warn: bool = False,) -> Iterator[Tag]: """ Yields the tags for an interpreter which requires no specialization.
This function should be used if one of the other interpreter-specific functions provided by this module is not appropriate (i.e. not calculating tags for a CPython interpreter).
The specific tags generated are:
- ``<interpreter>-<abi>-<platform>``
The ``"none"`` ABI will be added if it was not explicitly provided.
:param str interpreter: The name of the interpreter. Defaults to being calculated. :param Iterable abis: Iterable of compatible ABIs. Defaults to the ABIs compatible with the current system. :param Iterable platforms: Iterable of compatible platforms. Defaults to the platforms compatible with the current system. :param bool warn: Whether warnings should be logged. Defaults to ``False``. """ if not interpreter: interp_name = interpreter_name() interp_version = interpreter_version(warn=warn) interpreter = f"{interp_name}{interp_version}" abis = _generic_abi() if abis is None else list(abis) platforms = list(platforms or platform_tags()) if "none" not in abis: abis.append("none") for abi in abis: for platform_ in platforms: yield Tag(interpreter, abi, platform_)
def _py_interpreter_range(py_version: PythonVersion) -> Iterator[str]: """ Yields Python versions in descending order.
After the latest version, the major-only version will be yielded, and then all previous versions of that major version. """ if len(py_version) > 1: yield f"py{_version_nodot(py_version[:2])}" yield f"py{py_version[0]}" if len(py_version) > 1: for minor in range(py_version[1] - 1, -1, -1): yield f"py{_version_nodot((py_version[0], minor))}"
def compatible_tags( python_version: PythonVersion | None = None, interpreter: str | None = None, platforms: Iterable[str] | None = None,) -> Iterator[Tag]: """ Yields the tags for an interpreter compatible with the Python version specified by ``python_version``.
The specific tags generated are:
- ``py*-none-<platform>`` - ``<interpreter>-none-any`` if ``interpreter`` is provided - ``py*-none-any``
:param Sequence python_version: A one- or two-item sequence representing the compatible version of Python. Defaults to ``sys.version_info[:2]``. :param str interpreter: The name of the interpreter (if known), e.g. ``"cp38"``. Defaults to the current interpreter. :param Iterable platforms: Iterable of compatible platforms. Defaults to the platforms compatible with the current system. """ if not python_version: python_version = sys.version_info[:2] platforms = list(platforms or platform_tags()) for version in _py_interpreter_range(python_version): for platform_ in platforms: yield Tag(version, "none", platform_) if interpreter: yield Tag(interpreter, "none", "any") for version in _py_interpreter_range(python_version): yield Tag(version, "none", "any")
def _mac_arch(arch: str, is_32bit: bool = _32_BIT_INTERPRETER) -> str: if not is_32bit: return arch
if arch.startswith("ppc"): return "ppc"
return "i386"
def _mac_binary_formats(version: AppleVersion, cpu_arch: str) -> list[str]: formats = [cpu_arch] if cpu_arch == "x86_64": if version < (10, 4): return [] formats.extend(["intel", "fat64", "fat32"])
elif cpu_arch == "i386": if version < (10, 4): return [] formats.extend(["intel", "fat32", "fat"])
elif cpu_arch == "ppc64": # TODO: Need to care about 32-bit PPC for ppc64 through 10.2? if version > (10, 5) or version < (10, 4): return [] formats.append("fat64")
elif cpu_arch == "ppc": if version > (10, 6): return [] formats.extend(["fat32", "fat"])
if cpu_arch in {"arm64", "x86_64"}: formats.append("universal2")
if cpu_arch in {"x86_64", "i386", "ppc64", "ppc", "intel"}: formats.append("universal")
return formats
def mac_platforms( version: AppleVersion | None = None, arch: str | None = None) -> Iterator[str]: """ Yields the :attr:`~Tag.platform` tags for macOS.
The `version` parameter is a two-item tuple specifying the macOS version to generate platform tags for. The `arch` parameter is the CPU architecture to generate platform tags for. Both parameters default to the appropriate value for the current system.
:param tuple version: A two-item tuple representing the version of macOS. Defaults to the current system's version. :param str arch: The CPU architecture. Defaults to the architecture of the current system, e.g. ``"x86_64"``.
.. note:: Equivalent support for the other major platforms is purposefully not provided:
- On Windows, platform compatibility is statically specified - On Linux, code must be run on the system itself to determine compatibility """ version_str, _, cpu_arch = platform.mac_ver() if version is None: version = cast("AppleVersion", tuple(map(int, version_str.split(".")[:2]))) if version == (10, 16): # When built against an older macOS SDK, Python will report macOS 10.16 # instead of the real version. version_str = subprocess.run( [ sys.executable, "-sS", "-c", "import platform; print(platform.mac_ver()[0])", ], check=True, env={"SYSTEM_VERSION_COMPAT": "0"}, stdout=subprocess.PIPE, text=True, ).stdout version = cast("AppleVersion", tuple(map(int, version_str.split(".")[:2])))
if arch is None: arch = _mac_arch(cpu_arch)
if (10, 0) <= version < (11, 0): # Prior to Mac OS 11, each yearly release of Mac OS bumped the # "minor" version number. The major version was always 10. major_version = 10 for minor_version in range(version[1], -1, -1): compat_version = major_version, minor_version binary_formats = _mac_binary_formats(compat_version, arch) for binary_format in binary_formats: yield f"macosx_{major_version}_{minor_version}_{binary_format}"
if version >= (11, 0): # Starting with Mac OS 11, each yearly release bumps the major version # number. The minor versions are now the midyear updates. minor_version = 0 for major_version in range(version[0], 10, -1): compat_version = major_version, minor_version binary_formats = _mac_binary_formats(compat_version, arch) for binary_format in binary_formats: yield f"macosx_{major_version}_{minor_version}_{binary_format}"
if version >= (11, 0): # Mac OS 11 on x86_64 is compatible with binaries from previous releases. # Arm64 support was introduced in 11.0, so no Arm binaries from previous # releases exist. # # However, the "universal2" binary format can have a # macOS version earlier than 11.0 when the x86_64 part of the binary supports # that version of macOS. major_version = 10 if arch == "x86_64": for minor_version in range(16, 3, -1): compat_version = major_version, minor_version binary_formats = _mac_binary_formats(compat_version, arch) for binary_format in binary_formats: yield f"macosx_{major_version}_{minor_version}_{binary_format}" else: for minor_version in range(16, 3, -1): compat_version = major_version, minor_version binary_format = "universal2" yield f"macosx_{major_version}_{minor_version}_{binary_format}"
def ios_platforms( version: AppleVersion | None = None, multiarch: str | None = None) -> Iterator[str]: """
Yields the :attr:`~Tag.platform` tags for iOS.
:param tuple version: A two-item tuple representing the version of iOS. Defaults to the current system's version. :param str multiarch: The CPU architecture+ABI to be used. This should be in the format by ``sys.implementation._multiarch`` (e.g., ``arm64_iphoneos`` or ``x86_64_iphonesimulator``). Defaults to the current system's multiarch value.
.. note:: Behavior of this method is undefined if invoked on non-iOS platforms without providing explicit version and multiarch arguments. """ if version is None: # if iOS is the current platform, ios_ver *must* be defined. However, # it won't exist for CPython versions before 3.13, which causes a mypy # error. _, release, _, _ = platform.ios_ver() # type: ignore[attr-defined, unused-ignore] version = cast("AppleVersion", tuple(map(int, release.split(".")[:2])))
if multiarch is None: multiarch = sys.implementation._multiarch multiarch = multiarch.replace("-", "_")
ios_platform_template = "ios_{major}_{minor}_{multiarch}"
# Consider any iOS major.minor version from the version requested, down to # 12.0. 12.0 is the first iOS version that is known to have enough features # to support CPython. Consider every possible minor release up to X.9. There # highest the minor has ever gone is 8 (14.8 and 15.8) but having some extra # candidates that won't ever match doesn't really hurt, and it saves us from # having to keep an explicit list of known iOS versions in the code. Return # the results descending order of version number.
# If the requested major version is less than 12, there won't be any matches. if version[0] < 12: return
# Consider the actual X.Y version that was requested. yield ios_platform_template.format( major=version[0], minor=version[1], multiarch=multiarch )
# Consider every minor version from X.0 to the minor version prior to the # version requested by the platform. for minor in range(version[1] - 1, -1, -1): yield ios_platform_template.format( major=version[0], minor=minor, multiarch=multiarch )
for major in range(version[0] - 1, 11, -1): for minor in range(9, -1, -1): yield ios_platform_template.format( major=major, minor=minor, multiarch=multiarch )
def android_platforms( api_level: int | None = None, abi: str | None = None) -> Iterator[str]: """ Yields the :attr:`~Tag.platform` tags for Android. If this function is invoked on non-Android platforms, the ``api_level`` and ``abi`` arguments are required.
:param int api_level: The maximum `API level <https://developer.android.com/tools/releases/platforms>`__ to return. Defaults to the current system's version, as returned by ``platform.android_ver``. :param str abi: The `Android ABI <https://developer.android.com/ndk/guides/abis>`__, e.g. ``arm64_v8a``. Defaults to the current system's ABI , as returned by ``sysconfig.get_platform``. Hyphens and periods will be replaced with underscores. """ if platform.system() != "Android" and (api_level is None or abi is None): raise TypeError( "on non-Android platforms, the api_level and abi arguments are required" )
if api_level is None: # Python 3.13 was the first version to return platform.system() == "Android", # and also the first version to define platform.android_ver(). api_level = platform.android_ver().api_level # type: ignore[attr-defined]
if abi is None: abi = sysconfig.get_platform().split("-")[-1] abi = _normalize_string(abi)
# 16 is the minimum API level known to have enough features to support CPython # without major patching. Yield every API level from the maximum down to the # minimum, inclusive. min_api_level = 16 for ver in range(api_level, min_api_level - 1, -1): yield f"android_{ver}_{abi}"
def _linux_platforms(is_32bit: bool = _32_BIT_INTERPRETER) -> Iterator[str]: linux = _normalize_string(sysconfig.get_platform()) if not linux.startswith("linux_"): # we should never be here, just yield the sysconfig one and return yield linux return if is_32bit: if linux == "linux_x86_64": linux = "linux_i686" elif linux == "linux_aarch64": linux = "linux_armv8l" _, arch = linux.split("_", 1) archs = {"armv8l": ["armv8l", "armv7l"]}.get(arch, [arch]) yield from _manylinux.platform_tags(archs) yield from _musllinux.platform_tags(archs) for arch in archs: yield f"linux_{arch}"
def _emscripten_platforms() -> Iterator[str]: pyemscripten_platform_version = sysconfig.get_config_var( "PYEMSCRIPTEN_PLATFORM_VERSION" ) if pyemscripten_platform_version: yield f"pyemscripten_{pyemscripten_platform_version}_wasm32" yield from _generic_platforms()
def _generic_platforms() -> Iterator[str]: yield _normalize_string(sysconfig.get_platform())
def platform_tags() -> Iterator[str]: """ Yields the :attr:`~Tag.platform` tags for the running interpreter. """ if platform.system() == "Darwin": return mac_platforms() elif platform.system() == "iOS": return ios_platforms() elif platform.system() == "Android": return android_platforms() elif platform.system() == "Linux": return _linux_platforms() elif platform.system() == "Emscripten": return _emscripten_platforms() else: return _generic_platforms()
def interpreter_name() -> str: """ Returns the name of the running interpreter.
Some implementations have a reserved, two-letter abbreviation which will be returned when appropriate.
This typically acts as the prefix to the :attr:`~Tag.interpreter` tag. """ name = sys.implementation.name return INTERPRETER_SHORT_NAMES.get(name) or name
def interpreter_version(*, warn: bool = False) -> str: """ Returns the running interpreter's version.
This typically acts as the suffix to the :attr:`~Tag.interpreter` tag.
:param bool warn: Whether warnings should be logged. Defaults to ``False``. """ version = _get_config_var("py_version_nodot", warn=warn) return str(version) if version else _version_nodot(sys.version_info[:2])
def _version_nodot(version: PythonVersion) -> str: return "".join(map(str, version))
def sys_tags(*, warn: bool = False) -> Iterator[Tag]: """ Yields the sequence of tag triples that the running interpreter supports.
The iterable is ordered so that the best-matching tag is first in the sequence. The exact preferential order to tags is interpreter-specific, but in general the tag importance is in the order of:
1. Interpreter 2. Platform 3. ABI
This order is due to the fact that an ABI is inherently tied to the platform, but platform-specific code is not necessarily tied to the ABI. The interpreter is the most important tag as it dictates basic support for any wheel.
The function returns an iterable in order to allow for the possible short-circuiting of tag generation if the entire sequence is not necessary and tag calculation happens to be expensive.
:param bool warn: Whether warnings should be logged. Defaults to ``False``.
.. versionchanged:: 21.3 Added the `pp3-none-any` tag (:issue:`311`). .. versionchanged:: 27.0 Added the `abi3t` tag (:issue:`1099`). """
interp_name = interpreter_name() if interp_name == "cp": yield from cpython_tags(warn=warn) else: yield from generic_tags()
if interp_name == "pp": interp = "pp3" elif interp_name == "cp": interp = "cp" + interpreter_version(warn=warn) else: interp = None yield from compatible_tags(interpreter=interp)
def create_compatible_tags_selector( tags: Iterable[Tag],) -> Callable[[Iterable[tuple[_T, AbstractSet[Tag]]]], Iterator[_T]]: """Create a callable to select things compatible with supported tags.
This function accepts an ordered sequence of tags, with the preferred tags first.
The returned callable accepts an iterable of tuples (thing, set[Tag]), and returns an iterator of things, with the things with the best matching tags first.
Example to select compatible wheel filenames:
>>> from packaging import tags >>> from packaging.utils import parse_wheel_filename >>> selector = tags.create_compatible_tags_selector(tags.sys_tags()) >>> filenames = ["foo-1.0-py3-none-any.whl", "foo-1.0-py2-none-any.whl"] >>> list(selector([ ... (filename, parse_wheel_filename(filename)[-1]) for filename in filenames ... ])) ['foo-1.0-py3-none-any.whl']
.. versionadded:: 26.1 """ tag_ranks: dict[Tag, int] = {} for rank, tag in enumerate(tags): tag_ranks.setdefault(tag, rank) # ignore duplicate tags, keep first supported_tags = tag_ranks.keys()
def selector( tagged_things: Iterable[tuple[_T, AbstractSet[Tag]]], ) -> Iterator[_T]: ranked_things: list[tuple[_T, int]] = [] for thing, thing_tags in tagged_things: supported_thing_tags = thing_tags & supported_tags if supported_thing_tags: thing_rank = min(tag_ranks[t] for t in supported_thing_tags) ranked_things.append((thing, thing_rank)) return iter( thing for thing, _ in sorted(ranked_things, key=operator.itemgetter(1)) )
return selector123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296# This file is dual licensed under the terms of the Apache License, Version# 2.0, and the BSD License. See the LICENSE file in the root of this repository# for complete details.
from __future__ import annotations
import refrom typing import NewType, Tuple, Union, cast
from .tags import Tag, UnsortedTagsError, parse_tagfrom .version import InvalidVersion, Version, _TrimmedRelease
__all__ = [ "BuildTag", "InvalidName", "InvalidSdistFilename", "InvalidWheelFilename", "NormalizedName", "canonicalize_name", "canonicalize_version", "is_normalized_name", "parse_sdist_filename", "parse_wheel_filename",]
def __dir__() -> list[str]: return __all__
BuildTag = Union[Tuple[()], Tuple[int, str]]
NormalizedName = NewType("NormalizedName", str)"""A :class:`typing.NewType` of :class:`str`, representing a normalized name."""
class InvalidName(ValueError): """ An invalid distribution name; users should refer to the packaging user guide. """
class InvalidWheelFilename(ValueError): """ An invalid wheel filename was found, users should refer to PEP 427. """
class InvalidSdistFilename(ValueError): """ An invalid sdist filename was found, users should refer to the packaging user guide. """
# Core metadata spec for `Name`_validate_regex = re.compile( r"[a-z0-9]|[a-z0-9][a-z0-9._-]*[a-z0-9]", re.IGNORECASE | re.ASCII)_normalized_regex = re.compile(r"[a-z0-9]|[a-z0-9]([a-z0-9-](?!--))*[a-z0-9]", re.ASCII)# PEP 427: The build number must start with a digit._build_tag_regex = re.compile(r"(\d+)(.*)", re.ASCII)
def canonicalize_name(name: str, *, validate: bool = False) -> NormalizedName: """ This function takes a valid Python package or extra name, and returns the normalized form of it.
The return type is typed as :class:`NormalizedName`. This allows type checkers to help require that a string has passed through this function before use.
If **validate** is true, then the function will check if **name** is a valid distribution name before normalizing.
:param str name: The name to normalize. :param bool validate: Check whether the name is a valid distribution name. :raises InvalidName: If **validate** is true and the name is not an acceptable distribution name.
>>> from packaging.utils import canonicalize_name >>> canonicalize_name("Django") 'django' >>> canonicalize_name("oslo.concurrency") 'oslo-concurrency' >>> canonicalize_name("requests") 'requests' """ if validate and not _validate_regex.fullmatch(name): raise InvalidName(f"name is invalid: {name!r}") # Ensure all ``.`` and ``_`` are ``-`` # Emulates ``re.sub(r"[-_.]+", "-", name).lower()`` from PEP 503 # Much faster than re, and even faster than str.translate value = name.lower().replace("_", "-").replace(".", "-") # Condense repeats (faster than regex) while "--" in value: value = value.replace("--", "-") return cast("NormalizedName", value)
def is_normalized_name(name: str) -> bool: """ Check if a name is already normalized (i.e. :func:`canonicalize_name` would roundtrip to the same value).
:param str name: The name to check.
>>> from packaging.utils import is_normalized_name >>> is_normalized_name("requests") True >>> is_normalized_name("Django") False """ return _normalized_regex.fullmatch(name) is not None
def canonicalize_version( version: Version | str, *, strip_trailing_zero: bool = True) -> str: """Return a canonical form of a version as a string.
This function takes a string representing a package version (or a :class:`~packaging.version.Version` instance), and returns the normalized form of it. By default, it strips trailing zeros from the release segment.
>>> from packaging.utils import canonicalize_version >>> canonicalize_version('1.0.1') '1.0.1'
Per PEP 625, versions may have multiple canonical forms, differing only by trailing zeros.
>>> canonicalize_version('1.0.0') '1' >>> canonicalize_version('1.0.0', strip_trailing_zero=False) '1.0.0'
Invalid versions are returned unaltered.
>>> canonicalize_version('foo bar baz') 'foo bar baz'
>>> canonicalize_version('1.4.0.0.0') '1.4' """ if isinstance(version, str): try: version = Version(version) except InvalidVersion: return str(version) return str(_TrimmedRelease(version) if strip_trailing_zero else version)
def parse_wheel_filename( filename: str, *, validate_order: bool = False,) -> tuple[NormalizedName, Version, BuildTag, frozenset[Tag]]: """ This function takes the filename of a wheel file, and parses it, returning a tuple of name, version, build number, and tags.
The name part of the tuple is normalized and typed as :class:`NormalizedName`. The version portion is an instance of :class:`~packaging.version.Version`. The build number is ``()`` if there is no build number in the wheel filename, otherwise a two-item tuple of an integer for the leading digits and a string for the rest of the build number. The tags portion is a frozen set of :class:`~packaging.tags.Tag` instances (as the tag string format allows multiple tags to be combined into a single string).
If **validate_order** is true, compressed tag set components are checked to be in sorted order as required by PEP 425.
:param str filename: The name of the wheel file. :param bool validate_order: Check whether compressed tag set components are in sorted order. :raises InvalidWheelFilename: If the filename in question does not follow the :ref:`wheel specification <pypug:binary-distribution-format>`.
>>> from packaging.utils import parse_wheel_filename >>> from packaging.tags import Tag >>> from packaging.version import Version >>> name, ver, build, tags = parse_wheel_filename("foo-1.0-py3-none-any.whl") >>> name 'foo' >>> ver == Version('1.0') True >>> tags == {Tag("py3", "none", "any")} True >>> not build True
.. versionadded:: 26.1 The *validate_order* parameter. """ if not filename.endswith(".whl"): raise InvalidWheelFilename( f"Invalid wheel filename (extension must be '.whl'): {filename!r}" )
filename = filename[:-4] dashes = filename.count("-") if dashes not in (4, 5): raise InvalidWheelFilename( f"Invalid wheel filename (wrong number of parts): {filename!r}" )
parts = filename.split("-", dashes - 2) name_part = parts[0] # See PEP 427 for the rules on escaping the project name. if "__" in name_part or re.match(r"^[\w\d._]*$", name_part, re.UNICODE) is None: raise InvalidWheelFilename(f"Invalid project name: {filename!r}") name = canonicalize_name(name_part)
try: version = Version(parts[1]) except InvalidVersion as e: raise InvalidWheelFilename( f"Invalid wheel filename (invalid version): {filename!r}" ) from e
if dashes == 5: build_part = parts[2] build_match = _build_tag_regex.match(build_part) if build_match is None: raise InvalidWheelFilename( f"Invalid build number: {build_part} in {filename!r}" ) build = cast("BuildTag", (int(build_match.group(1)), build_match.group(2))) else: build = () tag_str = parts[-1] try: tags = parse_tag(tag_str, validate_order=validate_order) except UnsortedTagsError: raise InvalidWheelFilename( f"Invalid wheel filename (compressed tag set components must be in " f"sorted order per PEP 425): {filename!r}" ) from None return (name, version, build, tags)
def parse_sdist_filename(filename: str) -> tuple[NormalizedName, Version]: """ This function takes the filename of a sdist file (as specified in the `Source distribution format`_ documentation), and parses it, returning a tuple of the normalized name and version as represented by an instance of :class:`~packaging.version.Version`.
:param str filename: The name of the sdist file. :raises InvalidSdistFilename: If the filename does not end with an sdist extension (``.zip`` or ``.tar.gz``), or if it does not contain a dash separating the name and the version of the distribution.
>>> from packaging.utils import parse_sdist_filename >>> from packaging.version import Version >>> name, ver = parse_sdist_filename("foo-1.0.tar.gz") >>> name 'foo' >>> ver == Version('1.0') True
.. _Source distribution format: https://packaging.python.org/specifications/source-distribution-format/#source-distribution-file-name """ if filename.endswith(".tar.gz"): file_stem = filename[: -len(".tar.gz")] elif filename.endswith(".zip"): file_stem = filename[: -len(".zip")] else: raise InvalidSdistFilename( f"Invalid sdist filename (extension must be '.tar.gz' or '.zip'):" f" {filename!r}" )
# We are requiring a PEP 440 version, which cannot contain dashes, # so we split on the last dash. name_part, sep, version_part = file_stem.rpartition("-") if not sep: raise InvalidSdistFilename(f"Invalid sdist filename: {filename!r}")
name = canonicalize_name(name_part)
try: version = Version(version_part) except InvalidVersion as e: raise InvalidSdistFilename( f"Invalid sdist filename (invalid version): {filename!r}" ) from e
return (name, version)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231# This file is dual licensed under the terms of the Apache License, Version# 2.0, and the BSD License. See the LICENSE file in the root of this repository# for complete details.""".. testsetup::
from pip._vendor.packaging.version import parse, normalize_pre, Version, _cmpkey"""
from __future__ import annotations
import reimport sysimport typingfrom typing import ( Any, Callable, Literal, NamedTuple, SupportsInt, Tuple, TypedDict, Union,)
if typing.TYPE_CHECKING: from typing_extensions import Self, Unpack
if sys.version_info >= (3, 13): # pragma: no cover from warnings import deprecated as _deprecatedelif typing.TYPE_CHECKING: from typing_extensions import deprecated as _deprecatedelse: # pragma: no cover import functools import warnings
def _deprecated(message: str) -> object: def decorator(func: Callable[[...], object]) -> object: @functools.wraps(func) def wrapper(*args: object, **kwargs: object) -> object: warnings.warn( message, category=DeprecationWarning, stacklevel=2, ) return func(*args, **kwargs)
return wrapper
return decorator
_LETTER_NORMALIZATION = { "alpha": "a", "beta": "b", "c": "rc", "pre": "rc", "preview": "rc", "rev": "post", "r": "post",}
__all__ = ["VERSION_PATTERN", "InvalidVersion", "Version", "normalize_pre", "parse"]
def __dir__() -> list[str]: return __all__
LocalType = Tuple[Union[int, str], ...]
CmpLocalType = Tuple[Tuple[int, str], ...]CmpSuffix = Tuple[int, int, int, int, int, int]CmpKey = Union[ Tuple[int, Tuple[int, ...], CmpSuffix], Tuple[int, Tuple[int, ...], CmpSuffix, CmpLocalType],]VersionComparisonMethod = Callable[[CmpKey, CmpKey], bool]
class _VersionReplace(TypedDict, total=False): epoch: int | None release: tuple[int, ...] | None pre: tuple[str, int] | None post: int | None dev: int | None local: str | None
def normalize_pre(letter: str, /) -> str: """Normalize the pre-release segment of a version string.
Returns a lowercase version of the string if not a known pre-release identifier.
>>> normalize_pre('alpha') 'a' >>> normalize_pre('BETA') 'b' >>> normalize_pre('rc') 'rc'
:param letter:
.. versionadded:: 26.1 """ letter = letter.lower() return _LETTER_NORMALIZATION.get(letter, letter)
def parse(version: str) -> Version: """Parse the given version string.
This is identical to the :class:`Version` constructor.
>>> parse('1.0.dev1') <Version('1.0.dev1')>
:param version: The version string to parse. :raises InvalidVersion: When the version string is not a valid version. """ return Version(version)
class InvalidVersion(ValueError): """Raised when a version string is not a valid version.
>>> Version("invalid") Traceback (most recent call last): ... packaging.version.InvalidVersion: Invalid version: 'invalid' """
class _BaseVersion: __slots__ = ()
# This can also be a normal member (see the packaging_legacy package); # we are just requiring it to be readable. Actually defining a property # has runtime effect on subclasses, so it's typing only. if typing.TYPE_CHECKING:
@property def _key(self) -> tuple[Any, ...]: ...
def __hash__(self) -> int: return hash(self._key)
# Please keep the duplicated `isinstance` check # in the six comparisons hereunder # unless you find a way to avoid adding overhead function calls. def __lt__(self, other: _BaseVersion) -> bool: if not isinstance(other, _BaseVersion): return NotImplemented
return self._key < other._key
def __le__(self, other: _BaseVersion) -> bool: if not isinstance(other, _BaseVersion): return NotImplemented
return self._key <= other._key
def __eq__(self, other: object) -> bool: if not isinstance(other, _BaseVersion): return NotImplemented
return self._key == other._key
def __ge__(self, other: _BaseVersion) -> bool: if not isinstance(other, _BaseVersion): return NotImplemented
return self._key >= other._key
def __gt__(self, other: _BaseVersion) -> bool: if not isinstance(other, _BaseVersion): return NotImplemented
return self._key > other._key
def __ne__(self, other: object) -> bool: if not isinstance(other, _BaseVersion): return NotImplemented
return self._key != other._key
# Deliberately not anchored to the start and end of the string, to make it# easier for 3rd party code to reuse
# Note that ++ doesn't behave identically on CPython and PyPy, so not using it here_VERSION_PATTERN = r""" v?+ # optional leading v (?a: (?:(?P<epoch>[0-9]+)!)?+ # epoch (?P<release>[0-9]+(?:\.[0-9]+)*+) # release segment (?P<pre> # pre-release [._-]?+ (?P<pre_l>alpha|a|beta|b|preview|pre|c|rc) [._-]?+ (?P<pre_n>[0-9]+)? )?+ (?P<post> # post release (?:-(?P<post_n1>[0-9]+)) | (?: [._-]? (?P<post_l>post|rev|r) [._-]? (?P<post_n2>[0-9]+)? ) )?+ (?P<dev> # dev release [._-]?+ (?P<dev_l>dev) [._-]?+ (?P<dev_n>[0-9]+)? )?+ ) (?a:\+ (?P<local> # local version [a-z0-9]+ (?:[._-][a-z0-9]+)*+ ) )?+"""
_VERSION_PATTERN_OLD = _VERSION_PATTERN.replace("*+", "*").replace("?+", "?")
# Possessive qualifiers were added in Python 3.11.# CPython 3.11.0-3.11.4 had a bug: https://github.com/python/cpython/pull/107795# Older PyPy also had a bug.VERSION_PATTERN = ( _VERSION_PATTERN_OLD if (sys.implementation.name == "cpython" and sys.version_info < (3, 11, 5)) or (sys.implementation.name == "pypy" and sys.version_info < (3, 11, 13)) or sys.version_info < (3, 11) else _VERSION_PATTERN)"""A string containing the regular expression used to match a valid version.
The pattern is not anchored at either end, and is intended for embedding in largerexpressions (for example, matching a version number as part of a file name). Theregular expression should be compiled with the ``re.VERBOSE`` and ``re.IGNORECASE``flags set.
.. versionchanged:: 26.0
The regex now uses possessive qualifiers on Python 3.11 if they are supported (CPython 3.11.5+, PyPy 3.11.13+).
:meta hide-value:"""
# Validation pattern for local version in replace()_LOCAL_PATTERN = re.compile(r"[a-z0-9]+(?:[._-][a-z0-9]+)*", re.IGNORECASE | re.ASCII)
# Fast path: If a version has only digits and dots then we# can skip the regex and parse it as a release segment_SIMPLE_VERSION_INDICATORS = frozenset(".0123456789")
def _validate_epoch(value: object, /) -> int: epoch = value or 0 if isinstance(epoch, int) and epoch >= 0: return epoch msg = f"epoch must be non-negative integer, got {epoch}" raise InvalidVersion(msg)
def _validate_release(value: object, /) -> tuple[int, ...]: release = (0,) if value is None else value if ( isinstance(release, tuple) and len(release) > 0 and all(isinstance(i, int) and i >= 0 for i in release) ): return release msg = f"release must be a non-empty tuple of non-negative integers, got {release}" raise InvalidVersion(msg)
def _validate_pre(value: object, /) -> tuple[Literal["a", "b", "rc"], int] | None: if value is None: return value if isinstance(value, tuple) and len(value) == 2: letter, number = value letter = normalize_pre(letter) if letter in {"a", "b", "rc"} and isinstance(number, int) and number >= 0: # type checkers can't infer the Literal type here on letter return (letter, number) # type: ignore[return-value] msg = f"pre must be a tuple of ('a'|'b'|'rc', non-negative int), got {value}" raise InvalidVersion(msg)
def _validate_post(value: object, /) -> tuple[Literal["post"], int] | None: if value is None: return value if isinstance(value, int) and value >= 0: return ("post", value) msg = f"post must be non-negative integer, got {value}" raise InvalidVersion(msg)
def _validate_dev(value: object, /) -> tuple[Literal["dev"], int] | None: if value is None: return value if isinstance(value, int) and value >= 0: return ("dev", value) msg = f"dev must be non-negative integer, got {value}" raise InvalidVersion(msg)
def _validate_local(value: object, /) -> LocalType | None: if value is None: return value if isinstance(value, str) and _LOCAL_PATTERN.fullmatch(value): return _parse_local_version(value) msg = f"local must be a valid version string, got {value!r}" raise InvalidVersion(msg)
# Backward compatibility for internals before 26.0. Do not use.class _Version(NamedTuple): epoch: int release: tuple[int, ...] dev: tuple[Literal["dev"], int] | None pre: tuple[Literal["a", "b", "rc"], int] | None post: tuple[Literal["post"], int] | None local: LocalType | None
class Version(_BaseVersion): """This class abstracts handling of a project's versions.
A :class:`Version` instance is comparison aware and can be compared and sorted using the standard Python interfaces.
>>> v1 = Version("1.0a5") >>> v2 = Version("1.0") >>> v1 <Version('1.0a5')> >>> v2 <Version('1.0')> >>> v1 < v2 True >>> v1 == v2 False >>> v1 > v2 False >>> v1 >= v2 False >>> v1 <= v2 True
:class:`Version` is immutable; use :meth:`__replace__` to change part of a version.
Instances are safe to serialize with :mod:`pickle`. They use a stable format so the same pickle can be loaded in future packaging releases.
.. versionchanged:: 26.2
Added a stable pickle format. Pickles created with packaging 26.2+ can be unpickled with future releases. Backward compatibility with pickles from pip._vendor.packaging < 26.2 is supported but may be removed in a future release. """
__slots__ = ( "_dev", "_epoch", "_hash_cache", "_key_cache", "_local", "_post", "_pre", "_release", ) __match_args__ = ("_str",) """ Pattern matching is supported on Python 3.10+.
.. versionadded:: 26.0
:meta hide-value: """
_regex = re.compile(r"\s*" + VERSION_PATTERN + r"\s*", re.VERBOSE | re.IGNORECASE)
_epoch: int _release: tuple[int, ...] _dev: tuple[Literal["dev"], int] | None _pre: tuple[Literal["a", "b", "rc"], int] | None _post: tuple[Literal["post"], int] | None _local: LocalType | None
_hash_cache: int | None _key_cache: CmpKey | None
def __init__(self, version: str) -> None: """Initialize a Version object.
:param version: The string representation of a version which will be parsed and normalized before use. :raises InvalidVersion: If the ``version`` does not conform to PEP 440 in any way then this exception will be raised. """ if _SIMPLE_VERSION_INDICATORS.issuperset(version): try: self._release = tuple(map(int, version.split("."))) except ValueError: # Empty parts (from "1..2", ".1", etc.) are invalid versions. # Any other ValueError (e.g. int str-digits limit) should # propagate to the caller. if "" in version.split("."): raise InvalidVersion(f"Invalid version: {version!r}") from None # TODO: remove "no cover" when Python 3.9 is dropped. raise # pragma: no cover
self._epoch = 0 self._pre = None self._post = None self._dev = None self._local = None self._key_cache = None self._hash_cache = None return
# Validate the version and parse it into pieces match = self._regex.fullmatch(version) if not match: raise InvalidVersion(f"Invalid version: {version!r}") self._epoch = int(match.group("epoch")) if match.group("epoch") else 0 self._release = tuple(map(int, match.group("release").split("."))) # We can type ignore the assignments below because the regex guarantees # the correct strings self._pre = _parse_letter_version(match.group("pre_l"), match.group("pre_n")) # type: ignore[assignment] self._post = _parse_letter_version( # type: ignore[assignment] match.group("post_l"), match.group("post_n1") or match.group("post_n2") ) self._dev = _parse_letter_version(match.group("dev_l"), match.group("dev_n")) # type: ignore[assignment] self._local = _parse_local_version(match.group("local"))
# Key which will be used for sorting self._key_cache = None self._hash_cache = None
@classmethod def from_parts( cls, *, epoch: int = 0, release: tuple[int, ...], pre: tuple[str, int] | None = None, post: int | None = None, dev: int | None = None, local: str | None = None, ) -> Self: """ Return a new version composed of the various parts.
This allows you to build a version without going though a string and running a regular expression. It normalizes pre-release strings. The ``release=`` keyword argument is required.
>>> Version.from_parts(release=(1,2,3)) <Version('1.2.3')> >>> Version.from_parts(release=(0,1,0), pre=("b", 1)) <Version('0.1.0b1')>
:param epoch: :param release: This version tuple is required
.. versionadded:: 26.1 """ _epoch = _validate_epoch(epoch) _release = _validate_release(release) _pre = _validate_pre(pre) if pre is not None else None _post = _validate_post(post) if post is not None else None _dev = _validate_dev(dev) if dev is not None else None _local = _validate_local(local) if local is not None else None
new_version = cls.__new__(cls) new_version._key_cache = None new_version._hash_cache = None new_version._epoch = _epoch new_version._release = _release new_version._pre = _pre new_version._post = _post new_version._dev = _dev new_version._local = _local
return new_version
def __replace__(self, **kwargs: Unpack[_VersionReplace]) -> Self: """ __replace__(*, epoch=..., release=..., pre=..., post=..., dev=..., local=...)
Return a new version with parts replaced.
This returns a new version (unless no parts were changed). The pre-release is normalized. Setting a value to ``None`` clears it.
>>> v = Version("1.2.3") >>> v.__replace__(pre=("a", 1)) <Version('1.2.3a1')>
:param int | None epoch: :param tuple[int, ...] | None release: :param tuple[str, int] | None pre: :param int | None post: :param int | None dev: :param str | None local:
.. versionadded:: 26.0 .. versionchanged:: 26.1
The pre-release portion is now normalized. """ epoch = _validate_epoch(kwargs["epoch"]) if "epoch" in kwargs else self._epoch release = ( _validate_release(kwargs["release"]) if "release" in kwargs else self._release ) pre = _validate_pre(kwargs["pre"]) if "pre" in kwargs else self._pre post = _validate_post(kwargs["post"]) if "post" in kwargs else self._post dev = _validate_dev(kwargs["dev"]) if "dev" in kwargs else self._dev local = _validate_local(kwargs["local"]) if "local" in kwargs else self._local
if ( epoch == self._epoch and release == self._release and pre == self._pre and post == self._post and dev == self._dev and local == self._local ): return self
new_version = self.__class__.__new__(self.__class__) new_version._key_cache = None new_version._hash_cache = None new_version._epoch = epoch new_version._release = release new_version._pre = pre new_version._post = post new_version._dev = dev new_version._local = local
return new_version
@property def _key(self) -> CmpKey: if self._key_cache is None: self._key_cache = _cmpkey( self._epoch, self._release, self._pre, self._post, self._dev, self._local, ) return self._key_cache
# __hash__ must be defined when __eq__ is overridden, # otherwise Python sets __hash__ to None. def __hash__(self) -> int: if (cached_hash := self._hash_cache) is not None: return cached_hash
if (key := self._key_cache) is None: self._key_cache = key = _cmpkey( self._epoch, self._release, self._pre, self._post, self._dev, self._local, ) self._hash_cache = cached_hash = hash(key) return cached_hash
# Override comparison methods to use direct _key_cache access # This is faster than property access, especially before Python 3.12 def __lt__(self, other: _BaseVersion) -> bool: if isinstance(other, Version): if self._key_cache is None: self._key_cache = _cmpkey( self._epoch, self._release, self._pre, self._post, self._dev, self._local, ) if other._key_cache is None: other._key_cache = _cmpkey( other._epoch, other._release, other._pre, other._post, other._dev, other._local, ) return self._key_cache < other._key_cache
if not isinstance(other, _BaseVersion): return NotImplemented
return super().__lt__(other)
def __le__(self, other: _BaseVersion) -> bool: if isinstance(other, Version): if self._key_cache is None: self._key_cache = _cmpkey( self._epoch, self._release, self._pre, self._post, self._dev, self._local, ) if other._key_cache is None: other._key_cache = _cmpkey( other._epoch, other._release, other._pre, other._post, other._dev, other._local, ) return self._key_cache <= other._key_cache
if not isinstance(other, _BaseVersion): return NotImplemented
return super().__le__(other)
def __eq__(self, other: object) -> bool: if isinstance(other, Version): if self._key_cache is None: self._key_cache = _cmpkey( self._epoch, self._release, self._pre, self._post, self._dev, self._local, ) if other._key_cache is None: other._key_cache = _cmpkey( other._epoch, other._release, other._pre, other._post, other._dev, other._local, ) return self._key_cache == other._key_cache
if not isinstance(other, _BaseVersion): return NotImplemented
return super().__eq__(other)
def __ge__(self, other: _BaseVersion) -> bool: if isinstance(other, Version): if self._key_cache is None: self._key_cache = _cmpkey( self._epoch, self._release, self._pre, self._post, self._dev, self._local, ) if other._key_cache is None: other._key_cache = _cmpkey( other._epoch, other._release, other._pre, other._post, other._dev, other._local, ) return self._key_cache >= other._key_cache
if not isinstance(other, _BaseVersion): return NotImplemented
return super().__ge__(other)
def __gt__(self, other: _BaseVersion) -> bool: if isinstance(other, Version): if self._key_cache is None: self._key_cache = _cmpkey( self._epoch, self._release, self._pre, self._post, self._dev, self._local, ) if other._key_cache is None: other._key_cache = _cmpkey( other._epoch, other._release, other._pre, other._post, other._dev, other._local, ) return self._key_cache > other._key_cache
if not isinstance(other, _BaseVersion): return NotImplemented
return super().__gt__(other)
def __ne__(self, other: object) -> bool: if isinstance(other, Version): if self._key_cache is None: self._key_cache = _cmpkey( self._epoch, self._release, self._pre, self._post, self._dev, self._local, ) if other._key_cache is None: other._key_cache = _cmpkey( other._epoch, other._release, other._pre, other._post, other._dev, other._local, ) return self._key_cache != other._key_cache
if not isinstance(other, _BaseVersion): return NotImplemented
return super().__ne__(other)
def __getstate__( self, ) -> tuple[ int, tuple[int, ...], tuple[str, int] | None, tuple[str, int] | None, tuple[str, int] | None, LocalType | None, ]: # Return state as a 6-item tuple for compactness: # (epoch, release, pre, post, dev, local) # Cache members are excluded and will be recomputed on demand return ( self._epoch, self._release, self._pre, self._post, self._dev, self._local, )
def __setstate__(self, state: object) -> None: # Always discard cached values — they may contain stale references # (e.g. packaging._structures.InfinityType from pre-26.1 pickles) # and will be recomputed on demand from the core fields above. self._key_cache = None self._hash_cache = None
if isinstance(state, tuple): if len(state) == 6: # New format (26.2+): (epoch, release, pre, post, dev, local) ( self._epoch, self._release, self._pre, self._post, self._dev, self._local, ) = state return if len(state) == 2: # Format (packaging 26.0-26.1): (None, {slot: value}). _, slot_dict = state if isinstance(slot_dict, dict): self._epoch = slot_dict["_epoch"] self._release = slot_dict["_release"] self._pre = slot_dict.get("_pre") self._post = slot_dict.get("_post") self._dev = slot_dict.get("_dev") self._local = slot_dict.get("_local") return if isinstance(state, dict): # Old format (packaging <= 25.x, no __slots__): state is a plain # dict with "_version" (_Version NamedTuple) and "_key" entries. version_nt = state.get("_version") if version_nt is not None: self._epoch = version_nt.epoch self._release = version_nt.release self._pre = version_nt.pre self._post = version_nt.post self._dev = version_nt.dev self._local = version_nt.local return
raise TypeError(f"Cannot restore Version from {state!r}")
@property @_deprecated("Version._version is private and will be removed soon") def _version(self) -> _Version: return _Version( self._epoch, self._release, self._dev, self._pre, self._post, self._local )
@_version.setter @_deprecated("Version._version is private and will be removed soon") def _version(self, value: _Version) -> None: self._epoch = value.epoch self._release = value.release self._dev = value.dev self._pre = value.pre self._post = value.post self._local = value.local self._key_cache = None self._hash_cache = None
def __repr__(self) -> str: """A representation of the Version that shows all internal state.
>>> Version('1.0.0') <Version('1.0.0')> """ return f"<{self.__class__.__name__}({str(self)!r})>"
def __str__(self) -> str: """A string representation of the version that can be round-tripped.
>>> str(Version("1.0a5")) '1.0a5' """ # This is a hot function, so not calling self.base_version version = ".".join(map(str, self.release))
# Epoch if self.epoch: version = f"{self.epoch}!{version}"
# Pre-release if self.pre is not None: version += "".join(map(str, self.pre))
# Post-release if self.post is not None: version += f".post{self.post}"
# Development release if self.dev is not None: version += f".dev{self.dev}"
# Local version segment if self.local is not None: version += f"+{self.local}"
return version
@property def _str(self) -> str: """Internal property for match_args""" return str(self)
@property def epoch(self) -> int: """The epoch of the version.
>>> Version("2.0.0").epoch 0 >>> Version("1!2.0.0").epoch 1 """ return self._epoch
@property def release(self) -> tuple[int, ...]: """The components of the "release" segment of the version.
>>> Version("1.2.3").release (1, 2, 3) >>> Version("2.0.0").release (2, 0, 0) >>> Version("1!2.0.0.post0").release (2, 0, 0)
Includes trailing zeroes but not the epoch or any pre-release / development / post-release suffixes. """ return self._release
@property def pre(self) -> tuple[Literal["a", "b", "rc"], int] | None: """The pre-release segment of the version.
>>> print(Version("1.2.3").pre) None >>> Version("1.2.3a1").pre ('a', 1) >>> Version("1.2.3b1").pre ('b', 1) >>> Version("1.2.3rc1").pre ('rc', 1) """ return self._pre
@property def post(self) -> int | None: """The post-release number of the version.
>>> print(Version("1.2.3").post) None >>> Version("1.2.3.post1").post 1 """ return self._post[1] if self._post else None
@property def dev(self) -> int | None: """The development number of the version.
>>> print(Version("1.2.3").dev) None >>> Version("1.2.3.dev1").dev 1 """ return self._dev[1] if self._dev else None
@property def local(self) -> str | None: """The local version segment of the version.
>>> print(Version("1.2.3").local) None >>> Version("1.2.3+abc").local 'abc' """ if self._local: return ".".join(str(x) for x in self._local) else: return None
@property def public(self) -> str: """The public portion of the version.
This returns a string. If you want a :class:`Version` again and care about performance, use ``v.__replace__(local=None)`` instead.
>>> Version("1.2.3").public '1.2.3' >>> Version("1.2.3+abc").public '1.2.3' >>> Version("1!1.2.3dev1+abc").public '1!1.2.3.dev1' """ return str(self).split("+", 1)[0]
@property def base_version(self) -> str: """The "base version" of the version.
This returns a string. If you want a :class:`Version` again and care about performance, use ``v.__replace__(pre=None, post=None, dev=None, local=None)`` instead.
>>> Version("1.2.3").base_version '1.2.3' >>> Version("1.2.3+abc").base_version '1.2.3' >>> Version("1!1.2.3dev1+abc").base_version '1!1.2.3'
The "base version" is the public version of the project without any pre or post release markers. """ release_segment = ".".join(map(str, self.release)) return f"{self.epoch}!{release_segment}" if self.epoch else release_segment
@property def is_prerelease(self) -> bool: """Whether this version is a pre-release.
>>> Version("1.2.3").is_prerelease False >>> Version("1.2.3a1").is_prerelease True >>> Version("1.2.3b1").is_prerelease True >>> Version("1.2.3rc1").is_prerelease True >>> Version("1.2.3dev1").is_prerelease True """ return self.dev is not None or self.pre is not None
@property def is_postrelease(self) -> bool: """Whether this version is a post-release.
>>> Version("1.2.3").is_postrelease False >>> Version("1.2.3.post1").is_postrelease True """ return self.post is not None
@property def is_devrelease(self) -> bool: """Whether this version is a development release.
>>> Version("1.2.3").is_devrelease False >>> Version("1.2.3.dev1").is_devrelease True """ return self.dev is not None
@property def major(self) -> int: """The first item of :attr:`release` or ``0`` if unavailable.
>>> Version("1.2.3").major 1 """ return self.release[0] if len(self.release) >= 1 else 0
@property def minor(self) -> int: """The second item of :attr:`release` or ``0`` if unavailable.
>>> Version("1.2.3").minor 2 >>> Version("1").minor 0 """ return self.release[1] if len(self.release) >= 2 else 0
@property def micro(self) -> int: """The third item of :attr:`release` or ``0`` if unavailable.
>>> Version("1.2.3").micro 3 >>> Version("1").micro 0 """ return self.release[2] if len(self.release) >= 3 else 0
class _TrimmedRelease(Version): __slots__ = ()
def __init__(self, version: str | Version) -> None: if isinstance(version, Version): self._epoch = version._epoch self._release = version._release self._dev = version._dev self._pre = version._pre self._post = version._post self._local = version._local self._key_cache = version._key_cache return super().__init__(version) # pragma: no cover
@property def release(self) -> tuple[int, ...]: """ Release segment without any trailing zeros.
>>> _TrimmedRelease('1.0.0').release (1,) >>> _TrimmedRelease('0.0').release (0,) """ # This leaves one 0. rel = super().release len_release = len(rel) i = len_release while i > 1 and rel[i - 1] == 0: i -= 1 return rel if i == len_release else rel[:i]
def _parse_letter_version( letter: str | None, number: str | bytes | SupportsInt | None) -> tuple[str, int] | None: if letter: # We normalize any letters to their lower case form letter = letter.lower()
# We consider some words to be alternate spellings of other words and # in those cases we want to normalize the spellings to our preferred # spelling. letter = _LETTER_NORMALIZATION.get(letter, letter)
# We consider there to be an implicit 0 in a pre-release if there is # not a numeral associated with it. return letter, int(number or 0)
if number: # We assume if we are given a number, but we are not given a letter # then this is using the implicit post release syntax (e.g. 1.0-1) return "post", int(number)
return None
_local_version_separators = re.compile(r"[\._-]")
def _parse_local_version(local: str | None) -> LocalType | None: """ Takes a string like ``"abc.1.twelve"`` and turns it into ``("abc", 1, "twelve")``. """ if local is not None: return tuple( part.lower() if not part.isdigit() else int(part) for part in _local_version_separators.split(local) ) return None
# Sort ranks for pre-release: dev-only < a < b < rc < stable (no pre-release)._PRE_RANK = {"a": 0, "b": 1, "rc": 2}_PRE_RANK_DEV_ONLY = -1 # sorts before a(0)_PRE_RANK_STABLE = 3 # sorts after rc(2)
# In local version segments, strings sort before ints per PEP 440._LOCAL_STR_RANK = -1 # sorts before all non-negative ints
# Pre-computed suffix for stable releases (no pre, post, or dev segments).# See _cmpkey() for the suffix layout._STABLE_SUFFIX = (_PRE_RANK_STABLE, 0, 0, 0, 1, 0)
def _cmpkey( epoch: int, release: tuple[int, ...], pre: tuple[str, int] | None, post: tuple[str, int] | None, dev: tuple[str, int] | None, local: LocalType | None,) -> CmpKey: """Build a comparison key for PEP 440 ordering.
Returns ``(epoch, release, suffix)`` or ``(epoch, release, suffix, local)`` so that plain tuple comparison gives the correct order.
Trailing zeros are stripped from the release so that ``1.0.0 == 1``.
The suffix is a flat 6-int tuple that encodes pre/post/dev: ``(pre_rank, pre_n, post_rank, post_n, dev_rank, dev_n)``
pre_rank: dev-only=-1, a=0, b=1, rc=2, no-pre=3 Dev-only releases (no pre or post) get -1 so they sort before any alpha/beta/rc. Releases without a pre-release tag get 3 so they sort after rc. post_rank: no-post=0, post=1 Releases without a post segment sort before those with one. dev_rank: dev=0, no-dev=1 Releases without a dev segment sort after those with one.
Local segments use ``(n, "")`` for ints and ``(-1, s)`` for strings, following PEP 440: strings sort before ints, strings compare lexicographically, ints compare numerically, and shorter segments sort before longer when prefixes match. Versions without a local segment sort before those with one (3-tuple < 4-tuple).
>>> _cmpkey(0, (1, 0, 0), None, None, None, None) (0, (1,), (3, 0, 0, 0, 1, 0)) >>> _cmpkey(0, (1,), ("a", 1), None, None, None) (0, (1,), (0, 1, 0, 0, 1, 0)) >>> _cmpkey(0, (1,), None, None, None, ("ubuntu", 1)) (0, (1,), (3, 0, 0, 0, 1, 0), ((-1, 'ubuntu'), (1, ''))) """ # Strip trailing zeros: 1.0.0 compares equal to 1. len_release = len(release) i = len_release while i and release[i - 1] == 0: i -= 1 trimmed = release if i == len_release else release[:i]
# Fast path: stable release with no local segment. if pre is None and post is None and dev is None and local is None: return epoch, trimmed, _STABLE_SUFFIX
if pre is None and post is None and dev is not None: # dev-only (e.g. 1.0.dev1) sorts before all pre-releases. pre_rank, pre_n = _PRE_RANK_DEV_ONLY, 0 elif pre is None: pre_rank, pre_n = _PRE_RANK_STABLE, 0 else: pre_rank, pre_n = _PRE_RANK[pre[0]], pre[1]
post_rank = 0 if post is None else 1 post_n = 0 if post is None else post[1]
dev_rank = 1 if dev is None else 0 dev_n = 0 if dev is None else dev[1]
suffix = (pre_rank, pre_n, post_rank, post_n, dev_rank, dev_n)
if local is None: return epoch, trimmed, suffix
cmp_local: CmpLocalType = tuple( (seg, "") if isinstance(seg, int) else (_LOCAL_STR_RANK, seg) for seg in local ) return epoch, trimmed, suffix, cmp_local1234567891011121314151617Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), todeal in the Software without restriction, including without limitation therights to use, copy, modify, merge, publish, distribute, sublicense, and/orsell copies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGSIN THE SOFTWARE.123456789101112131415161718192021MIT License
Copyright (c) 2010-202x The platformdirs developers
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, 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 THESOFTWARE.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631"""Utilities for determining application-specific dirs.
See <https://github.com/platformdirs/platformdirs> for details and usage.
"""
from __future__ import annotations
import osimport sysfrom typing import TYPE_CHECKING
from .api import PlatformDirsABCfrom .version import __version__from .version import __version_tuple__ as __version_info__
if TYPE_CHECKING: from pathlib import Path from typing import Literal
if sys.platform == "win32": from pip._vendor.platformdirs.windows import Windows as _Resultelif sys.platform == "darwin": from pip._vendor.platformdirs.macos import MacOS as _Resultelse: from pip._vendor.platformdirs.unix import Unix as _Result
def _set_platform_dir_class() -> type[PlatformDirsABC]: if os.getenv("ANDROID_DATA") == "/data" and os.getenv("ANDROID_ROOT") == "/system": if os.getenv("SHELL") or os.getenv("PREFIX"): return _Result
from pip._vendor.platformdirs.android import _android_folder # noqa: PLC0415
if _android_folder() is not None: from pip._vendor.platformdirs.android import Android # noqa: PLC0415
return Android # return to avoid redefinition of a result
return _Result
if TYPE_CHECKING: # Work around mypy issue: https://github.com/python/mypy/issues/10962 PlatformDirs = _Resultelse: PlatformDirs = _set_platform_dir_class() #: Currently active platformAppDirs = PlatformDirs #: Backwards compatibility with appdirs
def user_data_dir( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, roaming: bool = False, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> str: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param roaming: See `roaming <platformdirs.api.PlatformDirsABC.roaming>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: data directory tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, roaming=roaming, ensure_exists=ensure_exists, ).user_data_dir
def site_data_dir( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, multipath: bool = False, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> str: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param multipath: See `roaming <platformdirs.api.PlatformDirsABC.multipath>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: data directory shared by users """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, multipath=multipath, ensure_exists=ensure_exists, ).site_data_dir
def user_config_dir( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, roaming: bool = False, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> str: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param roaming: See `roaming <platformdirs.api.PlatformDirsABC.roaming>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: config directory tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, roaming=roaming, ensure_exists=ensure_exists, ).user_config_dir
def site_config_dir( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, multipath: bool = False, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> str: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param multipath: See `roaming <platformdirs.api.PlatformDirsABC.multipath>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: config directory shared by the users """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, multipath=multipath, ensure_exists=ensure_exists, ).site_config_dir
def user_cache_dir( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, opinion: bool = True, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> str: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param opinion: See `roaming <platformdirs.api.PlatformDirsABC.opinion>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: cache directory tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, opinion=opinion, ensure_exists=ensure_exists, ).user_cache_dir
def site_cache_dir( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, opinion: bool = True, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> str: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param opinion: See `opinion <platformdirs.api.PlatformDirsABC.opinion>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: cache directory tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, opinion=opinion, ensure_exists=ensure_exists, ).site_cache_dir
def user_state_dir( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, roaming: bool = False, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> str: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param roaming: See `roaming <platformdirs.api.PlatformDirsABC.roaming>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: state directory tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, roaming=roaming, ensure_exists=ensure_exists, ).user_state_dir
def user_log_dir( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, opinion: bool = True, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> str: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param opinion: See `roaming <platformdirs.api.PlatformDirsABC.opinion>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: log directory tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, opinion=opinion, ensure_exists=ensure_exists, ).user_log_dir
def user_documents_dir() -> str: """:returns: documents directory tied to the user""" return PlatformDirs().user_documents_dir
def user_downloads_dir() -> str: """:returns: downloads directory tied to the user""" return PlatformDirs().user_downloads_dir
def user_pictures_dir() -> str: """:returns: pictures directory tied to the user""" return PlatformDirs().user_pictures_dir
def user_videos_dir() -> str: """:returns: videos directory tied to the user""" return PlatformDirs().user_videos_dir
def user_music_dir() -> str: """:returns: music directory tied to the user""" return PlatformDirs().user_music_dir
def user_desktop_dir() -> str: """:returns: desktop directory tied to the user""" return PlatformDirs().user_desktop_dir
def user_runtime_dir( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, opinion: bool = True, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> str: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param opinion: See `opinion <platformdirs.api.PlatformDirsABC.opinion>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: runtime directory tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, opinion=opinion, ensure_exists=ensure_exists, ).user_runtime_dir
def site_runtime_dir( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, opinion: bool = True, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> str: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param opinion: See `opinion <platformdirs.api.PlatformDirsABC.opinion>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: runtime directory shared by users """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, opinion=opinion, ensure_exists=ensure_exists, ).site_runtime_dir
def user_data_path( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, roaming: bool = False, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> Path: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param roaming: See `roaming <platformdirs.api.PlatformDirsABC.roaming>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: data path tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, roaming=roaming, ensure_exists=ensure_exists, ).user_data_path
def site_data_path( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, multipath: bool = False, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> Path: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param multipath: See `multipath <platformdirs.api.PlatformDirsABC.multipath>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: data path shared by users """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, multipath=multipath, ensure_exists=ensure_exists, ).site_data_path
def user_config_path( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, roaming: bool = False, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> Path: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param roaming: See `roaming <platformdirs.api.PlatformDirsABC.roaming>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: config path tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, roaming=roaming, ensure_exists=ensure_exists, ).user_config_path
def site_config_path( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, multipath: bool = False, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> Path: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param multipath: See `roaming <platformdirs.api.PlatformDirsABC.multipath>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: config path shared by the users """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, multipath=multipath, ensure_exists=ensure_exists, ).site_config_path
def site_cache_path( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, opinion: bool = True, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> Path: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param opinion: See `opinion <platformdirs.api.PlatformDirsABC.opinion>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: cache directory tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, opinion=opinion, ensure_exists=ensure_exists, ).site_cache_path
def user_cache_path( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, opinion: bool = True, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> Path: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param opinion: See `roaming <platformdirs.api.PlatformDirsABC.opinion>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: cache path tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, opinion=opinion, ensure_exists=ensure_exists, ).user_cache_path
def user_state_path( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, roaming: bool = False, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> Path: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param roaming: See `roaming <platformdirs.api.PlatformDirsABC.roaming>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: state path tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, roaming=roaming, ensure_exists=ensure_exists, ).user_state_path
def user_log_path( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, opinion: bool = True, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> Path: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param opinion: See `roaming <platformdirs.api.PlatformDirsABC.opinion>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: log path tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, opinion=opinion, ensure_exists=ensure_exists, ).user_log_path
def user_documents_path() -> Path: """:returns: documents a path tied to the user""" return PlatformDirs().user_documents_path
def user_downloads_path() -> Path: """:returns: downloads path tied to the user""" return PlatformDirs().user_downloads_path
def user_pictures_path() -> Path: """:returns: pictures path tied to the user""" return PlatformDirs().user_pictures_path
def user_videos_path() -> Path: """:returns: videos path tied to the user""" return PlatformDirs().user_videos_path
def user_music_path() -> Path: """:returns: music path tied to the user""" return PlatformDirs().user_music_path
def user_desktop_path() -> Path: """:returns: desktop path tied to the user""" return PlatformDirs().user_desktop_path
def user_runtime_path( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, opinion: bool = True, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> Path: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param opinion: See `opinion <platformdirs.api.PlatformDirsABC.opinion>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: runtime path tied to the user """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, opinion=opinion, ensure_exists=ensure_exists, ).user_runtime_path
def site_runtime_path( appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, opinion: bool = True, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002) -> Path: """ :param appname: See `appname <platformdirs.api.PlatformDirsABC.appname>`. :param appauthor: See `appauthor <platformdirs.api.PlatformDirsABC.appauthor>`. :param version: See `version <platformdirs.api.PlatformDirsABC.version>`. :param opinion: See `opinion <platformdirs.api.PlatformDirsABC.opinion>`. :param ensure_exists: See `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`. :returns: runtime path shared by users """ return PlatformDirs( appname=appname, appauthor=appauthor, version=version, opinion=opinion, ensure_exists=ensure_exists, ).site_runtime_path
__all__ = [ "AppDirs", "PlatformDirs", "PlatformDirsABC", "__version__", "__version_info__", "site_cache_dir", "site_cache_path", "site_config_dir", "site_config_path", "site_data_dir", "site_data_path", "site_runtime_dir", "site_runtime_path", "user_cache_dir", "user_cache_path", "user_config_dir", "user_config_path", "user_data_dir", "user_data_path", "user_desktop_dir", "user_desktop_path", "user_documents_dir", "user_documents_path", "user_downloads_dir", "user_downloads_path", "user_log_dir", "user_log_path", "user_music_dir", "user_music_path", "user_pictures_dir", "user_pictures_path", "user_runtime_dir", "user_runtime_path", "user_state_dir", "user_state_path", "user_videos_dir", "user_videos_path",]12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455"""Main entry point."""
from __future__ import annotations
from pip._vendor.platformdirs import PlatformDirs, __version__
PROPS = ( "user_data_dir", "user_config_dir", "user_cache_dir", "user_state_dir", "user_log_dir", "user_documents_dir", "user_downloads_dir", "user_pictures_dir", "user_videos_dir", "user_music_dir", "user_runtime_dir", "site_data_dir", "site_config_dir", "site_cache_dir", "site_runtime_dir",)
def main() -> None: """Run the main entry point.""" app_name = "MyApp" app_author = "MyCompany"
print(f"-- platformdirs {__version__} --") # noqa: T201
print("-- app dirs (with optional 'version')") # noqa: T201 dirs = PlatformDirs(app_name, app_author, version="1.0") for prop in PROPS: print(f"{prop}: {getattr(dirs, prop)}") # noqa: T201
print("\n-- app dirs (without optional 'version')") # noqa: T201 dirs = PlatformDirs(app_name, app_author) for prop in PROPS: print(f"{prop}: {getattr(dirs, prop)}") # noqa: T201
print("\n-- app dirs (without optional 'appauthor')") # noqa: T201 dirs = PlatformDirs(app_name) for prop in PROPS: print(f"{prop}: {getattr(dirs, prop)}") # noqa: T201
print("\n-- app dirs (with disabled 'appauthor')") # noqa: T201 dirs = PlatformDirs(app_name, appauthor=False) for prop in PROPS: print(f"{prop}: {getattr(dirs, prop)}") # noqa: T201
if __name__ == "__main__": main()123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249"""Android."""
from __future__ import annotations
import osimport reimport sysfrom functools import lru_cachefrom typing import TYPE_CHECKING, cast
from .api import PlatformDirsABC
class Android(PlatformDirsABC): """ Follows the guidance `from here <https://android.stackexchange.com/a/216132>`_.
Makes use of the `appname <platformdirs.api.PlatformDirsABC.appname>`, `version <platformdirs.api.PlatformDirsABC.version>`, `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`.
"""
@property def user_data_dir(self) -> str: """:return: data directory tied to the user, e.g. ``/data/user/<userid>/<packagename>/files/<AppName>``""" return self._append_app_name_and_version(cast("str", _android_folder()), "files")
@property def site_data_dir(self) -> str: """:return: data directory shared by users, same as `user_data_dir`""" return self.user_data_dir
@property def user_config_dir(self) -> str: """ :return: config directory tied to the user, e.g. \ ``/data/user/<userid>/<packagename>/shared_prefs/<AppName>`` """ return self._append_app_name_and_version(cast("str", _android_folder()), "shared_prefs")
@property def site_config_dir(self) -> str: """:return: config directory shared by the users, same as `user_config_dir`""" return self.user_config_dir
@property def user_cache_dir(self) -> str: """:return: cache directory tied to the user, e.g.,``/data/user/<userid>/<packagename>/cache/<AppName>``""" return self._append_app_name_and_version(cast("str", _android_folder()), "cache")
@property def site_cache_dir(self) -> str: """:return: cache directory shared by users, same as `user_cache_dir`""" return self.user_cache_dir
@property def user_state_dir(self) -> str: """:return: state directory tied to the user, same as `user_data_dir`""" return self.user_data_dir
@property def user_log_dir(self) -> str: """ :return: log directory tied to the user, same as `user_cache_dir` if not opinionated else ``log`` in it, e.g. ``/data/user/<userid>/<packagename>/cache/<AppName>/log`` """ path = self.user_cache_dir if self.opinion: path = os.path.join(path, "log") # noqa: PTH118 return path
@property def user_documents_dir(self) -> str: """:return: documents directory tied to the user e.g. ``/storage/emulated/0/Documents``""" return _android_documents_folder()
@property def user_downloads_dir(self) -> str: """:return: downloads directory tied to the user e.g. ``/storage/emulated/0/Downloads``""" return _android_downloads_folder()
@property def user_pictures_dir(self) -> str: """:return: pictures directory tied to the user e.g. ``/storage/emulated/0/Pictures``""" return _android_pictures_folder()
@property def user_videos_dir(self) -> str: """:return: videos directory tied to the user e.g. ``/storage/emulated/0/DCIM/Camera``""" return _android_videos_folder()
@property def user_music_dir(self) -> str: """:return: music directory tied to the user e.g. ``/storage/emulated/0/Music``""" return _android_music_folder()
@property def user_desktop_dir(self) -> str: """:return: desktop directory tied to the user e.g. ``/storage/emulated/0/Desktop``""" return "/storage/emulated/0/Desktop"
@property def user_runtime_dir(self) -> str: """ :return: runtime directory tied to the user, same as `user_cache_dir` if not opinionated else ``tmp`` in it, e.g. ``/data/user/<userid>/<packagename>/cache/<AppName>/tmp`` """ path = self.user_cache_dir if self.opinion: path = os.path.join(path, "tmp") # noqa: PTH118 return path
@property def site_runtime_dir(self) -> str: """:return: runtime directory shared by users, same as `user_runtime_dir`""" return self.user_runtime_dir
@lru_cache(maxsize=1)def _android_folder() -> str | None: # noqa: C901 """:return: base folder for the Android OS or None if it cannot be found""" result: str | None = None # type checker isn't happy with our "import android", just don't do this when type checking see # https://stackoverflow.com/a/61394121 if not TYPE_CHECKING: try: # First try to get a path to android app using python4android (if available)... from android import mActivity # noqa: PLC0415
context = cast("android.content.Context", mActivity.getApplicationContext()) # noqa: F821 result = context.getFilesDir().getParentFile().getAbsolutePath() except Exception: # noqa: BLE001 result = None if result is None: try: # ...and fall back to using plain pyjnius, if python4android isn't available or doesn't deliver any useful # result... from jnius import autoclass # noqa: PLC0415
context = autoclass("android.content.Context") result = context.getFilesDir().getParentFile().getAbsolutePath() except Exception: # noqa: BLE001 result = None if result is None: # and if that fails, too, find an android folder looking at path on the sys.path # warning: only works for apps installed under /data, not adopted storage etc. pattern = re.compile(r"/data/(data|user/\d+)/(.+)/files") for path in sys.path: if pattern.match(path): result = path.split("/files")[0] break else: result = None if result is None: # one last try: find an android folder looking at path on the sys.path taking adopted storage paths into # account pattern = re.compile(r"/mnt/expand/[a-fA-F0-9-]{36}/(data|user/\d+)/(.+)/files") for path in sys.path: if pattern.match(path): result = path.split("/files")[0] break else: result = None return result
@lru_cache(maxsize=1)def _android_documents_folder() -> str: """:return: documents folder for the Android OS""" # Get directories with pyjnius try: from jnius import autoclass # noqa: PLC0415
context = autoclass("android.content.Context") environment = autoclass("android.os.Environment") documents_dir: str = context.getExternalFilesDir(environment.DIRECTORY_DOCUMENTS).getAbsolutePath() except Exception: # noqa: BLE001 documents_dir = "/storage/emulated/0/Documents"
return documents_dir
@lru_cache(maxsize=1)def _android_downloads_folder() -> str: """:return: downloads folder for the Android OS""" # Get directories with pyjnius try: from jnius import autoclass # noqa: PLC0415
context = autoclass("android.content.Context") environment = autoclass("android.os.Environment") downloads_dir: str = context.getExternalFilesDir(environment.DIRECTORY_DOWNLOADS).getAbsolutePath() except Exception: # noqa: BLE001 downloads_dir = "/storage/emulated/0/Downloads"
return downloads_dir
@lru_cache(maxsize=1)def _android_pictures_folder() -> str: """:return: pictures folder for the Android OS""" # Get directories with pyjnius try: from jnius import autoclass # noqa: PLC0415
context = autoclass("android.content.Context") environment = autoclass("android.os.Environment") pictures_dir: str = context.getExternalFilesDir(environment.DIRECTORY_PICTURES).getAbsolutePath() except Exception: # noqa: BLE001 pictures_dir = "/storage/emulated/0/Pictures"
return pictures_dir
@lru_cache(maxsize=1)def _android_videos_folder() -> str: """:return: videos folder for the Android OS""" # Get directories with pyjnius try: from jnius import autoclass # noqa: PLC0415
context = autoclass("android.content.Context") environment = autoclass("android.os.Environment") videos_dir: str = context.getExternalFilesDir(environment.DIRECTORY_DCIM).getAbsolutePath() except Exception: # noqa: BLE001 videos_dir = "/storage/emulated/0/DCIM/Camera"
return videos_dir
@lru_cache(maxsize=1)def _android_music_folder() -> str: """:return: music folder for the Android OS""" # Get directories with pyjnius try: from jnius import autoclass # noqa: PLC0415
context = autoclass("android.content.Context") environment = autoclass("android.os.Environment") music_dir: str = context.getExternalFilesDir(environment.DIRECTORY_MUSIC).getAbsolutePath() except Exception: # noqa: BLE001 music_dir = "/storage/emulated/0/Music"
return music_dir
__all__ = [ "Android",]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299"""Base API."""
from __future__ import annotations
import osfrom abc import ABC, abstractmethodfrom pathlib import Pathfrom typing import TYPE_CHECKING
if TYPE_CHECKING: from collections.abc import Iterator from typing import Literal
class PlatformDirsABC(ABC): # noqa: PLR0904 """Abstract base class for platform directories."""
def __init__( # noqa: PLR0913, PLR0917 self, appname: str | None = None, appauthor: str | Literal[False] | None = None, version: str | None = None, roaming: bool = False, # noqa: FBT001, FBT002 multipath: bool = False, # noqa: FBT001, FBT002 opinion: bool = True, # noqa: FBT001, FBT002 ensure_exists: bool = False, # noqa: FBT001, FBT002 ) -> None: """ Create a new platform directory.
:param appname: See `appname`. :param appauthor: See `appauthor`. :param version: See `version`. :param roaming: See `roaming`. :param multipath: See `multipath`. :param opinion: See `opinion`. :param ensure_exists: See `ensure_exists`.
""" self.appname = appname #: The name of application. self.appauthor = appauthor """ The name of the app author or distributing body for this application.
Typically, it is the owning company name. Defaults to `appname`. You may pass ``False`` to disable it.
""" self.version = version """ An optional version path element to append to the path.
You might want to use this if you want multiple versions of your app to be able to run independently. If used, this would typically be ``<major>.<minor>``.
""" self.roaming = roaming """ Whether to use the roaming appdata directory on Windows.
That means that for users on a Windows network setup for roaming profiles, this user data will be synced on login (see `here <https://technet.microsoft.com/en-us/library/cc766489(WS.10).aspx>`_).
""" self.multipath = multipath """ An optional parameter which indicates that the entire list of data dirs should be returned.
By default, the first item would only be returned.
""" self.opinion = opinion #: A flag to indicating to use opinionated values. self.ensure_exists = ensure_exists """ Optionally create the directory (and any missing parents) upon access if it does not exist.
By default, no directories are created.
"""
def _append_app_name_and_version(self, *base: str) -> str: params = list(base[1:]) if self.appname: params.append(self.appname) if self.version: params.append(self.version) path = os.path.join(base[0], *params) # noqa: PTH118 self._optionally_create_directory(path) return path
def _optionally_create_directory(self, path: str) -> None: if self.ensure_exists: Path(path).mkdir(parents=True, exist_ok=True)
def _first_item_as_path_if_multipath(self, directory: str) -> Path: if self.multipath: # If multipath is True, the first path is returned. directory = directory.partition(os.pathsep)[0] return Path(directory)
@property @abstractmethod def user_data_dir(self) -> str: """:return: data directory tied to the user"""
@property @abstractmethod def site_data_dir(self) -> str: """:return: data directory shared by users"""
@property @abstractmethod def user_config_dir(self) -> str: """:return: config directory tied to the user"""
@property @abstractmethod def site_config_dir(self) -> str: """:return: config directory shared by the users"""
@property @abstractmethod def user_cache_dir(self) -> str: """:return: cache directory tied to the user"""
@property @abstractmethod def site_cache_dir(self) -> str: """:return: cache directory shared by users"""
@property @abstractmethod def user_state_dir(self) -> str: """:return: state directory tied to the user"""
@property @abstractmethod def user_log_dir(self) -> str: """:return: log directory tied to the user"""
@property @abstractmethod def user_documents_dir(self) -> str: """:return: documents directory tied to the user"""
@property @abstractmethod def user_downloads_dir(self) -> str: """:return: downloads directory tied to the user"""
@property @abstractmethod def user_pictures_dir(self) -> str: """:return: pictures directory tied to the user"""
@property @abstractmethod def user_videos_dir(self) -> str: """:return: videos directory tied to the user"""
@property @abstractmethod def user_music_dir(self) -> str: """:return: music directory tied to the user"""
@property @abstractmethod def user_desktop_dir(self) -> str: """:return: desktop directory tied to the user"""
@property @abstractmethod def user_runtime_dir(self) -> str: """:return: runtime directory tied to the user"""
@property @abstractmethod def site_runtime_dir(self) -> str: """:return: runtime directory shared by users"""
@property def user_data_path(self) -> Path: """:return: data path tied to the user""" return Path(self.user_data_dir)
@property def site_data_path(self) -> Path: """:return: data path shared by users""" return Path(self.site_data_dir)
@property def user_config_path(self) -> Path: """:return: config path tied to the user""" return Path(self.user_config_dir)
@property def site_config_path(self) -> Path: """:return: config path shared by the users""" return Path(self.site_config_dir)
@property def user_cache_path(self) -> Path: """:return: cache path tied to the user""" return Path(self.user_cache_dir)
@property def site_cache_path(self) -> Path: """:return: cache path shared by users""" return Path(self.site_cache_dir)
@property def user_state_path(self) -> Path: """:return: state path tied to the user""" return Path(self.user_state_dir)
@property def user_log_path(self) -> Path: """:return: log path tied to the user""" return Path(self.user_log_dir)
@property def user_documents_path(self) -> Path: """:return: documents a path tied to the user""" return Path(self.user_documents_dir)
@property def user_downloads_path(self) -> Path: """:return: downloads path tied to the user""" return Path(self.user_downloads_dir)
@property def user_pictures_path(self) -> Path: """:return: pictures path tied to the user""" return Path(self.user_pictures_dir)
@property def user_videos_path(self) -> Path: """:return: videos path tied to the user""" return Path(self.user_videos_dir)
@property def user_music_path(self) -> Path: """:return: music path tied to the user""" return Path(self.user_music_dir)
@property def user_desktop_path(self) -> Path: """:return: desktop path tied to the user""" return Path(self.user_desktop_dir)
@property def user_runtime_path(self) -> Path: """:return: runtime path tied to the user""" return Path(self.user_runtime_dir)
@property def site_runtime_path(self) -> Path: """:return: runtime path shared by users""" return Path(self.site_runtime_dir)
def iter_config_dirs(self) -> Iterator[str]: """:yield: all user and site configuration directories.""" yield self.user_config_dir yield self.site_config_dir
def iter_data_dirs(self) -> Iterator[str]: """:yield: all user and site data directories.""" yield self.user_data_dir yield self.site_data_dir
def iter_cache_dirs(self) -> Iterator[str]: """:yield: all user and site cache directories.""" yield self.user_cache_dir yield self.site_cache_dir
def iter_runtime_dirs(self) -> Iterator[str]: """:yield: all user and site runtime directories.""" yield self.user_runtime_dir yield self.site_runtime_dir
def iter_config_paths(self) -> Iterator[Path]: """:yield: all user and site configuration paths.""" for path in self.iter_config_dirs(): yield Path(path)
def iter_data_paths(self) -> Iterator[Path]: """:yield: all user and site data paths.""" for path in self.iter_data_dirs(): yield Path(path)
def iter_cache_paths(self) -> Iterator[Path]: """:yield: all user and site cache paths.""" for path in self.iter_cache_dirs(): yield Path(path)
def iter_runtime_paths(self) -> Iterator[Path]: """:yield: all user and site runtime paths.""" for path in self.iter_runtime_dirs(): yield Path(path)123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146"""macOS."""
from __future__ import annotations
import os.pathimport sysfrom typing import TYPE_CHECKING
from .api import PlatformDirsABC
if TYPE_CHECKING: from pathlib import Path
class MacOS(PlatformDirsABC): """ Platform directories for the macOS operating system.
Follows the guidance from `Apple documentation <https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html>`_. Makes use of the `appname <platformdirs.api.PlatformDirsABC.appname>`, `version <platformdirs.api.PlatformDirsABC.version>`, `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`.
"""
@property def user_data_dir(self) -> str: """:return: data directory tied to the user, e.g. ``~/Library/Application Support/$appname/$version``""" return self._append_app_name_and_version(os.path.expanduser("~/Library/Application Support")) # noqa: PTH111
@property def site_data_dir(self) -> str: """ :return: data directory shared by users, e.g. ``/Library/Application Support/$appname/$version``. If we're using a Python binary managed by `Homebrew <https://brew.sh>`_, the directory will be under the Homebrew prefix, e.g. ``$homebrew_prefix/share/$appname/$version``. If `multipath <platformdirs.api.PlatformDirsABC.multipath>` is enabled, and we're in Homebrew, the response is a multi-path string separated by ":", e.g. ``$homebrew_prefix/share/$appname/$version:/Library/Application Support/$appname/$version`` """ is_homebrew = "/opt/python" in sys.prefix homebrew_prefix = sys.prefix.split("/opt/python")[0] if is_homebrew else "" path_list = [self._append_app_name_and_version(f"{homebrew_prefix}/share")] if is_homebrew else [] path_list.append(self._append_app_name_and_version("/Library/Application Support")) if self.multipath: return os.pathsep.join(path_list) return path_list[0]
@property def site_data_path(self) -> Path: """:return: data path shared by users. Only return the first item, even if ``multipath`` is set to ``True``""" return self._first_item_as_path_if_multipath(self.site_data_dir)
@property def user_config_dir(self) -> str: """:return: config directory tied to the user, same as `user_data_dir`""" return self.user_data_dir
@property def site_config_dir(self) -> str: """:return: config directory shared by the users, same as `site_data_dir`""" return self.site_data_dir
@property def user_cache_dir(self) -> str: """:return: cache directory tied to the user, e.g. ``~/Library/Caches/$appname/$version``""" return self._append_app_name_and_version(os.path.expanduser("~/Library/Caches")) # noqa: PTH111
@property def site_cache_dir(self) -> str: """ :return: cache directory shared by users, e.g. ``/Library/Caches/$appname/$version``. If we're using a Python binary managed by `Homebrew <https://brew.sh>`_, the directory will be under the Homebrew prefix, e.g. ``$homebrew_prefix/var/cache/$appname/$version``. If `multipath <platformdirs.api.PlatformDirsABC.multipath>` is enabled, and we're in Homebrew, the response is a multi-path string separated by ":", e.g. ``$homebrew_prefix/var/cache/$appname/$version:/Library/Caches/$appname/$version`` """ is_homebrew = "/opt/python" in sys.prefix homebrew_prefix = sys.prefix.split("/opt/python")[0] if is_homebrew else "" path_list = [self._append_app_name_and_version(f"{homebrew_prefix}/var/cache")] if is_homebrew else [] path_list.append(self._append_app_name_and_version("/Library/Caches")) if self.multipath: return os.pathsep.join(path_list) return path_list[0]
@property def site_cache_path(self) -> Path: """:return: cache path shared by users. Only return the first item, even if ``multipath`` is set to ``True``""" return self._first_item_as_path_if_multipath(self.site_cache_dir)
@property def user_state_dir(self) -> str: """:return: state directory tied to the user, same as `user_data_dir`""" return self.user_data_dir
@property def user_log_dir(self) -> str: """:return: log directory tied to the user, e.g. ``~/Library/Logs/$appname/$version``""" return self._append_app_name_and_version(os.path.expanduser("~/Library/Logs")) # noqa: PTH111
@property def user_documents_dir(self) -> str: """:return: documents directory tied to the user, e.g. ``~/Documents``""" return os.path.expanduser("~/Documents") # noqa: PTH111
@property def user_downloads_dir(self) -> str: """:return: downloads directory tied to the user, e.g. ``~/Downloads``""" return os.path.expanduser("~/Downloads") # noqa: PTH111
@property def user_pictures_dir(self) -> str: """:return: pictures directory tied to the user, e.g. ``~/Pictures``""" return os.path.expanduser("~/Pictures") # noqa: PTH111
@property def user_videos_dir(self) -> str: """:return: videos directory tied to the user, e.g. ``~/Movies``""" return os.path.expanduser("~/Movies") # noqa: PTH111
@property def user_music_dir(self) -> str: """:return: music directory tied to the user, e.g. ``~/Music``""" return os.path.expanduser("~/Music") # noqa: PTH111
@property def user_desktop_dir(self) -> str: """:return: desktop directory tied to the user, e.g. ``~/Desktop``""" return os.path.expanduser("~/Desktop") # noqa: PTH111
@property def user_runtime_dir(self) -> str: """:return: runtime directory tied to the user, e.g. ``~/Library/Caches/TemporaryItems/$appname/$version``""" return self._append_app_name_and_version(os.path.expanduser("~/Library/Caches/TemporaryItems")) # noqa: PTH111
@property def site_runtime_dir(self) -> str: """:return: runtime directory shared by users, same as `user_runtime_dir`""" return self.user_runtime_dir
__all__ = [ "MacOS",]123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272"""Unix."""
from __future__ import annotations
import osimport sysfrom configparser import ConfigParserfrom pathlib import Pathfrom typing import TYPE_CHECKING, NoReturn
from .api import PlatformDirsABC
if TYPE_CHECKING: from collections.abc import Iterator
if sys.platform == "win32":
def getuid() -> NoReturn: msg = "should only be used on Unix" raise RuntimeError(msg)
else: from os import getuid
class Unix(PlatformDirsABC): # noqa: PLR0904 """ On Unix/Linux, we follow the `XDG Basedir Spec <https://specifications.freedesktop.org/basedir-spec/basedir-spec- latest.html>`_.
The spec allows overriding directories with environment variables. The examples shown are the default values, alongside the name of the environment variable that overrides them. Makes use of the `appname <platformdirs.api.PlatformDirsABC.appname>`, `version <platformdirs.api.PlatformDirsABC.version>`, `multipath <platformdirs.api.PlatformDirsABC.multipath>`, `opinion <platformdirs.api.PlatformDirsABC.opinion>`, `ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`.
"""
@property def user_data_dir(self) -> str: """ :return: data directory tied to the user, e.g. ``~/.local/share/$appname/$version`` or ``$XDG_DATA_HOME/$appname/$version`` """ path = os.environ.get("XDG_DATA_HOME", "") if not path.strip(): path = os.path.expanduser("~/.local/share") # noqa: PTH111 return self._append_app_name_and_version(path)
@property def _site_data_dirs(self) -> list[str]: path = os.environ.get("XDG_DATA_DIRS", "") if not path.strip(): path = f"/usr/local/share{os.pathsep}/usr/share" return [self._append_app_name_and_version(p) for p in path.split(os.pathsep)]
@property def site_data_dir(self) -> str: """ :return: data directories shared by users (if `multipath <platformdirs.api.PlatformDirsABC.multipath>` is enabled and ``XDG_DATA_DIRS`` is set and a multi path the response is also a multi path separated by the OS path separator), e.g. ``/usr/local/share/$appname/$version`` or ``/usr/share/$appname/$version`` """ # XDG default for $XDG_DATA_DIRS; only first, if multipath is False dirs = self._site_data_dirs if not self.multipath: return dirs[0] return os.pathsep.join(dirs)
@property def user_config_dir(self) -> str: """ :return: config directory tied to the user, e.g. ``~/.config/$appname/$version`` or ``$XDG_CONFIG_HOME/$appname/$version`` """ path = os.environ.get("XDG_CONFIG_HOME", "") if not path.strip(): path = os.path.expanduser("~/.config") # noqa: PTH111 return self._append_app_name_and_version(path)
@property def _site_config_dirs(self) -> list[str]: path = os.environ.get("XDG_CONFIG_DIRS", "") if not path.strip(): path = "/etc/xdg" return [self._append_app_name_and_version(p) for p in path.split(os.pathsep)]
@property def site_config_dir(self) -> str: """ :return: config directories shared by users (if `multipath <platformdirs.api.PlatformDirsABC.multipath>` is enabled and ``XDG_CONFIG_DIRS`` is set and a multi path the response is also a multi path separated by the OS path separator), e.g. ``/etc/xdg/$appname/$version`` """ # XDG default for $XDG_CONFIG_DIRS only first, if multipath is False dirs = self._site_config_dirs if not self.multipath: return dirs[0] return os.pathsep.join(dirs)
@property def user_cache_dir(self) -> str: """ :return: cache directory tied to the user, e.g. ``~/.cache/$appname/$version`` or ``~/$XDG_CACHE_HOME/$appname/$version`` """ path = os.environ.get("XDG_CACHE_HOME", "") if not path.strip(): path = os.path.expanduser("~/.cache") # noqa: PTH111 return self._append_app_name_and_version(path)
@property def site_cache_dir(self) -> str: """:return: cache directory shared by users, e.g. ``/var/cache/$appname/$version``""" return self._append_app_name_and_version("/var/cache")
@property def user_state_dir(self) -> str: """ :return: state directory tied to the user, e.g. ``~/.local/state/$appname/$version`` or ``$XDG_STATE_HOME/$appname/$version`` """ path = os.environ.get("XDG_STATE_HOME", "") if not path.strip(): path = os.path.expanduser("~/.local/state") # noqa: PTH111 return self._append_app_name_and_version(path)
@property def user_log_dir(self) -> str: """:return: log directory tied to the user, same as `user_state_dir` if not opinionated else ``log`` in it""" path = self.user_state_dir if self.opinion: path = os.path.join(path, "log") # noqa: PTH118 self._optionally_create_directory(path) return path
@property def user_documents_dir(self) -> str: """:return: documents directory tied to the user, e.g. ``~/Documents``""" return _get_user_media_dir("XDG_DOCUMENTS_DIR", "~/Documents")
@property def user_downloads_dir(self) -> str: """:return: downloads directory tied to the user, e.g. ``~/Downloads``""" return _get_user_media_dir("XDG_DOWNLOAD_DIR", "~/Downloads")
@property def user_pictures_dir(self) -> str: """:return: pictures directory tied to the user, e.g. ``~/Pictures``""" return _get_user_media_dir("XDG_PICTURES_DIR", "~/Pictures")
@property def user_videos_dir(self) -> str: """:return: videos directory tied to the user, e.g. ``~/Videos``""" return _get_user_media_dir("XDG_VIDEOS_DIR", "~/Videos")
@property def user_music_dir(self) -> str: """:return: music directory tied to the user, e.g. ``~/Music``""" return _get_user_media_dir("XDG_MUSIC_DIR", "~/Music")
@property def user_desktop_dir(self) -> str: """:return: desktop directory tied to the user, e.g. ``~/Desktop``""" return _get_user_media_dir("XDG_DESKTOP_DIR", "~/Desktop")
@property def user_runtime_dir(self) -> str: """ :return: runtime directory tied to the user, e.g. ``/run/user/$(id -u)/$appname/$version`` or ``$XDG_RUNTIME_DIR/$appname/$version``.
For FreeBSD/OpenBSD/NetBSD, it would return ``/var/run/user/$(id -u)/$appname/$version`` if exists, otherwise ``/tmp/runtime-$(id -u)/$appname/$version``, if``$XDG_RUNTIME_DIR`` is not set. """ path = os.environ.get("XDG_RUNTIME_DIR", "") if not path.strip(): if sys.platform.startswith(("freebsd", "openbsd", "netbsd")): path = f"/var/run/user/{getuid()}" if not Path(path).exists(): path = f"/tmp/runtime-{getuid()}" # noqa: S108 else: path = f"/run/user/{getuid()}" return self._append_app_name_and_version(path)
@property def site_runtime_dir(self) -> str: """ :return: runtime directory shared by users, e.g. ``/run/$appname/$version`` or \ ``$XDG_RUNTIME_DIR/$appname/$version``.
Note that this behaves almost exactly like `user_runtime_dir` if ``$XDG_RUNTIME_DIR`` is set, but will fall back to paths associated to the root user instead of a regular logged-in user if it's not set.
If you wish to ensure that a logged-in root user path is returned e.g. ``/run/user/0``, use `user_runtime_dir` instead.
For FreeBSD/OpenBSD/NetBSD, it would return ``/var/run/$appname/$version`` if ``$XDG_RUNTIME_DIR`` is not set. """ path = os.environ.get("XDG_RUNTIME_DIR", "") if not path.strip(): if sys.platform.startswith(("freebsd", "openbsd", "netbsd")): path = "/var/run" else: path = "/run" return self._append_app_name_and_version(path)
@property def site_data_path(self) -> Path: """:return: data path shared by users. Only return the first item, even if ``multipath`` is set to ``True``""" return self._first_item_as_path_if_multipath(self.site_data_dir)
@property def site_config_path(self) -> Path: """:return: config path shared by the users, returns the first item, even if ``multipath`` is set to ``True``""" return self._first_item_as_path_if_multipath(self.site_config_dir)
@property def site_cache_path(self) -> Path: """:return: cache path shared by users. Only return the first item, even if ``multipath`` is set to ``True``""" return self._first_item_as_path_if_multipath(self.site_cache_dir)
def iter_config_dirs(self) -> Iterator[str]: """:yield: all user and site configuration directories.""" yield self.user_config_dir yield from self._site_config_dirs
def iter_data_dirs(self) -> Iterator[str]: """:yield: all user and site data directories.""" yield self.user_data_dir yield from self._site_data_dirs
def _get_user_media_dir(env_var: str, fallback_tilde_path: str) -> str: media_dir = _get_user_dirs_folder(env_var) if media_dir is None: media_dir = os.environ.get(env_var, "").strip() if not media_dir: media_dir = os.path.expanduser(fallback_tilde_path) # noqa: PTH111
return media_dir
def _get_user_dirs_folder(key: str) -> str | None: """ Return directory from user-dirs.dirs config file.
See https://freedesktop.org/wiki/Software/xdg-user-dirs/.
""" user_dirs_config_path = Path(Unix().user_config_dir) / "user-dirs.dirs" if user_dirs_config_path.exists(): parser = ConfigParser()
with user_dirs_config_path.open() as stream: # Add fake section header, so ConfigParser doesn't complain parser.read_string(f"[top]\n{stream.read()}")
if key not in parser["top"]: return None
path = parser["top"][key].strip('"') # Handle relative home paths return path.replace("$HOME", os.path.expanduser("~")) # noqa: PTH111
return None
__all__ = [ "Unix",].venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/INSTALLERAdded+1
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/METADATAAdded+109
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/RECORDAdded+865
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/REQUESTEDAdded
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/WHEELAdded+4
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/entry_points.txtAdded+4
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/AUTHORS.txtAdded+867
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/LICENSE.txtAdded+20
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/cachecontrol/LICENSE.txtAdded+13
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/certifi/LICENSEAdded+20
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/distlib/LICENSE.txtAdded+284
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/distro/LICENSEAdded+202
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/idna/LICENSE.mdAdded+31
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/msgpack/COPYINGAdded+14
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/packaging/LICENSEAdded+3
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/packaging/LICENSE.APACHEAdded+177
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/packaging/LICENSE.BSDAdded+23
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/pkg_resources/LICENSEAdded+17
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/platformdirs/LICENSEAdded+21
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/pygments/LICENSEAdded+25
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/pyproject_hooks/LICENSEAdded+21
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/requests/LICENSEAdded+175
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/resolvelib/LICENSEAdded+13
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/rich/LICENSEAdded+19
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/tomli/LICENSEAdded+21
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/tomli_w/LICENSEAdded+21
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/truststore/LICENSEAdded+21
.venv-deploy/lib/python3.14/site-packages/pip-26.1.1.dist-info/licenses/src/pip/_vendor/urllib3/LICENSE.txtAdded+21
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/errors.pyAdded+94
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/licenses/__init__.pyAdded+186
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/licenses/_spdx.pyAdded+799
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/markers.pyAdded+492
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/metadata.pyAdded+964
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/py.typedAdded
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/pylock.pyAdded+905
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/requirements.pyAdded+129
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/specifiers.pyAdded+1943
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/tags.pyAdded+932
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/utils.pyAdded+296
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/packaging/version.pyAdded+1231
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/pkg_resources/LICENSEAdded+17
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/pkg_resources/__init__.pyAdded
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/LICENSEAdded+21
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/__init__.pyAdded+631
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/__main__.pyAdded+55
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/android.pyAdded+249
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/api.pyAdded+299
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/macos.pyAdded+146
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/py.typedAdded
.venv-deploy/lib/python3.14/site-packages/pip/_vendor/platformdirs/unix.pyAdded+272