diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/INSTALLER b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/METADATA b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..ee9fa7aac2230432fb4556f507f43c811749b632 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/METADATA @@ -0,0 +1,239 @@ +Metadata-Version: 2.4 +Name: conda +Version: 26.1.1 +Summary: OS-agnostic, system-level binary package manager. +Project-URL: changelog, https://github.com/conda/conda/blob/main/CHANGELOG.md +Project-URL: documentation, https://docs.conda.io/projects/conda/en/stable/ +Project-URL: repository, https://github.com/conda/conda +Author-email: "Anaconda, Inc." +License: BSD 3-Clause License + + Copyright (c) 2012, Anaconda, Inc. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + --- + + Conda incorporates the following libraries into its distributed code: + + * auxlib, licensed as ISC + * frozendict, license as LGPL-3.0 +License-File: AUTHORS.md +License-File: LICENSE +Classifier: Development Status :: 5 - Production/Stable +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: 3.14 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Requires-Python: >=3.10 +Requires-Dist: archspec>=0.2.3 +Requires-Dist: boltons>=23.0.0 +Requires-Dist: charset-normalizer +Requires-Dist: conda-package-handling>=2.2.0 +Requires-Dist: distro>=1.5.0 +Requires-Dist: frozendict>=2.4.2 +Requires-Dist: jsonpatch>=1.32 +Requires-Dist: menuinst>=2 +Requires-Dist: packaging>=23.0 +Requires-Dist: platformdirs>=3.10.0 +Requires-Dist: pluggy>=1.0.0 +Requires-Dist: pycosat>=0.6.3 +Requires-Dist: requests<3,>=2.28.0 +Requires-Dist: ruamel-yaml<0.19,>=0.11.14 +Requires-Dist: setuptools>=60.0.0 +Requires-Dist: tqdm>=4 +Requires-Dist: truststore>=0.8.0; python_version >= '3.10' +Requires-Dist: zstandard>=0.15 +Description-Content-Type: text/markdown + +[conda-logo]: https://s3.amazonaws.com/conda-dev/conda_logo.svg +[tests-badge]: https://img.shields.io/github/actions/workflow/status/conda/conda/tests.yml?branch=main&event=schedule&logo=github&label=tests +[codecov-badge]: https://img.shields.io/codecov/c/github/conda/conda/main?logo=codecov +[codspeed-badge]: https://img.shields.io/endpoint?url=https://codspeed.io/badge.json +[release-badge]: https://img.shields.io/github/v/release/conda/conda?logo=github +[anaconda-badge]: https://img.shields.io/conda/vn/anaconda/conda?logo=anaconda +[conda-forge-badge]: https://img.shields.io/conda/vn/conda-forge/conda?logo=conda-forge +[calver-badge]: https://img.shields.io/badge/calver-YY.MM.MICRO-22bfda.svg +[gitpod]: https://gitpod.io/button/open-in-gitpod.svg + +[![Conda Logo][conda-logo]](https://github.com/conda/conda) + +[![GitHub Scheduled Tests][tests-badge]](https://github.com/conda/conda/actions/workflows/tests.yml?query=branch%3Amain+event%3Aschedule) +[![Codecov Status][codecov-badge]](https://codecov.io/gh/conda/conda/branch/main) +[![CodSpeed Performance Benchmarks][codspeed-badge]](https://codspeed.io/conda/conda) +[![CalVer Versioning][calver-badge]](https://calver.org) +
+[![GitHub Release][release-badge]](https://github.com/conda/conda/releases) +[![Anaconda Package][anaconda-badge]](https://anaconda.org/anaconda/conda) +[![conda-forge Package][conda-forge-badge]](https://anaconda.org/conda-forge/conda) + +Conda is a cross-platform, language-agnostic binary package manager. It is a +package manager used in conda distributions like [Miniforge](https://github.com/conda-forge/miniforge) +and the [Anaconda Distribution](https://www.anaconda.com/distribution/), but it may be +used for other systems as well. Conda makes environments first-class +citizens, making it easy to create independent environments even for C +libraries. The conda command line interface is written entirely in Python, +and is BSD licensed open source. + +Conda is enhanced by organizations, tools, and repositories created and managed by +the amazing members of the [conda community](https://conda.org/). Some of them +can be found [here](https://github.com/conda/conda/wiki/Conda-Community). + + +## Installation + +To bootstrap a minimal distribution, use a minimal installer such as [Miniconda](https://docs.anaconda.com/free/miniconda/) or [Miniforge](https://conda-forge.org/download/). + +Conda is also included in the [Anaconda Distribution](https://repo.anaconda.com). + +## Updating conda + +To update `conda` to the newest version, use the following command: + +``` +$ conda update --name base conda +``` + +> [!TIP] +> It is possible that `conda update` does not install the newest version +> if the existing `conda` version is far behind the current release. +> In this case, updating needs to be done in stages. +> +> For example, to update from `conda 4.12` to `conda 23.10.0`, +> `conda 22.11.1` needs to be installed first: +> +> ``` +> $ conda install --name base conda=22.11.1 +> $ conda update conda +> ``` + +## Getting Started + +If you install the Anaconda Distribution, you will already have hundreds of packages +installed. You can see what packages are installed by running: + +```bash +$ conda list +``` + +to see all the packages that are available, use: + +```bash +$ conda search +``` + +and to install a package, use + +```bash +$ conda install +``` + +The real power of conda comes from its ability to manage environments. +In conda, an environment can be thought of as a completely separate installation. +Conda installs packages into environments efficiently using [hard links](https://en.wikipedia.org/wiki/Hard_link) by default when it is possible, so +environments are space efficient, and take seconds to create. + +The default environment, which `conda` itself is installed into, is called `base`. +To create another environment, use the `conda create` command. +For instance, to create an environment with PyTorch, you would run: + +```bash +$ conda create --name ml-project pytorch +``` + +This creates an environment called `ml-project` with the latest version of PyTorch, and its dependencies. + +We can now activate this environment: + +```bash +$ conda activate ml-project +``` + +This puts the `bin` directory of the `ml-project` environment in the front of the `PATH`, +and sets it as the default environment for all subsequent conda commands. + +To go back to the base environment, use: + +```bash +$ conda deactivate +``` + +## Building Your Own Packages + +You can easily build your own packages for conda, and upload them +to [anaconda.org](https://anaconda.org), a free service for hosting +packages for conda, as well as other package managers. +To build a package, create a recipe. Package building documentation is available +[here](https://docs.conda.io/projects/conda-build/en/latest/). +See [AnacondaRecipes](https://github.com/AnacondaRecipes) for the recipes that make up the Anaconda Distribution and `defaults` channel. +[Conda-forge](https://conda-forge.org/feedstocks/) and [Bioconda](https://github.com/bioconda/bioconda-recipes) are community-driven conda-based distributions. + +To upload to anaconda.org, create an account. Then, install the +anaconda-client and login: + +```bash +$ conda install anaconda-client +$ anaconda login +``` + +Then, after you build your recipe: + +```bash +$ conda build +``` + +you will be prompted to upload to anaconda.org. + +To add your anaconda.org channel, or other's channels, to conda so +that `conda install` will find and install their packages, run: + +```bash +$ conda config --add channels https://conda.anaconda.org/username +``` + +(replacing `username` with the username of the person whose channel you want +to add). + +## Getting Help + +- [Documentation](https://docs.conda.io/projects/conda/en/latest) +- [Zulip chat](https://conda.zulipchat.com/) +- [Bluesky](https://bsky.app/profile/conda.org) +- [Bug Reports/Feature Requests](https://github.com/conda/conda/issues) +- [Installer/Package Issues](https://github.com/ContinuumIO/anaconda-issues/issues) + +## Contributing + +Contributions to conda are welcome. See the [contributing](CONTRIBUTING.md) documentation +for instructions on setting up a development environment. diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/RECORD b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..8a6034ddb04465c842e71b507f7c5537222fe320 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/RECORD @@ -0,0 +1,475 @@ +../../../bin/conda,sha256=ifk9n2WWV8ClqWaGNFXxoRhzS2-Fy_cthEyx-a_XQB0,448 +conda-26.1.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +conda-26.1.1.dist-info/METADATA,sha256=dPouysq-PnBWygOq6SlIjSU4wEfEWahYKjwqGkqMtpY,9835 +conda-26.1.1.dist-info/RECORD,, +conda-26.1.1.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +conda-26.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87 +conda-26.1.1.dist-info/direct_url.json,sha256=VA3sbeRDqpyXZ038dlHEJjp4K7S8kiAtqP6aJU2CnqE,101 +conda-26.1.1.dist-info/entry_points.txt,sha256=i2OKMWwJQMdb0QjJpnyFmNqWpChIOSPrfC4vyadMo90,50 +conda-26.1.1.dist-info/licenses/AUTHORS.md,sha256=iVCVvtc7w1U7KhPrUXuU7Gvq3-gkKrRX7280Rcvz_V4,7911 +conda-26.1.1.dist-info/licenses/LICENSE,sha256=HzaVtzgJPLb2mjIQBNmZPY-bZwT_3iojygvFWXBvJAo,1638 +conda/__init__.py,sha256=Q2_2wex2U6S65y8qgebSwqCU9IrGTSFnHVnBgrrD7-E,6013 +conda/__main__.py,sha256=2FR_IlM54h7lP1TbwtdlPqHGFpGLSwOEzjW7-uCkv9M,165 +conda/__pycache__/__init__.cpython-313.pyc,, +conda/__pycache__/__main__.cpython-313.pyc,, +conda/__pycache__/_vendor.cpython-313.pyc,, +conda/__pycache__/_version.cpython-313.pyc,, +conda/__pycache__/activate.cpython-313.pyc,, +conda/__pycache__/api.cpython-313.pyc,, +conda/__pycache__/deprecations.cpython-313.pyc,, +conda/__pycache__/exception_handler.cpython-313.pyc,, +conda/__pycache__/exceptions.cpython-313.pyc,, +conda/__pycache__/exports.cpython-313.pyc,, +conda/__pycache__/history.cpython-313.pyc,, +conda/__pycache__/instructions.cpython-313.pyc,, +conda/__pycache__/misc.cpython-313.pyc,, +conda/__pycache__/plan.cpython-313.pyc,, +conda/__pycache__/reporters.cpython-313.pyc,, +conda/__pycache__/resolve.cpython-313.pyc,, +conda/__pycache__/utils.cpython-313.pyc,, +conda/_vendor.py,sha256=z3U462TQqDIrgEb_bVO3n0HgO2ZzKqIDTgLB7ppahQM,197 +conda/_version.py,sha256=zli0x26kPLV1BXRVu_m7wzRRkHFLR2QX1LAi22HLVEU,706 +conda/activate.py,sha256=QLq2xoZKiUmG9JXlo1ILPBI6qrQbbOIf2CpbnMibn-8,44267 +conda/api.py,sha256=wN_4orjNOd4Ty6nnRHH93AYrRzw3o9akQu6LvMQNUa8,17522 +conda/auxlib/LICENSE,sha256=JweyjAPYaVmBvTE10tfsPfV29-IYkrtMWAaZL3MSVh4,802 +conda/auxlib/__init__.py,sha256=JlKX85n2J6iX4flo9n1XXWjkzaMVo0ocPsua6X7NgoE,3042 +conda/auxlib/__pycache__/__init__.cpython-313.pyc,, +conda/auxlib/__pycache__/collection.cpython-313.pyc,, +conda/auxlib/__pycache__/compat.cpython-313.pyc,, +conda/auxlib/__pycache__/decorators.cpython-313.pyc,, +conda/auxlib/__pycache__/entity.cpython-313.pyc,, +conda/auxlib/__pycache__/exceptions.cpython-313.pyc,, +conda/auxlib/__pycache__/ish.cpython-313.pyc,, +conda/auxlib/__pycache__/logz.cpython-313.pyc,, +conda/auxlib/__pycache__/type_coercion.cpython-313.pyc,, +conda/auxlib/collection.py,sha256=APwSFGy5xotgOGJTyjlFVRPz_bRhKszb0HPUCXcjjqE,1941 +conda/auxlib/compat.py,sha256=NYtjb6ECJPchBfVGDMnw4M_FxLNFETDlxBcsFHCi9bI,1352 +conda/auxlib/decorators.py,sha256=ebhm_M7O92h8E0ElZ1c5m4GYmnEz2lELvMv_LJiNpNM,6388 +conda/auxlib/entity.py,sha256=jTd8ViUPSITJbLiZQEcuDdI78Cd79nIb5tXPdZC4pq4,33626 +conda/auxlib/exceptions.py,sha256=tGut8GRJTZYdw2ProFnqSGkF_b_I96aszhpcIJrv9BU,901 +conda/auxlib/ish.py,sha256=bq9Pukx8xphUsc_qQH708U_ZU_rUhlNBRJ-InKGY6Q0,1964 +conda/auxlib/logz.py,sha256=vEwmZFI_LvwjWHEDvF1mxiiGG9oppf-E5oB6K0pDEhI,6089 +conda/auxlib/type_coercion.py,sha256=nvQKnhD8DEaJMuemRSrgHnRDXbOYL5UMmojQw07KPiw,8936 +conda/base/__init__.py,sha256=x4VUuXPG2qbUrJ5KZnFQDD7p1ZvnHsL8G5RuEqTsYxY,520 +conda/base/__pycache__/__init__.cpython-313.pyc,, +conda/base/__pycache__/constants.cpython-313.pyc,, +conda/base/__pycache__/context.cpython-313.pyc,, +conda/base/constants.py,sha256=iNL2mygxJYKVFLafQIcOrXJ6UrHVkx9JcAFJcS2Lt5M,11874 +conda/base/context.py,sha256=cU_rR7Id-98bkJy64byOI9ZmiOsd021V2x5KL22-F-k,90605 +conda/cli/__init__.py,sha256=DkuX3aN6mu_d2Qyx0z0l_783Y4ZTzL64HyeQ6sF7AY8,106 +conda/cli/__pycache__/__init__.cpython-313.pyc,, +conda/cli/__pycache__/actions.cpython-313.pyc,, +conda/cli/__pycache__/common.cpython-313.pyc,, +conda/cli/__pycache__/conda_argparse.cpython-313.pyc,, +conda/cli/__pycache__/condarc.cpython-313.pyc,, +conda/cli/__pycache__/find_commands.cpython-313.pyc,, +conda/cli/__pycache__/helpers.cpython-313.pyc,, +conda/cli/__pycache__/install.cpython-313.pyc,, +conda/cli/__pycache__/main.cpython-313.pyc,, +conda/cli/__pycache__/main_clean.cpython-313.pyc,, +conda/cli/__pycache__/main_commands.cpython-313.pyc,, +conda/cli/__pycache__/main_compare.cpython-313.pyc,, +conda/cli/__pycache__/main_config.cpython-313.pyc,, +conda/cli/__pycache__/main_create.cpython-313.pyc,, +conda/cli/__pycache__/main_env.cpython-313.pyc,, +conda/cli/__pycache__/main_env_config.cpython-313.pyc,, +conda/cli/__pycache__/main_env_create.cpython-313.pyc,, +conda/cli/__pycache__/main_env_list.cpython-313.pyc,, +conda/cli/__pycache__/main_env_remove.cpython-313.pyc,, +conda/cli/__pycache__/main_env_update.cpython-313.pyc,, +conda/cli/__pycache__/main_env_vars.cpython-313.pyc,, +conda/cli/__pycache__/main_export.cpython-313.pyc,, +conda/cli/__pycache__/main_info.cpython-313.pyc,, +conda/cli/__pycache__/main_init.cpython-313.pyc,, +conda/cli/__pycache__/main_install.cpython-313.pyc,, +conda/cli/__pycache__/main_list.cpython-313.pyc,, +conda/cli/__pycache__/main_mock_activate.cpython-313.pyc,, +conda/cli/__pycache__/main_mock_deactivate.cpython-313.pyc,, +conda/cli/__pycache__/main_notices.cpython-313.pyc,, +conda/cli/__pycache__/main_package.cpython-313.pyc,, +conda/cli/__pycache__/main_pip.cpython-313.pyc,, +conda/cli/__pycache__/main_remove.cpython-313.pyc,, +conda/cli/__pycache__/main_rename.cpython-313.pyc,, +conda/cli/__pycache__/main_run.cpython-313.pyc,, +conda/cli/__pycache__/main_search.cpython-313.pyc,, +conda/cli/__pycache__/main_update.cpython-313.pyc,, +conda/cli/actions.py,sha256=-2G1HfcO7BW5JMKYlg1FyUfXumugY7xIKD2enVDXd9s,1673 +conda/cli/common.py,sha256=-ENiR15ygyWxfVkMLLtH-bU6Ftvr1OHvcKWdksNN7KA,12015 +conda/cli/conda_argparse.py,sha256=2Cl5v-NeUC3dFCRV88ko9WzawYVXmEcnE2Xiw11kY4w,13428 +conda/cli/condarc.py,sha256=3413pzjTk6061FkHzD-y7TUFgAYg_cYOYirkMOghOLY,20023 +conda/cli/find_commands.py,sha256=IImE12iwOXHSh61hkeu7rnFq8nj4nUbVSiTr4dyPk4A,2596 +conda/cli/helpers.py,sha256=qRvzO2mNCfkG6FzEZ6RPPxLGu_LmuG6o4ZN8pCbhoXA,20580 +conda/cli/install.py,sha256=mqgchwYNaD4LvYjibe-qBo22QOVT1WhEO4lpZFbGA_E,21706 +conda/cli/main.py,sha256=HpdLRjCzqcv8uSjlCZDe_qO7dFZ5QSHnAzLI4kcveSI,3527 +conda/cli/main_clean.py,sha256=X62utCiU1AJ0Q8DF1xpvql690s5FFHdRQCwzlA7noAc,12202 +conda/cli/main_commands.py,sha256=YEuLYFl5RKmMydtGy0AlOuugUk5lyRx_Ho40fNWhrGU,1120 +conda/cli/main_compare.py,sha256=jtyA9O5zsTlaT7AbUMwRXCL8uzgcmWHpoP-AGwzizEc,4119 +conda/cli/main_config.py,sha256=2kSITQhX2gnjRK6VoFr2gbOLuOOu2gjXoLvzIt8RbNU,26554 +conda/cli/main_create.py,sha256=f3ycWtpICumaMQRjTyccuhlygrwpV9ZaWfQncqKr8vg,5861 +conda/cli/main_env.py,sha256=DIfhSFDec8vc8MyhVXSc3qJvaWU5F7okSl_lSEykKz4,1239 +conda/cli/main_env_config.py,sha256=0flWw1EFTuhoHiHjQc0YsSBcKgGLemDorlskWOgYTk8,1167 +conda/cli/main_env_create.py,sha256=UwnDAvxHOb0e63C4_8Qsc5kECJ1bWKfd6P9c7fkILpU,6704 +conda/cli/main_env_list.py,sha256=s0P-ZWbcGIDZXJVrqC86MQ-NpBxvjOIjr6VhrQ99YlI,1333 +conda/cli/main_env_remove.py,sha256=bRyZzx2Q_pE7sGNKy53_EMhxX2Et4oE9Lfb6utujAkk,1505 +conda/cli/main_env_update.py,sha256=n_cN4UQw1fOgBJqw5GnPnJL6llETAFfhPB_MkClFaYw,5686 +conda/cli/main_env_vars.py,sha256=Vpm5yCP5VbJenejI3v-wnkPdOUgYmL-oL6rXphBsQlU,4623 +conda/cli/main_export.py,sha256=w6W68fWrGVe5DWhwVnk6F5YZbgFwwv5l6ukcRUfxKTs,7081 +conda/cli/main_info.py,sha256=HGizaVvmm92Qi4Ig3sS7SA7Ybk2aYn2K_v7nvVC6rQM,19555 +conda/cli/main_init.py,sha256=CFOBRgkmE8l5FMm-gG6RW0_31wxmMgUHyvVFo7_jqV8,6192 +conda/cli/main_install.py,sha256=onN18JEbbTfW9epssy83hOXBBxrbJpmCD6oWN8XFvag,5725 +conda/cli/main_list.py,sha256=BKTdWy_-jtT8yi95211opM0uZlm9C_6_z-UZDm2ImuE,12858 +conda/cli/main_mock_activate.py,sha256=QvVDdvO3x4DF-adTZzAmSzO5oaASQ8Ka0NTmJX64xSU,893 +conda/cli/main_mock_deactivate.py,sha256=atOwd6Ufhfbqf6hdUhGkWJLSjyPEJmZhGInc2z8haT4,823 +conda/cli/main_notices.py,sha256=y_HWkFN5k-sl6u443sfDCBXYF7lgZr--mS8UkcfdD8M,1666 +conda/cli/main_package.py,sha256=JqJTLg_K4GbdJqpf-wcKBfPrYgwJRHK1NBrKh82xhec,8743 +conda/cli/main_pip.py,sha256=34ltgt1y2cnmkta7PH0ORo-wvCnUj-W7sufwIkr8u30,872 +conda/cli/main_remove.py,sha256=Z7DWuqJoojCaeCCsU_AmjH6GRLFYMWWaSBTNfENiYSE,7722 +conda/cli/main_rename.py,sha256=D_wm4_q65zHNhJ7cxTQI9hHagqogHqeREapVeFw6ZaM,5665 +conda/cli/main_run.py,sha256=LOy0oXHTX1LfIBTNNPABFyvnapIqnxErIWhVgiYGVoA,4697 +conda/cli/main_search.py,sha256=XbXRuhB82iC62zkg5Ru6SSxq00-sOibnerIKQFQNUvU,10437 +conda/cli/main_update.py,sha256=NJkLab64brc1hi6-0Af15LdB4rMK3Uovp4CidNbzMbQ,3962 +conda/common/__init__.py,sha256=L4D64etjtKML2s_v1lAescFsHOLo59Hy1vmbCXu8MWQ,494 +conda/common/__pycache__/__init__.cpython-313.pyc,, +conda/common/__pycache__/_logic.cpython-313.pyc,, +conda/common/__pycache__/compat.cpython-313.pyc,, +conda/common/__pycache__/configuration.cpython-313.pyc,, +conda/common/__pycache__/constants.cpython-313.pyc,, +conda/common/__pycache__/io.cpython-313.pyc,, +conda/common/__pycache__/iterators.cpython-313.pyc,, +conda/common/__pycache__/logic.cpython-313.pyc,, +conda/common/__pycache__/signals.cpython-313.pyc,, +conda/common/__pycache__/toposort.cpython-313.pyc,, +conda/common/__pycache__/url.cpython-313.pyc,, +conda/common/_logic.py,sha256=XN58SBEqr4DknUVDNTpyvnkTsBOJylC__H7yTW5SW2Y,27446 +conda/common/_os/__init__.py,sha256=cRSBZvZv1CNufTFh1Umwc6kPdZL8XBdeW__d5sWzkyo,436 +conda/common/_os/__pycache__/__init__.cpython-313.pyc,, +conda/common/_os/__pycache__/linux.cpython-313.pyc,, +conda/common/_os/__pycache__/osx.cpython-313.pyc,, +conda/common/_os/__pycache__/unix.cpython-313.pyc,, +conda/common/_os/__pycache__/windows.cpython-313.pyc,, +conda/common/_os/linux.py,sha256=M6WRLM7xg-_bdiDQn2G8KoDpMlL3PKjfr4Rr2mHqH3k,2053 +conda/common/_os/osx.py,sha256=saOdjucF997z2NqLWZtgreBw7QyVr1QPyQj16RthKwY,742 +conda/common/_os/unix.py,sha256=3CtSycesTuZvW1-RyVIOHKflAube51kuhpE4zyQxrtg,353 +conda/common/_os/windows.py,sha256=v7EdkAoYy_c-slRftV183uWgsts8AEJfa3OovNnUHfM,5496 +conda/common/compat.py,sha256=GVs3hyAi78D_zsc0zCuddL7EH0mNK52pjWYjRxwH7mI,3071 +conda/common/configuration.py,sha256=7xLT4CF3LGJS0OFF4OilW4_MP_yxsN2p5NFXqjxYkMY,64743 +conda/common/constants.py,sha256=7_84KD-o_ynHgWi585MyQiO7R59OA6ir4qHUOj_3SI8,589 +conda/common/io.py,sha256=ZPMoxLgljgurdoSf7jJ8XBf0Js6zfTFJXECcxVgwWLQ,17176 +conda/common/iterators.py,sha256=CaBL-LeCuC7SRpnnsksbi7ACsGfoeqv3RdFi7AhtrV4,1107 +conda/common/logic.py,sha256=aAXlesrY2PBuiuW4KkqiG_X35JNj7ZQUAxazEiVa1PE,11114 +conda/common/path/__init__.py,sha256=BBqIz_wVZZbTesvcHGqzEbeSS64ERQMJngSKA4-h7QI,6207 +conda/common/path/__pycache__/__init__.cpython-313.pyc,, +conda/common/path/__pycache__/_cygpath.cpython-313.pyc,, +conda/common/path/__pycache__/directories.cpython-313.pyc,, +conda/common/path/__pycache__/python.cpython-313.pyc,, +conda/common/path/__pycache__/windows.cpython-313.pyc,, +conda/common/path/_cygpath.py,sha256=zO7RLyGZipH7Xh1j0aKaUj5K3QBbe5nK8Vnr3ccqM48,7046 +conda/common/path/directories.py,sha256=MeM1hKS3eMntg4IlSW2HU52xC4sbMw--0-tsKnzG_Ms,1675 +conda/common/path/python.py,sha256=8Rh5DK5LxdzqCWdv03S3LtvEnMnshxRCKUQb9M6g5Po,4275 +conda/common/path/windows.py,sha256=IFZuuEYJnBBlMhkWaluL8OTghtwaECIM-GLQJexAVFo,5444 +conda/common/pkg_formats/__init__.py,sha256=PeVza2KsTmy4DSq8qe9IjJe3jw8J5WpY0_LVI7MtRow,201 +conda/common/pkg_formats/__pycache__/__init__.cpython-313.pyc,, +conda/common/pkg_formats/__pycache__/python.cpython-313.pyc,, +conda/common/pkg_formats/python.py,sha256=tIhnl6PoliqKnwgdRrTjtX1EumfWCa8Sz6AiFUaV5cU,1083 +conda/common/serialize/__init__.py,sha256=8Fbb9_pLXstw7BddIYsNnm2zYr2X9o-D8E8ivRa8hIE,2655 +conda/common/serialize/__pycache__/__init__.cpython-313.pyc,, +conda/common/serialize/__pycache__/json.cpython-313.pyc,, +conda/common/serialize/__pycache__/yaml.cpython-313.pyc,, +conda/common/serialize/json.py,sha256=VIxLM1D_6rwu0MioZJdKGPuedxb8cSJUq78xoRVF5FQ,2750 +conda/common/serialize/yaml.py,sha256=z1kyQ-3uv5sVEryvvEKD19beAUbvAwrIYC9HaZMO0e8,2903 +conda/common/signals.py,sha256=a7er8UB5MFO8v1cxw41ZLNzU0KLcR1Y2vFf5eLeZnzI,1788 +conda/common/toposort.py,sha256=jaT1bsNO7nTradJogvPdq9QX-aBQQMzF4gQTjCnv-gE,3288 +conda/common/url.py,sha256=0P6jx_dzQoQp-hnAsKwB3IdfWFb1m9rhzkvWBqNlzvA,15626 +conda/core/__init__.py,sha256=JLaLQ6HLYXkAiCNfoI5_oNpD7MF_dV24dCw6-CSP3S0,698 +conda/core/__pycache__/__init__.cpython-313.pyc,, +conda/core/__pycache__/envs_manager.cpython-313.pyc,, +conda/core/__pycache__/index.cpython-313.pyc,, +conda/core/__pycache__/initialize.cpython-313.pyc,, +conda/core/__pycache__/link.cpython-313.pyc,, +conda/core/__pycache__/package_cache_data.cpython-313.pyc,, +conda/core/__pycache__/path_actions.cpython-313.pyc,, +conda/core/__pycache__/portability.cpython-313.pyc,, +conda/core/__pycache__/prefix_data.cpython-313.pyc,, +conda/core/__pycache__/solve.cpython-313.pyc,, +conda/core/__pycache__/subdir_data.cpython-313.pyc,, +conda/core/envs_manager.py,sha256=fZxc3FNwqi2r4lHWGwbWdc3Ct48uazagpHv8m0_5i7I,7699 +conda/core/index.py,sha256=jKkKlRoIcR_DbvZQyZWhdMpIim6IEMMvCsHqqm-Tng8,26666 +conda/core/initialize.py,sha256=Iy_2GhuB1fOQD3IFz7vutwskbMBF8FQHzBtK1Dyijbc,80730 +conda/core/link.py,sha256=Hrm8sTfVB6EIWfu4cY3A5dSrkqmCz7j0AU-p8P7mk68,64734 +conda/core/package_cache_data.py,sha256=qKUvckY3nbvqKoiKf2Q9Zn502jB_d86gpmGESuOx8Zk,40492 +conda/core/path_actions.py,sha256=AiB9GFnKo33mXkowwO2wI9KYfNPYAPvcHs2uAUMtvYs,53228 +conda/core/portability.py,sha256=btWAzco3Y-riaZxiEgTdh9YUAqL1obZzVQrDGZIGm1U,16066 +conda/core/prefix_data.py,sha256=rRswbE-qcwDxGriR6jPYZszFVOoDto3amh-FLjUFR8Y,33559 +conda/core/solve.py,sha256=Hv_LyD1sZqZcpEsUAELD8wYqvwQWbYP4Pz0O1jrJoCA,62818 +conda/core/subdir_data.py,sha256=Fyb1oz80gWnw46554TGW8A7t4-iz9nZ5tSRXv-BqIxs,28754 +conda/deprecations.py,sha256=5sjJt11Grj2uDrQxzhzKCSyg2TH4dY7kClcQquwhMvo,17610 +conda/env/__init__.py,sha256=Xc6wOJSxSUQz7Z91PPbZ27WAv28rNuNGy0WSNda9uQc,75 +conda/env/__pycache__/__init__.cpython-313.pyc,, +conda/env/__pycache__/env.cpython-313.pyc,, +conda/env/__pycache__/pip_util.cpython-313.pyc,, +conda/env/env.py,sha256=kLpaqV83EwSG64yNcEaL1mDzuckIZ4NM9lYr-UVX-mY,15281 +conda/env/installers/__init__.py,sha256=Xc6wOJSxSUQz7Z91PPbZ27WAv28rNuNGy0WSNda9uQc,75 +conda/env/installers/__pycache__/__init__.cpython-313.pyc,, +conda/env/installers/__pycache__/base.cpython-313.pyc,, +conda/env/installers/__pycache__/conda.cpython-313.pyc,, +conda/env/installers/__pycache__/pip.cpython-313.pyc,, +conda/env/installers/base.py,sha256=n3aymNtgTz1sEs3Bd6Yp4YGBcvy40jSjoXbJDbgPWLs,466 +conda/env/installers/conda.py,sha256=H9E6qLbmNyONfjexWnGPl3TOyPOKBE43QYVCa_A-ziQ,5076 +conda/env/installers/pip.py,sha256=zCebxvkWSdA-3ZwpAq_Ji8WROR-wbu9bN3EDCbVtpJQ,2585 +conda/env/pip_util.py,sha256=igmRvci1WH69H9Cs15pfrW4uxH3pHbJtUPfJqI1q8HY,1420 +conda/env/specs/__init__.py,sha256=mn7CyomLGWZakOnRusTGHzwg9prKu7VMA4GuA303cy0,2482 +conda/env/specs/__pycache__/__init__.cpython-313.pyc,, +conda/env/specs/__pycache__/binstar.cpython-313.pyc,, +conda/env/specs/__pycache__/cep_24.cpython-313.pyc,, +conda/env/specs/__pycache__/explicit.cpython-313.pyc,, +conda/env/specs/__pycache__/requirements.cpython-313.pyc,, +conda/env/specs/__pycache__/yaml_file.cpython-313.pyc,, +conda/env/specs/binstar.py,sha256=CDq5Lh6Jp0EOntGPMJhdJ_ZixDH3J7YG0cYY6v9orww,241 +conda/env/specs/cep_24.py,sha256=UpLY2onzlPKm7q_QN3yx-hvtO0ITCuFF1BPLtnFvaoo,1924 +conda/env/specs/explicit.py,sha256=ypKWMVPRY6APy2EZKhtjOJGgxfUjUco37wAmsN-yGLc,2263 +conda/env/specs/requirements.py,sha256=8Tny8qi1XAQER-q-fQ8pR1rk_PGGHgTnnkwgUXI1ang,5123 +conda/env/specs/yaml_file.py,sha256=r2dSHemjZ1mZedbGn_x0Pwd0EZCr0tEdYP8llLt5Iww,2687 +conda/exception_handler.py,sha256=R-meQ93yBKJrUUO1hKgQ4poqPpxY3T1wJ6-CkeZ75xo,15218 +conda/exceptions.py,sha256=rVzw3wSP6HNtdn_-WTiI1iPVcIMm7QN1b5mjQxqkH9M,49298 +conda/exports.py,sha256=y9BQ6nLLZpKd58vX1nwKnHjE_jwLWJ1ZDPvCMgdK-sc,9472 +conda/gateways/__init__.py,sha256=nGB6VGny0Pmr87aFRZJt_jv4FZmUVp3L3PBxvf2dONQ,732 +conda/gateways/__pycache__/__init__.cpython-313.pyc,, +conda/gateways/__pycache__/anaconda_client.cpython-313.pyc,, +conda/gateways/__pycache__/logging.cpython-313.pyc,, +conda/gateways/__pycache__/subprocess.cpython-313.pyc,, +conda/gateways/anaconda_client.py,sha256=XmlnbyRj45H12lnsRMHA9Uq18h7VdQcnM0tTo7a6D7o,1893 +conda/gateways/connection/__init__.py,sha256=EF2jMXXPZKDeSHkKmT-pUnq_YR_lj08bd08WkNNyDNA,973 +conda/gateways/connection/__pycache__/__init__.cpython-313.pyc,, +conda/gateways/connection/__pycache__/download.cpython-313.pyc,, +conda/gateways/connection/__pycache__/session.cpython-313.pyc,, +conda/gateways/connection/adapters/__init__.py,sha256=Xc6wOJSxSUQz7Z91PPbZ27WAv28rNuNGy0WSNda9uQc,75 +conda/gateways/connection/adapters/__pycache__/__init__.cpython-313.pyc,, +conda/gateways/connection/adapters/__pycache__/ftp.cpython-313.pyc,, +conda/gateways/connection/adapters/__pycache__/http.cpython-313.pyc,, +conda/gateways/connection/adapters/__pycache__/localfs.cpython-313.pyc,, +conda/gateways/connection/adapters/__pycache__/s3.cpython-313.pyc,, +conda/gateways/connection/adapters/ftp.py,sha256=4VYeQ1cyGki2RJ0gXigEbucGkZHM8m35hv-ht4X06Es,9554 +conda/gateways/connection/adapters/http.py,sha256=xRxsRkwaHqpq5BHiLGzsWxQiT76gWGZ5npFSnND7Cz4,2825 +conda/gateways/connection/adapters/localfs.py,sha256=7MdYuRJFybr7I5IrUk-QMO2CxHLDOetq3T2-oLBNkN0,1821 +conda/gateways/connection/adapters/s3.py,sha256=g1Vt_6NJ_wurVIaj_gO5oTpKGIXf07Mmz42f8tkcRdI,3308 +conda/gateways/connection/download.py,sha256=ssi99wnvvp68fsgdIGMUHouCapuhGQJhCCcRj_EtBoM,16245 +conda/gateways/connection/session.py,sha256=C584RPldGOe2rYMkXEGhqcpkbnYkP7kr6lRlYT0EoxQ,14754 +conda/gateways/disk/__init__.py,sha256=1FIK1_eBng0XtJ95nIj9qonndsPNtM9kFcMbBHylAA8,3575 +conda/gateways/disk/__pycache__/__init__.cpython-313.pyc,, +conda/gateways/disk/__pycache__/create.cpython-313.pyc,, +conda/gateways/disk/__pycache__/delete.cpython-313.pyc,, +conda/gateways/disk/__pycache__/link.cpython-313.pyc,, +conda/gateways/disk/__pycache__/lock.cpython-313.pyc,, +conda/gateways/disk/__pycache__/permissions.cpython-313.pyc,, +conda/gateways/disk/__pycache__/read.cpython-313.pyc,, +conda/gateways/disk/__pycache__/test.cpython-313.pyc,, +conda/gateways/disk/__pycache__/update.cpython-313.pyc,, +conda/gateways/disk/create.py,sha256=TVN-1muegqSWpr7Cc5Nh9Gjcx9t_SkoAHalhsilNFRo,16465 +conda/gateways/disk/delete.py,sha256=yNynZ08_AbXp36evbkvnMteQm1IN6mk4SVfNyVZBjIA,10187 +conda/gateways/disk/link.py,sha256=F4UQQBRh2RzOW-zs-RvHTHEvaQ-YAqdWHT_hc9dsRIY,13614 +conda/gateways/disk/lock.py,sha256=E6FXGnkwd2nn-IY22eSYuTFyMTs3whAsMe2LsVTBFvU,2856 +conda/gateways/disk/permissions.py,sha256=yAOWFjeI9bmXUKQzHOWAdyfkdvnUlxtBg3FsY_XKpog,3057 +conda/gateways/disk/read.py,sha256=JarRL13NdvTARC6pN4ADaf28bVbMBI0X3cv7meEN0lo,8495 +conda/gateways/disk/test.py,sha256=3VhyYVpZIhvg0pjju6L_-7UQ9MKSt8vGaUSdl37CmVU,3420 +conda/gateways/disk/update.py,sha256=0SVJ3MQQLgqEH-Jt_XYwWt8i5qFhLPI3Bk8TDLXznrM,6150 +conda/gateways/logging.py,sha256=9mlAwBSy-oo7fEVAENEHFd4RO71TLRNwU5eix5vRpeI,7384 +conda/gateways/repodata/__init__.py,sha256=wSDjKJ-Ol4xMrUmGVBu5BCGPJ5QYsJHLPJ4s0guzlO8,33792 +conda/gateways/repodata/__pycache__/__init__.cpython-313.pyc,, +conda/gateways/repodata/__pycache__/lock.cpython-313.pyc,, +conda/gateways/repodata/jlap/__init__.py,sha256=ClUn_wwlAxu9PuxnDidDZV_S-KDQsLA2aYVdwIw0Qzo,138 +conda/gateways/repodata/jlap/__pycache__/__init__.cpython-313.pyc,, +conda/gateways/repodata/jlap/__pycache__/core.cpython-313.pyc,, +conda/gateways/repodata/jlap/__pycache__/fetch.cpython-313.pyc,, +conda/gateways/repodata/jlap/__pycache__/interface.cpython-313.pyc,, +conda/gateways/repodata/jlap/core.py,sha256=4-zcI0we_C0MDv2fme_jJ7OWe9N1ZBXL27ORtodoWvs,4146 +conda/gateways/repodata/jlap/fetch.py,sha256=hdskf1KV9qZd7XpB-FxyVcik7xnETVKlADLP3ky4q2Y,16284 +conda/gateways/repodata/jlap/interface.py,sha256=V9_4QC_Iq5XL5BTjeTJBnrjyqSkDJlDAdJ3dostsFDs,4659 +conda/gateways/repodata/lock.py,sha256=K8QRj_0au17Ozx7WKc-9Fu2ci5PAvNxkQoNesvKSCqc,195 +conda/gateways/subprocess.py,sha256=9F8XQUcHBB1wTiDi00ntLyS75YrpfFarrG4i0H3R5a4,4846 +conda/history.py,sha256=AVpl9FibV3c2XGQ7QYxTZ_faTIhQLdZ-dLfzCPh_RxE,15693 +conda/instructions.py,sha256=QbSD5GjLh2QnWN2xjrHJ7Nr_tD0NNVEsFk8TpOHGr9A,2769 +conda/misc.py,sha256=IvYJINZvYbNiJxPjoWAUSGcHzOI3XQ6fKoPnX-7xxIE,12628 +conda/models/__init__.py,sha256=3LnN1LhlKAdCERPdWTMimFGYNYSzFAtF3S7JJzeNGcg,685 +conda/models/__pycache__/__init__.cpython-313.pyc,, +conda/models/__pycache__/channel.cpython-313.pyc,, +conda/models/__pycache__/dist.cpython-313.pyc,, +conda/models/__pycache__/enums.cpython-313.pyc,, +conda/models/__pycache__/environment.cpython-313.pyc,, +conda/models/__pycache__/match_spec.cpython-313.pyc,, +conda/models/__pycache__/package_info.cpython-313.pyc,, +conda/models/__pycache__/prefix_graph.cpython-313.pyc,, +conda/models/__pycache__/records.cpython-313.pyc,, +conda/models/__pycache__/version.cpython-313.pyc,, +conda/models/channel.py,sha256=swYUXSgj0tNzYqm19-4ogrSca-InhMR-nysMx0ghj2A,24371 +conda/models/dist.py,sha256=NViRx6xFI5oomfbnT9Ps46UlMyt9Jd52UaKYbaSoYo0,12093 +conda/models/enums.py,sha256=enz1jNBFHc08lpmQi89gME564ONmCowZaZhPXL2ODDQ,4884 +conda/models/environment.py,sha256=FdBorQmkjoj7vtKr1V9xbRqiVdrJIp1j39CVYfNFyQc,21553 +conda/models/match_spec.py,sha256=khpcHkualGfaOY9YeLRD-YxOl0t6k2pmtiEiF5nOG-E,43607 +conda/models/package_info.py,sha256=PhFu10iyInC0dzt7v_okEh6wXFftKU7XzXI1lzW7VHI,2257 +conda/models/prefix_graph.py,sha256=6AxnQZnpHAEwJ3ZhCyXE0GldDvfR8g2Ai2Bd1B_PZOk,16633 +conda/models/records.py,sha256=l4nO-HSnxJu90ufiU5O_8M1hmH4zF4We6qss6Vo4rHo,24239 +conda/models/version.py,sha256=YXMB0Rnu_LzIn8-yPBuLMiU4I0wonqJqObVJgFPMrDQ,26182 +conda/notices/__init__.py,sha256=qZejFJsNxj8WzUycGz1CnTwDKjSIMLk2qmIXJQiF-NU,115 +conda/notices/__pycache__/__init__.cpython-313.pyc,, +conda/notices/__pycache__/cache.cpython-313.pyc,, +conda/notices/__pycache__/core.cpython-313.pyc,, +conda/notices/__pycache__/fetch.cpython-313.pyc,, +conda/notices/__pycache__/types.cpython-313.pyc,, +conda/notices/__pycache__/views.cpython-313.pyc,, +conda/notices/cache.py,sha256=nWlxj-uZXg3DvaDC-cVxIS0hRflCIfocms7w3Xf5gGQ,5231 +conda/notices/core.py,sha256=XrGZ4zA10c0EE5DuaU2Tm3Im0L0NCMT01J7sQLRVyCM,7170 +conda/notices/fetch.py,sha256=nSnrTMZ8veuUnGQ-sywtWG8v41AoweBkyKrkkvj4e-M,2607 +conda/notices/types.py,sha256=-Wz3ikqyMAQ6_HtXXpQF7eTZLPoCbzeabHhShSDuaAo,3631 +conda/notices/views.py,sha256=EerPVSennF1abV_Xks_NZCI_VAaZ79tuMDzaht-cJ38,2040 +conda/plan.py,sha256=Jnf4yxMDBgkMGcecgPOOWA_1o-0owx9LrMG4f-i5884,5678 +conda/plugins/__init__.py,sha256=guYmeJ8-9xk7TV9Fl4s3T_s-zYRkwcioJ7K-HtKAhCA,3955 +conda/plugins/__pycache__/__init__.cpython-313.pyc,, +conda/plugins/__pycache__/config.cpython-313.pyc,, +conda/plugins/__pycache__/hookspec.cpython-313.pyc,, +conda/plugins/__pycache__/manager.cpython-313.pyc,, +conda/plugins/__pycache__/solvers.cpython-313.pyc,, +conda/plugins/__pycache__/types.cpython-313.pyc,, +conda/plugins/config.py,sha256=r-tab7jcI18aDT9ARhp60NDxoMIsqPyL6AzEpM2_yD4,4294 +conda/plugins/environment_exporters/__init__.py,sha256=Mn6hopuxj57k3HiE9ZGWWi_jYdbpE5eKMxBnpb2a6Oc,326 +conda/plugins/environment_exporters/__pycache__/__init__.cpython-313.pyc,, +conda/plugins/environment_exporters/__pycache__/environment_yml.cpython-313.pyc,, +conda/plugins/environment_exporters/__pycache__/explicit.cpython-313.pyc,, +conda/plugins/environment_exporters/__pycache__/requirements_txt.cpython-313.pyc,, +conda/plugins/environment_exporters/environment_yml.py,sha256=AAmKkx9QmAscqFkaR3-2bW7078wJaxoAZdqzAvgw30Y,3738 +conda/plugins/environment_exporters/explicit.py,sha256=EnBldjck9e0DB2st_Xz2acNX5kXJ9_xnfQajpWse89A,3574 +conda/plugins/environment_exporters/requirements_txt.py,sha256=5h_FmUQ9ZhkkoCQn-4wLRmrMySMA0fRlVjZGFbtUMxw,2197 +conda/plugins/environment_specifiers/__init__.py,sha256=3VXIblGv0UoN97guytGN6CPu0iukygbVM7LG6WN6dYI,364 +conda/plugins/environment_specifiers/__pycache__/__init__.cpython-313.pyc,, +conda/plugins/environment_specifiers/__pycache__/cep_24.cpython-313.pyc,, +conda/plugins/environment_specifiers/__pycache__/environment_yml.cpython-313.pyc,, +conda/plugins/environment_specifiers/__pycache__/explicit.cpython-313.pyc,, +conda/plugins/environment_specifiers/__pycache__/requirements_txt.cpython-313.pyc,, +conda/plugins/environment_specifiers/cep_24.py,sha256=55itTvzAl8RMgOdnTXRoRzxEqOGe8ZCatpxsR3g2xlE,454 +conda/plugins/environment_specifiers/environment_yml.py,sha256=fODwplvMbMqR5-ms9Ycpsx9Ae1zBb2vGh1_4MfBQODs,456 +conda/plugins/environment_specifiers/explicit.py,sha256=rNm3jFmaCPcwctwURoQW3omdh23mU9n7rUzCTGOy5fc,426 +conda/plugins/environment_specifiers/requirements_txt.py,sha256=us-fxuqBYujBX5I3sDNNUbQcOKnyP5R9sVJGsl7AiXw,454 +conda/plugins/hookspec.py,sha256=WD2GkuXQlXVlLHtuQwPN8xM6hSMi5zOOzaVxBdv9WTc,24661 +conda/plugins/manager.py,sha256=k4fO38vR0woc0Bxbu_C7YY9iK52EYlajKvTtcOerfgw,35020 +conda/plugins/package_extractors/__init__.py,sha256=AlXLPDZVxlJ3exyjjs4FrOPCQDA5ZzdJMeP3eDExRP0,148 +conda/plugins/package_extractors/__pycache__/__init__.cpython-313.pyc,, +conda/plugins/package_extractors/__pycache__/conda.cpython-313.pyc,, +conda/plugins/package_extractors/conda.py,sha256=Vu-yqWGMdHw0EYkkUrV4fDxVznlwZmw_Lj2cYtLgYVE,2503 +conda/plugins/post_solves/__init__.py,sha256=okGqcsGXCNX5kc8HWc2nTFLwrAVubbuHETEcc7I6yeY,285 +conda/plugins/post_solves/__pycache__/__init__.cpython-313.pyc,, +conda/plugins/post_solves/__pycache__/signature_verification.cpython-313.pyc,, +conda/plugins/post_solves/signature_verification.py,sha256=LCO1i-_4fSqWioNdjH6AUCfRDDj9dbqWhbQ0rMULBYM,761 +conda/plugins/prefix_data_loaders/__init__.py,sha256=w3WDOPuwTxVfPhG7jOqYmWY6tvRYK7qPUlZyF13vAJQ,112 +conda/plugins/prefix_data_loaders/__pycache__/__init__.cpython-313.pyc,, +conda/plugins/prefix_data_loaders/pypi/__init__.py,sha256=nevdkxAtLAYX_j65g1gAQpLWl4FQOnCjVLiAM9WIpkw,6353 +conda/plugins/prefix_data_loaders/pypi/__pycache__/__init__.cpython-313.pyc,, +conda/plugins/prefix_data_loaders/pypi/__pycache__/pkg_format.cpython-313.pyc,, +conda/plugins/prefix_data_loaders/pypi/pkg_format.py,sha256=cij6eFV0ol_mYW2WWhqaVKPSb2HRzDdUktqx5O1zAdE,48895 +conda/plugins/reporter_backends/__init__.py,sha256=ry9SFj-ie-bsYej1T7XeKJ2YRzQWagQY4vvDiNfmMnE,130 +conda/plugins/reporter_backends/__pycache__/__init__.cpython-313.pyc,, +conda/plugins/reporter_backends/__pycache__/console.cpython-313.pyc,, +conda/plugins/reporter_backends/__pycache__/json.cpython-313.pyc,, +conda/plugins/reporter_backends/console.py,sha256=zhrRKhSAZbXsmla3U45453Mqu80RT0ZW7BRvT28Gwr4,8597 +conda/plugins/reporter_backends/json.py,sha256=d2HZHXyisliOO129zJmjusj7dfR21tdjs7whmoOLwcc,3552 +conda/plugins/solvers.py,sha256=lZ99mLvog0oX0S2vs1SgfF9mIeRCITrVxse6qr9ilZc,496 +conda/plugins/subcommands/__init__.py,sha256=D9JxxKjbqbK4AZcm8eJnfJJjr4Aw4AodquXQaRjQCMs,116 +conda/plugins/subcommands/__pycache__/__init__.cpython-313.pyc,, +conda/plugins/subcommands/doctor/__init__.py,sha256=AQISE_iDfIvSRM7EHAvoQE8HaRoZJ6Cd0aflkw6-8PM,4516 +conda/plugins/subcommands/doctor/__pycache__/__init__.cpython-313.pyc,, +conda/plugins/subcommands/doctor/health_checks/__init__.py,sha256=-loNJSufygQGC-4rBFhucQo6oX9H83NTDz6KH0dYK7w,656 +conda/plugins/subcommands/doctor/health_checks/__pycache__/__init__.cpython-313.pyc,, +conda/plugins/subcommands/doctor/health_checks/__pycache__/altered_files.cpython-313.pyc,, +conda/plugins/subcommands/doctor/health_checks/__pycache__/consistency.cpython-313.pyc,, +conda/plugins/subcommands/doctor/health_checks/__pycache__/environment_txt.cpython-313.pyc,, +conda/plugins/subcommands/doctor/health_checks/__pycache__/file_locking.cpython-313.pyc,, +conda/plugins/subcommands/doctor/health_checks/__pycache__/missing_files.cpython-313.pyc,, +conda/plugins/subcommands/doctor/health_checks/__pycache__/pinned.cpython-313.pyc,, +conda/plugins/subcommands/doctor/health_checks/__pycache__/requests_ca_bundle.cpython-313.pyc,, +conda/plugins/subcommands/doctor/health_checks/altered_files.py,sha256=WfvE1JvsjtiCaaFuOphkQ7CuH6XdRfy6pFs8n6cMWOM,3871 +conda/plugins/subcommands/doctor/health_checks/consistency.py,sha256=o-0vWWgEzmXbqJQQa6_MRm0Kwpxzv2c0p40EIANREvk,4652 +conda/plugins/subcommands/doctor/health_checks/environment_txt.py,sha256=Gfb1LdbvoXS_02HBzgP8CauXozfBM2AMl7VrgwaeEmM,2757 +conda/plugins/subcommands/doctor/health_checks/file_locking.py,sha256=jaTbCb18LOyB7FVtLrS5fbmKKxhFwLxMzJoDEAkXKs0,1202 +conda/plugins/subcommands/doctor/health_checks/missing_files.py,sha256=woOoReBPhI6lzw7zBmgBlw3Q3U9HQcZjY3qnjTsUZIM,3031 +conda/plugins/subcommands/doctor/health_checks/pinned.py,sha256=SuLobGBw0pBaoEZAAWB1s6rcPCBxu0sxIweUigbNgPg,4080 +conda/plugins/subcommands/doctor/health_checks/requests_ca_bundle.py,sha256=kg7A_ymiQKqnI88WO8H9PsvoXRC34FGOGBF47zSbNb8,1893 +conda/plugins/types.py,sha256=TyNC27S7JHgaen-_uwg-CVmxAPNF_iy91axgKvcYofg,22039 +conda/plugins/virtual_packages/__init__.py,sha256=5xFFWXkcLptae63gkhH8Ya1XbLAAG-ww_A1TKMxloSE,321 +conda/plugins/virtual_packages/__pycache__/__init__.cpython-313.pyc,, +conda/plugins/virtual_packages/__pycache__/archspec.cpython-313.pyc,, +conda/plugins/virtual_packages/__pycache__/conda.cpython-313.pyc,, +conda/plugins/virtual_packages/__pycache__/cuda.cpython-313.pyc,, +conda/plugins/virtual_packages/__pycache__/freebsd.cpython-313.pyc,, +conda/plugins/virtual_packages/__pycache__/linux.cpython-313.pyc,, +conda/plugins/virtual_packages/__pycache__/osx.cpython-313.pyc,, +conda/plugins/virtual_packages/__pycache__/windows.cpython-313.pyc,, +conda/plugins/virtual_packages/archspec.py,sha256=vtIwgWqFlpQ9VwisfypOZBFUUOhKsbb1ukCDuRyiP3o,782 +conda/plugins/virtual_packages/conda.py,sha256=1odWmsaOvEkKJijlZlarTlVvXkwAcbwTmxzRV7kvDLg,615 +conda/plugins/virtual_packages/cuda.py,sha256=JgkmfZnuVkFc99YWH4TguptbJ-varvEcoEYQdJAdIqk,5221 +conda/plugins/virtual_packages/freebsd.py,sha256=JbHw7Rylkc22cd3Sbwmt1XueltWilE4hMcPMQiu_EGI,708 +conda/plugins/virtual_packages/linux.py,sha256=C-xd9MpVWoHw3I412PpESmuQ5gJr-pRG47sSL2OXD3M,2534 +conda/plugins/virtual_packages/osx.py,sha256=PlIuTf4zf2nCKax-wYrark33qKJ7EiZ4s-90f4utQyc,1263 +conda/plugins/virtual_packages/windows.py,sha256=G1rIfYPAO0cAhb0wR20lK09rPcFQzioiZvsfyFoOchw,1048 +conda/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +conda/reporters.py,sha256=S8AUE_gLFtIIffdIRgvJmBYKr6NHpNRGH-ErLX2VTnU,2787 +conda/resolve.py,sha256=Eljw-s-IxSRaTN1WE40qaeHizCyPEc9mlYUAtAseMec,69223 +conda/shell/Library/bin/conda.bat,sha256=hKsbqhMFT8BkUqiuz7WqYsXPsK0vkZD47iVh-J4Bf74,121 +conda/shell/Scripts/activate.bat,sha256=5W1-QLkOBdt8ukBOFfhcIQnEphc6XV1-tv6hI_4YLEA,1111 +conda/shell/bin/activate,sha256=RNhzx3837W_voLmBF7kPiCsZHYj8BCBgshDsgUg35C4,149 +conda/shell/bin/deactivate,sha256=jm6Z5CsrAQl1RiGZNPo2H1b2RU_6v5HQPTh88JMJk8I,237 +conda/shell/cli-32.exe,sha256=AXDdpglRnAiLHkYZoeHRWgFwGmxRS7Vfmahfy71UFjE,53016 +conda/shell/cli-64.exe,sha256=ksFczN7sw4Vsad19R_4B2Nd4K29K2h29hnkKXnAupz8,54040 +conda/shell/conda.xsh,sha256=qnsGmsr3m5s8mqQwOHnryzDkRWQxvJQy46nkSPAGgM4,7390 +conda/shell/conda_icon.ico,sha256=OdhQ1RaSD84ZdELWRVg0TxsPacDbayB7n6BCFzD1SQE,126355 +conda/shell/condabin/Conda.psm1,sha256=xwP7_p0xeULdlPuZT2ATcbuZhe9ZQZuGcx-vJP2ufWg,7731 +conda/shell/condabin/_conda_activate.bat,sha256=fMesb0Kjt5PEYUXxaBgsuWePr7mCySePtAy3KAmJM0Q,3116 +conda/shell/condabin/activate.bat,sha256=EqSYwn1ietETn45sCPAolmz3TPWmIprqHQsUIQxYViE,143 +conda/shell/condabin/conda-hook.ps1,sha256=CPhZL_Usn1Jqg5wHj5_HO2NR9OlCtlxcQwyZcYfWNV0,90 +conda/shell/condabin/conda.bat,sha256=Kw1kNMG0wMRtXCUgJ376sbDO9oNOWXjikm_6uq3X47s,729 +conda/shell/condabin/conda_auto_activate.bat,sha256=ZCmP1B6KCQ98AX8madnybnMiiKVaGD-6YyAmi2gTjJQ,715 +conda/shell/condabin/conda_hook.bat,sha256=a5BCc15kVj796u_i9Pa1mQlPPMZ7fRHI-RpeHP4Dp-c,641 +conda/shell/condabin/deactivate.bat,sha256=sQV8wQYB6RaUysTLgLFVaOWQuwobY-f6ShsbqBMS2KM,188 +conda/shell/condabin/rename_tmp.bat,sha256=6D-r8u3iWM2rUeMT5-hQ19TkKpaywVZzy4Hdq7dpNYs,149 +conda/shell/etc/fish/conf.d/conda.fish,sha256=u75-0zl1THLTJfL8gF-pmry2Gx_30Caq6NHnEPR-gqA,3444 +conda/shell/etc/profile.d/conda.csh,sha256=ymLhXdGlyDZGnHQP1CIUJ8um4b8lq_3TTPYj3KIzw5o,2022 +conda/shell/etc/profile.d/conda.sh,sha256=Zraru-9b2UMrXy_MgQrJ9Fw4wHQg88FLSd1FhNxggK8,2201 +conda/testing/__init__.py,sha256=GmEBCU47O4PCMxV6JuSSf4l8P3CH0zC-xEEacSFENnQ,2954 +conda/testing/__pycache__/__init__.cpython-313.pyc,, +conda/testing/__pycache__/cases.cpython-313.pyc,, +conda/testing/__pycache__/fixtures.cpython-313.pyc,, +conda/testing/__pycache__/helpers.cpython-313.pyc,, +conda/testing/__pycache__/http_test_server.cpython-313.pyc,, +conda/testing/__pycache__/integration.cpython-313.pyc,, +conda/testing/__pycache__/solver_helpers.cpython-313.pyc,, +conda/testing/cases.py,sha256=oEZufgaOAkmQAqVyWbKHeQ9gufW4b-wgFN0PRyTZpS0,453 +conda/testing/fixtures.py,sha256=XQ6Zpr7IgisEKQSxX6HcLJ7ons-KyrOAyrgGcz4606Q,24391 +conda/testing/gateways/__init__.py,sha256=Xc6wOJSxSUQz7Z91PPbZ27WAv28rNuNGy0WSNda9uQc,75 +conda/testing/gateways/__pycache__/__init__.cpython-313.pyc,, +conda/testing/gateways/__pycache__/fixtures.cpython-313.pyc,, +conda/testing/gateways/fixtures.py,sha256=XFVySza_IaVEAipgmvkX2koGV3FLBgmk3xMFGyxpWIU,4383 +conda/testing/helpers.py,sha256=5COnkpCamzJvVRgn8WxxGs_KnexCde-2OZpdyHbcrOo,23127 +conda/testing/http_test_server.py,sha256=1iSQujto5zynsqycLMb-FfGCEd2LCvRHCKCA4lF_gCQ,2920 +conda/testing/integration.py,sha256=lWWQ-EHU6hf-OU_rniXD814RBCG-tHsUPAY-SPBgH-0,3828 +conda/testing/notices/__init__.py,sha256=Xc6wOJSxSUQz7Z91PPbZ27WAv28rNuNGy0WSNda9uQc,75 +conda/testing/notices/__pycache__/__init__.cpython-313.pyc,, +conda/testing/notices/__pycache__/fixtures.cpython-313.pyc,, +conda/testing/notices/__pycache__/helpers.cpython-313.pyc,, +conda/testing/notices/fixtures.py,sha256=xZRj1B1aJhL56WPVpbyKmd7jZINu2Qs8i5SLKIEv1Q8,1294 +conda/testing/notices/helpers.py,sha256=4NnsyobQqmczvWH1OHObnjfyQvFL_1rnzIWLMQOlQdI,4053 +conda/testing/solver_helpers.py,sha256=J_sVEaDMUy7mlHnP0xthEmhlM3nISRB6xQn-rJkj-qg,47104 +conda/trust/__init__.py,sha256=hQHUKs8Qf-lBCCfm23taKt-U_uvDrYYRuAzMXOozwYA,274 +conda/trust/__pycache__/__init__.cpython-313.pyc,, +conda/trust/__pycache__/constants.cpython-313.pyc,, +conda/trust/__pycache__/signature_verification.cpython-313.pyc,, +conda/trust/constants.py,sha256=zlFUPQSbj97z6gNkbtRNo5a-PffCMkthzEAhe3AVK4U,2816 +conda/trust/signature_verification.py,sha256=IlpDSQhwLufgcK4IbWVMzFiLBLadIbFUDsZO34P3AG8,11540 +conda/utils.py,sha256=rapC3wPPnllTk5HLj13xCECOB1qSbD210kC5tqVvzGU,16313 +conda_env/README.md,sha256=aSlTDVqtGwv4Cc-xBZ_00WotjCZkj1912SNKHa95FBQ,2389 +conda_env/__init__.py,sha256=_MeKNchxNWv6ONduTfaHQCpkcB_mJzRkeQ97z8qE3nQ,196 +conda_env/__pycache__/__init__.cpython-313.pyc,, +conda_env/cli/__init__.py,sha256=G8ALfOi7Gn1pmAowcRFnmsU-aCif2MoEQ_v9SJ6AX9w,152 +conda_env/cli/__pycache__/__init__.cpython-313.pyc,, +conda_env/installers/__init__.py,sha256=G8ALfOi7Gn1pmAowcRFnmsU-aCif2MoEQ_v9SJ6AX9w,152 +conda_env/installers/__pycache__/__init__.cpython-313.pyc,, +tests/data/recipes/activate_deactivate_package/src/etc/conda/activate.d/activate.bat,sha256=ExRqo4kq6_IrZpUTur2J2WdoFSi-EX9MzYFC3KrOKHM,120 +tests/data/recipes/activate_deactivate_package/src/etc/conda/activate.d/activate.sh,sha256=v_2Cxyn3WEKgVKYoBEuB5WsMtdypkQ3U3SObt1jt2Yc,74 +tests/data/recipes/activate_deactivate_package/src/etc/conda/deactivate.d/deactivate.bat,sha256=5O5-sotlPKxEQyOz44t08meMxSgQ_4370db7XuwUSLQ,52 +tests/data/recipes/activate_deactivate_package/src/etc/conda/deactivate.d/deactivate.sh,sha256=4KIMhteeaC0tHmB5exM26OiFCv9uJyu2yCFj3QrnMRI,90 diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/REQUESTED b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/WHEEL b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..12228d414b6cfed7c39d3781c85c63256a1d7fb5 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.27.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/direct_url.json b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..35057da2e742a04ce914be7c0c8f607aee4c5982 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/task_177140125005974/croot/conda_1771402194624/work/conda-src"} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/entry_points.txt b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..6d7da3a6e231bb52990a75097606ab894b85d227 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +conda = conda.cli.main_pip:main diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/licenses/AUTHORS.md b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/licenses/AUTHORS.md new file mode 100644 index 0000000000000000000000000000000000000000..e2fc5f759d97e5726805021828f7f5eb8326c65a --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/licenses/AUTHORS.md @@ -0,0 +1,487 @@ +All of the people who have made at least one contribution to conda. +Authors are sorted alphabetically. + +* ARF1 +* Aaron Meurer +* Abheek Mathur +* Adrian Freund +* Agriya Khetarpal +* Ahmet Deger +* Alain Domissy +* Alan Du +* Albert DeFusco +* Albert Kottke +* Alberto Gobbi +* Alex Alvarez +* Alex Hall +* Alex Liew +* Alex Wiltschko +* Ali Abbas Zaidi +* Alisue +* Almar Klein +* Amelio Vazquez-Reina +* Amir Mohammadi +* Andrea Ghensi +* Andreas Girgensohn +* Andrew Achkar +* Andrew Arendt +* Andrew M. Farrell +* Andy Kipp +* Andy R. Terrel +* Angela Gloyna +* Aniket Patil +* Anthon van der Neut +* Anthony Scopatz +* Antoine Gallix +* Antoine Prouvost +* Antony Lee +* Anže Starič +* ApurvaWavhal +* Armin Burgmeier +* Arqam Hussain +* Attila Nagy +* Aurelien Vallee +* Avalon +* Bas Nijholt +* Bastian Zimmermann +* Ben Bodenmiller +* Ben Mares +* Benedikt Wildenhain +* Benjamin Bertrand +* Benjamin Fischer +* Benjamin Wilhelm +* Benjamin Zaitlen +* Bernardo da Eira Duarte +* Bernd Jünger +* Berton Earnshaw +* Bhanuja Karumuru +* Bianca Henderson +* Billy Keyes +* Blake Nicholson +* Bocong Sui +* Bojan Delic +* Brad Erickson +* Brad Nemanich +* Brad S +* Bradley Kreider +* Brennan Chapman +* Brent Pedersen +* Brett Cannon +* Brett Randall +* Brian W. Hart +* Bruno Oliveira +* Bryan Van de Ven +* Carl Anderson +* Carlos H Brandt +* Casper da Costa-Luis +* Chawye Hsu +* Cheng H. Lee +* Chris Burr +* Chris Granade +* Chris Linton-Ford +* Chris Osborn +* Chris Tomkins-Tinch +* Christine Doig +* Christoph Buchner +* Christoph Deil +* Christoph Stich +* Christopher Barber +* Christopher Granade +* Christopher Howard +* Christopher J. Wright +* Christos Panopoulos +* ColemanTom +* Colin Brislawn +* Conda Bot +* Cong +* Connor Martin +* Crystal Soja +* Daekwon Yun +* Dainese Hsiao +* Dan Blanchard +* Dan Dascalescu +* Dan Lovell +* Dan Meador +* Dan Yeaw +* Daniel Bast +* Daniel Holth +* Daniel Hook +* Daniel Wehner +* Daniel Zeng +* Dario Curreri +* Darren Dale +* Dave +* Dave Hirschfeld +* Dave Hogue +* Dave Masino +* David Froger +* David Kent +* David Li +* David Mertz +* David Warde-Farley +* Deepyaman Datta +* Dennis George +* Derek Ludwig +* Diogo de Campos +* Duncan Macleod +* Dylan Morroll +* Dylan Orzel +* Dzianis Shpektarau +* Ed Reed +* Eli Rykoff +* Elsa Granger +* Eric Dill +* Eric Prestat +* Erik Sundell +* Erik Whiting +* Ernst Reissner +* Eugene Van den Bulke +* Evo +* Faith Rider +* Faustin Carter +* FelisNivalis +* Filipe Laíns +* Flavio Martins +* Florenz A. P. Hollebrandse +* Floris Bruynooghe +* Forrest Waters +* Frederic Bastien +* Gabe Martin-Dempesy +* Gabriel Reis +* Gayan Silva +* Geir Ove Myhr +* George Hartzell +* Giacomo Cirò +* Gil Forsyth +* Giles Cope +* Gonzalo Peña-Castellanos +* Greg Brener +* Gregor Kržmanc +* Guilherme Quentel Melo +* Guo Ci +* Hamza Sheikh +* Havoc Pennington +* Henning Schroder +* Hsin-Hsiang Peng +* Hugo Buddelmeijer +* Iain Gillis +* Ian Fitchet +* Ian Stokes-Rees +* Igor Igamberdiev +* Ikko Eltociear Ashimine +* Ilan Cosman +* Ilan Schnell +* Ilango Rajagopal +* InfiniteChai +* Isaiah Norton +* Isuru Fernando +* Ivan Smirnov +* Jacob Hultman +* Jacob Smith +* Jacopo Sabbatini +* Jacques Kvam +* Jaime Rodríguez-Guerra +* James Domingo +* James Myatt +* James Penn +* James Sexton +* James Winegar +* Jan-Benedikt Jagusch +* Jan-Philipp Igla +* Jannis Leidel +* Jason Carpenter +* Jason Grout +* Jason Vestuto +* Javier Rovegno +* Jayson Messenger +* Jeffrey Gill +* Jeremy Liu +* Jerimiah Willhite +* Jesse Hamer +* Jillian Rowe +* Joao Azevedo +* Joe D +* Joe Jevnik +* Joel Hull +* Joel Kim +* Joel Tony +* Johan Carlin +* Johannes Köster +* John Ayad +* John Flavin +* John Kirkham +* Johnny Núñez Cano +* Jonas Haag +* Jonathan J. Helmus +* Josh Mayer +* Juan Luis Cano Rodríguez +* Juan Nunez-Iglesias +* Julien Schueller +* Justin Wood (Callek) +* Justus Schwabedal +* Justyn Harriman +* Kahlil Hodgson +* Kai Tietz +* Kale Franz +* Kamil Kwiek +* Kannan Jayachandran +* Kara de la Marck +* Katherine Abrikian +* Katherine Kinnaman +* Kelvin Ou +* Ken Odegard +* Kenneth Laskoski +* Kenneth Schackart +* Kerry Watson +* Kevin Deldycke +* Kfir Zvi +* Kian-Meng Ang +* Klaus Zimmermann +* Korijn van Golen +* Kurt Wheeler +* Kyle Gerard Felker +* Larry Bradley +* Lila Hickey +* Lorcan Hamill +* Lori A. Burns +* Loïc Estève +* Luc J. Bourhis +* Luis Gutierrez +* Maggie Mari +* Mahe Iram Khan +* Majid alDosari +* Mak Sze Chun +* Maksim Rakitin +* Mandeep Bhutani +* Mansour Moufid +* Marcel Bargull +* Marcel Stimberg +* Marcelo Duarte Trevisani +* Marcin Wojdyr +* Marco Esters +* Marco Rossi +* Marcos Vanetta +* Marcus Caisey +* Mario Juric +* Mark Edzel Potane +* Mark Harfouche +* Mark Wiebe +* Markus Gerstel +* Marland Sitt +* Martin Dengler +* Martin Kou +* Martin Lang +* Martin Prüsse +* Martin Raden +* Mary M +* Matt Craig +* Matt Kramer +* Matthew Anderson +* Matthew Dillon +* Matthew Feickert +* Matthew Linebaugh +* Matthew R. Becker +* Matthew Rocklin +* Matthew Wardrop +* Matthieu Guillaumin +* Matthieu Muffato +* MatthieuDartiailh +* Matti Picus +* Maurice Meyer +* Max Reeder +* Maximilian Noethe +* Maya Gilad +* Meixu Song +* Mervin Fansler +* Michael Albert +* Michael C. Grant +* Michael Heilman +* Michael Kincaid +* Michael Marchetti +* Michael Sarahan +* Michael Wild +* Michaël Defferrard +* Michele Mastropietro +* Mickey Rose +* Mihir Rege +* Mika Fischer +* Mike Croucher +* MinRK +* Minh Phan +* Monius +* Morgan Parry +* Morten Enemark Lund +* Murray Read +* NaincyKumariKnoldus +* Nate Coraor +* Nathan Nguyen +* Navdeeppal Singh +* Nehal J Wani +* Nelson Liu +* Ni Huang +* Nicholas Blair +* Nicholas Pierotti +* Nick Eubank +* Nicky Sandhu +* Nikhil Dhandre +* Nikhil Raverkar +* Niklas Holm +* Nils Koch +* Nir Ganani +* Nitin Madnani +* Nixon Kwok +* Noah Pendleton +* Ofek Lev +* Ohad Ravid +* Oleg Samoylenko +* Oleh Khoma +* Ondřej Čertík +* Orion Poplawski +* Patricio Hubmann +* Patrick Snape +* Paul Yim +* Pavel Zwerschke +* Pete Bachant +* Peter Cable +* Peter Talley +* Peter Williams +* Peyton Murray +* Phil Elson +* Philip Thomas +* Philippe Mathieu +* Philippe Ombredanne +* Pirzada Ahmad Faraz +* Pradipta Ghosh +* Preston Moore +* Rachel Rigdon +* Rafael de Barros +* Ralf Gommers +* Rami Chowdhury +* Ramsey D'silva +* Ravi Gummadi +* Ray Donnelly +* Remi Rampin +* Riccardo Vianello +* Rich Lewis +* Richard Gowers +* Robert Johansson +* Robin +* Roger Erens +* Rollin Thomas +* Ryan Grout +* Ryan Keith +* Rüdiger Busche +* Saad Parwaiz +* Sachin G Biradar +* Sam Davis +* Sam Haese +* Sam Nicholls +* Samson Yeung +* Samuel Debionne +* Samuel Walters-Nevet +* Sanskrati +* Santi Villalba +* Santiago Castro +* Sarah Bird +* Saranya Mahalingam +* Satyam Vyas +* Sauco Cano Navarro +* Schuyler Martin +* Scott Evtuch +* Scruel Tao +* Sean Ross-Ross +* Sebastien Awwad +* Sergio Oller +* Serhii Kupriienko +* Shannon Green +* Shaun Thompson +* Shaun Walbridge +* Sidhant Bansal +* Simon Høxbro Hansen +* Simon Li +* Simon McLaren +* Skipper Seabold +* Sophia Castellarin +* Spencer Mathews +* Srivas Venkatesh +* Stan Seibert +* Stanis Shkel +* Stefaan Lippens +* Stefan Scherfke +* Stefan Seefeld +* Steffen Van +* Stephan Hoyer +* Stephen Robinson +* Steve Palmroth +* Steven Engler +* Stijn Verstraeten +* Stuart Berg +* Sumanth +* Sylvain Corlay +* Tadeu Manoel +* Tarcisio +* Teake Nutma +* Thomas Holder +* Thomas Kluyver +* Thomas Lam +* Thomas Wiecki +* Thorsten Beier +* Théo Segonds +* Tian Zhang +* Tianchen Zhong +* Tim Gates +* Tim Hoffmann +* Tim Hopper +* Tim Snyder +* Tobias Megies +* Tom Hu +* Tom Saleeba +* Travis E. Oliphant +* Travis Hathaway +* Travis Swicegood +* Trent Nelson +* Troy Powell +* Tyler Kim +* Tyrone Grandison +* Udo-Peter Steyer +* Ujjwal Das +* Ullrich Koethe +* Uwe L. Korn +* Valentin Haenel +* Victor Ma +* Vlad Frolov +* Vlad Zagorodniy +* Vladyslav Shevchenko +* Wes Roach +* Wes Turner +* Will Warner +* Willy Chen +* Winston Sebastian Pais +* Wolf Vollprecht +* Wolfgang Ulmer +* Xuehai Pan +* Xylar Asay-Davis +* Yaroslav Dmytryk +* Yuval Reches +* Yuvi Panda +* Zach Heaton +* Zahari +* Zhiwei Liang +* Zongyuan Zuo +* dependabot[bot] +* endolith +* giumas +* kanehira +* lexual +* mcopes73 +* oinizan +* ovz +* padeoe +* peter1000 +* pre-commit CI +* saraneem +* shadow_walker +* ugurthemaster +* wulmer +* Øystein Idema Torget +* İrem "Siren" Kuyucu diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/licenses/LICENSE b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a2fbff055a4a2c501a54936ad1ec343ea049bce2 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda-26.1.1.dist-info/licenses/LICENSE @@ -0,0 +1,35 @@ +BSD 3-Clause License + +Copyright (c) 2012, Anaconda, Inc. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +Conda incorporates the following libraries into its distributed code: + +* auxlib, licensed as ISC +* frozendict, license as LGPL-3.0 diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/gateways/__init__.py b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/gateways/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..89baace772768b1a316ab48e28e2395ed0d2650d --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/gateways/__init__.py @@ -0,0 +1,2 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/gateways/fixtures.py b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/gateways/fixtures.py new file mode 100644 index 0000000000000000000000000000000000000000..aeb44ee622e395eefe7d8bf2e5623754caefd54a --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/gateways/fixtures.py @@ -0,0 +1,131 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Collection of pytest fixtures used in conda.gateways tests.""" + +import os +import socket +from pathlib import Path +from shutil import which + +import pytest +from xprocess import ProcessStarter + +from ...common.serialize import json + +MINIO_EXE = which("minio") + + +# rely on tests not requesting this fixture, and pytest not creating this if +# MINIO_EXE was not found +@pytest.fixture() +def minio_s3_server(xprocess, tmp_path): + """ + Mock a local S3 server using `minio` + + This requires: + - pytest-xprocess: runs the background process + - minio: the executable must be in PATH + + Note, the given S3 server will be EMPTY! The test function needs + to populate it. You can use + `conda.testing.helpers.populate_s3_server` for that. + """ + + class Minio: + # The 'name' below will be the name of the S3 bucket containing + # keys like `noarch/repodata.json` + # see https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html + name = "minio-s3-server" + port = 9000 + + def __init__(self): + (Path(tmp_path) / self.name).mkdir() + + @property + def server_url(self): + return f"{self.endpoint}/{self.name}" + + @property + def endpoint(self): + return f"http://localhost:{self.port}" + + def populate_bucket(self, endpoint, bucket_name, channel_dir): + """Prepare the s3 connection for our minio instance""" + from boto3.session import Session + from botocore.client import Config + + # Make the minio bucket public first + # https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-example-bucket-policies.html#set-a-bucket-policy + session = Session() + client = session.client( + "s3", + endpoint_url=endpoint, + aws_access_key_id="minioadmin", + aws_secret_access_key="minioadmin", + config=Config(signature_version="s3v4"), + region_name="us-east-1", + ) + bucket_policy = json.dumps( + { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "AddPerm", + "Effect": "Allow", + "Principal": "*", + "Action": ["s3:GetObject"], + "Resource": f"arn:aws:s3:::{bucket_name}/*", + } + ], + } + ) + client.put_bucket_policy(Bucket=bucket_name, Policy=bucket_policy) + + # Minio has to start with an empty directory; once available, + # we can import all channel files by "uploading" them + for current, _, files in os.walk(channel_dir): + for f in files: + path = Path(current, f) + key = path.relative_to(channel_dir) + client.upload_file( + str(path), + bucket_name, + str(key).replace("\\", "/"), # MinIO expects Unix paths + ExtraArgs={"ACL": "public-read"}, + ) + + print("Starting mock_s3_server") + minio = Minio() + + class Starter(ProcessStarter): + pattern = "MinIO Object Storage Server" + terminate_on_interrupt = True + timeout = 10 + args = [ + MINIO_EXE, + "server", + f"--address=:{minio.port}", + tmp_path, + ] + + def startup_check(self, port=minio.port): + s = socket.socket() + address = "localhost" + error = False + try: + s.connect((address, port)) + except Exception as e: + print( + "something's wrong with %s:%d. Exception is %s" % (address, port, e) + ) + error = True + finally: + s.close() + + return not error + + # ensure process is running and return its logfile + pid, logfile = xprocess.ensure(minio.name, Starter) + print(f"Server (PID: {pid}) log file can be found here: {logfile}") + yield minio + xprocess.getinfo(minio.name).terminate() diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/notices/__init__.py b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/notices/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..89baace772768b1a316ab48e28e2395ed0d2650d --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/notices/__init__.py @@ -0,0 +1,2 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/notices/fixtures.py b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/notices/fixtures.py new file mode 100644 index 0000000000000000000000000000000000000000..b4889e062cad32fc6c48766f18049bb298c406fd --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/notices/fixtures.py @@ -0,0 +1,42 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Collection of pytest fixtures used in conda.notices tests.""" + +from pathlib import Path +from unittest import mock + +import pytest + +from ...base.constants import DEFAULTS_CHANNEL_NAME, NOTICES_CACHE_SUBDIR +from ...base.context import reset_context +from ...cli.conda_argparse import generate_parser + + +@pytest.fixture(scope="function") +def notices_cache_dir(tmpdir): + """ + Fixture that creates the notices cache dir while also mocking + out a call to user_cache_dir. + """ + with mock.patch("conda.notices.cache.user_cache_dir") as user_cache_dir: + user_cache_dir.return_value = tmpdir + cache_dir = Path(tmpdir).joinpath(NOTICES_CACHE_SUBDIR) + cache_dir.mkdir(parents=True, exist_ok=True) + + yield cache_dir + + +@pytest.fixture(scope="function") +def notices_mock_fetch_get_session(): + with mock.patch("conda.notices.fetch.get_session") as mock_get_session: + mock_get_session.return_value = mock.MagicMock() + yield mock_get_session + + +@pytest.fixture(scope="function") +def conda_notices_args_n_parser(): + parser = generate_parser() + args = parser.parse_args(["notices", f"--channel={DEFAULTS_CHANNEL_NAME}"]) + reset_context((), args) + + return args, parser diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/notices/helpers.py b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/notices/helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..5e5e1458eddda7d28b9015f19e01e168a8f07f43 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/notices/helpers.py @@ -0,0 +1,143 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Collection of helper functions used in conda.notices tests.""" + +from __future__ import annotations + +import datetime +import os +import uuid +from itertools import chain +from pathlib import Path +from typing import TYPE_CHECKING + +from ...common.serialize import json +from ...models.channel import get_channel_objs +from ...notices.cache import get_notices_cache_file +from ...notices.core import get_channel_name_and_urls +from ...notices.types import ChannelNoticeResponse + +if TYPE_CHECKING: + from collections.abc import Sequence + from unittest import mock + + from ...base.context import Context + +DEFAULT_NOTICE_MESG = "Here is an example message that will be displayed to users" + + +def get_test_notices( + messages: Sequence[str], + level: str | None = "info", + created_at: datetime.datetime | None = None, + expired_at: datetime.datetime | None = None, +) -> dict: + created_at = created_at or datetime.datetime.now(datetime.timezone.utc) + expired_at = expired_at or created_at + datetime.timedelta(days=7) + + return { + "notices": [ + { + "id": str(uuid.uuid4()), + "message": message, + "level": level, + "created_at": created_at.isoformat(), + "expired_at": expired_at.isoformat(), + } + for message in messages + ] + } + + +def add_resp_to_mock( + mock_session: mock.MagicMock, + status_code: int, + messages_json: dict, + raise_exc: bool = False, +) -> None: + """Adds any number of MockResponse to MagicMock object as side_effects""" + + def forever_404(): + while True: + yield MockResponse(404, {}) + + def one_200(): + yield MockResponse(status_code, messages_json, raise_exc=raise_exc) + + chn = chain(one_200(), forever_404()) + mock_session().get.side_effect = tuple(next(chn) for _ in range(100)) + + +def create_notice_cache_files( + cache_dir: Path, + cache_files: Sequence[str], + messages_json_seq: Sequence[dict], +) -> None: + """Creates the cache files that we use in tests""" + for message_json, file in zip(messages_json_seq, cache_files): + with cache_dir.joinpath(file).open("w") as fp: + json.dump(message_json, fp) + + +def offset_cache_file_mtime(mtime_offset) -> None: + """ + Allows for offsetting the mtime of the notices cache file. This is often + used to mock an older creation time the cache file. + """ + cache_file = get_notices_cache_file() + os.utime( + cache_file, + times=(cache_file.stat().st_atime, cache_file.stat().st_mtime - mtime_offset), + ) + + +class DummyArgs: + """Dummy object that sets all kwargs as object properties.""" + + def __init__(self, **kwargs): + self.no_ansi_colors = True + + for key, val in kwargs.items(): + setattr(self, key, val) + + +def notices_decorator_assert_message_in_stdout( + captured, + messages: Sequence[str], + dummy_mesg: str | None = None, + not_in: bool = False, +): + """ + Tests a run of notices decorator where we expect to see the messages + print to stdout. + """ + assert captured.err == "" + assert dummy_mesg in captured.out + + for mesg in messages: + if not_in: + assert mesg not in captured.out + else: + assert mesg in captured.out + + +class MockResponse: + def __init__(self, status_code, json_data, raise_exc=False): + self.status_code = status_code + self.json_data = json_data + self.raise_exc = raise_exc + + def json(self): + if self.raise_exc: + raise ValueError("Error") + return self.json_data + + +def get_notice_cache_filenames(ctx: Context) -> tuple[str]: + """Returns the filenames of the cache files that will be searched for""" + channel_urls_and_names = get_channel_name_and_urls(get_channel_objs(ctx)) + + return tuple( + ChannelNoticeResponse.get_cache_key(url, Path("")).name + for url, name in channel_urls_and_names + ) diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/solver_helpers.py b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/solver_helpers.py new file mode 100644 index 0000000000000000000000000000000000000000..6e900a2a90526d1216f630ea50d3f81eb8a880de --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/testing/solver_helpers.py @@ -0,0 +1,1324 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Helpers for testing the solver.""" + +from __future__ import annotations + +import collections +import functools +import pathlib +import time +from tempfile import TemporaryDirectory + +import pytest + +from ..base.context import context +from ..common.serialize import json +from ..core.solve import Solver +from ..exceptions import ( + PackagesNotFoundError, + ResolvePackageNotFound, + UnsatisfiableError, +) +from ..models.channel import Channel +from ..models.match_spec import MatchSpec +from ..models.records import PackageRecord +from . import helpers + + +@functools.cache +def index_packages(num): + """Get the index data of the ``helpers.get_index_r_*`` helpers.""" + # XXX: get_index_r_X should probably be refactored to avoid loading the environment like this. + get_index = getattr(helpers, f"get_index_r_{num}") + index, _ = get_index(context.subdir) + return list(index.values()) + + +def package_string(record): + return f"{record.channel.name}::{record.name}-{record.version}-{record.build}" + + +def package_string_set(packages): + """Transforms package container in package string set.""" + return {package_string(record) for record in packages} + + +def package_dict(packages): + """Transforms package container into a dictionary.""" + return {record.name: record for record in packages} + + +class SimpleEnvironment: + """Helper environment object.""" + + REPO_DATA_KEYS = ( + "build", + "build_number", + "depends", + "license", + "md5", + "name", + "sha256", + "size", + "subdir", + "timestamp", + "version", + "track_features", + "features", + ) + + def __init__(self, path, solver_class, subdirs=context.subdirs): + self._path = pathlib.Path(path) + self._prefix_path = self._path / "prefix" + self._channels_path = self._path / "channels" + self._solver_class = solver_class + self.subdirs = subdirs + self.installed_packages = [] + # if repo_packages is a list, the packages will be put in a `test` channel + # if it is a dictionary, it the keys are the channel name and the value + # the channel packages + self.repo_packages: list[str] | dict[str, list[str]] = [] + + def solver(self, add, remove): + """Writes ``repo_packages`` to the disk and creates a solver instance.""" + channels = [] + self._write_installed_packages() + for channel_name, packages in self._channel_packages.items(): + self._write_repo_packages(channel_name, packages) + channel = Channel(str(self._channels_path / channel_name)) + channels.append(channel) + return self._solver_class( + prefix=self._prefix_path, + subdirs=self.subdirs, + channels=channels, + specs_to_add=add, + specs_to_remove=remove, + ) + + def solver_transaction(self, add=(), remove=(), as_specs=False): + packages = self.solver(add=add, remove=remove).solve_final_state() + if as_specs: + return packages + return package_string_set(packages) + + def install(self, *specs, as_specs=False): + return self.solver_transaction(add=specs, as_specs=as_specs) + + def remove(self, *specs, as_specs=False): + return self.solver_transaction(remove=specs, as_specs=as_specs) + + @property + def _channel_packages(self): + """Helper that unfolds the ``repo_packages`` into a dictionary.""" + if isinstance(self.repo_packages, dict): + return self.repo_packages + return {"test": self.repo_packages} + + def _package_data(self, record): + """Turn record into data, to be written in the JSON environment/repo files.""" + data = { + key: value + for key, value in vars(record).items() + if key in self.REPO_DATA_KEYS + } + if "subdir" not in data: + data["subdir"] = context.subdir + return data + + def _write_installed_packages(self): + if not self.installed_packages: + return + conda_meta = self._prefix_path / "conda-meta" + conda_meta.mkdir(exist_ok=True, parents=True) + # write record files + for record in self.installed_packages: + record_path = ( + conda_meta / f"{record.name}-{record.version}-{record.build}.json" + ) + record_data = self._package_data(record) + record_data["channel"] = record.channel.name + record_path.write_text(json.dumps(record_data)) + # write history file + history_path = conda_meta / "history" + history_path.write_text( + "\n".join( + ( + "==> 2000-01-01 00:00:00 <==", + *map(package_string, self.installed_packages), + ) + ) + ) + + def _write_repo_packages(self, channel_name, packages): + """Write packages to the channel path.""" + # build package data + package_data = collections.defaultdict(dict) + for record in packages: + package_data[record.subdir][record.fn] = self._package_data(record) + # write repodata + assert set(self.subdirs).issuperset(set(package_data.keys())) + for subdir in self.subdirs: + subdir_path = self._channels_path / channel_name / subdir + subdir_path.mkdir(parents=True, exist_ok=True) + subdir_path.joinpath("repodata.json").write_text( + json.dumps( + { + "info": { + "subdir": subdir, + }, + "packages": package_data.get(subdir, {}), + } + ) + ) + + +def empty_prefix(): + return TemporaryDirectory(prefix="conda-test-repo-") + + +@pytest.fixture() +def temp_simple_env(solver_class=Solver) -> SimpleEnvironment: + with empty_prefix() as prefix: + yield SimpleEnvironment(prefix, solver_class) + + +class SolverTests: + """Tests for :py:class:`conda.core.solve.Solver` implementations.""" + + @property + def solver_class(self) -> type[Solver]: + """Class under test.""" + raise NotImplementedError + + @property + def tests_to_skip(self): + return {} # skip reason -> list of tests to skip + + @pytest.fixture(autouse=True) + def skip_tests(self, request): + for reason, skip_list in self.tests_to_skip.items(): + if request.node.name in skip_list: + pytest.skip(reason) + + @pytest.fixture() + def env(self): + with TemporaryDirectory(prefix="conda-test-repo-") as tmpdir: + self.env = SimpleEnvironment(tmpdir, self.solver_class) + yield self.env + self.env = None + + def find_package_in_list(self, packages, **kwargs): + for record in packages: + if all(getattr(record, key) == value for key, value in kwargs.items()): + return record + + def find_package(self, **kwargs): + if isinstance(self.env.repo_packages, dict): + if "channel" not in kwargs: + raise ValueError( + "Repo has multiple channels, the `channel` argument must be specified" + ) + packages = self.env.repo_packages[kwargs["channel"]] + else: + packages = self.env.repo_packages + return self.find_package_in_list(packages, **kwargs) + + def assert_unsatisfiable(self, exc_info, entries): + """Helper to assert that a :py:class:`conda.exceptions.UnsatisfiableError` + instance as a the specified set of unsatisfiable specifications. + """ + assert issubclass(exc_info.type, UnsatisfiableError) + if exc_info.type is UnsatisfiableError: + assert ( + sorted( + tuple(map(str, entries)) for entries in exc_info.value.unsatisfiable + ) + == entries + ) + + def test_empty(self, env): + env.repo_packages = index_packages(1) + assert env.install() == set() + + def test_iopro_mkl(self, env): + env.repo_packages = index_packages(1) + assert env.install("iopro 1.4*", "python 2.7*", "numpy 1.7*") == { + "test::iopro-1.4.3-np17py27_p0", + "test::numpy-1.7.1-py27_0", + "test::openssl-1.0.1c-0", + "test::python-2.7.5-0", + "test::readline-6.2-0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::unixodbc-2.3.1-0", + "test::zlib-1.2.7-0", + "test::distribute-0.6.36-py27_1", + "test::pip-1.3.1-py27_1", + } + + def test_iopro_nomkl(self, env): + env.repo_packages = index_packages(1) + assert env.install( + "iopro 1.4*", "python 2.7*", "numpy 1.7*", MatchSpec(track_features="mkl") + ) == { + "test::iopro-1.4.3-np17py27_p0", + "test::mkl-rt-11.0-p0", + "test::numpy-1.7.1-py27_p0", + "test::openssl-1.0.1c-0", + "test::python-2.7.5-0", + "test::readline-6.2-0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::unixodbc-2.3.1-0", + "test::zlib-1.2.7-0", + "test::distribute-0.6.36-py27_1", + "test::pip-1.3.1-py27_1", + } + + def test_mkl(self, env): + env.repo_packages = index_packages(1) + assert env.install("mkl") == env.install( + "mkl 11*", MatchSpec(track_features="mkl") + ) + + def test_accelerate(self, env): + env.repo_packages = index_packages(1) + assert env.install("accelerate") == env.install( + "accelerate", MatchSpec(track_features="mkl") + ) + + def test_scipy_mkl(self, env): + env.repo_packages = index_packages(1) + records = env.install( + "scipy", + "python 2.7*", + "numpy 1.7*", + MatchSpec(track_features="mkl"), + as_specs=True, + ) + + for record in records: + if record.name in ("numpy", "scipy"): + assert "mkl" in record.features + + assert "test::numpy-1.7.1-py27_p0" in package_string_set(records) + assert "test::scipy-0.12.0-np17py27_p0" in package_string_set(records) + + def test_anaconda_nomkl(self, env): + env.repo_packages = index_packages(1) + records = env.install("anaconda 1.5.0", "python 2.7*", "numpy 1.7*") + assert len(records) == 107 + assert "test::scipy-0.12.0-np17py27_0" in records + + def test_pseudo_boolean(self, env): + env.repo_packages = index_packages(1) + # The latest version of iopro, 1.5.0, was not built against numpy 1.5 + assert env.install("iopro", "python 2.7*", "numpy 1.5*") == { + "test::iopro-1.4.3-np15py27_p0", + "test::numpy-1.5.1-py27_4", + "test::openssl-1.0.1c-0", + "test::python-2.7.5-0", + "test::readline-6.2-0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::unixodbc-2.3.1-0", + "test::zlib-1.2.7-0", + "test::distribute-0.6.36-py27_1", + "test::pip-1.3.1-py27_1", + } + assert env.install( + "iopro", "python 2.7*", "numpy 1.5*", MatchSpec(track_features="mkl") + ) == { + "test::iopro-1.4.3-np15py27_p0", + "test::mkl-rt-11.0-p0", + "test::numpy-1.5.1-py27_p4", + "test::openssl-1.0.1c-0", + "test::python-2.7.5-0", + "test::readline-6.2-0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::unixodbc-2.3.1-0", + "test::zlib-1.2.7-0", + "test::distribute-0.6.36-py27_1", + "test::pip-1.3.1-py27_1", + } + + def test_unsat_from_r1(self, env): + env.repo_packages = index_packages(1) + + with pytest.raises(UnsatisfiableError) as exc_info: + env.install("numpy 1.5*", "scipy 0.12.0b1") + self.assert_unsatisfiable( + exc_info, + [ + ("numpy=1.5",), + ("scipy==0.12.0b1", "numpy[version='1.6.*|1.7.*']"), + ], + ) + + with pytest.raises(UnsatisfiableError) as exc_info: + env.install("numpy 1.5*", "python 3*") + self.assert_unsatisfiable( + exc_info, + [ + ("numpy=1.5", "nose", "python=3.3"), + ("numpy=1.5", "python[version='2.6.*|2.7.*']"), + ("python=3",), + ], + ) + + with pytest.raises((ResolvePackageNotFound, PackagesNotFoundError)) as exc_info: + env.install("numpy 1.5*", "numpy 1.6*") + if exc_info.type is ResolvePackageNotFound: + assert sorted(map(str, exc_info.value.bad_deps)) == [ + "numpy[version='1.5.*,1.6.*']", + ] + + def test_unsat_simple(self, env): + env.repo_packages = [ + helpers.record(name="a", depends=["c >=1,<2"]), + helpers.record(name="b", depends=["c >=2,<3"]), + helpers.record(name="c", version="1.0"), + helpers.record(name="c", version="2.0"), + ] + with pytest.raises(UnsatisfiableError) as exc_info: + env.install("a", "b") + self.assert_unsatisfiable( + exc_info, + [ + ("a", "c[version='>=1,<2']"), + ("b", "c[version='>=2,<3']"), + ], + ) + + def test_get_dists(self, env): + env.repo_packages = index_packages(1) + records = env.install("anaconda 1.4.0") + assert "test::anaconda-1.4.0-np17py33_0" in records + assert "test::freetype-2.4.10-0" in records + + def test_unsat_shortest_chain_1(self, env): + env.repo_packages = [ + helpers.record(name="a", depends=["d", "c <1.3.0"]), + helpers.record(name="b", depends=["c"]), + helpers.record( + name="c", + version="1.3.6", + ), + helpers.record( + name="c", + version="1.2.8", + ), + helpers.record(name="d", depends=["c >=0.8.0"]), + ] + with pytest.raises(UnsatisfiableError) as exc_info: + env.install("c=1.3.6", "a", "b") + self.assert_unsatisfiable( + exc_info, + [ + ("a", "c[version='<1.3.0']"), + ("a", "d", "c[version='>=0.8.0']"), + ("b", "c"), + ("c=1.3.6",), + ], + ) + + def test_unsat_shortest_chain_2(self, env): + env.repo_packages = [ + helpers.record(name="a", depends=["d", "c >=0.8.0"]), + helpers.record(name="b", depends=["c"]), + helpers.record( + name="c", + version="1.3.6", + ), + helpers.record( + name="c", + version="1.2.8", + ), + helpers.record(name="d", depends=["c <1.3.0"]), + ] + with pytest.raises(UnsatisfiableError) as exc_info: + env.install("c=1.3.6", "a", "b") + self.assert_unsatisfiable( + exc_info, + [ + ("a", "c[version='>=0.8.0']"), + ("a", "d", "c[version='<1.3.0']"), + ("b", "c"), + ("c=1.3.6",), + ], + ) + + def test_unsat_shortest_chain_3(self, env): + env.repo_packages = [ + helpers.record(name="a", depends=["f", "e"]), + helpers.record(name="b", depends=["c"]), + helpers.record( + name="c", + version="1.3.6", + ), + helpers.record( + name="c", + version="1.2.8", + ), + helpers.record(name="d", depends=["c >=0.8.0"]), + helpers.record(name="e", depends=["c <1.3.0"]), + helpers.record(name="f", depends=["d"]), + ] + with pytest.raises(UnsatisfiableError) as exc_info: + env.install("c=1.3.6", "a", "b") + self.assert_unsatisfiable( + exc_info, + [ + ("a", "e", "c[version='<1.3.0']"), + ("b", "c"), + ("c=1.3.6",), + ], + ) + + def test_unsat_shortest_chain_4(self, env): + env.repo_packages = [ + helpers.record(name="a", depends=["py =3.7.1"]), + helpers.record(name="py_req_1"), + helpers.record(name="py_req_2"), + helpers.record( + name="py", version="3.7.1", depends=["py_req_1", "py_req_2"] + ), + helpers.record( + name="py", version="3.6.1", depends=["py_req_1", "py_req_2"] + ), + ] + with pytest.raises(UnsatisfiableError) as exc_info: + env.install("a", "py=3.6.1") + self.assert_unsatisfiable( + exc_info, + [ + ("a", "py=3.7.1"), + ("py=3.6.1",), + ], + ) + + def test_unsat_chain(self, env): + # a -> b -> c=1.x -> d=1.x + # e -> c=2.x -> d=2.x + env.repo_packages = [ + helpers.record(name="a", depends=["b"]), + helpers.record(name="b", depends=["c >=1,<2"]), + helpers.record(name="c", version="1.0", depends=["d >=1,<2"]), + helpers.record(name="d", version="1.0"), + helpers.record(name="e", depends=["c >=2,<3"]), + helpers.record(name="c", version="2.0", depends=["d >=2,<3"]), + helpers.record(name="d", version="2.0"), + ] + with pytest.raises(UnsatisfiableError) as exc_info: + env.install("a", "e") + self.assert_unsatisfiable( + exc_info, + [ + ("a", "b", "c[version='>=1,<2']"), + ("e", "c[version='>=2,<3']"), + ], + ) + + def test_unsat_any_two_not_three(self, env): + # can install any two of a, b and c but not all three + env.repo_packages = [ + helpers.record(name="a", version="1.0", depends=["d >=1,<2"]), + helpers.record(name="a", version="2.0", depends=["d >=2,<3"]), + helpers.record(name="b", version="1.0", depends=["d >=1,<2"]), + helpers.record(name="b", version="2.0", depends=["d >=3,<4"]), + helpers.record(name="c", version="1.0", depends=["d >=2,<3"]), + helpers.record(name="c", version="2.0", depends=["d >=3,<4"]), + helpers.record(name="d", version="1.0"), + helpers.record(name="d", version="2.0"), + helpers.record(name="d", version="3.0"), + ] + # a and b can be installed + installed = env.install("a", "b", as_specs=True) + assert any(k.name == "a" and k.version == "1.0" for k in installed) + assert any(k.name == "b" and k.version == "1.0" for k in installed) + # a and c can be installed + installed = env.install("a", "c", as_specs=True) + assert any(k.name == "a" and k.version == "2.0" for k in installed) + assert any(k.name == "c" and k.version == "1.0" for k in installed) + # b and c can be installed + installed = env.install("b", "c", as_specs=True) + assert any(k.name == "b" and k.version == "2.0" for k in installed) + assert any(k.name == "c" and k.version == "2.0" for k in installed) + # a, b and c cannot be installed + with pytest.raises(UnsatisfiableError) as exc_info: + env.install("a", "b", "c") + self.assert_unsatisfiable( + exc_info, + [ + ("a", "d[version='>=1,<2|>=2,<3']"), + ("b", "d[version='>=1,<2|>=3,<4']"), + ("c", "d[version='>=2,<3|>=3,<4']"), + ], + ) + + def test_unsat_expand_single(self, env): + env.repo_packages = [ + helpers.record(name="a", depends=["b", "c"]), + helpers.record(name="b", depends=["d >=1,<2"]), + helpers.record(name="c", depends=["d >=2,<3"]), + helpers.record(name="d", version="1.0"), + helpers.record(name="d", version="2.0"), + ] + with pytest.raises(UnsatisfiableError) as exc_info: + env.install("a") + self.assert_unsatisfiable( + exc_info, + [ + ("b", "d[version='>=1,<2']"), + ("c", "d[version='>=2,<3']"), + ], + ) + + def test_unsat_missing_dep(self, env): + env.repo_packages = [ + helpers.record(name="a", depends=["b", "c"]), + helpers.record(name="b", depends=["c >=2,<3"]), + helpers.record(name="c", version="1.0"), + ] + with pytest.raises(UnsatisfiableError) as exc_info: + env.install("a", "b") + self.assert_unsatisfiable( + exc_info, + [ + ("a", "b"), + ("b",), + ], + ) + + def test_nonexistent(self, env): + with pytest.raises((ResolvePackageNotFound, PackagesNotFoundError)): + env.install("notarealpackage 2.0*") + with pytest.raises((ResolvePackageNotFound, PackagesNotFoundError)): + env.install("numpy 1.5") + + def test_timestamps_and_deps(self, env): + env.repo_packages = index_packages(1) + [ + helpers.record( + name="mypackage", + version="1.0", + build="hash12_0", + timestamp=1, + depends=["libpng 1.2.*"], + ), + helpers.record( + name="mypackage", + version="1.0", + build="hash15_0", + timestamp=0, + depends=["libpng 1.5.*"], + ), + ] + # libpng 1.2 + records_12 = env.install("libpng 1.2.*", "mypackage") + assert "test::libpng-1.2.50-0" in records_12 + assert "test::mypackage-1.0-hash12_0" in records_12 + # libpng 1.5 + records_15 = env.install("libpng 1.5.*", "mypackage") + assert "test::libpng-1.5.13-1" in records_15 + assert "test::mypackage-1.0-hash15_0" in records_15 + # this is testing that previously installed reqs are not disrupted + # by newer timestamps. regression test of sorts for + # https://github.com/conda/conda/issues/6271 + assert ( + env.install("mypackage", *env.install("libpng 1.2.*", as_specs=True)) + == records_12 + ) + assert ( + env.install("mypackage", *env.install("libpng 1.5.*", as_specs=True)) + == records_15 + ) + # unspecified python version should maximize libpng (v1.5), + # even though it has a lower timestamp + assert env.install("mypackage") == records_15 + + def test_nonexistent_deps(self, env): + env.repo_packages = index_packages(1) + [ + helpers.record( + name="mypackage", + version="1.0", + depends=["nose", "python 3.3*", "notarealpackage 2.0*"], + ), + helpers.record( + name="mypackage", + version="1.1", + depends=["nose", "python 3.3*"], + ), + helpers.record( + name="anotherpackage", + version="1.0", + depends=["nose", "mypackage 1.1"], + ), + helpers.record( + name="anotherpackage", + version="2.0", + depends=["nose", "mypackage"], + ), + ] + # XXX: missing find_matches and reduced_index + assert env.install("mypackage") == { + "test::mypackage-1.1-0", + "test::nose-1.3.0-py33_0", + "test::openssl-1.0.1c-0", + "test::python-3.3.2-0", + "test::readline-6.2-0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + "test::distribute-0.6.36-py33_1", + "test::pip-1.3.1-py33_1", + } + assert env.install("anotherpackage 1.0") == { + "test::anotherpackage-1.0-0", + "test::mypackage-1.1-0", + "test::nose-1.3.0-py33_0", + "test::openssl-1.0.1c-0", + "test::python-3.3.2-0", + "test::readline-6.2-0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + "test::distribute-0.6.36-py33_1", + "test::pip-1.3.1-py33_1", + } + assert env.install("anotherpackage") == { + "test::anotherpackage-2.0-0", + "test::mypackage-1.1-0", + "test::nose-1.3.0-py33_0", + "test::openssl-1.0.1c-0", + "test::python-3.3.2-0", + "test::readline-6.2-0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + "test::distribute-0.6.36-py33_1", + "test::pip-1.3.1-py33_1", + } + + # Add 1s to make sure the new repodata.jsons have different mod times + time.sleep(1) + + # This time, the latest version is messed up + env.repo_packages = index_packages(1) + [ + helpers.record( + name="mypackage", + version="1.0", + depends=["nose", "python 3.3*"], + ), + helpers.record( + name="mypackage", + version="1.1", + depends=["nose", "python 3.3*", "notarealpackage 2.0*"], + ), + helpers.record( + name="anotherpackage", + version="1.0", + depends=["nose", "mypackage 1.0"], + ), + helpers.record( + name="anotherpackage", + version="2.0", + depends=["nose", "mypackage"], + ), + ] + # XXX: missing find_matches and reduced_index + assert env.install("mypackage") == { + "test::mypackage-1.0-0", + "test::nose-1.3.0-py33_0", + "test::openssl-1.0.1c-0", + "test::python-3.3.2-0", + "test::readline-6.2-0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + "test::distribute-0.6.36-py33_1", + "test::pip-1.3.1-py33_1", + } + # TODO: We need UnsatisfiableError here because mamba does not + # have more granular exceptions yet. + with pytest.raises((ResolvePackageNotFound, UnsatisfiableError)): + env.install("mypackage 1.1") + assert env.install("anotherpackage 1.0") == { + "test::anotherpackage-1.0-0", + "test::mypackage-1.0-0", + "test::nose-1.3.0-py33_0", + "test::openssl-1.0.1c-0", + "test::python-3.3.2-0", + "test::readline-6.2-0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + "test::distribute-0.6.36-py33_1", + "test::pip-1.3.1-py33_1", + } + + # If recursive checking is working correctly, this will give + # anotherpackage 2.0, not anotherpackage 1.0 + assert env.install("anotherpackage") == { + "test::anotherpackage-2.0-0", + "test::mypackage-1.0-0", + "test::nose-1.3.0-py33_0", + "test::openssl-1.0.1c-0", + "test::python-3.3.2-0", + "test::readline-6.2-0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + "test::distribute-0.6.36-py33_1", + "test::pip-1.3.1-py33_1", + } + + def test_install_package_with_feature(self, env): + env.repo_packages = index_packages(1) + [ + helpers.record( + name="mypackage", + version="1.0", + depends=["python 3.3*"], + features="feature", + ), + helpers.record( + name="feature", + version="1.0", + depends=["python 3.3*"], + track_features="feature", + ), + ] + # should not raise + env.install("mypackage", "feature 1.0") + + def test_unintentional_feature_downgrade(self, env): + # See https://github.com/conda/conda/issues/6765 + # With the bug in place, this bad build of scipy + # will be selected for install instead of a later + # build of scipy 0.11.0. + good_rec_match = MatchSpec("channel-1::scipy==0.11.0=np17py33_3") + good_rec = next( + prec for prec in index_packages(1) if good_rec_match.match(prec) + ) + bad_deps = tuple(d for d in good_rec.depends if not d.startswith("numpy")) + bad_rec = PackageRecord.from_objects( + good_rec, + channel="test", + build=good_rec.build.replace("_3", "_x0"), + build_number=0, + depends=bad_deps, + fn=good_rec.fn.replace("_3", "_x0"), + url=good_rec.url.replace("_3", "_x0"), + ) + + env.repo_packages = index_packages(1) + [bad_rec] + records = env.install("scipy 0.11.0") + assert "test::scipy-0.11.0-np17py33_x0" not in records + assert "test::scipy-0.11.0-np17py33_3" in records + + def test_circular_dependencies(self, env): + env.repo_packages = index_packages(1) + [ + helpers.record( + name="package1", + depends=["package2"], + ), + helpers.record( + name="package2", + depends=["package1"], + ), + ] + assert ( + env.install("package1", "package2") + == env.install("package1") + == env.install("package2") + ) + + def test_irrational_version(self, env): + env.repo_packages = index_packages(1) + assert env.install("pytz 2012d", "python 3*") == { + "test::distribute-0.6.36-py33_1", + "test::openssl-1.0.1c-0", + "test::pip-1.3.1-py33_1", + "test::python-3.3.2-0", + "test::pytz-2012d-py33_0", + "test::readline-6.2-0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + } + + def test_no_features(self, env): + env.repo_packages = index_packages(1) + + assert env.install("python 2.6*", "numpy 1.6*", "scipy 0.11*") == { + "test::distribute-0.6.36-py26_1", + "test::numpy-1.6.2-py26_4", + "test::openssl-1.0.1c-0", + "test::pip-1.3.1-py26_1", + "test::python-2.6.8-6", + "test::readline-6.2-0", + "test::scipy-0.11.0-np16py26_3", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + } + assert env.install( + "python 2.6*", "numpy 1.6*", "scipy 0.11*", MatchSpec(track_features="mkl") + ) == { + "test::distribute-0.6.36-py26_1", + "test::mkl-rt-11.0-p0", + "test::numpy-1.6.2-py26_p4", + "test::openssl-1.0.1c-0", + "test::pip-1.3.1-py26_1", + "test::python-2.6.8-6", + "test::readline-6.2-0", + "test::scipy-0.11.0-np16py26_p3", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + } + + env.repo_packages += [ + helpers.record( + name="pandas", + version="0.12.0", + build="np16py27_0", + depends=[ + "dateutil", + "numpy 1.6*", + "python 2.7*", + "pytz", + ], + ), + helpers.record( + name="numpy", + version="1.6.2", + build="py27_p5", + build_number=0, + depends=[ + "mkl-rt 11.0", + "python 2.7", + ], + features="mkl", + ), + ] + assert env.install("pandas 0.12.0 np16py27_0", "python 2.7*") == { + "test::dateutil-2.1-py27_1", + "test::distribute-0.6.36-py27_1", + "test::numpy-1.6.2-py27_4", + "test::openssl-1.0.1c-0", + "test::pandas-0.12.0-np16py27_0", + "test::pip-1.3.1-py27_1", + "test::python-2.7.5-0", + "test::pytz-2013b-py27_0", + "test::readline-6.2-0", + "test::six-1.3.0-py27_0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + } + assert env.install( + "pandas 0.12.0 np16py27_0", "python 2.7*", MatchSpec(track_features="mkl") + ) == { + "test::dateutil-2.1-py27_1", + "test::distribute-0.6.36-py27_1", + "test::mkl-rt-11.0-p0", + "test::numpy-1.6.2-py27_p4", + "test::openssl-1.0.1c-0", + "test::pandas-0.12.0-np16py27_0", + "test::pip-1.3.1-py27_1", + "test::python-2.7.5-0", + "test::pytz-2013b-py27_0", + "test::readline-6.2-0", + "test::six-1.3.0-py27_0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + } + + @pytest.mark.xfail(reason="CONDA_CHANNEL_PRIORITY does not seem to have any effect") + def test_channel_priority_1(self, monkeypatch, env): + # XXX: Test is skipped because CONDA_CHANNEL_PRIORITY does not seems to + # have any effect. I have also tried conda.common.io.env_var like + # the other tests but no luck. + env.repo_packages = {} + env.repo_packages["channel-A"] = [] + env.repo_packages["channel-1"] = index_packages(1) + + pandas_0 = self.find_package( + channel="channel-1", + name="pandas", + version="0.10.1", + build="np17py27_0", + ) + env.repo_packages["channel-A"].append(pandas_0) + + # channel-1 has pandas np17py27_1, channel-A only has np17py27_0 + # when priority is set, it channel-A should take precedence and + # np17py27_0 be installed, otherwise np17py27_1 should be installed as + # it has a higher build version + monkeypatch.setenv("CONDA_CHANNEL_PRIORITY", "True") + assert "channel-A::pandas-0.11.0-np16py27_0" in env.install( + "pandas", "python 2.7*", "numpy 1.6*" + ) + monkeypatch.setenv("CONDA_CHANNEL_PRIORITY", "False") + assert "channel-1::pandas-0.11.0-np16py27_1" in env.install( + "pandas", "python 2.7*", "numpy 1.6*" + ) + # now lets revert the channels + env.repo_packages = dict(reversed(env.repo_packages.items())) + monkeypatch.setenv("CONDA_CHANNEL_PRIORITY", "True") + assert "channel-1::pandas-0.11.0-np16py27_1" in env.install( + "pandas", "python 2.7*", "numpy 1.6*" + ) + + @pytest.mark.xfail(reason="CONDA_CHANNEL_PRIORITY does not seem to have any effect") + def test_unsat_channel_priority(self, monkeypatch, env): + # XXX: Test is skipped because CONDA_CHANNEL_PRIORITY does not seems to + # have any effect. I have also tried conda.common.io.env_var like + # the other tests but no luck. + env.repo_packages = {} + # higher priority + env.repo_packages["channel-1"] = [ + helpers.record( + name="a", + version="1.0", + depends=["c"], + ), + helpers.record( + name="b", + version="1.0", + depends=["c >=2,<3"], + ), + helpers.record( + name="c", + version="1.0", + ), + ] + # lower priority, missing c 2.0 + env.repo_packages["channel-2"] = [ + helpers.record( + name="a", + version="2.0", + depends=["c"], + ), + helpers.record( + name="b", + version="2.0", + depends=["c >=2,<3"], + ), + helpers.record( + name="c", + version="1.0", + ), + helpers.record( + name="c", + version="2.0", + ), + ] + + monkeypatch.setenv("CONDA_CHANNEL_PRIORITY", "True") + records = env.install("a", "b", as_specs=True) + # channel-1 a and b packages (1.0) installed + assert any(k.name == "a" and k.version == "1.0" for k in records) + assert any(k.name == "b" and k.version == "1.0" for k in records) + + monkeypatch.setenv("CONDA_CHANNEL_PRIORITY", "False") + records = env.install("a", "b", as_specs=True) + # no channel priority, largest version of a and b (2.0) installed + assert any(k.name == "a" and k.version == "2.0" for k in records) + assert any(k.name == "b" and k.version == "2.0" for k in records) + + monkeypatch.setenv("CONDA_CHANNEL_PRIORITY", "True") + with pytest.raises(UnsatisfiableError) as exc_info: + env.install("a", "b") + self.assert_unsatisfiable(exc_info, [("b", "c[version='>=2,<3']")]) + + @pytest.mark.xfail( + reason="There is some weird global state making " + "this test fail when the whole test suite is run" + ) + def test_remove(self, env): + env.repo_packages = index_packages(1) + records = env.install("pandas", "python 2.7*", as_specs=True) + assert package_string_set(records) == { + "test::dateutil-2.1-py27_1", + "test::distribute-0.6.36-py27_1", + "test::numpy-1.7.1-py27_0", + "test::openssl-1.0.1c-0", + "test::pandas-0.11.0-np17py27_1", + "test::pip-1.3.1-py27_1", + "test::python-2.7.5-0", + "test::pytz-2013b-py27_0", + "test::readline-6.2-0", + "test::scipy-0.12.0-np17py27_0", + "test::six-1.3.0-py27_0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + } + + env.installed_packages = records + assert env.remove("pandas") == { + "test::dateutil-2.1-py27_1", + "test::distribute-0.6.36-py27_1", + "test::numpy-1.7.1-py27_0", + "test::openssl-1.0.1c-0", + "test::pip-1.3.1-py27_1", + "test::python-2.7.5-0", + "test::pytz-2013b-py27_0", + "test::readline-6.2-0", + "test::scipy-0.12.0-np17py27_0", + "test::six-1.3.0-py27_0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + } + assert env.remove("numpy") == { + "test::dateutil-2.1-py27_1", + "test::distribute-0.6.36-py27_1", + "test::openssl-1.0.1c-0", + "test::pip-1.3.1-py27_1", + "test::python-2.7.5-0", + "test::pytz-2013b-py27_0", + "test::readline-6.2-0", + "test::six-1.3.0-py27_0", + "test::sqlite-3.7.13-0", + "test::system-5.8-1", + "test::tk-8.5.13-0", + "test::zlib-1.2.7-0", + } + + def test_surplus_features_1(self, env): + env.repo_packages += [ + helpers.record( + name="feature", + track_features="feature", + ), + helpers.record( + name="package1", + features="feature", + ), + helpers.record( + name="package2", + version="1.0", + features="feature", + depends=["package1"], + ), + helpers.record( + name="package2", + version="2.0", + features="feature", + ), + ] + assert env.install("package2", "feature") == { + "test::package2-2.0-0", + "test::feature-1.0-0", + } + + def test_surplus_features_2(self, env): + env.repo_packages += [ + helpers.record( + name="feature", + track_features="feature", + ), + helpers.record( + name="package1", + features="feature", + ), + helpers.record( + name="package2", + version="1.0", + build_number=0, + features="feature", + depends=["package1"], + ), + helpers.record( + name="package2", + version="1.0", + build_number=1, + features="feature", + ), + ] + assert env.install("package2", "feature") == { + "test::package2-1.0-0", + "test::feature-1.0-0", + } + + def test_get_reduced_index_broadening_with_unsatisfiable_early_dep(self, env): + # Test that spec broadening reduction doesn't kill valid solutions + # In other words, the order of packages in the index should not affect the + # overall result of the reduced index. + # see discussion at https://github.com/conda/conda/pull/8117#discussion_r249249815 + env.repo_packages += [ + helpers.record( + name="a", + version="1.0", + # not satisfiable. This record should come first, so that its c==2 + # constraint tries to mess up the inclusion of the c record below, + # which should be included as part of b's deps, but which is + # broader than this dep. + depends=["b", "c==2"], + ), + helpers.record( + name="a", + version="2.0", + depends=["b"], + ), + helpers.record( + name="b", + depends=["c"], + ), + helpers.record( + name="c", + ), + ] + assert env.install("a") == { + "test::a-2.0-0", + "test::b-1.0-0", + "test::c-1.0-0", + } + + def test_get_reduced_index_broadening_preferred_solution(self, env): + # test that order of index reduction does not eliminate what should be a preferred solution + # https://github.com/conda/conda/pull/8117#discussion_r249216068 + env.repo_packages += [ + helpers.record( + name="top", + version="1.0", + # this is the first processed record, and imposes a broadening constraint on bottom + # if things are overly restricted, we'll end up with bottom 1.5 in our solution + # instead of the preferred (latest) 2.5 + depends=["middle", "bottom==1.5"], + ), + helpers.record( + name="top", + version="2.0", + depends=["middle"], + ), + helpers.record( + name="middle", + depends=["bottom"], + ), + helpers.record( + name="bottom", + version="1.5", + ), + helpers.record( + name="bottom", + version="2.5", + ), + ] + for record in env.install("top", as_specs=True): + if record.name == "top": + assert record.version == "2.0", ( + f"top version should be 2.0, but is {record.version}" + ) + elif record.name == "bottom": + assert record.version == "2.5", ( + f"bottom version should be 2.5, but is {record.version}" + ) + + def test_arch_preferred_over_noarch_when_otherwise_equal(self, env): + env.repo_packages += [ + helpers.record( + name="package1", + subdir="noarch", + ), + helpers.record( + name="package1", + ), + ] + records = env.install("package1", as_specs=True) + assert len(records) == 1 + assert records[0].subdir == context.subdir + + def test_noarch_preferred_over_arch_when_version_greater(self, env): + env.repo_packages += [ + helpers.record( + name="package1", + version="2.0", + subdir="noarch", + ), + helpers.record( + name="package1", + version="1.0", + ), + ] + records = env.install("package1", as_specs=True) + assert len(records) == 1 + assert records[0].subdir == "noarch" + + def test_noarch_preferred_over_arch_when_version_greater_dep(self, env): + env.repo_packages += [ + helpers.record( + name="package1", + version="1.0", + ), + helpers.record( + name="package1", + version="2.0", + subdir="noarch", + ), + helpers.record( + name="package2", + depends=["package1"], + ), + ] + records = env.install("package2", as_specs=True) + package1 = self.find_package_in_list(records, name="package1") + assert package1.subdir == "noarch" + + def test_noarch_preferred_over_arch_when_build_greater(self, env): + env.repo_packages += [ + helpers.record( + name="package1", + build_number=0, + ), + helpers.record( + name="package1", + build_number=1, + subdir="noarch", + ), + ] + records = env.install("package1", as_specs=True) + assert len(records) == 1 + assert records[0].subdir == "noarch" + + def test_noarch_preferred_over_arch_when_build_greater_dep(self, env): + env.repo_packages += [ + helpers.record( + name="package1", + build_number=0, + ), + helpers.record( + name="package1", + build_number=1, + subdir="noarch", + ), + helpers.record( + name="package2", + depends=["package1"], + ), + ] + records = env.install("package2", as_specs=True) + package1 = self.find_package_in_list(records, name="package1") + assert package1.subdir == "noarch" diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/trust/__init__.py b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/trust/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..b601a4b66b017829b4b3733eaa823a94c07f9a13 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/trust/__init__.py @@ -0,0 +1,8 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause + +from ..deprecations import deprecated + +# Mark the entire module for deprecation. For more information see +# https://github.com/conda/conda-content-trust and #14797 +deprecated.module("25.9", "26.3") diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/trust/constants.py b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/trust/constants.py new file mode 100644 index 0000000000000000000000000000000000000000..a65f0ff428a564d9c6d4d40c9fe420c99b37e4f2 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/trust/constants.py @@ -0,0 +1,64 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Context trust constants. + +You could argue that the signatures being here is not necessary; indeed, we +are not necessarily going to be able to check them *properly* (based on some +prior expectations) as the user, since this is the beginning of trust +bootstrapping, the first/backup version of the root of trust metadata. +Still, the signatures here are useful for diagnostic purposes, and, more +important, to allow self-consistency checks: that helps us avoid breaking the +chain of trust if someone accidentally lists the wrong keys down the line. (: +The discrepancy can be detected when loading the root data, and we can +decline to cache incorrect trust metadata that would make further root +updates impossible. +""" + +from ..deprecations import deprecated + +# Mark the entire module for deprecation. For more information see +# https://github.com/conda/conda-content-trust and #14797 +deprecated.module( + "25.9", # deprecate_in version + "26.3", # remove_in version + addendum="This module will be moved to conda-anaconda-trust-root.", +) + +INITIAL_TRUST_ROOT = { + "signatures": { + "6d4d5888398ad77465e9fd53996309187723e16509144aa6733015c960378e7a": { + "other_headers": "04001608001d162104d2ca1d4bf5d77e7c312534284dd9c45328b685ec0502605dbb03", + "signature": "b71c9b3aa60e77258c402e574397127bcb4bc15ef3055ada8539b0d1e355bf1415a135fb7cecc9244f839a929f6b1f82844a5b3df8d6225ec9a50b181692490f", + }, + "508debb915ede0b16dc0cff63f250bde73c5923317b44719fcfc25cc95560c44": { + "other_headers": "04001608001d162104e6dffee4638f24cfa60a08ba03afe1314a3a38fc050260621281", + "signature": "29d53d4e7dbea0a3efb07266d22e57cf4df7abe004453981c631245716e1b737c7a6b4ab95f42592af70be67abf56e97020e1aa1f52b49ef39b37481f05d5701", + }, + }, + "signed": { + "delegations": { + "key_mgr": { + "pubkeys": [ + "f24c813d23a9b26be665eee5c54680c35321061b337f862385ed6d783b0bedb0" + ], + "threshold": 1, + }, + "root": { + "pubkeys": [ + "668a3217d72d4064edb16648435dc4a3e09a172ecee45dcab1464dcd2f402ec6", + "508debb915ede0b16dc0cff63f250bde73c5923317b44719fcfc25cc95560c44", + "6d4d5888398ad77465e9fd53996309187723e16509144aa6733015c960378e7a", + "e0c88b4c0721bd451b7e720dfb0d0bb6b3853f0cbcf5570edd73367d0841be51", + ], + "threshold": 2, + }, + }, + "expiration": "2022-10-31T18:00:00Z", + "metadata_spec_version": "0.6.0", + "timestamp": "2021-03-26T00:00:00Z", + "type": "root", + "version": 1, + }, +} + +KEY_MGR_FILE = "key_mgr.json" diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/trust/signature_verification.py b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/trust/signature_verification.py new file mode 100644 index 0000000000000000000000000000000000000000..80d4f9426373a6f34270fa6461bcf3f8dc3ac548 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda/trust/signature_verification.py @@ -0,0 +1,325 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Interface between conda-content-trust and conda.""" + +from __future__ import annotations + +import os +import re +import warnings +from functools import cache +from logging import getLogger +from pathlib import Path + +from ..common.serialize import json + +try: + from conda_content_trust.authentication import verify_delegation, verify_root + from conda_content_trust.common import ( + SignatureError, + load_metadata_from_file, + write_metadata_to_file, + ) + from conda_content_trust.signing import wrap_as_signable +except ImportError: + # _SignatureVerification.enabled handles the rest of this state + class SignatureError(Exception): + pass + + +from typing import TYPE_CHECKING + +from ..base.constants import CONDA_PACKAGE_EXTENSION_V1, CONDA_PACKAGE_EXTENSION_V2 +from ..base.context import context +from ..common.url import join_url +from ..core.subdir_data import SubdirData +from ..deprecations import deprecated +from ..gateways.connection import HTTPError, InsecureRequestWarning +from ..gateways.connection.session import get_session +from .constants import INITIAL_TRUST_ROOT, KEY_MGR_FILE + +if TYPE_CHECKING: + from ..models.records import PackageRecord + +# Mark the entire module for deprecation. For more information see +# https://github.com/conda/conda-content-trust and #14797 +deprecated.module( + "25.9", # deprecate_in version + "26.3", # remove_in version + addendum="This module will be moved to conda-content-trust.", +) + + +log = getLogger(__name__) + + +RE_ROOT_METADATA = re.compile(r"(?P\d+)\.root\.json") + + +class _SignatureVerification: + @property + @cache + def enabled(self) -> bool: + # safety checks must be enabled + if not context.extra_safety_checks: + return False + + # signing url must be defined + if not context.signing_metadata_url_base: + log.warning( + "metadata signature verification requested, " + "but no metadata URL base has not been specified." + ) + return False + + # conda_content_trust must be installed + try: + import conda_content_trust # noqa: F401 + except ImportError: + log.warning( + "metadata signature verification requested, " + "but `conda-content-trust` is not installed." + ) + return False + + # ensure artifact verification directory exists + Path(context.av_data_dir).mkdir(parents=True, exist_ok=True) + + # ensure the trusted_root exists + if self.trusted_root is None: + log.warning( + "could not find trusted_root data for metadata signature verification" + ) + return False + + # ensure the key_mgr exists + if self.key_mgr is None: + log.warning( + "could not find key_mgr data for metadata signature verification" + ) + return False + + # signature verification is enabled + return True + + @property + @cache + def trusted_root(self) -> dict: + # TODO: formalize paths for `*.root.json` and `key_mgr.json` on server-side + trusted: dict | None = None + + # Load latest trust root metadata from filesystem + try: + paths = { + int(m.group("number")): entry + for entry in os.scandir(context.av_data_dir) + if (m := RE_ROOT_METADATA.match(entry.name)) + } + except (FileNotFoundError, NotADirectoryError, PermissionError): + # FileNotFoundError: context.av_data_dir does not exist + # NotADirectoryError: context.av_data_dir is not a directory + # PermsissionError: context.av_data_dir is not readable + pass + else: + for _, entry in sorted(paths.items(), reverse=True): + log.info(f"Loading root metadata from {entry}.") + try: + trusted = load_metadata_from_file(entry) + except (IsADirectoryError, FileNotFoundError, PermissionError): + # IsADirectoryError: entry is not a file + # FileNotFoundError: entry does not exist + # PermsissionError: entry is not readable + continue + else: + break + + # Fallback to default root metadata if unable to fetch any + if not trusted: + log.debug( + f"No root metadata in {context.av_data_dir}. " + "Using built-in root metadata." + ) + trusted = INITIAL_TRUST_ROOT + + # Refresh trust root metadata + while True: + # TODO: caching mechanism to reduce number of refresh requests + fname = f"{trusted['signed']['version'] + 1}.root.json" + path = Path(context.av_data_dir, fname) + + try: + # TODO: support fetching root data with credentials + untrusted = self._fetch_channel_signing_data( + context.signing_metadata_url_base, + fname, + ) + + verify_root(trusted, untrusted) + except HTTPError as err: + # HTTP 404 implies no updated root.json is available, which is + # not really an "error" and does not need to be logged. + if err.response.status_code != 404: + log.error(err) + break + except Exception as err: + # TODO: more error handling + log.error(err) + break + else: + # New trust root metadata checks out + write_metadata_to_file(trusted := untrusted, path) + + return trusted + + @property + @cache + def key_mgr(self) -> dict | None: + trusted: dict | None = None + + # Refresh key manager metadata + fname = KEY_MGR_FILE + path = Path(context.av_data_dir, fname) + + try: + untrusted = self._fetch_channel_signing_data( + context.signing_metadata_url_base, + fname, + ) + + verify_delegation("key_mgr", untrusted, self.trusted_root) + except ConnectionError as err: + log.warning(err) + except HTTPError as err: + # sometimes the HTTPError message is blank, when that occurs include the + # HTTP status code + log.warning( + str(err) or f"{err.__class__.__name__} ({err.response.status_code})" + ) + else: + # New key manager metadata checks out + write_metadata_to_file(trusted := untrusted, path) + + # If key_mgr is unavailable from server, fall back to copy on disk + if not trusted and path.exists(): + trusted = load_metadata_from_file(path) + + return trusted + + def _fetch_channel_signing_data( + self, signing_data_url: str, filename: str, etag=None, mod_stamp=None + ) -> dict: + session = get_session(signing_data_url) + + if not context.ssl_verify: + warnings.simplefilter("ignore", InsecureRequestWarning) + + headers = { + "Accept-Encoding": "gzip, deflate, compress, identity", + "Content-Type": "application/json", + } + if etag: + headers["If-None-Match"] = etag + if mod_stamp: + headers["If-Modified-Since"] = mod_stamp + + saved_token_setting = context.add_anaconda_token + try: + # Assume trust metadata is intended to be "generally available", + # and specifically, _not_ protected by a conda/binstar token. + # Seems reasonable, since we (probably) don't want the headaches of + # dealing with protected, per-channel trust metadata. + # + # Note: Setting `auth=None` here does allow trust metadata to be + # protected using standard HTTP basic auth mechanisms, with the + # login information being provided in the user's netrc file. + context.add_anaconda_token = False + resp = session.get( + join_url(signing_data_url, filename), + headers=headers, + proxies=session.proxies, + auth=None, + timeout=( + context.remote_connect_timeout_secs, + context.remote_read_timeout_secs, + ), + ) + # TODO: maybe add more sensible error handling + resp.raise_for_status() + finally: + context.add_anaconda_token = saved_token_setting + + # In certain cases (e.g., using `-c` access anaconda.org channels), the + # `CondaSession.get()` retry logic combined with the remote server's + # behavior can result in non-JSON content being returned. Parse returned + # content here (rather than directly in the return statement) so callers of + # this function only have to worry about a ValueError being raised. + try: + return resp.json() + except json.JSONDecodeError as err: # noqa + # TODO: additional loading and error handling improvements? + raise ValueError( + f"Invalid JSON returned from {signing_data_url}/{filename}" + ) + + def verify(self, repodata_fn: str, record: PackageRecord): + repodata, _ = SubdirData( + record.channel, + repodata_fn=repodata_fn, + ).repo_fetch.fetch_latest_parsed() + + # short-circuit if no signatures are defined + if "signatures" not in repodata: + record.metadata.add( + f"(no signatures found for {record.channel.canonical_name})" + ) + return + signatures = repodata["signatures"] + + # short-circuit if no signature is defined for this package + if record.fn not in signatures: + record.metadata.add(f"(no signatures found for {record.fn})") + return + signature = signatures[record.fn] + + # extract metadata to be verified + if record.fn.endswith(CONDA_PACKAGE_EXTENSION_V1): + info = repodata["packages"][record.fn] + elif record.fn.endswith(CONDA_PACKAGE_EXTENSION_V2): + info = repodata["packages.conda"][record.fn] + else: + raise ValueError("unknown package extension") + + # create a signable envelope (a dict with the info and signatures) + envelope = wrap_as_signable(info) + envelope["signatures"] = signature + + try: + verify_delegation("pkg_mgr", envelope, self.key_mgr) + except SignatureError: + log.warning(f"invalid signature for {record.fn}") + record.metadata.add("(package metadata is UNTRUSTED)") + else: + log.info(f"valid signature for {record.fn}") + record.metadata.add("(package metadata is TRUSTED)") + + def __call__( + self, + repodata_fn: str, + unlink_precs: tuple[PackageRecord, ...], + link_precs: tuple[PackageRecord, ...], + ) -> None: + if not self.enabled: + return + + for prec in link_precs: + self.verify(repodata_fn, prec) + + @classmethod + def cache_clear(cls) -> None: + cls.enabled.fget.cache_clear() + cls.trusted_root.fget.cache_clear() + cls.key_mgr.fget.cache_clear() + + +# singleton for caching +signature_verification = _SignatureVerification() diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda_env/README.md b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda_env/README.md new file mode 100644 index 0000000000000000000000000000000000000000..eabe15a8365bc305c14411caf7d18cef4b4391de --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda_env/README.md @@ -0,0 +1,90 @@ +# conda-env + +Provides the `conda env` interface to Conda environments. + +## Installing + +`conda env` is included in `conda` itself. + +## Usage + +All of the usage is documented via the `--help` flag. + +```bash +$ conda env --help +usage: conda-env [-h] {create,export,list,remove,update,config} ... + +positional arguments: + {create,export,list,remove,update,config} + create Create an environment based on an environment file + export Export a given environment + list List the Conda environments + remove Remove an environment + update Update the current environment based on environment file + config Configure a conda environment + +optional arguments: + -h, --help Show this help message and exit. +``` + + +## `environment.yml` + +conda-env allows creating environments using the `environment.yml` +specification file. This allows you to specify a name, channels to use when +creating the environment, and the dependencies. For example, to create an +environment named `stats` with numpy and pandas, create an `environment.yml` +file with this as the contents: + +```yaml +name: stats +dependencies: + - numpy + - pandas +``` + +Then run this from the command line: + +```bash +$ conda env create +Fetching package metadata: ... +Solving package specifications: .Linking packages ... +[ COMPLETE ] |#################################################| 100% +# +# To activate this environment, use: +# $ conda activate stats +# +# To deactivate this environment, use: +# $ conda deactivate +# +``` + +Your output might vary a little bit, depending on whether you have the packages +in your local package cache. + +You can explicitly provide an environment spec file using `-f` or `--file` +and the name of the file you would like to use. + +The default channels can be excluded by adding `nodefaults` to the list of +channels. This is equivalent to passing the `--override-channels` option +to most `conda` commands, and is like `defaults` in the `.condarc` +channel configuration but with the reverse logic. + +## Environment file example + +```yaml +name: stats +channels: + - javascript +dependencies: + - python=3.4 # or 2.7 if you are feeling nostalgic + - bokeh=0.9.2 + - numpy=1.9.* + - nodejs=0.10.* + - flask + - pip + - pip: + - Flask-Testing +``` + +**Recommendation:** Always create your `environment.yml` file by hand. diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda_env/__init__.py b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda_env/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..4bdaacf082c9ba5a0d0b8c285c4776f423b354e0 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda_env/__init__.py @@ -0,0 +1,6 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +from conda import __version__ # noqa: F401 +from conda.deprecations import deprecated + +deprecated.module("25.9", "26.3") diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda_env/cli/__init__.py b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda_env/cli/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..257be2505e2176a8a934a36dfca503610426787f --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda_env/cli/__init__.py @@ -0,0 +1,5 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +from conda.deprecations import deprecated + +deprecated.module("25.9", "26.3") diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda_env/installers/__init__.py b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda_env/installers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..257be2505e2176a8a934a36dfca503610426787f --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/conda_env/installers/__init__.py @@ -0,0 +1,5 @@ +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +from conda.deprecations import deprecated + +deprecated.module("25.9", "26.3") diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/tests/data/recipes/activate_deactivate_package/src/etc/conda/activate.d/activate.bat b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/tests/data/recipes/activate_deactivate_package/src/etc/conda/activate.d/activate.bat new file mode 100644 index 0000000000000000000000000000000000000000..0ad5bbf860027e2f834080ee322e08e7b253a208 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/tests/data/recipes/activate_deactivate_package/src/etc/conda/activate.d/activate.bat @@ -0,0 +1,5 @@ +@ECHO OFF +set TEST=teststringfromactivate + +set PATH_PRE_ACTIVATE_DEACTIVATE=%PATH% +set PATH=%TEST%/bin/test;%PATH% diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/tests/data/recipes/activate_deactivate_package/src/etc/conda/activate.d/activate.sh b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/tests/data/recipes/activate_deactivate_package/src/etc/conda/activate.d/activate.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8c8134df9765f8bdd718f4f262f34821b05aa56 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/tests/data/recipes/activate_deactivate_package/src/etc/conda/activate.d/activate.sh @@ -0,0 +1,2 @@ +export TEST=teststringfromactivate +export PATH="${TEST}/bin/test:${PATH}" diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/tests/data/recipes/activate_deactivate_package/src/etc/conda/deactivate.d/deactivate.bat b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/tests/data/recipes/activate_deactivate_package/src/etc/conda/deactivate.d/deactivate.bat new file mode 100644 index 0000000000000000000000000000000000000000..0ec2c4324569af150280f197eb2431f9bcbeda80 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/tests/data/recipes/activate_deactivate_package/src/etc/conda/deactivate.d/deactivate.bat @@ -0,0 +1,2 @@ +@ECHO OFF +set PATH=%PATH_PRE_ACTIVATE_DEACTIVATE% diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/tests/data/recipes/activate_deactivate_package/src/etc/conda/deactivate.d/deactivate.sh b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/tests/data/recipes/activate_deactivate_package/src/etc/conda/deactivate.d/deactivate.sh new file mode 100644 index 0000000000000000000000000000000000000000..51f007911f4b4ee6b66f802eedc71f382b912242 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/tests/data/recipes/activate_deactivate_package/src/etc/conda/deactivate.d/deactivate.sh @@ -0,0 +1,2 @@ +export TEST=teststringfromactivate +export PATH=`echo $PATH | sed "s|${TEST}/bin/test:||"` diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/xontrib/conda.xsh b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/xontrib/conda.xsh new file mode 100644 index 0000000000000000000000000000000000000000..87fef0d6f8296bfad9825b46cbb3f9ffc712391c --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/lib/python3.13/site-packages/xontrib/conda.xsh @@ -0,0 +1,217 @@ +$CONDA_EXE = '/home/task_177140125005974/croot/conda_1771402194624/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/bin/conda' +$_CONDA_EXE = '/home/task_177140125005974/croot/conda_1771402194624/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/bin/conda' +try: + del $_CE_M +except KeyError: + pass +try: + del $_CE_CONDA +except KeyError: + pass +$CONDA_PYTHON_EXE = '/home/task_177140125005974/croot/conda_1771402194624/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/bin/python' +$_CONDA_ROOT = '/home/task_177140125005974/croot/conda_1771402194624/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place' + +# Copyright (C) 2012 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +# Much of this forked from https://github.com/gforsyth/xonda +# Copyright (c) 2016, Gil Forsyth, All rights reserved. +# Original code licensed under BSD-3-Clause. + +try: + # xonsh >= 0.18.0 + from xonsh.lib.lazyasd import lazyobject +except: + # xonsh < 0.18.0 + from xonsh.lazyasd import lazyobject + +if 'CONDA_EXE' not in ${...}: + ![python -m conda init --dev out> conda-dev-init.sh] + source-bash conda-dev-init.sh + import os + os.remove("conda-dev-init.sh") + +_REACTIVATE_COMMANDS = ('install', 'update', 'upgrade', 'remove', 'uninstall') + + +@lazyobject +def Env(): + from collections import namedtuple + return namedtuple('Env', ['name', 'path', 'bin_dir', 'envs_dir']) + + +def _parse_args(args=None): + from argparse import ArgumentParser + p = ArgumentParser(add_help=False) + p.add_argument('command', nargs='?') + p.add_argument('-h', '--help', dest='help', action='store_true', default=False) + p.add_argument('-v', '--version', dest='version', action='store_true', default=False) + ns, _ = p.parse_known_args(args) + if ns.command == 'activate': + p.add_argument('env_name_or_prefix', default='base') + elif ns.command in _REACTIVATE_COMMANDS: + p.add_argument('-n', '--name') + p.add_argument('-p', '--prefix') + parsed_args, _ = p.parse_known_args(args) + return parsed_args + + +def _raise_pipeline_error(pipeline): + stdout = pipeline.out + stderr = pipeline.err + if pipeline.returncode != 0: + message = ("exited with %s\nstdout: %s\nstderr: %s\n" + "" % (pipeline.returncode, stdout, stderr)) + raise RuntimeError(message) + return stdout.strip() + + +def _conda_activate_handler(env_name_or_prefix): + import os + + __xonsh__.execer.exec($($CONDA_EXE shell.xonsh activate @(env_name_or_prefix)), + glbs=__xonsh__.ctx, + filename="$(conda shell.xonsh activate " + env_name_or_prefix + ")") + if $CONDA_DEFAULT_ENV != os.path.split(env_name_or_prefix)[1]: + import sys as _sys + + print("WARNING: conda environment not activated properly. " + "This is likely because you have a conda init inside of your " + "~/.bashrc (unix) or *.bat activation file (windows). This is " + "causing conda to activate twice in xonsh. Please remove the conda " + "init block from your other shell.", file=_sys.stderr) + + +def _conda_deactivate_handler(): + __xonsh__.execer.exec($($CONDA_EXE shell.xonsh deactivate), + glbs=__xonsh__.ctx, + filename="$(conda shell.xonsh deactivate)") + + +def _conda_passthrough_handler(args): + pipeline = ![$CONDA_EXE @(args)] + _raise_pipeline_error(pipeline) + + +def _conda_reactivate_handler(args, name_or_prefix_given): + pipeline = ![$CONDA_EXE @(args)] + _raise_pipeline_error(pipeline) + if not name_or_prefix_given: + __xonsh__.execer.exec($($CONDA_EXE shell.xonsh reactivate), + glbs=__xonsh__.ctx, + filename="$(conda shell.xonsh reactivate)") + + +def _conda_main(args=None): + parsed_args = _parse_args(args) + if parsed_args.command == 'activate': + _conda_activate_handler(parsed_args.env_name_or_prefix) + elif parsed_args.command == 'deactivate': + _conda_deactivate_handler() + elif parsed_args.command in _REACTIVATE_COMMANDS: + name_or_prefix_given = bool(parsed_args.name or parsed_args.prefix) + _conda_reactivate_handler(args, name_or_prefix_given) + else: + _conda_passthrough_handler(args) + + +if 'CONDA_SHLVL' not in ${...}: + $CONDA_SHLVL = '0' + import os as _os + import sys as _sys + _sys.path.insert(0, _os.path.join(_os.path.dirname(_os.path.dirname($CONDA_EXE)), "condabin")) + del _os, _sys + +aliases['conda'] = _conda_main + + +def _list_dirs(path): + """Generator that lists the directories in a given path.""" + import os + for entry in os.scandir(path): + if not entry.name.startswith('.') and entry.is_dir(): + yield entry.name + + +def _get_envs_unfiltered(): + """Grab a list of all conda env dirs from conda, allowing all warnings.""" + import os + import importlib + + try: + # breaking changes introduced in Anaconda 4.4.7 + # try to import newer library structure first + context = importlib.import_module('conda.base.context') + config = context.context + except ModuleNotFoundError: + config = importlib.import_module('conda.config') + + # create the list of environments + env_list = [] + for envs_dir in config.envs_dirs: + # skip non-existing environments directories + if not os.path.exists(envs_dir): + continue + # for each environment in the environments directory + for env_name in _list_dirs(envs_dir): + # check for duplicates names + if env_name in [env.name for env in env_list]: + raise ValueError('Multiple environments with the same name ' + "in the system is not supported by conda's xonsh tools.") + # add the environment to the list + env_list.append(Env(name=env_name, + path=os.path.join(envs_dir, env_name), + bin_dir=os.path.join(envs_dir, env_name, 'bin'), + envs_dir=envs_dir, + )) + return env_list + + +def _get_envs(): + """Grab a list of all conda env dirs from conda, ignoring all warnings.""" + import warnings + with warnings.catch_warnings(): + warnings.simplefilter("ignore") + return _get_envs_unfiltered() + + +def _conda_completer(prefix, line, start, end, ctx): + """Completion for conda.""" + args = line.split(' ') + possible = set() + if len(args) == 0 or args[0] not in ['xonda', 'conda']: + return None + curix = args.index(prefix) + if curix == 1: + possible = {'activate', 'deactivate', 'install', 'remove', 'info', + 'help', 'list', 'search', 'update', 'upgrade', 'uninstall', + 'config', 'init', 'clean', 'package', 'bundle', 'env', + 'select', 'create', '-h', '--help', '-V', '--version'} + + elif curix == 2: + if args[1] in ['activate', 'select']: + possible = set([env.name for env in _get_envs()]) + elif args[1] == 'create': + possible = {'-p', '-n'} + elif args[1] == 'env': + possible = {'attach', 'create', 'export', 'list', 'remove', + 'upload', 'update'} + + elif curix == 3: + if args[2] == 'export': + possible = {'-n', '--name'} + elif args[2] == 'create': + possible = {'-h', '--help', '-f', '--file', '-n', '--name', '-p', + '--prefix', '-q', '--quiet', '--force', '--json', + '--debug', '-v', '--verbose'} + + elif curix == 4: + if args[2] == 'export' and args[3] in ['-n','--name']: + possible = set([env.name for env in _get_envs()]) + + return {i for i in possible if i.startswith(prefix)} + + +# add _xonda_completer to list of completers +__xonsh__.completers['conda'] = _conda_completer +# bump to top of list +__xonsh__.completers.move_to_end('conda', last=False) diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/shell/condabin/Conda.psm1 b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/shell/condabin/Conda.psm1 new file mode 100644 index 0000000000000000000000000000000000000000..64f51c1d0c9f04e04658172b606ab4a13ce7a084 --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/shell/condabin/Conda.psm1 @@ -0,0 +1,266 @@ +param([parameter(Position=0,Mandatory=$false)] [Hashtable] $CondaModuleArgs=@{}) + +# Defaults from before we had arguments. +if (-not $CondaModuleArgs.ContainsKey('ChangePs1')) { + $CondaModuleArgs.ChangePs1 = $True +} + +## ENVIRONMENT MANAGEMENT ###################################################### + +<# + .SYNOPSIS + Obtains a list of valid conda environments. + + .EXAMPLE + Get-CondaEnvironment + + .EXAMPLE + genv +#> +function Get-CondaEnvironment { + [CmdletBinding()] + param(); + + begin {} + + process { + # NB: the JSON output of conda env list does not include the names + # of each env, so we need to parse the fragile output instead. + & $Env:CONDA_EXE $Env:_CE_M $Env:_CE_CONDA env list | ` + Where-Object { -not $_.StartsWith("#") } | ` + Where-Object { -not $_.Trim().Length -eq 0 } | ` + ForEach-Object { + $envLine = $_ -split "\s+"; + $Active = $envLine[1] -eq "*"; + [PSCustomObject] @{ + Name = $envLine[0]; + Active = $Active; + Path = if ($Active) {$envLine[2]} else {$envLine[1]}; + } | Write-Output; + } + } + + end {} +} + +<# + .SYNOPSIS + Activates a conda environment, placing its commands and packages at + the head of $Env:PATH. + + .EXAMPLE + Enter-CondaEnvironment my-env + + .EXAMPLE + etenv my-env + + .NOTES + This command does not currently support activating environments stored + in a non-standard location. +#> +function Enter-CondaEnvironment { + [CmdletBinding()] + param( + [Parameter(Mandatory=$false)][switch]$Stack, + [Parameter(Position=0)][string]$Name + ); + + begin { + If ($Stack) { + $activateCommand = (& $Env:CONDA_EXE $Env:_CE_M $Env:_CE_CONDA shell.powershell activate --stack $Name | Out-String); + } Else { + $activateCommand = (& $Env:CONDA_EXE $Env:_CE_M $Env:_CE_CONDA shell.powershell activate $Name | Out-String); + } + + Write-Verbose "[conda shell.powershell activate $Name]`n$activateCommand"; + Invoke-Expression -Command $activateCommand; + } + + process {} + + end {} + +} + +<# + .SYNOPSIS + Deactivates the current conda environment, if any. + + .EXAMPLE + Exit-CondaEnvironment + + .EXAMPLE + exenv +#> +function Exit-CondaEnvironment { + [CmdletBinding()] + param(); + + begin { + $deactivateCommand = (& $Env:CONDA_EXE $Env:_CE_M $Env:_CE_CONDA shell.powershell deactivate | Out-String); + + # If deactivate returns an empty string, we have nothing more to do, + # so return early. + if ($deactivateCommand.Trim().Length -eq 0) { + return; + } + Write-Verbose "[conda shell.powershell deactivate]`n$deactivateCommand"; + Invoke-Expression -Command $deactivateCommand; + } + process {} + end {} +} + +## CONDA WRAPPER ############################################################### + +<# + .SYNOPSIS + conda is a tool for managing and deploying applications, environments + and packages. + + .PARAMETER Command + Subcommand to invoke. + + .EXAMPLE + conda install toolz +#> +function Invoke-Conda() { + # Don't use any explicit args here, we'll use $args and tab completion + # so that we can capture everything, INCLUDING short options (e.g. -n). + if ($Args.Count -eq 0) { + # No args, just call the underlying conda executable. + & $Env:CONDA_EXE $Env:_CE_M $Env:_CE_CONDA; + } + else { + $Command = $Args[0]; + if ($Args.Count -ge 2) { + $OtherArgs = $Args[1..($Args.Count - 1)]; + } else { + $OtherArgs = @(); + } + switch ($Command) { + "activate" { + Enter-CondaEnvironment @OtherArgs; + } + "deactivate" { + Exit-CondaEnvironment; + } + + default { + # There may be a command we don't know want to handle + # differently in the shell wrapper, pass it through + # verbatim. + & $Env:CONDA_EXE $Env:_CE_M $Env:_CE_CONDA $Command @OtherArgs; + } + } + } +} + +## TAB COMPLETION ############################################################## +# We borrow the approach used by posh-git, in which we override any existing +# functions named TabExpansion, look for commands we can complete on, and then +# default to the previously defined TabExpansion function for everything else. + +if (Test-Path Function:\TabExpansion) { + # Since this technique is common, we encounter an infinite loop if it's + # used more than once unless we give our backup a unique name. + Rename-Item Function:\TabExpansion CondaTabExpansionBackup +} + +function Expand-CondaEnv() { + param( + [string] + $Filter + ); + + $ValidEnvs = Get-CondaEnvironment; + $ValidEnvs ` + | Where-Object { $_.Name -like "$filter*" } ` + | ForEach-Object { $_.Name } ` + | Write-Output; + $ValidEnvs ` + | Where-Object { $_.Path -like "$filter*" } ` + | ForEach-Object { $_.Path } ` + | Write-Output; + +} + +function Expand-CondaSubcommands() { + param( + [string] + $Filter + ); + + # Filter and output applicable subcommands + Invoke-Conda commands | Where-Object { $_ -like "$Filter*" } | Write-Output; + +} + +function TabExpansion($line, $lastWord) { + $lastBlock = [regex]::Split($line, '[|;]')[-1].TrimStart() + + switch -regex ($lastBlock) { + # Pull out conda commands we recognize first before falling through + # to the general patterns for conda itself. + "^conda activate (.*)" { Expand-CondaEnv $lastWord; break; } + "^etenv (.*)" { Expand-CondaEnv $lastWord; break; } + + # If we got down to here, check arguments to conda itself. + "^conda (.*)" { Expand-CondaSubcommands $lastWord; break; } + + # Finally, fall back on existing tab expansion. + default { + if (Test-Path Function:\CondaTabExpansionBackup) { + CondaTabExpansionBackup $line $lastWord + } + } + } +} + +## PROMPT MANAGEMENT ########################################################### + +<# + .SYNOPSIS + Modifies the current prompt to show the currently activated conda + environment, if any. + .EXAMPLE + Add-CondaEnvironmentToPrompt + + Causes the current session's prompt to display the currently activated + conda environment. +#> +if ($CondaModuleArgs.ChangePs1) { + # We use the same procedure to nest prompts as we did for nested tab completion. + if (Test-Path Function:\prompt) { + Rename-Item Function:\prompt CondaPromptBackup + } else { + function CondaPromptBackup() { + # Restore a basic prompt if the definition is missing. + "PS $($executionContext.SessionState.Path.CurrentLocation)$('>' * ($nestedPromptLevel + 1)) "; + } + } + + function global:prompt() { + if ($Env:CONDA_PROMPT_MODIFIER) { + $Env:CONDA_PROMPT_MODIFIER | Write-Host -NoNewline + } + CondaPromptBackup; + } +} + +## ALIASES ##################################################################### + +New-Alias conda Invoke-Conda -Force +New-Alias genv Get-CondaEnvironment -Force +New-Alias etenv Enter-CondaEnvironment -Force +New-Alias exenv Exit-CondaEnvironment -Force + +## EXPORTS ################################################################### + +Export-ModuleMember ` + -Alias * ` + -Function ` + Invoke-Conda, ` + Get-CondaEnvironment, ` + Enter-CondaEnvironment, Exit-CondaEnvironment, ` + TabExpansion, prompt diff --git a/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/shell/condabin/conda-hook.ps1 b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/shell/condabin/conda-hook.ps1 new file mode 100644 index 0000000000000000000000000000000000000000..70e7f08ff5741d8f90ff0a5582200b0d50773fdf --- /dev/null +++ b/miniconda3/pkgs/conda-26.1.1-py313h06a4308_0/shell/condabin/conda-hook.ps1 @@ -0,0 +1,11 @@ +$Env:CONDA_EXE = "/home/task_177140125005974/croot/conda_1771402194624/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/bin/conda" +$Env:_CONDA_EXE = "/home/task_177140125005974/croot/conda_1771402194624/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/bin/conda" +$Env:_CE_M = $null +$Env:_CE_CONDA = $null +$Env:CONDA_PYTHON_EXE = "/home/task_177140125005974/croot/conda_1771402194624/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place/bin/python" +$Env:_CONDA_ROOT = "/home/task_177140125005974/croot/conda_1771402194624/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_place" +$CondaModuleArgs = @{ChangePs1 = $True} + +Import-Module "$Env:_CONDA_ROOT\shell\condabin\Conda.psm1" -ArgumentList $CondaModuleArgs + +Remove-Variable CondaModuleArgs \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/about.json b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..8c59da0295dfc34cbe43db2bcef91a75d0a9563e --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/about.json @@ -0,0 +1,132 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main" + ], + "conda_build_version": "24.1.2", + "conda_version": "24.1.2", + "description": "Anaconda Telemetry for conda adds helps us understand how conda is being used.", + "dev_url": "https://github.com/anaconda/conda-anaconda-telemetry", + "doc_source_url": "https://github.com/anaconda/conda-anaconda-telemetry/blob/0.3.0/README.md", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true, + "flow_run_id": "8053c301-0789-4608-86d2-5c7ef0f8b3e1", + "recipe-maintainers": [ + "travishathaway", + "jezdez" + ], + "remote_url": "git@github.com:AnacondaRecipes/conda-anaconda-telemetry-feedstock.git", + "sha": "7560739847d77b618fbdec503005ab9ba496ee07" + }, + "home": "https://github.com/anaconda/conda-anaconda-telemetry", + "identifiers": [], + "keywords": [], + "license": "BSD-3-Clause", + "license_family": "BSD", + "license_file": "LICENSE", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "_openmp_mutex 5.1 1_gnu", + "archspec 0.2.1 pyhd3eb1b0_0", + "boltons 23.0.0 py39h06a4308_0", + "brotli-python 1.0.9 py39h6a678d5_7", + "bzip2 1.0.8 h7b6447c_0", + "c-ares 1.19.1 h5eee18b_0", + "charset-normalizer 2.0.4 pyhd3eb1b0_0", + "conda-content-trust 0.2.0 py39h06a4308_0", + "conda-package-handling 2.2.0 py39h06a4308_0", + "conda-package-streaming 0.9.0 py39h06a4308_0", + "fmt 9.1.0 hdb19cb5_0", + "icu 73.1 h6a678d5_0", + "idna 3.4 py39h06a4308_0", + "jsonpatch 1.32 pyhd3eb1b0_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "krb5 1.20.1 h143b758_1", + "ld_impl_linux-64 2.38 h1181459_1", + "libarchive 3.6.2 h6ac8c49_2", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_0", + "libgcc-ng 11.2.0 h1234567_1", + "libgomp 11.2.0 h1234567_1", + "libnghttp2 1.57.0 h2d74bed_0", + "libsolv 0.7.24 he621ea3_0", + "libssh2 1.10.0 hdbd6064_2", + "libstdcxx-ng 11.2.0 h1234567_1", + "libxml2 2.10.4 hf1b16e4_1", + "lz4-c 1.9.4 h6a678d5_0", + "ncurses 6.4 h6a678d5_0", + "packaging 23.1 py39h06a4308_0", + "pcre2 10.42 hebb0a14_0", + "pluggy 1.0.0 py39h06a4308_1", + "pybind11-abi 4 hd3eb1b0_1", + "pycosat 0.6.6 py39h5eee18b_0", + "pycparser 2.21 pyhd3eb1b0_0", + "pysocks 1.7.1 py39h06a4308_0", + "python 3.9.18 h955ad1f_0", + "readline 8.2 h5eee18b_0", + "reproc 14.2.4 h295c915_1", + "reproc-cpp 14.2.4 h295c915_1", + "ruamel.yaml 0.17.21 py39h5eee18b_0", + "ruamel.yaml.clib 0.2.6 py39h5eee18b_1", + "sqlite 3.41.2 h5eee18b_0", + "tk 8.6.12 h1ccaba5_0", + "tqdm 4.65.0 py39hb070fc8_0", + "wheel 0.41.2 py39h06a4308_0", + "yaml-cpp 0.8.0 h6a678d5_0", + "zlib 1.2.13 h5eee18b_0", + "zstandard 0.19.0 py39h5eee18b_0", + "zstd 1.5.5 hc292b87_0", + "attrs 23.1.0 py39h06a4308_0", + "beautifulsoup4 4.12.2 py39h06a4308_0", + "ca-certificates 2023.12.12 h06a4308_0", + "certifi 2024.2.2 py39h06a4308_0", + "cffi 1.16.0 py39h5eee18b_0", + "chardet 4.0.0 py39h06a4308_1003", + "click 8.1.7 py39h06a4308_0", + "conda 24.1.2 py39h06a4308_0", + "conda-build 24.1.2 py39h06a4308_0", + "conda-index 0.4.0 pyhd3eb1b0_0", + "conda-libmamba-solver 24.1.0 pyhd3eb1b0_0", + "cryptography 42.0.2 py39hdda0065_0", + "distro 1.8.0 py39h06a4308_0", + "filelock 3.13.1 py39h06a4308_0", + "jinja2 3.1.3 py39h06a4308_0", + "jsonschema 4.19.2 py39h06a4308_0", + "jsonschema-specifications 2023.7.1 py39h06a4308_0", + "libcurl 8.5.0 h251f7ec_0", + "libedit 3.1.20230828 h5eee18b_0", + "liblief 0.12.3 h6a678d5_0", + "libmamba 1.5.6 haf1ee3a_0", + "libmambapy 1.5.6 py39h2dafd23_0", + "markupsafe 2.1.3 py39h5eee18b_0", + "menuinst 2.0.2 py39h06a4308_0", + "more-itertools 10.1.0 py39h06a4308_0", + "openssl 3.0.13 h7f8727e_0", + "patch 2.7.6 h7b6447c_1001", + "patchelf 0.17.2 h6a678d5_0", + "pip 23.3.1 py39h06a4308_0", + "pkginfo 1.9.6 py39h06a4308_0", + "platformdirs 3.10.0 py39h06a4308_0", + "psutil 5.9.0 py39h5eee18b_0", + "py-lief 0.12.3 py39h6a678d5_0", + "pyopenssl 24.0.0 py39h06a4308_0", + "python-libarchive-c 2.9 pyhd3eb1b0_1", + "pytz 2023.3.post1 py39h06a4308_0", + "pyyaml 6.0.1 py39h5eee18b_0", + "referencing 0.30.2 py39h06a4308_0", + "requests 2.31.0 py39h06a4308_1", + "rpds-py 0.10.6 py39hb02cf49_0", + "setuptools 68.2.2 py39h06a4308_0", + "soupsieve 2.5 py39h06a4308_0", + "tomli 2.0.1 py39h06a4308_0", + "tzdata 2023d h04d1e81_0", + "urllib3 2.1.0 py39h06a4308_1", + "xz 5.4.5 h5eee18b_0", + "yaml 0.2.5 h7b6447c_0" + ], + "summary": "Anaconda Telemetry conda plugin", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/files b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/files new file mode 100644 index 0000000000000000000000000000000000000000..0b8f60976b7d17ab37f8d7e7aa54341c53e62aa9 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/files @@ -0,0 +1,12 @@ +site-packages/conda_anaconda_telemetry-0.3.0.dist-info/INSTALLER +site-packages/conda_anaconda_telemetry-0.3.0.dist-info/METADATA +site-packages/conda_anaconda_telemetry-0.3.0.dist-info/RECORD +site-packages/conda_anaconda_telemetry-0.3.0.dist-info/REQUESTED +site-packages/conda_anaconda_telemetry-0.3.0.dist-info/WHEEL +site-packages/conda_anaconda_telemetry-0.3.0.dist-info/direct_url.json +site-packages/conda_anaconda_telemetry-0.3.0.dist-info/entry_points.txt +site-packages/conda_anaconda_telemetry-0.3.0.dist-info/licenses/LICENSE +site-packages/conda_anaconda_telemetry/__init__.py +site-packages/conda_anaconda_telemetry/_version.py +site-packages/conda_anaconda_telemetry/hooks.py +site-packages/conda_anaconda_telemetry/py.typed diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/git b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/hash_input.json b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..03c137a2d34204d05990e03d3dfb47a87a927cbc --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/hash_input.json @@ -0,0 +1,3 @@ +{ + "channel_targets": "defaults" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/index.json b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..0dcd01e436d537540743690b3826011dad48e6c6 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/index.json @@ -0,0 +1,17 @@ +{ + "arch": null, + "build": "pyhd3eb1b0_1", + "build_number": 1, + "depends": [ + "conda >=24.11", + "python >=3.9" + ], + "license": "BSD-3-Clause", + "license_family": "BSD", + "name": "conda-anaconda-telemetry", + "noarch": "python", + "platform": null, + "subdir": "noarch", + "timestamp": 1755883824264, + "version": "0.3.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/licenses/LICENSE b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..eeebfbfeda28357c61cc3618c43c334579cba80e --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/licenses/LICENSE @@ -0,0 +1,27 @@ +BSD 3-Clause License + +Copyright (c) 2024, Anaconda, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/link.json b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/link.json new file mode 100644 index 0000000000000000000000000000000000000000..ec6589c68a1bf1aedb3f856ab584e80f5302f2cb --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/link.json @@ -0,0 +1,6 @@ +{ + "noarch": { + "type": "python" + }, + "package_metadata_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/paths.json b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..e8575e2aa73b990a57203543544017b0ec83f4d7 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/paths.json @@ -0,0 +1,77 @@ +{ + "paths": [ + { + "_path": "site-packages/conda_anaconda_telemetry-0.3.0.dist-info/INSTALLER", + "path_type": "hardlink", + "sha256": "d0edee15f91b406f3f99726e44eb990be6e34fd0345b52b910c568e0eef6a2a8", + "size_in_bytes": 5 + }, + { + "_path": "site-packages/conda_anaconda_telemetry-0.3.0.dist-info/METADATA", + "path_type": "hardlink", + "sha256": "0f08c92b3fad865721081f2c8b33a614a2af9cd9a03f2a9e51f5d2bd35b133bc", + "size_in_bytes": 3787 + }, + { + "_path": "site-packages/conda_anaconda_telemetry-0.3.0.dist-info/RECORD", + "path_type": "hardlink", + "sha256": "7022b2a6b4b27b164d942b2c6f30181cb7f94809672834ad0aaa5778cf35b440", + "size_in_bytes": 1364 + }, + { + "_path": "site-packages/conda_anaconda_telemetry-0.3.0.dist-info/REQUESTED", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "site-packages/conda_anaconda_telemetry-0.3.0.dist-info/WHEEL", + "path_type": "hardlink", + "sha256": "aad0b0a12256807936d52d4a6f88a1773236ae527564a688bab4e3fe780e8724", + "size_in_bytes": 87 + }, + { + "_path": "site-packages/conda_anaconda_telemetry-0.3.0.dist-info/direct_url.json", + "path_type": "hardlink", + "sha256": "9db048b1cb7ae854f3cf77621c4fac3014bb456b9d463a1ad18c7071c2d30951", + "size_in_bytes": 84 + }, + { + "_path": "site-packages/conda_anaconda_telemetry-0.3.0.dist-info/entry_points.txt", + "path_type": "hardlink", + "sha256": "31162e8ee8e56095821750cf2fcf1d6f40a077dc0bb900134429e9a6b190c1fc", + "size_in_bytes": 66 + }, + { + "_path": "site-packages/conda_anaconda_telemetry-0.3.0.dist-info/licenses/LICENSE", + "path_type": "hardlink", + "sha256": "9e504431070dd8a4cc8c021042d1bea065a71cae71ba7841e1d26ce7d2596b5a", + "size_in_bytes": 1544 + }, + { + "_path": "site-packages/conda_anaconda_telemetry/__init__.py", + "path_type": "hardlink", + "sha256": "d09702cb8b481fa9b3f9137be0a7062fe3a711139cd10ecace05ab379834fb28", + "size_in_bytes": 983 + }, + { + "_path": "site-packages/conda_anaconda_telemetry/_version.py", + "path_type": "hardlink", + "sha256": "006986fcbc74fbdced170ffb77d9986da62e0bed9a6f1135a17394340636f586", + "size_in_bytes": 511 + }, + { + "_path": "site-packages/conda_anaconda_telemetry/hooks.py", + "path_type": "hardlink", + "sha256": "4654a71f92477b9742f9cbced4cb7e651a38a12709b82e3cc0734570a16e0e44", + "size_in_bytes": 9058 + }, + { + "_path": "site-packages/conda_anaconda_telemetry/py.typed", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..372391d75f2d680f395bedb5ed2f22852b39d80a --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/recipe/conda_build_config.yaml @@ -0,0 +1,395 @@ +VERBOSE_AT: V=1 +VERBOSE_CM: VERBOSE=1 +alsa_lib: '1.2' +ampl_mp: '3.1' +aom: '3.6' +armadillo: '12' +arpack: '3.9' +arrow_cpp: 19.0.0 +assimp: 6.0.2 +at_spi2_core: '2.36' +aws_c_auth: 0.9.0 +aws_c_cal: 0.9.2 +aws_c_common: 0.12.3 +aws_c_compression: 0.3.1 +aws_c_event_stream: 0.5.5 +aws_c_http: 0.10.2 +aws_c_io: 0.20.1 +aws_c_mqtt: 0.13.2 +aws_c_s3: 0.8.3 +aws_c_sdkutils: 0.2.4 +aws_checksums: 0.2.7 +aws_crt_cpp: 0.32.10 +aws_sdk_cpp: 1.11.528 +azure_core_cpp: 1.14.1 +azure_identity_cpp: 1.10.1 +azure_storage_blobs_cpp: 12.13.0 +azure_storage_common_cpp: 12.10.0 +backtrace: '20241216' +blas_impl: mkl +blosc: '1' +brotli: '1' +brunsli: '0' +bzip2: '1' +c_ares: '1' +c_blosc2: '2.17' +c_compiler: gcc +c_compiler_version: 11.2.0 +c_stdlib: sysroot +c_stdlib_version: '2.17' +cairo: '1' +capnproto: 1.1.0 +ceres_solver: '2.2' +cfitsio: '3.470' +cgo_compiler: go-cgo +cgo_compiler_version: '1.21' +channel_targets: defaults +charls: '2.2' +clang_variant: clang +coin_or_cbc: '2.10' +coin_or_cgl: '0.60' +coin_or_clp: '1.17' +coin_or_osi: '0.108' +coin_or_utils: '2.11' +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cuda_compiler: cuda-nvcc +cuda_compiler_version: '12.4' +cudnn: '9' +cutensor: '2' +cxx_compiler: gxx +cxx_compiler_version: 11.2.0 +cyrus_sasl: 2.1.28 +dav1d: 1.2.1 +dbus: '1' +eigen: 3.3.7 +epoxy: '1.5' +expat: '2' +extend_keys: +- ignore_build_only_deps +- extend_keys +- pin_run_as_build +- ignore_version +ffmpeg: '6' +fftw: '3.3' +flatbuffers: 25.2.10 +fmt: '9' +fontconfig: '2' +fortran_compiler: gfortran +fortran_compiler_version: 11.2.0 +freeglut: '3' +freetds: '1' +freetype: '2' +freexl: '2' +fribidi: '1' +g2clib: '1.6' +gcab: '1' +gdbm: '1.18' +gdk_pixbuf: '2' +geos: 3.10.6 +geotiff: '1.7' +getopt_win32: '0.1' +gettext: '0' +gflags: '2.2' +giflib: '5.2' +gl2ps: 1.4.2 +glew: '2.2' +glib: '2' +glog: '0.5' +glpk: '4.65' +glslang: '15' +gmp: 6.3.0 +gnupg: '2.4' +gnutls: '3.8' +go_compiler: go-nocgo +go_compiler_version: '1.21' +graphite2: '1' +gsl: '2.7' +gst_plugins_base: '1.24' +gst_plugins_good: '1.24' +gstreamer: '1.24' +gstreamer_orc: '0.4' +gtest: 1.14.0 +gtk3: '3' +gts: '0.7' +harfbuzz: '10' +hdf4: 4.2.13 +hdf5: 1.14.5 +hdfeos2: '2.20' +hdfeos5: '5.1' +icu: '73' +ignore_build_only_deps: +- python +- numpy +igraph: '0.10' +isl: '0.22' +jansson: '2' +jasper: '4' +jemalloc: 5.2.1 +jpeg: 9e +json_c: '0.16' +jsoncpp: 1.9.6 +jxrlib: '1.1' +kealib: '1.5' +khronos_opencl_icd_loader: 2024.5.8 +krb5: '1.21' +lame: '3.100' +lcms2: '2' +leptonica: '1.82' +lerc: '4' +level_zero: '1' +leveldb: '1.23' +libabseil: '20250127.0' +libaec: '1' +libaio: '0.3' +libapr: '1' +libapriconv: '1' +libaprutil: '1' +libarchive: '3.7' +libassuan: '3' +libavif: '1' +libboost: 1.88.0 +libboost_devel: 1.88.0 +libbrotlicommon: '1.0' +libbrotlidec: '1.0' +libbrotlienc: '1.0' +libclang13: '14.0' +libclang_cpp14: '14.0' +libcrc32c: '1.1' +libcryptominisat: '5.6' +libcurl: '8' +libdap4: '3.19' +libde265: 1.0.15 +libdeflate: '1.22' +libdrm: '2.4' +libebm: 0.4.4 +libedit: '3.1' +libegl: '1' +libev: '4.33' +libevent: 2.1.12 +libfaiss: 1.0.0 +libffi: '3.4' +libflac: '1.4' +libgcrypt: '1' +libgd: '2.3' +libgdal: '3.11' +libgdal_core: '3.11' +libgit2: '1.6' +libgl: '1' +libgles: '1' +libglib: '2' +libglu: '9' +libglvnd: '1' +libglx: '1' +libgpg_error: '1' +libgrpc: '1.71' +libgsasl: '1' +libgsf: '1.14' +libheif: '1.19' +libhiredis: '1.3' +libiconv: '1' +libidn2: '2' +libjpeg_turbo: '3' +libkml: '1.3' +libksba: '1.6' +liblief: '0.16' +libllvm19: '19.1' +libmamba: '2.0' +libmambapy: '2.0' +libmlir19: '19.1' +libmpdec: '4' +libmpdecxx: '4' +libnetcdf: '4' +libnghttp2: '1' +libnsl: '2.0' +libntlm: '1' +libogg: '1.3' +libopenblas: '0' +libopengl: '1' +libopus: '1' +libortools: '9.9' +libosqp: 0.6.3 +libpcap: '1.10' +libpciaccess: '0.18' +libpng: '1.6' +libpq: '17' +libprotobuf: 5.29.3 +libqdldl: 0.1.7 +librdkafka: '2.2' +libre2_11: '2024' +librsvg: '2' +libsentencepiece: 0.2.0 +libsndfile: '1.2' +libsodium: 1.0.18 +libspatialindex: 1.9.3 +libspatialite: '5.1' +libssh2: '1' +libtasn1: '4' +libtensorflow: 2.18.1 +libtensorflow_cc: 2.18.1 +libtheora: '1' +libthrift: '0.15' +libtiff: '4' +libtmglib: '3' +libtorch: '2.6' +libunistring: '0' +libunwind: '1' +libutf8proc: '2' +libuuid: '1' +libuv: '1' +libvorbis: '1' +libvpx: '1.13' +libvulkan: '1.4' +libwebp: 1.3.2 +libwebp_base: '1' +libxcb: '1' +libxkbcommon: '1' +libxkbfile: '1' +libxml2: '2.13' +libxmlsec1: '1.3' +libxslt: '1' +libzopfli: '1.0' +lmdb: '0' +lua: '5' +lz4_c: '1.9' +lzo: '2' +macports_legacy_support: '1' +mbedtls: '3.5' +mesalib: '25.1' +metis: '5.1' +minizip: '4' +mkl: '2023' +mkl_service: '2' +mpc: '1' +mpfr: '4' +mpich: '4' +mysql_libs: '9.3' +nanobind_abi: '15' +nccl: '2' +ncurses: '6' +nettle: '3.7' +nlopt: '2.7' +npth: '1' +nspr: '4' +nss: '3' +ntbtls: '0' +numpy: '2.1' +ocl_icd: '2' +oniguruma: '6.9' +openblas: '0' +openblas_devel: '0' +openh264: '2.6' +openjpeg: '2' +openldap: '2.6' +openmpi: '4.1' +openssl: '3' +orc: 2.1.1 +pango: '1' +pcre: '8' +pcre2: '10.42' +pdal: '2.5' +perl: '5.38' +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x + libboost: + max_pin: x.x.x +pixman: 0.46.4 +popt: '1' +proj: 9.3.1 +ptscotch: 6.0.9 +pugixml: '1.11' +py_lief: '0.16' +pybind11_abi: '5' +pyqt: '6.7' +pyqtchart: '5.15' +pyqtwebengine: '6.7' +python: '3.13' +python_igraph: '0.10' +python_impl: cpython +python_implementation: cpython +pytorch: '2.6' +qhull: '2020.2' +qpdf: '11' +qt: '6.9' +quantlib: '1' +r_base: 4.3.1 +r_implementation: r-base +r_version: 4.3.1 +rdkit: 2023.03.3 +re2: '2024' +readline: '8' +reproc: '14.2' +reproc_cpp: '14.2' +rhash: '1' +ruby: '3.2' +rust_compiler: rust +rust_compiler_version: 1.87.0 +s2n: 1.5.14 +scotch: 6.0.9 +serf: '1.3' +simdjson: '3.10' +sip: '6.10' +sleef: '3' +snappy: '1' +spdlog: '1' +spdlog_fmt_embed: '1' +spirv_tools: '2025' +sqlite: '3' +suitesparse: '7' +target_platform: linux-64 +tesseract: 5.2.0 +tiledb: '2.26' +tk: '8.6' +unixodbc: '2.3' +vc: '14' +vtk_base: 9.4.1 +vtk_io_ffmpeg: 9.4.1 +wayland: '1.24' +x264: 1!152.20180806 +xcb_util: '0.4' +xcb_util_cursor: '0.1' +xcb_util_image: '0.4' +xcb_util_keysyms: '0.4' +xcb_util_renderutil: '0.3' +xcb_util_wm: '0.4' +xerces_c: '3.2' +xorg_libice: '1' +xorg_libsm: '1' +xorg_libx11: '1' +xorg_libxau: '1' +xorg_libxcomposite: '0' +xorg_libxcursor: '1' +xorg_libxdamage: '1' +xorg_libxdmcp: '1' +xorg_libxext: '1' +xorg_libxfixes: '6' +xorg_libxft: '2' +xorg_libxi: '1' +xorg_libxinerama: '1.1' +xorg_libxmu: '1' +xorg_libxrandr: '1' +xorg_libxrender: '0.9' +xorg_libxscrnsaver: '1' +xorg_libxshmfence: '1' +xorg_libxt: '1' +xorg_libxtst: '1' +xorg_libxxf86vm: '1' +xorg_xextproto: '7' +xorg_xorgproto: '2024' +xxhash: 0.8.0 +xz: '5' +yaml: '0.2' +yaml_cpp: '0.8' +zeromq: '4.3' +zfp: '1' +zip_keys: +- - python + - numpy +zlib: '1.2' +zlib_ng: '2.0' +zstd: '1.5' diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/recipe/meta.yaml b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..2a1ec220befe71f23750cf24e9c1ec329346417d --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/recipe/meta.yaml @@ -0,0 +1,124 @@ +# This file created by conda-build 24.1.2 +# meta.yaml template originally from: +# /feedstock/recipe, last modified Fri Aug 22 17:29:43 2025 +# ------------------------------------------------ + +package: + name: conda-anaconda-telemetry + version: 0.3.0 +source: + sha256: 01044e9d7cc51eab3fa70e0ffa0b7638e20c90ce00e1b346e97d94288d1111fc + url: https://github.com/anaconda/conda-anaconda-telemetry/archive/0.3.0.tar.gz +build: + noarch: python + number: '1' + script: /croot/conda-anaconda-telemetry_1755883788794/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/bin/python + -m pip install . --no-deps --no-build-isolation -vv + string: pyhd3eb1b0_1 +requirements: + build: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - bzip2 1.0.8 h5eee18b_6 + - c-ares 1.19.1 h5eee18b_0 + - ca-certificates 2025.7.15 h06a4308_0 + - curl 8.14.1 h14366f7_1 + - expat 2.7.1 h6a678d5_0 + - gettext 0.21.0 hedfda30_2 + - git 2.45.2 pl5402h72990fb_2 + - icu 73.1 h6a678d5_0 + - libcurl 8.14.1 hc1efc7f_1 + - libev 4.33 h7f8727e_1 + - libgcc-ng 11.2.0 h1234567_1 + - libgomp 11.2.0 h1234567_1 + - libnghttp2 1.57.0 h2d74bed_0 + - libssh2 1.11.1 h251f7ec_0 + - libstdcxx-ng 11.2.0 h1234567_1 + - libxcb 1.17.0 h9b100fa_0 + - libxml2 2.13.8 hfdd30dd_0 + - lz4-c 1.9.4 h6a678d5_1 + - ncurses 6.5 h7934f7d_0 + - openssl 3.0.17 h5eee18b_0 + - pcre2 10.42 hebb0a14_1 + - perl 5.40.2 0_h5eee18b_perl5 + - pthread-stubs 0.3 h0ce48e5_1 + - tk 8.6.15 h54e0aa7_0 + - xorg-libx11 1.8.12 h9b100fa_1 + - xorg-libxau 1.0.12 h9b100fa_0 + - xorg-libxdmcp 1.1.5 h9b100fa_0 + - xorg-xorgproto 2024.1 h5eee18b_1 + - xz 5.6.4 h5eee18b_1 + - zlib 1.2.13 h5eee18b_1 + - zstd 1.5.6 hc292b87_0 + host: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - bzip2 1.0.8 h5eee18b_6 + - ca-certificates 2025.7.15 h06a4308_0 + - expat 2.7.1 h6a678d5_0 + - hatch-vcs 0.4.0 py39h06a4308_0 + - hatchling 1.27.0 py39h06a4308_0 + - importlib-metadata 8.5.0 py39h06a4308_0 + - ld_impl_linux-64 2.40 h12ee557_0 + - libffi 3.4.4 h6a678d5_1 + - libgcc-ng 11.2.0 h1234567_1 + - libgomp 11.2.0 h1234567_1 + - libstdcxx-ng 11.2.0 h1234567_1 + - libxcb 1.17.0 h9b100fa_0 + - ncurses 6.5 h7934f7d_0 + - openssl 3.0.17 h5eee18b_0 + - packaging 25.0 py39h06a4308_0 + - pathspec 0.12.1 py39h06a4308_0 + - pip 25.1 pyhc872135_2 + - pluggy 1.5.0 py39h06a4308_0 + - pthread-stubs 0.3 h0ce48e5_1 + - python 3.9.23 he99959a_0 + - readline 8.3 hc2a1206_0 + - setuptools 78.1.1 py39h06a4308_0 + - setuptools-scm 8.3.1 py39h06a4308_1 + - sqlite 3.50.2 hb25bd0a_1 + - tk 8.6.15 h54e0aa7_0 + - tomli 2.2.1 py39h06a4308_0 + - trove-classifiers 2025.5.9.12 py39h06a4308_0 + - typing-extensions 4.12.2 py39h06a4308_0 + - typing_extensions 4.12.2 py39h06a4308_0 + - tzdata 2025b h04d1e81_0 + - wheel 0.45.1 py39h06a4308_0 + - xorg-libx11 1.8.12 h9b100fa_1 + - xorg-libxau 1.0.12 h9b100fa_0 + - xorg-libxdmcp 1.1.5 h9b100fa_0 + - xorg-xorgproto 2024.1 h5eee18b_1 + - xz 5.6.4 h5eee18b_1 + - zipp 3.21.0 py39h06a4308_0 + - zlib 1.2.13 h5eee18b_1 + run: + - conda >=24.11 + - python >=3.9 +test: + commands: + - pip check + - python -m conda --version + imports: + - conda_anaconda_telemetry + - conda_anaconda_telemetry.hooks + requires: + - pip +about: + description: Anaconda Telemetry for conda adds helps us understand how conda is + being used. + dev_url: https://github.com/anaconda/conda-anaconda-telemetry + doc_source_url: https://github.com/anaconda/conda-anaconda-telemetry/blob/0.3.0/README.md + home: https://github.com/anaconda/conda-anaconda-telemetry + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: Anaconda Telemetry conda plugin +extra: + copy_test_source_files: true + final: true + flow_run_id: 8053c301-0789-4608-86d2-5c7ef0f8b3e1 + recipe-maintainers: + - jezdez + - travishathaway + remote_url: git@github.com:AnacondaRecipes/conda-anaconda-telemetry-feedstock.git + sha: 7560739847d77b618fbdec503005ab9ba496ee07 diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/recipe/meta.yaml.template b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/recipe/meta.yaml.template new file mode 100644 index 0000000000000000000000000000000000000000..f799fa3150a40a8cf3b9aec6e00108c890ccf809 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/recipe/meta.yaml.template @@ -0,0 +1,54 @@ +{% set name = "conda-anaconda-telemetry" %} +{% set version = "0.3.0" %} +{% set sha256 = "01044e9d7cc51eab3fa70e0ffa0b7638e20c90ce00e1b346e97d94288d1111fc" %} + +package: + name: {{ name|lower }} + version: {{ version }} + +source: + url: https://github.com/anaconda/{{ name }}/archive/{{ version }}.tar.gz + sha256: {{ sha256 }} + +build: + # keeping as noarch so that the plugin may be used with architectures which are no longer actively maintained (e.g. osx-64) + noarch: python + number: 1 + script: {{ PYTHON }} -m pip install . --no-deps --no-build-isolation -vv + +requirements: + build: + - git # [not win] + host: + - python 3.9 + - pip + - hatchling >=1.12.2 + - hatch-vcs >=0.2.0 + run: + - python >=3.9 + - conda >=24.11 + +test: + imports: + - conda_anaconda_telemetry + - conda_anaconda_telemetry.hooks + requires: + - pip + commands: + - pip check + - python -m conda --version + +about: + home: https://github.com/anaconda/{{ name }} + summary: Anaconda Telemetry conda plugin + description: Anaconda Telemetry for conda adds helps us understand how conda is being used. + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + doc_source_url: https://github.com/anaconda/{{ name }}/blob/{{ version }}/README.md + dev_url: https://github.com/anaconda/{{ name }} + +extra: + recipe-maintainers: + - travishathaway + - jezdez diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/repodata_record.json b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..1641472141a1d01d1f959a0da534685a86eb1a21 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/repodata_record.json @@ -0,0 +1,23 @@ +{ + "build": "pyhd3eb1b0_1", + "build_number": 1, + "channel": "https://repo.anaconda.com/pkgs/main/noarch/", + "constrains": [], + "depends": [ + "conda >=24.11", + "python >=3.9" + ], + "fn": "conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1.conda", + "license": "BSD-3-Clause", + "license_family": "BSD", + "md5": "2ac481091c9cc4eec50cf2f0cc42744d", + "name": "conda-anaconda-telemetry", + "noarch": "python", + "package_type": "noarch_python", + "sha256": "93b33a69c7e6b410ecb02c9922c71d8e07b9f4b874139a0d350165f8d1d557f3", + "size": 13808, + "subdir": "noarch", + "timestamp": 1755883824000, + "url": "https://repo.anaconda.com/pkgs/main/noarch/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1.conda", + "version": "0.3.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/test/run_test.bat b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/test/run_test.bat new file mode 100644 index 0000000000000000000000000000000000000000..2b11ea48a8a8d4dde33c3747772ba19f435448e6 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/test/run_test.bat @@ -0,0 +1,9 @@ + + + + +pip check +IF %ERRORLEVEL% NEQ 0 exit /B 1 +python -m conda --version +IF %ERRORLEVEL% NEQ 0 exit /B 1 +exit /B 0 diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/test/run_test.py b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/test/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..8134c4ad9c8d6a36f5af01eaaa05f170d1667d93 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/test/run_test.py @@ -0,0 +1,6 @@ +print("import: 'conda_anaconda_telemetry'") +import conda_anaconda_telemetry + +print("import: 'conda_anaconda_telemetry.hooks'") +import conda_anaconda_telemetry.hooks + diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/test/run_test.sh b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..94c2c03cfbadc823b7962452be8a2d4a5f24d556 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/test/run_test.sh @@ -0,0 +1,9 @@ + + +set -ex + + + +pip check +python -m conda --version +exit 0 diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/test/test_time_dependencies.json b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..215362c1832b66eb448cdeeadbb1db3470d5adb4 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["pip"] \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/INSTALLER b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/METADATA b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..4a2f5420fb7a76ab9fa63476f56e8f30522433f3 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/METADATA @@ -0,0 +1,86 @@ +Metadata-Version: 2.4 +Name: conda-anaconda-telemetry +Version: 0.3.0 +Summary: A conda plugin for Anaconda Telemetry +License: BSD 3-Clause License + + Copyright (c) 2024, Anaconda, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +License-File: LICENSE +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Requires-Python: >=3.9 +Requires-Dist: conda>=24.11 +Description-Content-Type: text/markdown + +# Conda Anaconda Telemetry + +Welcome to the Conda Anaconda Telemetry project! This project is a plugin that +submits data about conda's usage to Anaconda. This helps Anaconda learn more about +those using conda. This plugin is also an example of how others can leverage conda's +plugin system to begin collecting more information about their conda users too. + +## Installation + +To begin using this plugin, install it in your base environment with the following command: + +```commandline +conda install --name base conda-anaconda-telemetry +``` + +## Disabling + +To disable this plugin, you can either add the following to your `.condarc` file: + +```yaml +plugins: + anaconda_telemetry: false +``` + +Or remove it from your base environment: + +```commandline +conda remove --name base conda-anaconda-telemetry +``` + +## Contributing to this repository + +Contributions are very welcome 😄 + +Feel free to: +1. File bug reports +2. Create feature requests +3. Open pull requests to resolve issues available in the [Github issues queue](https://github.com/anaconda/conda-anaconda-telemetry/issues). +4. Review open pull requests +5. Report any typos, wrong/outdated information on the [documentation website](https://anaconda.github.io/conda-anaconda-telemetry/). +6. Engage in ongoing discussions in this project and add new ideas. diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/RECORD b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..9e8b87e9076cda5dc65f3e4729a3c117f349c221 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/RECORD @@ -0,0 +1,15 @@ +conda_anaconda_telemetry-0.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +conda_anaconda_telemetry-0.3.0.dist-info/METADATA,sha256=DwjJKz-thlchCB8sizOmFKKvnNmgPyqeUfXSvTWxM7w,3787 +conda_anaconda_telemetry-0.3.0.dist-info/RECORD,, +conda_anaconda_telemetry-0.3.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +conda_anaconda_telemetry-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87 +conda_anaconda_telemetry-0.3.0.dist-info/direct_url.json,sha256=nbBIsct66FTzz3diHE-sMBS7RWudRjoa0YxwccLTCVE,84 +conda_anaconda_telemetry-0.3.0.dist-info/entry_points.txt,sha256=MRYujujlYJWCF1DPL88db0Cgd9wLuQATRCnpprGQwfw,66 +conda_anaconda_telemetry-0.3.0.dist-info/licenses/LICENSE,sha256=nlBEMQcN2KTMjAIQQtG-oGWnHK5xunhB4dJs59JZa1o,1544 +conda_anaconda_telemetry/__init__.py,sha256=0JcCy4tIH6mz-RN74KcGL-OnEROc0Q7KzgWrN5g0-yg,983 +conda_anaconda_telemetry/__pycache__/__init__.cpython-39.pyc,, +conda_anaconda_telemetry/__pycache__/_version.cpython-39.pyc,, +conda_anaconda_telemetry/__pycache__/hooks.cpython-39.pyc,, +conda_anaconda_telemetry/_version.py,sha256=AGmG_Lx0-9ztFw_7d9mYbaYuC-2abxE1oXOUNAY29YY,511 +conda_anaconda_telemetry/hooks.py,sha256=RlSnH5JHe5dC-cvO1Mt-ZRo4oScJuC48wHNFcKFuDkQ,9058 +conda_anaconda_telemetry/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/REQUESTED b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/WHEEL b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..12228d414b6cfed7c39d3781c85c63256a1d7fb5 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.27.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/direct_url.json b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..594b28bdbc410976e272632ea21e51ef490bdac0 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///croot/conda-anaconda-telemetry_1755883788794/work"} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/entry_points.txt b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..c8405e19e9b65266e3f1f0e0f267e5bd5d1e39f2 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/entry_points.txt @@ -0,0 +1,2 @@ +[conda] +conda-anaconda-telemetry = conda_anaconda_telemetry.hooks diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/licenses/LICENSE b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..eeebfbfeda28357c61cc3618c43c334579cba80e --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry-0.3.0.dist-info/licenses/LICENSE @@ -0,0 +1,27 @@ +BSD 3-Clause License + +Copyright (c) 2024, Anaconda, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry/__init__.py b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..8c97011ee44a7deee086bc1a5e7f243e1c70bf12 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry/__init__.py @@ -0,0 +1,32 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""A conda plugin for Anaconda Telemetry.""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from typing import Final + +#: Application name. +APP_NAME: Final = "conda-anaconda-telemetry" + +try: + from ._version import __version__ +except ImportError: + # _version.py is only created after running `pip install` + try: + from setuptools_scm import get_version + + __version__ = get_version(root="..", relative_to=__file__) + except (ImportError, OSError, LookupError): + # ImportError: setuptools_scm isn't installed + # OSError: git isn't installed + # LookupError: setuptools_scm unable to detect version + # conda-anaconda-telemetry follows SemVer, so the dev version is: + # MJ.MN.MICRO.devN+gHASH[.dirty] + __version__ = "0.0.0.dev0+placeholder" + +#: Application version. +APP_VERSION: Final = __version__ diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry/_version.py b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry/_version.py new file mode 100644 index 0000000000000000000000000000000000000000..ac8d8d494d79bd19c708ea69e224679485cf1b37 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry/_version.py @@ -0,0 +1,21 @@ +# file generated by setuptools-scm +# don't change, don't track in version control + +__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"] + +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Tuple + from typing import Union + + VERSION_TUPLE = Tuple[Union[int, str], ...] +else: + VERSION_TUPLE = object + +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE + +__version__ = version = '0.3.0' +__version_tuple__ = version_tuple = (0, 3, 0) diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry/hooks.py b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry/hooks.py new file mode 100644 index 0000000000000000000000000000000000000000..d0f44f089e9f17224fee7987f88096fee0ef1aae --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry/hooks.py @@ -0,0 +1,289 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Conda plugin that adds telemetry headers to requests made by conda.""" + +from __future__ import annotations + +import functools +import logging +import re +import time +import typing + +from conda.base.context import context +from conda.cli.main_list import list_packages +from conda.common.configuration import PrimitiveParameter +from conda.common.url import mask_anaconda_token +from conda.models.channel import all_channel_urls +from conda.plugins import CondaRequestHeader, CondaSetting, hookimpl + +try: + from conda_build import __version__ as conda_build_version +except ImportError: + conda_build_version = "n/a" + +if typing.TYPE_CHECKING: + from collections.abc import Iterator, Sequence + from typing import Callable + +logger = logging.getLogger(__name__) + +#: Field separator for request header +FIELD_SEPARATOR = ";" + +#: Size limit in bytes for the payload in the request header +SIZE_LIMIT = 7_000 + +#: Prefix for all custom headers submitted via this plugin +# Note: header names are normalized to lowercase by the HTTP layer, so keep +# the prefix lowercased to match the actual header names emitted at runtime. +HEADER_PREFIX = "anaconda-telemetry" + +#: Name of the virtual package header +HEADER_VIRTUAL_PACKAGES = f"{HEADER_PREFIX}-virtual-packages" + +#: Name of the channels header +HEADER_CHANNELS = f"{HEADER_PREFIX}-channels" + +#: Name of the packages header +HEADER_PACKAGES = f"{HEADER_PREFIX}-packages" + +#: Name of the search header +HEADER_SEARCH = f"{HEADER_PREFIX}-search" + +#: Name of the install header +HEADER_INSTALL = f"{HEADER_PREFIX}-install" + +#: Name of the sys info header +HEADER_SYS_INFO = f"{HEADER_PREFIX}-sys-info" + +#: Regex pattern for hosts and paths we want to submit request headers to +REQUEST_HEADER_PATTERN = re.compile( + r""" + ^ # Start of string + (?: # Non-capturing group for host patterns + repo\.anaconda\. # repo.anaconda. (literal dots) + (?:com|cloud) # Either "com" or "cloud" + (?:/.*)? # Optional path starting with forward slash + | # OR + conda\.anaconda\.org/ # conda.anaconda.org/ (literal dots and slash) + (?: # Non-capturing group for channel paths + anaconda| # anaconda channel + conda-forge| # conda-forge channel + main| # main channel + msys2| # msys2 channel + r # r channel + ) + /.* # Forward slash followed by any characters + ) + $ # End of string + """, + re.VERBOSE, +) + + +def timer(func: Callable) -> Callable: + """Log the duration of a function call.""" + + @functools.wraps(func) + def wrapper_timer(*args: tuple, **kwargs: dict) -> Callable: + """Wrap the given function.""" + if logger.getEffectiveLevel() <= logging.INFO: + tic = time.perf_counter() + value = func(*args, **kwargs) + toc = time.perf_counter() + elapsed_time = toc - tic + logger.info( + "function: %s; duration (seconds): %0.4f", + func.__name__, + elapsed_time, + ) + return value + + return func(*args, **kwargs) + + return wrapper_timer + + +def get_virtual_packages() -> tuple[str, ...]: + """Retrieve the registered virtual packages from conda's context.""" + return tuple( + f"{package.name}={package.version}={package.build}" + for package in context.plugin_manager.get_virtual_package_records() + ) + + +def get_channel_urls() -> tuple[str, ...]: + """Return a list of currently configured channel URLs with tokens masked.""" + channels = list(all_channel_urls(context.channels)) + return tuple(mask_anaconda_token(c) for c in channels) + + +def get_conda_command() -> str: + """Use ``sys.argv`` to determine the conda command that is current being run.""" + return context._argparse_args.cmd + + +def get_package_list() -> tuple[str, ...]: + """Retrieve the list of packages in the current environment.""" + prefix = context.active_prefix or context.root_prefix + _, packages = list_packages(prefix, format="canonical") + + return packages + + +def get_search_term() -> str: + """Retrieve the search term being used when search command is run.""" + return context._argparse_args.match_spec + + +def get_install_arguments() -> tuple[str, ...]: + """Get the parsed position argument.""" + return context._argparse_args.packages + + +@timer +@functools.lru_cache(None) +def get_sys_info_header_value() -> str: + """Return ``;`` delimited string of extra system information.""" + telemetry_data = { + "conda_build_version": conda_build_version, + "conda_command": get_conda_command(), + } + + return FIELD_SEPARATOR.join( + f"{key}:{value}" for key, value in telemetry_data.items() + ) + + +@timer +@functools.lru_cache(None) +def get_channel_urls_header_value() -> str: + """Return ``FIELD_SEPARATOR`` delimited string of channel URLs.""" + return FIELD_SEPARATOR.join(get_channel_urls()) + + +@timer +@functools.lru_cache(None) +def get_virtual_packages_header_value() -> str: + """Return ``FIELD_SEPARATOR`` delimited string of virtual packages.""" + return FIELD_SEPARATOR.join(get_virtual_packages()) + + +@timer +@functools.lru_cache(None) +def get_install_arguments_header_value() -> str: + """Return ``FIELD_SEPARATOR`` delimited string of channel URLs.""" + return FIELD_SEPARATOR.join(get_install_arguments()) + + +@timer +@functools.lru_cache(None) +def get_installed_packages_header_value() -> str: + """Return ``FIELD_SEPARATOR`` delimited string of install arguments.""" + return FIELD_SEPARATOR.join(get_package_list()) + + +class HeaderWrapper(typing.NamedTuple): + """Object that wraps ``CondaRequestHeader`` and adds a ``size_limit`` field.""" + + header: CondaRequestHeader + size_limit: int + + +def validate_headers( + header_wrappers: Sequence[HeaderWrapper], +) -> Iterator[CondaRequestHeader]: + """Make sure that all headers combined are not larger than ``SIZE_LIMIT``. + + Any headers over their individual limits will be truncated. + """ + for wrapper in header_wrappers: + wrapper.header.value = wrapper.header.value[: wrapper.size_limit] + yield wrapper.header + + +def _conda_request_headers() -> Sequence[HeaderWrapper]: + custom_headers = [ + HeaderWrapper( + header=CondaRequestHeader( + name=HEADER_SYS_INFO, + value=get_sys_info_header_value(), + ), + size_limit=500, + ), + HeaderWrapper( + header=CondaRequestHeader( + name=HEADER_CHANNELS, + value=get_channel_urls_header_value(), + ), + size_limit=500, + ), + HeaderWrapper( + header=CondaRequestHeader( + name=HEADER_VIRTUAL_PACKAGES, + value=get_virtual_packages_header_value(), + ), + size_limit=500, + ), + HeaderWrapper( + header=CondaRequestHeader( + name=HEADER_PACKAGES, + value=get_installed_packages_header_value(), + ), + size_limit=5_000, + ), + ] + + command = get_conda_command() + + if command == "search": + custom_headers.append( + HeaderWrapper( + header=CondaRequestHeader( + name=HEADER_SEARCH, + value=get_search_term(), + ), + size_limit=500, + ) + ) + + elif command in {"install", "create"}: + custom_headers.append( + HeaderWrapper( + header=CondaRequestHeader( + name=HEADER_INSTALL, + value=get_install_arguments_header_value(), + ), + size_limit=500, + ) + ) + + return custom_headers + + +def should_submit_request_headers(host: str, path: str) -> bool: + """Return whether we should submit request headers to the given host and path.""" + return REQUEST_HEADER_PATTERN.match(f"{host}{path}") is not None + + +@hookimpl +def conda_request_headers(host: str, path: str) -> Iterator[CondaRequestHeader]: + """Return a list of custom headers to be included in the request.""" + try: + if context.plugins.anaconda_telemetry and should_submit_request_headers( + host, path + ): + yield from validate_headers(_conda_request_headers()) + except Exception as exc: + logger.debug("Failed to collect telemetry data", exc_info=exc) + + +@hookimpl +def conda_settings() -> Iterator[CondaSetting]: + """Return a list of settings that can be configured by the user.""" + yield CondaSetting( + name="anaconda_telemetry", + description="Whether Anaconda Telemetry is enabled", + parameter=PrimitiveParameter(True, element_type=bool), + ) diff --git a/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry/py.typed b/miniconda3/pkgs/conda-anaconda-telemetry-0.3.0-pyhd3eb1b0_1/site-packages/conda_anaconda_telemetry/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/bin/.conda-anaconda-tos-pre-unlink.sh b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/bin/.conda-anaconda-tos-pre-unlink.sh new file mode 100644 index 0000000000000000000000000000000000000000..5e6659bea781a68e9e151bd23660aded2f65a522 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/bin/.conda-anaconda-tos-pre-unlink.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +_PREFIX="${CONDA_PREFIX:-${PREFIX:-}}" +_PYTHON="${_PREFIX}/python.exe" +[ -f "${_PYTHON}" ] || _PYTHON="${_PREFIX}/bin/python" +"${_PYTHON}" -m conda tos clean --all >>"${_PREFIX}/.messages.txt" 2>&1 || : diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/about.json b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..eeca3d4925058f5b8effd870a54cb90e12194d72 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/about.json @@ -0,0 +1,132 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main" + ], + "conda_build_version": "24.1.2", + "conda_version": "24.1.2", + "description": "Conda subcommand to view, accept, and interact with a channel's Terms of Service (ToS).", + "dev_url": "https://github.com/anaconda/conda-anaconda-tos", + "doc_source_url": "https://github.com/anaconda/conda-anaconda-tos/blob/0.2.2/README.md", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true, + "flow_run_id": "f6e8f788-62ec-4240-904c-a58d47beb37c", + "recipe-maintainers": [ + "kenodegard", + "jezdez" + ], + "remote_url": "git@github.com:AnacondaRecipes/private_conda_recipes.git", + "sha": "c79e9e98898658f4ba1724f0663fb820d917154b" + }, + "home": "https://github.com/anaconda/conda-anaconda-tos", + "identifiers": [], + "keywords": [], + "license": "BSD-3-Clause", + "license_family": "BSD", + "license_file": "LICENSE", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "_openmp_mutex 5.1 1_gnu", + "archspec 0.2.1 pyhd3eb1b0_0", + "boltons 23.0.0 py39h06a4308_0", + "brotli-python 1.0.9 py39h6a678d5_7", + "bzip2 1.0.8 h7b6447c_0", + "c-ares 1.19.1 h5eee18b_0", + "charset-normalizer 2.0.4 pyhd3eb1b0_0", + "conda-content-trust 0.2.0 py39h06a4308_0", + "conda-package-handling 2.2.0 py39h06a4308_0", + "conda-package-streaming 0.9.0 py39h06a4308_0", + "fmt 9.1.0 hdb19cb5_0", + "icu 73.1 h6a678d5_0", + "idna 3.4 py39h06a4308_0", + "jsonpatch 1.32 pyhd3eb1b0_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "krb5 1.20.1 h143b758_1", + "ld_impl_linux-64 2.38 h1181459_1", + "libarchive 3.6.2 h6ac8c49_2", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_0", + "libgcc-ng 11.2.0 h1234567_1", + "libgomp 11.2.0 h1234567_1", + "libnghttp2 1.57.0 h2d74bed_0", + "libsolv 0.7.24 he621ea3_0", + "libssh2 1.10.0 hdbd6064_2", + "libstdcxx-ng 11.2.0 h1234567_1", + "libxml2 2.10.4 hf1b16e4_1", + "lz4-c 1.9.4 h6a678d5_0", + "ncurses 6.4 h6a678d5_0", + "packaging 23.1 py39h06a4308_0", + "pcre2 10.42 hebb0a14_0", + "pluggy 1.0.0 py39h06a4308_1", + "pybind11-abi 4 hd3eb1b0_1", + "pycosat 0.6.6 py39h5eee18b_0", + "pycparser 2.21 pyhd3eb1b0_0", + "pysocks 1.7.1 py39h06a4308_0", + "python 3.9.18 h955ad1f_0", + "readline 8.2 h5eee18b_0", + "reproc 14.2.4 h295c915_1", + "reproc-cpp 14.2.4 h295c915_1", + "ruamel.yaml 0.17.21 py39h5eee18b_0", + "ruamel.yaml.clib 0.2.6 py39h5eee18b_1", + "sqlite 3.41.2 h5eee18b_0", + "tk 8.6.12 h1ccaba5_0", + "tqdm 4.65.0 py39hb070fc8_0", + "wheel 0.41.2 py39h06a4308_0", + "yaml-cpp 0.8.0 h6a678d5_0", + "zlib 1.2.13 h5eee18b_0", + "zstandard 0.19.0 py39h5eee18b_0", + "zstd 1.5.5 hc292b87_0", + "attrs 23.1.0 py39h06a4308_0", + "beautifulsoup4 4.12.2 py39h06a4308_0", + "ca-certificates 2023.12.12 h06a4308_0", + "certifi 2024.2.2 py39h06a4308_0", + "cffi 1.16.0 py39h5eee18b_0", + "chardet 4.0.0 py39h06a4308_1003", + "click 8.1.7 py39h06a4308_0", + "conda 24.1.2 py39h06a4308_0", + "conda-build 24.1.2 py39h06a4308_0", + "conda-index 0.4.0 pyhd3eb1b0_0", + "conda-libmamba-solver 24.1.0 pyhd3eb1b0_0", + "cryptography 42.0.2 py39hdda0065_0", + "distro 1.8.0 py39h06a4308_0", + "filelock 3.13.1 py39h06a4308_0", + "jinja2 3.1.3 py39h06a4308_0", + "jsonschema 4.19.2 py39h06a4308_0", + "jsonschema-specifications 2023.7.1 py39h06a4308_0", + "libcurl 8.5.0 h251f7ec_0", + "libedit 3.1.20230828 h5eee18b_0", + "liblief 0.12.3 h6a678d5_0", + "libmamba 1.5.6 haf1ee3a_0", + "libmambapy 1.5.6 py39h2dafd23_0", + "markupsafe 2.1.3 py39h5eee18b_0", + "menuinst 2.0.2 py39h06a4308_0", + "more-itertools 10.1.0 py39h06a4308_0", + "openssl 3.0.13 h7f8727e_0", + "patch 2.7.6 h7b6447c_1001", + "patchelf 0.17.2 h6a678d5_0", + "pip 23.3.1 py39h06a4308_0", + "pkginfo 1.9.6 py39h06a4308_0", + "platformdirs 3.10.0 py39h06a4308_0", + "psutil 5.9.0 py39h5eee18b_0", + "py-lief 0.12.3 py39h6a678d5_0", + "pyopenssl 24.0.0 py39h06a4308_0", + "python-libarchive-c 2.9 pyhd3eb1b0_1", + "pytz 2023.3.post1 py39h06a4308_0", + "pyyaml 6.0.1 py39h5eee18b_0", + "referencing 0.30.2 py39h06a4308_0", + "requests 2.31.0 py39h06a4308_1", + "rpds-py 0.10.6 py39hb02cf49_0", + "setuptools 68.2.2 py39h06a4308_0", + "soupsieve 2.5 py39h06a4308_0", + "tomli 2.0.1 py39h06a4308_0", + "tzdata 2023d h04d1e81_0", + "urllib3 2.1.0 py39h06a4308_1", + "xz 5.4.5 h5eee18b_0", + "yaml 0.2.5 h7b6447c_0" + ], + "summary": "Anaconda Terms of Service conda plugin", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/files b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/files new file mode 100644 index 0000000000000000000000000000000000000000..8398461eed1eb83cbd3fe62737a506a220829fa1 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/files @@ -0,0 +1,36 @@ +bin/.conda-anaconda-tos-pre-unlink.sh +lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/INSTALLER +lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/METADATA +lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/RECORD +lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/REQUESTED +lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/WHEEL +lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/direct_url.json +lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/entry_points.txt +lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/licenses/LICENSE +lib/python3.13/site-packages/conda_anaconda_tos/__init__.py +lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/__init__.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/_version.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/api.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/exceptions.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/local.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/models.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/path.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/plugin.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/remote.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/_version.py +lib/python3.13/site-packages/conda_anaconda_tos/api.py +lib/python3.13/site-packages/conda_anaconda_tos/console/__init__.py +lib/python3.13/site-packages/conda_anaconda_tos/console/__pycache__/__init__.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/console/__pycache__/mappers.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/console/__pycache__/prompt.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/console/__pycache__/render.cpython-313.pyc +lib/python3.13/site-packages/conda_anaconda_tos/console/mappers.py +lib/python3.13/site-packages/conda_anaconda_tos/console/prompt.py +lib/python3.13/site-packages/conda_anaconda_tos/console/render.py +lib/python3.13/site-packages/conda_anaconda_tos/exceptions.py +lib/python3.13/site-packages/conda_anaconda_tos/local.py +lib/python3.13/site-packages/conda_anaconda_tos/models.py +lib/python3.13/site-packages/conda_anaconda_tos/path.py +lib/python3.13/site-packages/conda_anaconda_tos/plugin.py +lib/python3.13/site-packages/conda_anaconda_tos/py.typed +lib/python3.13/site-packages/conda_anaconda_tos/remote.py diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/git b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/git new file mode 100644 index 0000000000000000000000000000000000000000..bf7e9f529b6b8188ff723de9ff7cb34d2ec80d42 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/git @@ -0,0 +1,23 @@ +==> /croot/conda-anaconda-tos_1755123313635/_build_env/bin/git log -n1 <== +commit 06c5dfa887a459d9682908684ddcc53723f3647d +Author: Jannis Leidel +Date: Wed Aug 13 23:42:31 2025 +0200 + + Test conda 25.7.x as well. (#263) + + * Test conda 25.7.x as well. + + * Normalize header name in test_request_headers_hook + + * Update pyproject.toml to ignore conda binstar deprecation warnings +==> /croot/conda-anaconda-tos_1755123313635/_build_env/bin/git describe --tags --dirty <== +0.2.2 +==> /croot/conda-anaconda-tos_1755123313635/_build_env/bin/git status <== +HEAD detached at 0.2.2 +Untracked files: + (use "git add ..." to include in what will be committed) + build_env_setup.sh + conda_build.sh + metadata_conda_debug.yaml + +nothing added to commit but untracked files present (use "git add" to track) diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/hash_input.json b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..e1489271625fa4f5548417553f3725447d4df321 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/hash_input.json @@ -0,0 +1,4 @@ +{ + "channel_targets": "defaults", + "target_platform": "linux-64" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/index.json b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..d6650bf941da00365839f160127cefb68ac4eb2c --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/index.json @@ -0,0 +1,19 @@ +{ + "arch": "x86_64", + "build": "py313h06a4308_1", + "build_number": 1, + "depends": [ + "conda >=24.11", + "pydantic", + "python >=3.13,<3.14.0a0", + "python_abi 3.13.* *_cp313", + "rich" + ], + "license": "BSD-3-Clause", + "license_family": "BSD", + "name": "conda-anaconda-tos", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1755123417919, + "version": "0.2.2" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/licenses/LICENSE b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..eeebfbfeda28357c61cc3618c43c334579cba80e --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/licenses/LICENSE @@ -0,0 +1,27 @@ +BSD 3-Clause License + +Copyright (c) 2024, Anaconda, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/paths.json b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..fbaa6dc33a763cc6e4b1e802d92caffc79cb4635 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/paths.json @@ -0,0 +1,221 @@ +{ + "paths": [ + { + "_path": "bin/.conda-anaconda-tos-pre-unlink.sh", + "path_type": "hardlink", + "sha256": "291bdba086368c1e6bb96a4bf359071fec588d148ad21f82e8c1211f7e01ed42", + "size_in_bytes": 214 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/INSTALLER", + "path_type": "hardlink", + "sha256": "d0edee15f91b406f3f99726e44eb990be6e34fd0345b52b910c568e0eef6a2a8", + "size_in_bytes": 5 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/METADATA", + "path_type": "hardlink", + "sha256": "6b1e5bbe7ab61f3104f8a2e76f0f7ee683c38a24a7dbfd72bd7d765816d03376", + "size_in_bytes": 2532 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/RECORD", + "path_type": "hardlink", + "sha256": "a869f88321415fcc3986cea77eaec316d817678295ef2fef58efe981fbe8be99", + "size_in_bytes": 2777 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/REQUESTED", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/WHEEL", + "path_type": "hardlink", + "sha256": "aad0b0a12256807936d52d4a6f88a1773236ae527564a688bab4e3fe780e8724", + "size_in_bytes": 87 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/direct_url.json", + "path_type": "hardlink", + "sha256": "0b906ac0e81767a4d988045f9f7793155c9dab4a7d6faafbea2c56211a8f4e38", + "size_in_bytes": 78 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/entry_points.txt", + "path_type": "hardlink", + "sha256": "d1c5235d44ad1c73f1ec24a221ceda382a67e714511082a34c67e33df03951dc", + "size_in_bytes": 55 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/licenses/LICENSE", + "path_type": "hardlink", + "sha256": "9e504431070dd8a4cc8c021042d1bea065a71cae71ba7841e1d26ce7d2596b5a", + "size_in_bytes": 1544 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/__init__.py", + "path_type": "hardlink", + "sha256": "de8d60c5086ac7ee6e38fd20bdc97c480b331de29e516f0e0d8037a7faafbc20", + "size_in_bytes": 984 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/__init__.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "a6869f4794bc433f2006f0de3833a037b3042712f519db45e495abfe1aa07d42", + "size_in_bytes": 875 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/_version.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "8bd9c75a0f512455883e3afbffe13bc6f8cae9429f24f98d20102e288db5ad9c", + "size_in_bytes": 627 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/api.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "c45e629beb07048a1b56dab31986208edae371744642ce0e11013129b9759aed", + "size_in_bytes": 9991 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/exceptions.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "7c1f5f03a6348a6ae2c2fcde97f4ca9095968f60dc1779623bb0429d819da446", + "size_in_bytes": 5806 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/local.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "bd5644087e3362fb1d70be37456b84b6f7e5ff11777c22f5b91be9fdb5d0cbb4", + "size_in_bytes": 4725 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/models.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "0a1bbce8b44f9428b8b39daf8953b1987f6e9b4c0a0ca7242db4e722fb35d722", + "size_in_bytes": 3680 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/path.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "c3662aae050249bb43324b3c86dd7123a1dcb822020ba509de3b19d7e765f6ea", + "size_in_bytes": 5984 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/plugin.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "be3fa0d72abcf8e88a274f4461f95bc1a13181edd4f9a699b7c0831a63c12879", + "size_in_bytes": 13557 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/__pycache__/remote.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "069bc2454302e2f4339f969ee04925e9e74fa5454eb91a292448cb021367fa5b", + "size_in_bytes": 6079 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/_version.py", + "path_type": "hardlink", + "sha256": "3a31862b94dc1d51b8e18eb6680a9e247e02b24919a18f7275b1ceb420dec39d", + "size_in_bytes": 511 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/api.py", + "path_type": "hardlink", + "sha256": "dc31e01058e511cd3bf91adf0288beeafaf1fcfcefa29237a6e9ee41e8cfab42", + "size_in_bytes": 13142 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/console/__init__.py", + "path_type": "hardlink", + "sha256": "9b4fd1e7910037c83522414f7debed4ca2cea570964fe0ff99e8d7d9e83e82c7", + "size_in_bytes": 306 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/console/__pycache__/__init__.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "6dc4f2183f1c912acdc00c8f969352e528a6919e2e236be78bb7891c99d4fc72", + "size_in_bytes": 444 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/console/__pycache__/mappers.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "9268cd62e91d19263958dc05b694cdf3d29eaa0f10b8cfcfb1a4a76f32cb91c1", + "size_in_bytes": 2225 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/console/__pycache__/prompt.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "d158ebfc9a1c055932a2459d6aeb58f24f1285ee0aa5fb9d9874a75404ae35d0", + "size_in_bytes": 2663 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/console/__pycache__/render.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "de2ac466bdaa1081d11e614354896a25f9e110f8108a556a34f6f16087a3df7c", + "size_in_bytes": 17101 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/console/mappers.py", + "path_type": "hardlink", + "sha256": "795406fc819ffdb97d844427574a21b85df405d70944fab46a05cb5e048023e4", + "size_in_bytes": 1707 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/console/prompt.py", + "path_type": "hardlink", + "sha256": "f51500c8045b20ce90e16b75dabeb43b2f0a4555d0ba4cc941ab64c1d1321e7f", + "size_in_bytes": 1473 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/console/render.py", + "path_type": "hardlink", + "sha256": "64f599046944d568bf193f86eec433babbf0ccd55db8144aa3a185267bfc51ae", + "size_in_bytes": 16007 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/exceptions.py", + "path_type": "hardlink", + "sha256": "56c2db116f9769382f7dbae88ab515c648b4769b3b2301ca8895599443c45808", + "size_in_bytes": 4039 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/local.py", + "path_type": "hardlink", + "sha256": "9af52d6ac4e6879f382d9f2626683974e05349512e02cf7083b96c0ee4723338", + "size_in_bytes": 4366 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/models.py", + "path_type": "hardlink", + "sha256": "22c95e9705ecb80ddf07f3aa5da36c3eca04bfacc438dc2984b44f949ea8097a", + "size_in_bytes": 2186 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/path.py", + "path_type": "hardlink", + "sha256": "f9567f71f397ea01704f0ca51214eb736c12f70f037eb6517f5d40415ac85aa5", + "size_in_bytes": 4446 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/plugin.py", + "path_type": "hardlink", + "sha256": "4ae55579de420c56351b7744aca28774ee759c0e15886999d93a0a7276d34974", + "size_in_bytes": 12532 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/py.typed", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "lib/python3.13/site-packages/conda_anaconda_tos/remote.py", + "path_type": "hardlink", + "sha256": "d015e2662998c821dedd8023905811c64c4a475f8935e976c78400d3c3a13559", + "size_in_bytes": 5942 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/repodata_record.json b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..a45cb29524acc180f1308a1f15aafdc6fc01ee91 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/repodata_record.json @@ -0,0 +1,26 @@ +{ + "arch": "x86_64", + "build": "py313h06a4308_1", + "build_number": 1, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [], + "depends": [ + "conda >=24.11", + "pydantic", + "python >=3.13,<3.14.0a0", + "python_abi 3.13.* *_cp313", + "rich" + ], + "fn": "conda-anaconda-tos-0.2.2-py313h06a4308_1.conda", + "license": "BSD-3-Clause", + "license_family": "BSD", + "md5": "48b92f96da51225fe57f3fe687eec943", + "name": "conda-anaconda-tos", + "platform": "linux", + "sha256": "db63dbb7179e28fed7616989cf9c52637a5cd4008929bd5d5c9063094ec098cd", + "size": 49390, + "subdir": "linux-64", + "timestamp": 1755123417000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/conda-anaconda-tos-0.2.2-py313h06a4308_1.conda", + "version": "0.2.2" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/test/run_test.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/test/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..ad47bb352048a1b2c0552cfb3b50c05342452e85 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/test/run_test.py @@ -0,0 +1,9 @@ +print("import: 'conda_anaconda_tos'") +import conda_anaconda_tos + +print("import: 'conda_anaconda_tos.plugin'") +import conda_anaconda_tos.plugin + +print("import: 'conda_anaconda_tos.api'") +import conda_anaconda_tos.api + diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/test/run_test.sh b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..cbc6bd594268460077854cd5307c568cbab1cae6 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/test/run_test.sh @@ -0,0 +1,9 @@ + + +set -ex + + + +pip check +python -m conda tos --version +exit 0 diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/test/test_time_dependencies.json b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..215362c1832b66eb448cdeeadbb1db3470d5adb4 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["pip"] \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/INSTALLER b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/METADATA b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..9a4ae15b12d5f32354f767a7f06914a52e2d8337 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/METADATA @@ -0,0 +1,45 @@ +Metadata-Version: 2.4 +Name: conda-anaconda-tos +Version: 0.2.2 +Summary: Conda subcommand to view, accept, and interact with a channel's Terms of Service (ToS). +License: BSD 3-Clause License + + Copyright (c) 2024, Anaconda, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +License-File: LICENSE +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Requires-Python: >=3.9 +Requires-Dist: conda>=24.11 +Requires-Dist: pydantic +Requires-Dist: rich diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/RECORD b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..23c068b2aa4b74ceff5a431e62d4635737bfbcd9 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/RECORD @@ -0,0 +1,35 @@ +conda_anaconda_tos-0.2.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +conda_anaconda_tos-0.2.2.dist-info/METADATA,sha256=ax5bvnq2HzEE-KLnbw9-5oPDiiSn2_1yvX12WBbQM3Y,2532 +conda_anaconda_tos-0.2.2.dist-info/RECORD,, +conda_anaconda_tos-0.2.2.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +conda_anaconda_tos-0.2.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87 +conda_anaconda_tos-0.2.2.dist-info/direct_url.json,sha256=C5BqwOgXZ6TZiARfn3eTFVydq0p9b6r76ixWIRqPTjg,78 +conda_anaconda_tos-0.2.2.dist-info/entry_points.txt,sha256=0cUjXUStHHPx7CSiIc7aOCpn5xRREIKjTGfjPfA5Udw,55 +conda_anaconda_tos-0.2.2.dist-info/licenses/LICENSE,sha256=nlBEMQcN2KTMjAIQQtG-oGWnHK5xunhB4dJs59JZa1o,1544 +conda_anaconda_tos/__init__.py,sha256=3o1gxQhqx-5uOP0gvcl8SAszHeKeUW8ODYA3p_qvvCA,984 +conda_anaconda_tos/__pycache__/__init__.cpython-313.pyc,, +conda_anaconda_tos/__pycache__/_version.cpython-313.pyc,, +conda_anaconda_tos/__pycache__/api.cpython-313.pyc,, +conda_anaconda_tos/__pycache__/exceptions.cpython-313.pyc,, +conda_anaconda_tos/__pycache__/local.cpython-313.pyc,, +conda_anaconda_tos/__pycache__/models.cpython-313.pyc,, +conda_anaconda_tos/__pycache__/path.cpython-313.pyc,, +conda_anaconda_tos/__pycache__/plugin.cpython-313.pyc,, +conda_anaconda_tos/__pycache__/remote.cpython-313.pyc,, +conda_anaconda_tos/_version.py,sha256=OjGGK5TcHVG44Y62aAqeJH4CskkZoY9ydbHOtCDew50,511 +conda_anaconda_tos/api.py,sha256=3DHgEFjlEc07-RrfAoi-6vrx_PzvopI3punuQejPq0I,13142 +conda_anaconda_tos/console/__init__.py,sha256=m0_R55EAN8g1IkFPfevtTKLOpXCWT-D_mejX2eg-gsc,306 +conda_anaconda_tos/console/__pycache__/__init__.cpython-313.pyc,, +conda_anaconda_tos/console/__pycache__/mappers.cpython-313.pyc,, +conda_anaconda_tos/console/__pycache__/prompt.cpython-313.pyc,, +conda_anaconda_tos/console/__pycache__/render.cpython-313.pyc,, +conda_anaconda_tos/console/mappers.py,sha256=eVQG_IGf_bl9hEQnV0ohuF30BdcJRPq0agXLXgSAI-Q,1707 +conda_anaconda_tos/console/prompt.py,sha256=9RUAyARbIM6Q4Wt12r60Oy8KRVXQukzJQatkwdEyHn8,1473 +conda_anaconda_tos/console/render.py,sha256=ZPWZBGlE1Wi_GT-G7sQzurvwzNVduBRKo6GFJnv8Ua4,16007 +conda_anaconda_tos/exceptions.py,sha256=VsLbEW-XaTgvfbroirUVxki0dps7IwHKiJVZlEPEWAg,4039 +conda_anaconda_tos/local.py,sha256=mvUtasTmh584LZ8mJmg5dOBTSVEuAs9wg7lsDuRyMzg,4366 +conda_anaconda_tos/models.py,sha256=IslelwXsuA3fB_OqXaNsPsoEv6zEONwphLRPlJ6oCXo,2186 +conda_anaconda_tos/path.py,sha256=-VZ_cfOX6gFwTwylEhTrc2wS9w8DfrZRf11AQVrIWqU,4446 +conda_anaconda_tos/plugin.py,sha256=SuVVed5CDFY1G3dErKKHdO51nA4ViGmZ2ToKcnbTSXQ,12532 +conda_anaconda_tos/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +conda_anaconda_tos/remote.py,sha256=0BXiZimYyCHe3YAjkFgRxkxKR1-JNel2x4QA08OhNVk,5942 diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/REQUESTED b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/WHEEL b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..12228d414b6cfed7c39d3781c85c63256a1d7fb5 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.27.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/direct_url.json b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..7208d8842084af793587e3b5518c202975c17eff --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///croot/conda-anaconda-tos_1755123313635/work"} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/entry_points.txt b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..800cc8ca4badc8fe75d5b6dec393d3936c90734c --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/entry_points.txt @@ -0,0 +1,2 @@ +[conda] +conda-anaconda-tos = conda_anaconda_tos.plugin diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/licenses/LICENSE b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..eeebfbfeda28357c61cc3618c43c334579cba80e --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos-0.2.2.dist-info/licenses/LICENSE @@ -0,0 +1,27 @@ +BSD 3-Clause License + +Copyright (c) 2024, Anaconda, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/__init__.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d86b0941639c68a9d4b027d92f667cc598433585 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/__init__.py @@ -0,0 +1,32 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Conda channel's Terms of Service management plugin.""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from typing import Final + +#: Application name. +APP_NAME: Final = "conda-anaconda-tos" + +try: + from ._version import __version__ +except ImportError: + # _version.py is only created after running `pip install` + try: + from setuptools_scm import get_version + + __version__ = get_version(root="..", relative_to=__file__) + except (ImportError, OSError, LookupError): + # ImportError: setuptools_scm isn't installed + # OSError: git isn't installed + # LookupError: setuptools_scm unable to detect version + # conda-anaconda-tos follows SemVer, so the dev version is: + # MJ.MN.MICRO.devN+gHASH[.dirty] + __version__ = "0.0.0.dev0+placeholder" + +#: Application version. +APP_VERSION: Final = __version__ diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/_version.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/_version.py new file mode 100644 index 0000000000000000000000000000000000000000..e38f676dc504b9efb2253f6b65ae06b9ef3e6ec6 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/_version.py @@ -0,0 +1,21 @@ +# file generated by setuptools-scm +# don't change, don't track in version control + +__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"] + +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Tuple + from typing import Union + + VERSION_TUPLE = Tuple[Union[int, str], ...] +else: + VERSION_TUPLE = object + +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE + +__version__ = version = '0.2.2' +__version_tuple__ = version_tuple = (0, 2, 2) diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/api.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/api.py new file mode 100644 index 0000000000000000000000000000000000000000..6033f471e0082f75c1ff42e2ed9fd33946f5e8ff --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/api.py @@ -0,0 +1,327 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""High-level API functions for interacting with a channel's Terms of Service.""" + +from __future__ import annotations + +import os +from pathlib import Path +from typing import TYPE_CHECKING + +from conda.auxlib.type_coercion import boolify +from conda.models.channel import Channel + +from .exceptions import CondaToSMissingError +from .local import get_local_metadata, get_local_metadatas, write_metadata +from .models import LocalPair, RemotePair +from .path import get_all_channel_paths, get_cache_paths +from .remote import get_remote_metadata + +if TYPE_CHECKING: + from collections.abc import Iterable, Iterator + from typing import Final + + +#: Boolean CI environment variables (checked with boolify) +#: Sources: Official CI platform documentation and community knowledge base +CI_BOOLEAN_VARS: Final = ( + "APPVEYOR", # AppVeyor CI (https://www.appveyor.com/docs/environment-variables/) + "BITRISE_IO", # Bitrise (https://devcenter.bitrise.io/en/references/available-environment-variables.html) + "BUDDY", # Buddy CI/CD (https://buddy.works/docs/pipelines/environment-variables) + "BUILDKITE", # Buildkite (https://buildkite.com/docs/pipelines/environment-variables) + "CI", # Generic CI indicator (many platforms) + "CIRCLECI", # CircleCI (https://circleci.com/docs/variables/#built-in-environment-variables) + "CIRRUS_CI", # Cirrus CI (https://cirrus-ci.org/guide/environment-variables/) + "CONCOURSE_CI", # Concourse CI (https://concourse-ci.org/implementing-resource-types.html#environment) + "DRONE", # Drone CI (https://docs.drone.io/pipeline/environment/reference/) + "GITHUB_ACTIONS", # GitHub Actions (https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables) + "GITLAB_CI", # GitLab CI/CD (https://docs.gitlab.com/ee/ci/variables/predefined_variables.html) + "SAIL_CI", # Sail CI + "SEMAPHORE", # Semaphore CI (https://docs.semaphoreci.com/ci-cd-environment/environment-variables/) + "TF_BUILD", # Azure DevOps (Team Foundation) (https://docs.microsoft.com/en-us/azure/devops/pipelines/build/variables) + "TRAVIS", # Travis CI (https://docs.travis-ci.com/user/environment-variables/#default-environment-variables) + "WERCKER", # Wercker (deprecated) + "WOODPECKER_CI", # Woodpecker CI (https://woodpecker-ci.org/docs/usage/environment) +) + +#: Presence-based CI environment variables (checked for existence) +#: Sources: Official CI platform documentation +CI_PRESENCE_VARS: Final = ( + "BAMBOO_BUILDKEY", # Atlassian Bamboo (https://confluence.atlassian.com/bamboo/bamboo-variables-289277087.html) + "CODEBUILD_BUILD_ID", # AWS CodeBuild (https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-env-vars.html) + "HEROKU_TEST_RUN_ID", # Heroku CI (https://devcenter.heroku.com/articles/heroku-ci#environment-variables) + "JENKINS_URL", # Jenkins (https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables) + "TEAMCITY_VERSION", # JetBrains TeamCity (https://www.jetbrains.com/help/teamcity/predefined-build-parameters.html) +) + + +#: Container indicators for cgroup detection +#: Reference: https://github.com/containers/podman/issues/3586, +#: Docker/containerd documentation +CONTAINER_INDICATORS: Final = ( + "containerd", # containerd runtime + "docker", # Docker containers + "kubepods", # Kubernetes pods (https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/find-out-runtime-you-use/) + "lxc", # Linux Containers + "podman", # Podman containers +) + +#: Partial CI environment variables (used with container detection) +#: These variables may be present in containerized CI environments that don't +#: set full CI variables +PARTIAL_CI_VARS: Final = ( + "AZURE_HTTP_USER_AGENT", # Azure DevOps user agent + "BUILD_ID", # Generic build identifier (Jenkins, etc.) + "BUILD_NUMBER", # Generic build number (Jenkins, etc.) + "BUILD_URL", # Generic build URL (Jenkins, etc.) + "BUILDKITE_BUILD_ID", # Buildkite build identifier + "CIRCLE_BUILD_NUM", # CircleCI build number + "CIRCLE_PROJECT_REPONAME", # CircleCI repository name + "GITHUB_JOB", # GitHub Actions job name + "GITHUB_REPOSITORY", # GitHub repository name + "GITHUB_WORKFLOW", # GitHub Actions workflow name + "GITLAB_PROJECT_ID", # GitLab project identifier + "GITLAB_USER_ID", # GitLab user identifier + "JOB_NAME", # Generic job name (Jenkins, etc.) + "RUNNER_ARCH", # GitHub Actions runner architecture + "RUNNER_OS", # GitHub Actions runner OS + "WORKSPACE", # Generic workspace path (Jenkins, etc.) +) + + +def _in_ci_container() -> bool: + """Detect if running in a containerized CI environment. + + This function combines container detection with partial CI environment variables + to address cases where CI systems run jobs in containers but don't set complete + CI environment variables (see GitHub issue #232). This is a workaround for + https://github.com/anaconda/conda-anaconda-tos/issues/232. + + Returns: + bool: True if both container indicators and partial CI variables are present + + """ + # Check documented container indicators + container_checks = [ + os.getpid() == 1, # Process ID 1 (init process in containers) + bool(os.environ.get("CONTAINER")), # Generic container environment variable + ] + + # Check cgroup for container runtime identifiers (Docker official method) + # Reference: https://docs.docker.com/engine/containers/runmetrics/#find-the-cgroup-for-a-given-container + try: + with Path("/proc/self/cgroup").open() as f: + cgroup_content = f.read() + # Container runtime signatures in cgroups (documented by Docker): + # - "docker": Docker containers + # - "containerd": containerd runtime + # - "kubepods": Kubernetes pods + # - "lxc": Linux Containers + # - "podman": Podman containers + if any(indicator in cgroup_content for indicator in CONTAINER_INDICATORS): + container_checks.append(True) + except OSError: + # Ignore errors (e.g., on non-Linux systems or restricted access) + pass + + # Return True only if we detect container AND partial CI indicators + # This prevents false positives from containers without CI context + return any(container_checks) and any(os.getenv(var) for var in PARTIAL_CI_VARS) + + +def _is_ci() -> bool: + """Determine if running in a CI environment. + + This function uses a multi-layered approach to detect CI environments: + 1. First checks if any CI variables are explicitly set to false + (respects user override) + 2. Then checks boolean CI variables for true values + 3. Finally checks presence-based variables and container environments + + Returns: + bool: True if running in a detected CI environment + + """ + # Check all boolean CI variables for explicit false values first + # If any CI variable is explicitly set to false, respect that + for var_value in map(os.getenv, CI_BOOLEAN_VARS): + if var_value and not boolify(var_value): + return False + + # Check boolean CI environment variables for true values + for var_value in map(os.getenv, CI_BOOLEAN_VARS): + if boolify(var_value): + return True + + # Check presence-based CI environment variables + return any(os.getenv(var) for var in CI_PRESENCE_VARS) or _in_ci_container() + + +#: Whether the current environment is a CI environment +CI: Final = _is_ci() + +#: Whether the current environment is a Jupyter environment +JUPYTER: Final = os.getenv("JPY_SESSION_NAME") and os.getenv("JPY_PARENT_PID") + + +def get_channels(*channels: str | Channel) -> Iterable[Channel]: + """Yield all unique channels from the given channels.""" + # expand every multichannel into its individual channels + # and remove any duplicates + seen: set[Channel] = set() + for multichannel in map(Channel, channels): + for channel in map(Channel, multichannel.urls()): + channel = Channel(channel.base_url) + if channel not in seen: + yield channel + seen.add(channel) + + +def get_one_tos( + channel: str | Channel, + *, + tos_root: str | os.PathLike[str] | Path, + cache_timeout: int | float | None, +) -> LocalPair | RemotePair: + """Get the Terms of Service metadata for the given channel.""" + # fetch remote metadata + remote_metadata = remote_exc = None + try: + remote_metadata = get_remote_metadata(channel, cache_timeout=cache_timeout) + except CondaToSMissingError as exc: + # CondaToSMissingError: no remote metadata + remote_exc = exc + + # fetch local metadata + try: + local_pair = get_local_metadata(channel, extend_search_path=[tos_root]) + except CondaToSMissingError as exc: + # CondaToSMissingError: no local metadata + if remote_exc: + raise remote_exc from exc + # no local ToS metadata + return RemotePair(metadata=remote_metadata) + else: + # return local metadata, include remote metadata if newer + if not remote_metadata or local_pair.metadata >= remote_metadata: + return local_pair + return LocalPair( + metadata=local_pair.metadata, + path=local_pair.path, + remote=remote_metadata, + ) + + +def get_stored_tos( + *, + tos_root: str | os.PathLike[str] | Path, + cache_timeout: int | float | None, +) -> Iterator[tuple[Channel, LocalPair]]: + """Yield metadata of all stored Terms of Service.""" + for channel, local_pair in get_local_metadatas(extend_search_path=[tos_root]): + try: + remote_metadata = get_remote_metadata(channel, cache_timeout=cache_timeout) + except CondaToSMissingError: + # CondaToSMissingError: no remote metadata + continue + + # yield local metadata, include remote metadata if newer + if local_pair.metadata >= remote_metadata: + yield channel, local_pair + else: + yield ( + channel, + LocalPair( + metadata=local_pair.metadata, + path=local_pair.path, + remote=remote_metadata, + ), + ) + + +def accept_tos( + channel: str | Channel, + *, + tos_root: str | os.PathLike[str] | Path, + cache_timeout: int | float | None, +) -> LocalPair: + """Accept the Terms of Service for the given channel.""" + pair = get_one_tos( + channel, + tos_root=tos_root, + cache_timeout=cache_timeout, + ) + metadata = pair.remote or pair.metadata + return write_metadata(tos_root, channel, metadata, tos_accepted=True) + + +def reject_tos( + channel: str | Channel, + *, + tos_root: str | os.PathLike[str] | Path, + cache_timeout: int | float | None, +) -> LocalPair: + """Reject the Terms of Service for the given channel.""" + pair = get_one_tos( + channel, + tos_root=tos_root, + cache_timeout=cache_timeout, + ) + metadata = pair.remote or pair.metadata + return write_metadata(tos_root, channel, metadata, tos_accepted=False) + + +def get_all_tos( + *channels: str | Channel, + tos_root: str | os.PathLike | Path, + cache_timeout: int | float | None, +) -> Iterator[tuple[Channel, LocalPair | RemotePair | None]]: + """List all channels and whether their Terms of Service have been accepted.""" + # list all active channels + seen: set[Channel] = set() + for channel in get_channels(*channels): + try: + yield ( + channel, + get_one_tos(channel, tos_root=tos_root, cache_timeout=cache_timeout), + ) + except CondaToSMissingError: + yield channel, None + seen.add(channel) + + # list all other channels whose Terms of Service have been accepted/rejected + for channel, metadata_pair in get_stored_tos( + tos_root=tos_root, + cache_timeout=cache_timeout, + ): + if channel not in seen: + yield channel, metadata_pair + seen.add(channel) + + +def clean_cache() -> Iterator[Path]: + """Clean all metadata cache files.""" + for path in get_cache_paths(): + try: + path.unlink() + except (PermissionError, FileNotFoundError, IsADirectoryError): + # PermissionError: no permission to delete the file + # FileNotFoundError: the file doesn't exist + # IsADirectoryError: the path is a directory + pass + else: + yield path + + +def clean_tos(tos_root: str | os.PathLike[str] | Path) -> Iterator[Path]: + """Clean all metadata directories.""" + for path in get_all_channel_paths(extend_search_path=[tos_root]): + try: + path.unlink() + except (PermissionError, FileNotFoundError, IsADirectoryError): + # PermissionError: no permission to delete the file + # FileNotFoundError: the file doesn't exist + # IsADirectoryError: the path is a directory + pass + else: + yield path diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/console/__init__.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/console/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e6de20c79d10e7f6c03959ea19d51783fa1dda67 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/console/__init__.py @@ -0,0 +1,14 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Render functions for console output.""" + +from .render import ( # noqa: F401 + noop_printer, + render_accept, + render_clean, + render_info, + render_interactive, + render_list, + render_reject, + render_view, +) diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/console/mappers.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/console/mappers.py new file mode 100644 index 0000000000000000000000000000000000000000..879044a938042d0233d3b1716112b243f212dc75 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/console/mappers.py @@ -0,0 +1,55 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Mappers to aid in rendering of console output.""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +from ..models import RemoteToSMetadata + +if TYPE_CHECKING: + from datetime import datetime + from pathlib import Path + from typing import Final + + from ..models import LocalToSMetadata + + +NULL_CHAR: Final = "[dim]-" + + +def timestamp_mapping(timestamp: datetime) -> str: + """Map the UTC metadata timestamp to a localized human-readable string.""" + return timestamp.astimezone().strftime("%Y-%m-%d %H:%M:%S %Z") + + +def accepted_mapping(metadata: RemoteToSMetadata | LocalToSMetadata) -> str: + """Map the metadata acceptance status to a human-readable string.""" + if isinstance(metadata, RemoteToSMetadata): + return NULL_CHAR + + tos_accepted = metadata.tos_accepted + acceptance_timestamp = metadata.acceptance_timestamp + if tos_accepted: + if acceptance_timestamp: + # convert timestamp to localized time + return f"[bold green]{timestamp_mapping(acceptance_timestamp)}" + else: + # accepted but no timestamp + return "[dim]unknown" + else: + return "[bold red]rejected" + + +def location_mapping(path: Path | None) -> str: + """Map the metadata path to a human-readable string.""" + if not path: + return NULL_CHAR + return str(path.parent.parent) + + +def version_mapping(version: datetime, remote: RemoteToSMetadata | None) -> str: + """Map the metadata version to a human-readable string.""" + version_str = timestamp_mapping(version) + return f"[bold yellow]{version_str} *" if remote else version_str diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/console/prompt.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/console/prompt.py new file mode 100644 index 0000000000000000000000000000000000000000..f2a96ce60eec41f0969d3a5412b2db8ee355b0f4 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/console/prompt.py @@ -0,0 +1,47 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Custom rich.prompt.Prompt implementations for console prompting.""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +from rich.prompt import InvalidResponse, Prompt + +if TYPE_CHECKING: + from typing import Self + + +class FuzzyPrompt(Prompt): + """A prompt that fuzzy matches the choices.""" + + @staticmethod + def strip_braces(value: str) -> str: + """Strip braces from value.""" + return value.replace("(", "").replace(")", "").strip() + + def check_choice(self: Self, value: str) -> str | None: + """Check value is in the list of valid choices.""" + if not self.choices: + return value + value = self.strip_braces(value) + value = value.lower() + return next( + ( + choice + for choice in map(self.strip_braces, self.choices) + if choice.lower().startswith(value) + ), + None, + ) + + def process_response(self: Self, value: str) -> str: + """Process response from user, convert to prompt type.""" + try: + return_value = self.response_type(value) + except ValueError as exc: + raise InvalidResponse(self.validate_error_message) from exc + + if not (return_value := self.check_choice(return_value)): + raise InvalidResponse(self.illegal_choice_message) + return return_value diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/console/render.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/console/render.py new file mode 100644 index 0000000000000000000000000000000000000000..56511b34fd5e6766a00391f64c2b5bc731aca2ff --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/console/render.py @@ -0,0 +1,516 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Render functions for console output.""" + +from __future__ import annotations + +import functools +from pathlib import Path +from typing import TYPE_CHECKING + +from conda.common.io import IS_INTERACTIVE +from conda.exceptions import ArgumentError +from rich.console import Console +from rich.table import Table + +from ..api import ( + CI, + JUPYTER, + accept_tos, + clean_cache, + clean_tos, + get_all_tos, + get_channels, + get_one_tos, + reject_tos, +) +from ..exceptions import ( + CondaToSMissingError, + CondaToSNonInteractiveError, + CondaToSRejectedError, +) +from ..path import CACHE_DIR, SEARCH_PATH +from .mappers import NULL_CHAR, accepted_mapping, location_mapping, version_mapping +from .prompt import FuzzyPrompt + +if TYPE_CHECKING: + import os + from collections.abc import Iterable + from typing import Any, Callable, Final + + from conda.models.channel import Channel + + from ..models import LocalPair, RemotePair + + AcceptedType = dict[str, dict] + RejectedType = list[Channel] + NonInteractiveType = list[Channel] + ChannelPairsType = list[tuple[Channel, RemotePair | LocalPair]] + + +TOS_OUTDATED: Final = "* Terms of Service version(s) are outdated." + +TOS_AUTO_ACCEPTED_TEMPLATE: Final = ( + "By accessing {channel} with auto acceptance enabled (auto_accept_tos=True) " + "for this repository you acknowledge and agree to the Terms of Service:\n" + "{tos_text}" +) +TOS_CI_ACCEPTED_TEMPLATE: Final = ( + "By accessing {channel} via CI " + "for this repository you acknowledge and agree to the Terms of Service:\n" + "{tos_text}" +) + + +def noop_printer(*args: Any, **kwargs: Any) -> None: # noqa: ANN401 + """Use this no-op printer when nothing should be printed to the screen.""" + + +def printable(func: Callable[..., int]) -> Callable[..., int]: + """Pass console and printer functions to the decorated function. + + This instantiates a console for the render functions if not provided and + the console and json printers to pass them to the decorated function. + """ + + @functools.wraps(func) + def wrapper(*args: Any, **kwargs: Any) -> int: # noqa: ANN401 + console = kwargs.pop("console", Console()) + json = kwargs.pop("json", False) + printer = kwargs.pop("printer", noop_printer if json else console.print) + json_printer = kwargs.pop("json_printer", console.print_json) + return func( + *args, + **kwargs, + json=json, + console=console, + printer=printer, + json_printer=json_printer, + ) + + return wrapper + + +@printable +def render_list( + *channels: str | Channel, + tos_root: str | os.PathLike[str] | Path, + cache_timeout: int | float | None, + json: bool = False, + verbose: bool = False, + console: Console | None = None, # noqa: ARG001 + printer: Callable[..., None], + json_printer: Callable[..., None], +) -> int: + """Display listing of unaccepted, accepted, and rejected Terms of Service.""" + table = Table() + table.add_column("Channel") + table.add_column("Version") + table.add_column("Accepted") + table.add_column("Support") + if verbose: + table.add_column("Location") + add_row = table.add_row + else: + add_row = lambda *args: table.add_row(*args[:-1]) # noqa: E731 + + json_output: dict[str, Any] = {} + outdated = False + for channel, metadata_pair in get_all_tos( + *channels, + tos_root=tos_root, + cache_timeout=cache_timeout, + ): + if not metadata_pair: + json_output[channel.base_url] = None + add_row(channel.base_url, NULL_CHAR, NULL_CHAR, NULL_CHAR, NULL_CHAR) + else: + json_output[channel.base_url] = { + **metadata_pair.metadata.model_dump(mode="json"), + "outdated": bool(metadata_pair.remote), + "path": str(metadata_pair.path), + } + outdated = outdated or bool(metadata_pair.remote) + add_row( + channel.base_url, + version_mapping(metadata_pair.metadata.version, metadata_pair.remote), + accepted_mapping(metadata_pair.metadata), + metadata_pair.metadata.support, + location_mapping(metadata_pair.path), + ) + + if json: + json_printer(data=json_output) + else: + printer(table) + if outdated: + printer(f"[bold yellow]{TOS_OUTDATED}") + return 0 + + +@printable +def render_view( + *channels: str | Channel, + tos_root: str | os.PathLike[str] | Path, + cache_timeout: int | float | None, + json: bool = False, + console: Console | None = None, # noqa: ARG001 + printer: Callable[..., None], + json_printer: Callable[..., None], +) -> int: + """Display the Terms of Service text for the given channels.""" + json_output: dict[str, Any] = {} + for channel in get_channels(*channels): + try: + metadata = get_one_tos( + channel, + tos_root=tos_root, + cache_timeout=cache_timeout, + ).metadata + except CondaToSMissingError: + json_output[channel.base_url] = None + printer(f"no Terms of Service for {channel}") + else: + json_output[channel.base_url] = metadata.model_dump(mode="json") + printer(f"viewing Terms of Service for {channel}:") + printer(metadata.text) + + if json: + json_printer(data=json_output) + return 0 + + +@printable +def render_accept( + *channels: str | Channel, + tos_root: str | os.PathLike[str] | Path, + cache_timeout: int | float | None, + json: bool = False, + console: Console | None = None, # noqa: ARG001 + printer: Callable[..., None], + json_printer: Callable[..., None], +) -> int: + """Display acceptance of the Terms of Service for the given channels.""" + json_output: dict[str, Any] = {} + for channel in get_channels(*channels): + try: + metadata = accept_tos( + channel, + tos_root=tos_root, + cache_timeout=cache_timeout, + ).metadata + except CondaToSMissingError: + json_output[channel.base_url] = None + printer(f"Terms of Service not found for {channel}") + else: + json_output[channel.base_url] = metadata.model_dump(mode="json") + printer(f"accepted Terms of Service for {channel}") + + if json: + json_printer(data=json_output) + return 0 + + +@printable +def render_reject( + *channels: str | Channel, + tos_root: str | os.PathLike[str] | Path, + cache_timeout: int | float | None, + json: bool = False, + console: Console | None = None, # noqa: ARG001 + printer: Callable[..., None], + json_printer: Callable[..., None], +) -> int: + """Display rejection of the Terms of Service for the given channels.""" + json_output: dict[str, Any] = {} + for channel in get_channels(*channels): + try: + metadata = reject_tos( + channel, + tos_root=tos_root, + cache_timeout=cache_timeout, + ).metadata + except CondaToSMissingError: + json_output[channel.base_url] = None + printer(f"Terms of Service not found for {channel}") + else: + json_output[channel.base_url] = metadata.model_dump(mode="json") + printer(f"rejected Terms of Service for {channel}") + + if json: + json_printer(data=json_output) + return 0 + + +def _prompt_acceptance( + channel: Channel, + pair: RemotePair | LocalPair, + console: Console, + choices: Iterable[str] = ("(a)ccept", "(r)eject", "(v)iew"), +) -> bool: + prologue = "" + if pair.remote: + state = "[bold red]rejected[/]" + if pair.metadata.tos_accepted: + state = "[bold green]accepted[/]" + prologue = ( + f"The Terms of Service for {channel} was previously {state}. " + f"An updated Terms of Service is now available.\n" + ) + + response = FuzzyPrompt.ask( + f"{prologue}Do you accept the Terms of Service (ToS) for {channel}?", + choices=choices, + console=console, + ) + if response == "accept": + return True + elif response == "reject": + return False + else: + console.print(pair.latest_text) + return _prompt_acceptance(channel, pair, console, ("(a)ccept", "(r)eject")) + + +def _gather_tos( + *channels: str | Channel, + tos_root: str | os.PathLike[str] | Path, + cache_timeout: int | float | None, +) -> tuple[ + AcceptedType, + RejectedType, + ChannelPairsType, +]: + accepted = {} + rejected = [] + channel_pairs = [] + for channel in get_channels(*channels): + try: + pair = get_one_tos(channel, tos_root=tos_root, cache_timeout=cache_timeout) + except CondaToSMissingError: + # CondaToSMissingError: no metadata found + continue + + if pair.remote or getattr(pair.metadata, "tos_accepted", None) is None: + # Terms of Service has been updated or + # Terms of Service haven't been accepted or rejected yet + channel_pairs.append((channel, pair)) + elif pair.metadata.tos_accepted: + accepted[channel.base_url] = pair.metadata.model_dump(mode="json") + else: + rejected.append(channel) + return accepted, rejected, channel_pairs + + +def _is_tos_accepted( + *, + channel: Channel, + pair: RemotePair | LocalPair, + auto_accept_tos: bool, + always_yes: bool, + json_mode: bool, + console: Console, + printer: Callable[..., None], +) -> bool: + """Determine if the Terms of Service is accepted for a channel.""" + # Auto-accept has highest priority + if auto_accept_tos: + printer( + TOS_AUTO_ACCEPTED_TEMPLATE.format( + channel=channel, + tos_text=pair.latest_text, + ), + style="bold yellow", + ) + return True + + # CI environment auto-accepts with warning + if CI: + printer( + TOS_CI_ACCEPTED_TEMPLATE.format( + channel=channel, + tos_text=pair.latest_text, + ), + style="bold yellow", + ) + return True + + # Non-interactive environments exits before prompt + if json_mode or always_yes or JUPYTER or not IS_INTERACTIVE: + raise CondaToSNonInteractiveError + + # Interactive prompt + return _prompt_acceptance(channel, pair, console) + + +def _process_channel_pairs( + *, + channel_pairs: ChannelPairsType, + tos_root: str | os.PathLike[str] | Path, + cache_timeout: int | float | None, + auto_accept_tos: bool, + always_yes: bool, + json_mode: bool, + console: Console, + printer: Callable[..., None], + # optional arguments, if provided they are updated in place + accepted: AcceptedType | None = None, + rejected: RejectedType | None = None, + non_interactive: NonInteractiveType | None = None, +) -> tuple[AcceptedType, RejectedType, NonInteractiveType]: + """Iterate over channel pairs and process the Terms of Service.""" + accepted = {} if accepted is None else accepted + rejected = [] if rejected is None else rejected + non_interactive = [] if non_interactive is None else non_interactive + + for channel, pair in channel_pairs: + try: + if _is_tos_accepted( + channel=channel, + pair=pair, + auto_accept_tos=auto_accept_tos, + always_yes=always_yes, + json_mode=json_mode, + console=console, + printer=printer, + ): + accepted[channel.base_url] = accept_tos( + channel, + tos_root=tos_root, + cache_timeout=cache_timeout, + ).metadata + else: + reject_tos(channel, tos_root=tos_root, cache_timeout=cache_timeout) + rejected.append(channel) + except CondaToSNonInteractiveError: + non_interactive.append(channel) + + return accepted, rejected, non_interactive + + +@printable +def render_interactive( + *channels: str | Channel, + tos_root: str | os.PathLike[str] | Path, + cache_timeout: int | float | None, + json: bool = False, + verbose: bool = False, + auto_accept_tos: bool, + always_yes: bool, + console: Console | None = None, + printer: Callable[..., None], + json_printer: Callable[..., None], +) -> int: + """Prompt user to accept or reject Terms of Service for channels.""" + if verbose: + printer("[bold blue]Gathering channels...") + + accepted, rejected, channel_pairs = _gather_tos( + *channels, + tos_root=tos_root, + cache_timeout=cache_timeout, + ) + + if verbose: + printer("[bold yellow]Reviewing channels...") + + # exit early if some channels are already rejected + if rejected: + printer(f"[bold red]{len(rejected)} channel Terms of Service rejected") + raise CondaToSRejectedError(*rejected) + + if CI: + printer("[bold yellow]CI detected...") + elif JUPYTER: + printer("[bold yellow]Jupyter detected...") + + accepted, rejected, non_interactive = _process_channel_pairs( + accepted=accepted, + rejected=rejected, + channel_pairs=channel_pairs, + tos_root=tos_root, + cache_timeout=cache_timeout, + auto_accept_tos=auto_accept_tos, + always_yes=always_yes, + json_mode=json, + console=console, + printer=printer, + ) + + if non_interactive: + raise CondaToSNonInteractiveError(*non_interactive) + elif rejected: + printer(f"[bold red]{len(rejected)} channel Terms of Service rejected") + raise CondaToSRejectedError(*rejected) + + if verbose or accepted: + printer(f"[bold green]{len(accepted)} channel Terms of Service accepted") + + if json: + json_printer(data=accepted) + return 0 + + +@printable +def render_info( + *, + json: bool = False, + console: Console | None = None, # noqa: ARG001 + printer: Callable[..., None], + json_printer: Callable[..., None], +) -> int: + """Display information about the Terms of Service cache.""" + data: dict[str, str | tuple[str, ...]] = {} + data["SEARCH_PATH"] = SEARCH_PATH + try: + relative_dir = Path("~", CACHE_DIR.relative_to(Path.home())) + except ValueError: + # ValueError: CACHE_DIR is not relative to the user's home directory + relative_dir = CACHE_DIR + data["CACHE_DIR"] = str(relative_dir) + + if json: + json_printer(data=data) + else: + table = Table(show_header=False) + table.add_column("Key") + table.add_column("Value") + for key, value in data.items(): + if isinstance(value, (tuple, list)): + value = "\n".join(map(str, value)) + else: + value = str(value) + table.add_row(key, value) + printer(table) + return 0 + + +@printable +def render_clean( + cache: bool, + tos: bool, + all: bool, # noqa: A002 + *, + tos_root: str | os.PathLike[str] | Path, + json: bool = False, + console: Console | None = None, # noqa: ARG001 + printer: Callable[..., None], + json_printer: Callable[..., None], +) -> int: + """Clean the metadata cache directories.""" + if not (all or cache or tos): + raise ArgumentError( + "At least one removal target must be given. See 'conda tos clean --help'." + ) + + json_output: dict[str, Any] = {} + if all or cache: + json_output["cache"] = cache_files = list(map(str, clean_cache())) + printer(f"Removed {len(cache_files)} cache files.") + if all or tos: + json_output["tos"] = tos_files = list(map(str, clean_tos(tos_root))) + printer(f"Removed {len(tos_files)} Terms of Service files.") + + if json: + json_printer(data=json_output) + return 0 diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/exceptions.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..46b2394c3c73e3f3fd06fdbc1b8480ba0533a55b --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/exceptions.py @@ -0,0 +1,115 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Custom exceptions.""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +from conda.exceptions import CondaError +from conda.models.channel import Channel + +if TYPE_CHECKING: + import os + from collections.abc import Iterable + from pathlib import Path + from typing import Self + + +class CondaToSError(CondaError): + """Base exception.""" + + +class CondaToSMissingError(CondaToSError): + """Error class for when the metadata is missing for a channel.""" + + def __init__(self: Self, channel: str | Channel) -> None: + """Format error message with channel base URL.""" + super().__init__(f"No Terms of Service for {_url(channel)}.") + + +class CondaToSInvalidError(CondaToSMissingError): + """Error class for when the metadata is invalid for a channel.""" + + def __init__(self: Self, channel: str | Channel) -> None: + """Format error message with channel base URL.""" + super().__init__(f"Invalid Terms of Service for {_url(channel)}.") + + +class CondaToSPermissionError(PermissionError, CondaToSError): + """Error class for when the metadata file cannot be written.""" + + def __init__( + self: Self, + path: str | os.PathLike[str] | Path, + channel: str | Channel | None = None, + ) -> None: + """Format error message with channel base URL and path.""" + addendum = f" for {_url(channel)}" if channel else "" + super().__init__( + f"Unable to read/write path ({path}){addendum}. Please check permissions." + ) + + +class CondaToSRejectedError(CondaToSError): + """Error class for when the Terms of Service are rejected for a channel.""" + + def __init__(self: Self, *channels: str | Channel) -> None: + """Format error message with channel base URL.""" + channel_urls = [_url(channel) for channel in channels] + accept_commands = [ + f"conda tos accept --override-channels --channel {url}" + for url in channel_urls + ] + + super().__init__( + f"Terms of Service has been rejected for the following channels. " + f"Please remove or accept them before proceeding:\n" + f"{_bullet(channel_urls)}\n" + f"\n" + f"To accept these channels' Terms of Service, run the following commands:\n" + f"{_bullet(accept_commands, prefix=' ')}\n" + f"\n" + f"{_get_removal_guidance()}" + ) + + +class CondaToSNonInteractiveError(CondaToSError): + """Error class when Terms of Service are not actionable in non-interactive mode.""" + + def __init__(self: Self, *channels: str | Channel) -> None: + """Format error message with channel base URL.""" + channel_urls = [_url(channel) for channel in channels] + accept_commands = [ + f"conda tos accept --override-channels --channel {url}" + for url in channel_urls + ] + + super().__init__( + f"Terms of Service have not been accepted for the following channels. " + f"Please accept or remove them before proceeding:\n" + f"{_bullet(channel_urls)}\n" + f"\n" + f"To accept these channels' Terms of Service, run the following commands:\n" + f"{_bullet(accept_commands, prefix=' ')}\n" + f"\n" + f"{_get_removal_guidance()}" + ) + + +def _url(channel: str | Channel) -> str: + _channel = channel if isinstance(channel, Channel) else Channel(str(channel)) + return str(_channel.base_url or channel) + + +def _bullet(args: Iterable[str], *, prefix: str = " - ") -> str: + return prefix + f"\n{prefix}".join(args) + + +def _get_removal_guidance() -> str: + """Generate removal guidance based on channel types.""" + return ( + "For information on safely removing channels from your conda configuration,\n" + "please see the official documentation:\n\n" + " https://www.anaconda.com/docs/tools/working-with-conda/channels" + ) diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/local.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/local.py new file mode 100644 index 0000000000000000000000000000000000000000..3e715e21d18c0658082a3a1096575934a718213e --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/local.py @@ -0,0 +1,120 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Low-level local (acceptance & rejection) Terms of Service metadata management.""" + +from __future__ import annotations + +from datetime import datetime, timezone +from typing import TYPE_CHECKING + +from conda.models.channel import Channel +from pydantic import ValidationError + +from .exceptions import CondaToSMissingError, CondaToSPermissionError +from .models import LocalPair, LocalToSMetadata, RemoteToSMetadata +from .path import get_all_channel_paths, get_channel_paths, get_metadata_path, get_path + +if TYPE_CHECKING: + import os + from collections.abc import Iterable, Iterator + from pathlib import Path + from typing import Any + + +def write_metadata( + tos_root: str | os.PathLike[str] | Path, + channel: str | Channel, + metadata: LocalToSMetadata | RemoteToSMetadata, + # kwargs extends/overrides metadata fields + **kwargs: Any, # noqa: ANN401 +) -> LocalPair: + """Write the metadata to file.""" + # argument validation/coercion + channel = Channel(channel) + if not channel.base_url: + raise ValueError("`channel` must have a base URL.") + if not isinstance(metadata, (LocalToSMetadata, RemoteToSMetadata)): + raise TypeError("`metadata` must be a LocalToSMetadata or RemoteToSMetadata.") + + # create/update ToSMetadata object + metadata = LocalToSMetadata( + **{ + **metadata.model_dump(), + **kwargs, + # override the following fields with the current time and channel base URL + "acceptance_timestamp": datetime.now(tz=timezone.utc), + "base_url": channel.base_url, + } + ) + + # write metadata to file + path = get_metadata_path(tos_root, channel, metadata.version) + try: + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(metadata.model_dump_json()) + except PermissionError as exc: + # PermissionError: can't write metadata path + raise CondaToSPermissionError(path, channel) from exc + + return LocalPair(metadata=metadata, path=path) + + +def read_metadata(path: str | os.PathLike[str] | Path) -> LocalPair | None: + """Load the metadata from file.""" + try: + return LocalPair( + metadata=LocalToSMetadata.model_validate_json(get_path(path).read_text()), + path=path, + ) + except (FileNotFoundError, ValidationError): + # FileNotFoundError: metadata path doesn't exist + # ValidationError: invalid JSON schema, treat it as missing + return None + except PermissionError as exc: + # PermissionError: can't read metadata path + raise CondaToSPermissionError(path) from exc + + +def get_local_metadata( + channel: str | Channel, + *, + extend_search_path: Iterable[str | os.PathLike[str] | Path] | None = None, +) -> LocalPair: + """Get the latest metadata for the given channel.""" + # find all metadata files for the given channel + metadata_pairs = [ + metadata_pair + for path in get_channel_paths(channel, extend_search_path=extend_search_path) + if (metadata_pair := read_metadata(path)) + ] + + # return if no metadata found + if not metadata_pairs: + raise CondaToSMissingError(f"No Terms of Service metadata found for {channel}") + + # reverse to order from lowest to highest priority + metadata_pairs.reverse() + + # return newest (and highest priority) metadata for channel + return sorted(metadata_pairs)[-1] + + +def get_local_metadatas( + *, + extend_search_path: Iterable[str | os.PathLike[str] | Path] | None = None, +) -> Iterator[tuple[Channel, LocalPair]]: + """Yield all metadata.""" + # group metadata by channel + grouped_metadatas: dict[Channel, list[LocalPair]] = {} + for path in get_all_channel_paths(extend_search_path=extend_search_path): + if metadata_pair := read_metadata(path): + channel = Channel(metadata_pair.metadata.base_url) + grouped_metadatas.setdefault(channel, []).append(metadata_pair) + + # return the newest (and highest priority) metadata for each channel + for channel, metadata_pairs in grouped_metadatas.items(): + # reverse to order from lowest to highest priority + metadata_pairs.reverse() + + # yield newest (and highest priority) metadata for channel + yield channel, sorted(metadata_pairs)[-1] diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/models.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/models.py new file mode 100644 index 0000000000000000000000000000000000000000..cae06ce4df993bfc1b6f866bd9e4a46e133fe2df --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/models.py @@ -0,0 +1,77 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Models to encapsulate Terms of Service metadata.""" + +from __future__ import annotations + +from datetime import datetime # noqa: TC003 # needed for Pydantic model +from pathlib import Path # noqa: TC003 # needed for Pydantic model +from typing import TYPE_CHECKING, Optional + +from pydantic import BaseModel, ConfigDict + +if TYPE_CHECKING: + from typing import Self + + +class _ToSMetadata(BaseModel): + model_config = ConfigDict(extra="allow", frozen=True) + version: datetime + text: str + support: str + + def __ge__(self: Self, other: _ToSMetadata) -> bool: + """Compare the ToS metadata version.""" + if not isinstance(other, _ToSMetadata): + return NotImplemented + return self.version >= other.version + + +class RemoteToSMetadata(_ToSMetadata): + """Metadata schema for the remote endpoint.""" + + +class LocalToSMetadata(_ToSMetadata): + """Metadata schema with acceptance fields.""" + + base_url: str + tos_accepted: bool + acceptance_timestamp: datetime + + +class _MetadataPathPair(BaseModel): + model_config = ConfigDict(frozen=True) + metadata: _ToSMetadata + # FUTURE: Python 3.10+, switch to `Path | None` + path: Optional[Path] # noqa: UP045 + # FUTURE: Python 3.10+, switch to `_ToSMetadata | None` + remote: Optional[RemoteToSMetadata] = None # noqa: UP045 + + def __lt__(self: Self, other: _MetadataPathPair) -> bool: + """Compare the metadata version. + + Critical for sorting a list of metadata path pairs. + """ + if not isinstance(other, _MetadataPathPair): + return NotImplemented + return self.metadata.version < other.metadata.version + + @property + def latest_text(self: Self) -> str: + """Get the latest text of the Terms of Service.""" + return (self.remote or self.metadata).text + + +class RemotePair(_MetadataPathPair): + """Tuple of remote metadata and no path.""" + + metadata: RemoteToSMetadata + path: None = None + remote: None = None + + +class LocalPair(_MetadataPathPair): + """Tuple of local metadata and path.""" + + metadata: LocalToSMetadata + path: Path diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/path.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/path.py new file mode 100644 index 0000000000000000000000000000000000000000..6e7c346ea850a6162de1d84d7c07ee25497cd01d --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/path.py @@ -0,0 +1,140 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Low-level path helpers.""" + +from __future__ import annotations + +import hashlib +import os +from functools import cache +from pathlib import Path +from typing import TYPE_CHECKING + +from conda.common.compat import on_win +from conda.common.configuration import custom_expandvars +from conda.models.channel import Channel +from platformdirs import user_cache_dir + +from . import APP_NAME + +if TYPE_CHECKING: + from collections.abc import Iterable, Iterator + from datetime import datetime + from typing import Final + +#: Site metadata directory. This is the highest priority location. +SITE_TOS_ROOT: Final = "C:/ProgramData/conda/tos" if on_win else "/etc/conda/tos" + +#: System metadata directory. Located in the conda installation. +SYSTEM_TOS_ROOT: Final = "$CONDA_ROOT/conda-meta/tos" + +#: User metadata directory. Located in the user home directory. +USER_TOS_ROOT: Final = "~/.conda/tos" + +#: Environment metadata directory. Located in the current conda environment. +ENV_TOS_ROOT: Final = "$CONDA_PREFIX/conda-meta/tos" + +#: Search path for metadata directories. +SEARCH_PATH: Final = tuple( + filter( + None, + ( + SITE_TOS_ROOT, + "/var/lib/conda/tos" if not on_win else None, + SYSTEM_TOS_ROOT, + "$XDG_CONFIG_HOME/conda/tos", + "~/.config/conda/tos", + USER_TOS_ROOT, + ENV_TOS_ROOT, + # mirrors $CONDARC + "$CONDATOS", + ), + ), +) + +#: Metadata file glob pattern. +TOS_GLOB: Final = "*.json" + +#: OS and user specific metadata cache directory. +CACHE_DIR: Final = Path(user_cache_dir(APP_NAME, appauthor=APP_NAME)) + + +@cache +def hash_channel(channel: str | Channel) -> str: + """Hash the channel to remove problematic characters (e.g. /).""" + channel = Channel(channel) + if not channel.base_url: + raise ValueError( + "`channel` must have a base URL. " + "(hint: `conda.models.channel.MultiChannel` cannot be hashed)" + ) + + hasher = hashlib.new("sha256") + hasher.update(channel.channel_location.encode("utf-8")) + hasher.update(channel.channel_name.encode("utf-8")) + return hasher.hexdigest() + + +def get_path(path: str | os.PathLike[str] | Path) -> Path: + """Expand environment variables and user home in the path.""" + if isinstance(path, str): + path = custom_expandvars(path, os.environ) + elif not isinstance(path, Path): + raise TypeError("`path` must be a string or `pathlib.Path`.") + return Path(path).expanduser() + + +def get_search_path( + extend_search_path: Iterable[str | os.PathLike[str] | Path] | None = None, +) -> Iterator[Path]: + """Get all root metadata paths ordered from highest to lowest priority.""" + seen: set[Path] = set() + for tos_root in (*SEARCH_PATH, *(extend_search_path or ())): + if (path := get_path(tos_root)).is_dir() and path not in seen: + yield path + seen.add(path) + + +def get_tos_dir( + tos_root: str | os.PathLike[str] | Path, + channel: str | Channel, +) -> Path: + """Get the metadata directory for the given channel.""" + return get_path(tos_root) / hash_channel(channel) + + +def get_metadata_path( + tos_root: str | os.PathLike[str] | Path, + channel: str | Channel, + version: datetime, +) -> Path: + """Get the metadata file path for the given channel and version.""" + return get_tos_dir(tos_root, channel) / f"{version.timestamp()}.json" + + +def get_all_channel_paths( + extend_search_path: Iterable[str | os.PathLike[str] | Path] | None = None, +) -> Iterator[Path]: + """Get all local metadata file paths.""" + for path in get_search_path(extend_search_path): + yield from sorted(get_path(path).glob(f"*/{TOS_GLOB}")) + + +def get_channel_paths( + channel: str | Channel, + *, + extend_search_path: Iterable[str | os.PathLike[str] | Path] | None = None, +) -> Iterator[Path]: + """Get all local metadata file paths for the given channel.""" + for path in get_search_path(extend_search_path): + yield from sorted(get_tos_dir(path, channel).glob(TOS_GLOB)) + + +def get_cache_path(channel: str | Channel) -> Path: + """Get the metadata cache file path for the given channel.""" + return CACHE_DIR / f"{hash_channel(channel)}.cache" + + +def get_cache_paths() -> Iterator[Path]: + """Get all local metadata cache file paths.""" + yield from sorted(CACHE_DIR.glob("*.cache")) diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/plugin.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/plugin.py new file mode 100644 index 0000000000000000000000000000000000000000..6c81d1cb42a4bdca3152f190f379eb28540ce6f8 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/plugin.py @@ -0,0 +1,411 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""High-level conda plugin registration.""" + +from __future__ import annotations + +from datetime import timedelta +from functools import cache +from typing import TYPE_CHECKING + +from conda.base.context import context +from conda.cli.helpers import add_parser_prefix, add_parser_verbose +from conda.common.configuration import PrimitiveParameter +from conda.common.constants import NULL +from conda.plugins import ( + CondaPreCommand, + CondaRequestHeader, + CondaSetting, + CondaSubcommand, + hookimpl, +) +from rich.console import Console + +from . import APP_NAME, APP_VERSION +from .api import CI, get_channels +from .console import ( + noop_printer, + render_accept, + render_clean, + render_info, + render_interactive, + render_list, + render_reject, + render_view, +) +from .exceptions import CondaToSMissingError +from .local import get_local_metadata +from .path import ENV_TOS_ROOT, SITE_TOS_ROOT, SYSTEM_TOS_ROOT, USER_TOS_ROOT +from .remote import ENDPOINT + +if TYPE_CHECKING: + from argparse import ArgumentParser, Namespace + from collections.abc import Iterator + from typing import Callable + + +#: Default metadata storage location. +DEFAULT_TOS_ROOT = USER_TOS_ROOT + +#: Default cache timeout in seconds. +DEFAULT_CACHE_TIMEOUT = timedelta(hours=1).total_seconds() + +#: Field separator for request header +FIELD_SEPARATOR = ";" + +#: Key-value separator for request header +KEY_SEPARATOR = "=" + +#: Terms of Service acceptance request header +TOS_ACCEPT_HEADER = "Anaconda-ToS-Accept" + +#: Hosts to which the Terms of Service header is added +HOSTS = {"repo.anaconda.com"} + + +def _add_channel(parser: ArgumentParser) -> None: + channel_group = parser.add_argument_group("Channel Customization") + channel_group.add_argument( + "-c", + "--channel", + action="append", + help="Additional channels to search for Terms of Service.", + ) + channel_group.add_argument( + "--override-channels", + action="store_true", + help="Do not search default or .condarc channels. Requires --channel.", + ) + + +def _add_location(parser: ArgumentParser) -> None: + location_group = parser.add_argument_group("Local Metadata Storage Location") + location_mutex = location_group.add_mutually_exclusive_group() + for flag, value, text in ( + ("--site", SITE_TOS_ROOT, "System-wide storage location."), + ("--system", SYSTEM_TOS_ROOT, "Conda installation storage location."), + ("--user", USER_TOS_ROOT, "User storage location."), + ("--env", ENV_TOS_ROOT, "Conda environment storage location."), + ): + location_mutex.add_argument( + flag, + dest="tos_root", + action="store_const", + const=value, + help=text, + ) + location_mutex.add_argument( + "--tos-root", + action="store", + help="Custom storage location.", + ) + parser.set_defaults(tos_root=DEFAULT_TOS_ROOT) + + +def _add_cache(parser: ArgumentParser) -> None: + cache_group = parser.add_argument_group("Cache Control") + cache_mutex = cache_group.add_mutually_exclusive_group() + cache_mutex.add_argument( + "--cache-timeout", + action="store", + type=int, + help="Cache timeout (in seconds) to check for Terms of Service updates.", + ) + cache_mutex.add_argument( + "--ignore-cache", + dest="cache_timeout", + action="store_const", + const=0, + help="Ignore the cache and always check for Terms of Service updates.", + ) + parser.set_defaults(cache_timeout=DEFAULT_CACHE_TIMEOUT) + + +def _add_json(parser: ArgumentParser) -> None: + # TODO: replace with conda.cli.helpers.add_parser_json + parser.add_argument( + "--json", + action="store_true", + default=NULL, + help="Report all output as json. Suitable for using conda programmatically.", + ) + + +def configure_parser(parser: ArgumentParser) -> None: + """Configure the parser for the `tos` subcommand.""" + # conda tos --version + parser.add_argument( + "-V", + "--version", + action="version", + version=f"{APP_NAME} {APP_VERSION}", + help=f"Show the {APP_NAME} version number and exit.", + ) + + # conda tos (default behavior) + _add_channel(parser) + add_parser_prefix(parser) + _add_cache(parser) + _add_json(parser) + add_parser_verbose(parser) + parser.set_defaults(tos_root=DEFAULT_TOS_ROOT) + + # conda tos + subparsers = parser.add_subparsers( + title="subcommand", + description="The following subcommands are available.", + dest="cmd", + required=False, + ) + + # conda tos accept + accept_parser = subparsers.add_parser( + "accept", + help=( + "Accept the Terms of Service for all active channels " + "(default, .condarc, and/or those specified via --channel)." + ), + ) + _add_channel(accept_parser) + add_parser_prefix(accept_parser) + _add_location(accept_parser) + _add_cache(accept_parser) + _add_json(accept_parser) + + # conda tos reject + reject_parser = subparsers.add_parser( + "reject", + help=( + "Reject the Terms of Service for all active channels " + "(default, .condarc, and/or those specified via --channel)." + ), + ) + _add_channel(reject_parser) + add_parser_prefix(reject_parser) + _add_location(reject_parser) + _add_cache(reject_parser) + _add_json(reject_parser) + + # conda tos view + view_parser = subparsers.add_parser( + "view", + help=( + "View the Terms of Service for all active channels " + "(default, .condarc, and/or those specified via --channel)." + ), + ) + _add_channel(view_parser) + add_parser_prefix(view_parser) + _add_location(view_parser) + _add_cache(view_parser) + _add_json(view_parser) + + # conda tos interactive + interactive_parser = subparsers.add_parser( + "interactive", + help=( + "Interactively accept/reject/view Terms of Service for all active channels " + "(default, .condarc, and/or those specified via --channel)." + ), + ) + _add_channel(interactive_parser) + add_parser_prefix(interactive_parser) + _add_location(interactive_parser) + _add_cache(interactive_parser) + _add_json(interactive_parser) + add_parser_verbose(interactive_parser) + + # conda tos info + info_parser = subparsers.add_parser( + "info", + help=( + "Display information about the plugin " + "(e.g., search path and cache directory)." + ), + ) + _add_json(info_parser) + + # conda tos clean + clean_parser = subparsers.add_parser( + "clean", + help="Clean the cache directories.", + ) + clean_parser.add_argument( + "--cache", + action="store_true", + help="Remove all cache files.", + ) + clean_parser.add_argument( + "--tos", + action="store_true", + help="Remove all acceptances/rejections.", + ) + clean_parser.add_argument( + "--all", + action="store_true", + help="Invoke both `--cache` and `--tos`.", + ) + _add_json(clean_parser) + + +def execute(args: Namespace) -> int: + """Execute the `tos` subcommand.""" + try: + # FUTURE: update once we only support conda 25.5+ + from conda.core.prefix_data import PrefixData + + PrefixData(context.target_prefix).assert_exists() + except AttributeError: + # AttributeError: PrefixData.assert_exists isn't defined + from pathlib import Path + + from conda.exceptions import EnvironmentLocationNotFound + + if not (prefix := Path(context.target_prefix).exists()): + raise EnvironmentLocationNotFound(prefix) from None + + console = Console() + action: Callable + kwargs = {} + if args.cmd == "accept": + action = render_accept + elif args.cmd == "reject": + action = render_reject + elif args.cmd == "view": + action = render_view + elif args.cmd == "interactive": + action = render_interactive + kwargs["auto_accept_tos"] = context.plugins.auto_accept_tos + kwargs["always_yes"] = context.always_yes + kwargs["verbose"] = context.verbose + elif args.cmd == "info": + # refactor into `conda info` plugin (when possible) + return render_info(json=context.json, console=console) + elif args.cmd == "clean": + # refactor into `conda clean` plugin (when possible) + return render_clean( + cache=args.cache, + tos=args.tos, + all=args.all, + tos_root=args.tos_root, + json=context.json, + console=console, + ) + else: + # default + action = render_list + kwargs["verbose"] = context.verbose + + return action( + *context.channels, + tos_root=args.tos_root, + cache_timeout=args.cache_timeout, + json=context.json, + console=console, + **kwargs, + ) + + +@hookimpl +def conda_subcommands() -> Iterator[CondaSubcommand]: + """Return a list of subcommands for the plugin.""" + yield CondaSubcommand( + name="tos", + action=execute, + summary=( + "A subcommand for viewing, accepting, rejecting, and otherwise interacting " + "with a channel's Terms of Service (ToS). This plugin periodically checks " + "for updated Terms of Service for the active/selected channels. " + "Channels with a Terms of Service will need to be accepted or rejected " + "prior to use. Conda will only allow package installation from channels " + "without a Terms of Service or with an accepted Terms of Service. " + "Attempting to use a channel with a rejected Terms of Service will result " + "in an error." + ), + configure_parser=configure_parser, + ) + + +@hookimpl +def conda_settings() -> Iterator[CondaSetting]: + """Return a list of settings for the plugin.""" + yield CondaSetting( + name="auto_accept_tos", + description="Automatically accept Terms of Service (ToS) for all channels.", + parameter=PrimitiveParameter(False, element_type=bool), + ) + + +def _pre_command_check_tos(_command: str) -> None: + render_interactive( + *context.channels, + tos_root=DEFAULT_TOS_ROOT, + cache_timeout=DEFAULT_CACHE_TIMEOUT, + json=context.json, + verbose=context.verbose, + auto_accept_tos=context.plugins.auto_accept_tos, + always_yes=context.always_yes, + json_printer=noop_printer, # no JSON output even if --json + ) + + +@hookimpl(tryfirst=True) +def conda_pre_commands() -> Iterator[CondaPreCommand]: + """Return a list of pre-commands for the plugin.""" + yield CondaPreCommand( + name="check_tos", + action=_pre_command_check_tos, + run_for={ + "create", + "env_create", + "env_remove", + "env_update", + "install", + "remove", + "rename", + "search", + "update", + }, + ) + + +@cache +def _get_tos_acceptance_header() -> str: + values = [] + for channel in get_channels(*context.channels): + try: + local_pair = get_local_metadata( + channel, + extend_search_path=[DEFAULT_TOS_ROOT], + ) + except CondaToSMissingError: + pass + else: + values.append( + KEY_SEPARATOR.join( + ( + channel.base_url, + str(int(local_pair.metadata.version.timestamp())), + "accepted" if local_pair.metadata.tos_accepted else "rejected", + str(int(local_pair.metadata.acceptance_timestamp.timestamp())), + ) + ) + ) + if CI: + values.append("CI=true") + return FIELD_SEPARATOR.join(values) + + +@hookimpl +def conda_request_headers(host: str, path: str) -> Iterator[CondaRequestHeader]: + """Return a list of request headers for the plugin.""" + if ( + # only add the header to anaconda.com endpoints + host in HOSTS + # only add the Terms of Service header for non-Terms of Service endpoints + and not path.endswith(f"/{ENDPOINT}") + ): + yield CondaRequestHeader( + name=TOS_ACCEPT_HEADER, + value=_get_tos_acceptance_header(), + ) diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/py.typed b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/py.typed new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/remote.py b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/remote.py new file mode 100644 index 0000000000000000000000000000000000000000..a0b183813b31f8e0fa35840947ac6d83db323839 --- /dev/null +++ b/miniconda3/pkgs/conda-anaconda-tos-0.2.2-py313h06a4308_1/lib/python3.13/site-packages/conda_anaconda_tos/remote.py @@ -0,0 +1,179 @@ +# Copyright (C) 2024 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +"""Low-level remote (the "raw" endpoint JSON) Terms of Service metadata management.""" + +from __future__ import annotations + +from datetime import datetime +from json import JSONDecodeError +from typing import TYPE_CHECKING + +from conda.base.context import context +from conda.common.url import join_url +from conda.gateways.connection.session import get_session +from conda.models.channel import Channel +from pydantic import ValidationError +from requests.exceptions import RequestException + +from .exceptions import ( + CondaToSInvalidError, + CondaToSMissingError, + CondaToSPermissionError, +) +from .models import RemoteToSMetadata +from .path import get_cache_path + +if TYPE_CHECKING: + from pathlib import Path + from typing import Final + + from requests import Response + +ENDPOINT: Final = "terms.json" + + +def get_endpoint(channel: str | Channel) -> Response: + """Get the metadata endpoint for the given channel.""" + channel = Channel(channel) + if not channel.base_url: + raise ValueError( + "`channel` must have a base URL. " + "(hint: `conda.models.channel.MultiChannel` doesn't have an endpoint)" + ) + + session = get_session(channel.base_url) + url = join_url(channel.base_url, ENDPOINT) + + saved_token_setting = context.add_anaconda_token + try: + # do not inject conda/binstar token into URL for two reasons: + # 1. Metadata endpoint shouldn't be a protected endpoint + # 2. CondaHttpAuth.add_binstar_token adds subdir to the URL + # which the metadata endpoint doesn't have + context.add_anaconda_token = False + response = session.get( + url, + headers={"Content-Type": "application/json"}, + timeout=( + context.remote_connect_timeout_secs, + context.remote_read_timeout_secs, + ), + ) + response.raise_for_status() + except RequestException as exc: + # RequestException: failed to get metadata endpoint + raise CondaToSMissingError(channel) from exc + finally: + context.add_anaconda_token = saved_token_setting + return response + + +def get_cached_endpoint( + channel: str | Channel, + *, + cache_timeout: int | float | None = float("inf"), +) -> Path | None: + """Get the path to cached payload for the given channel.""" + # early exit if cache is disabled + if not cache_timeout: + return None + + # argument validation/coercion + path = get_cache_path(channel) + if not isinstance(cache_timeout, (int, float)): + raise TypeError("`cache_timeout` must be an integer, float, or falsy.") + + # get mtime of cache + try: + mtime = path.stat().st_mtime + except FileNotFoundError: + # FileNotFoundError: cache path doesn't exist + return None + + # check if cache is stale + now = datetime.now().timestamp() # noqa: DTZ005 + if (now - mtime) >= cache_timeout: + return None + return path + + +def write_cached_endpoint( + channel: str | Channel, + metadata: RemoteToSMetadata | None, +) -> Path: + """Write the metadata cache for the given channel.""" + # argument validation/coercion + path = get_cache_path(channel) + if metadata and not isinstance(metadata, RemoteToSMetadata): + raise TypeError("`metadata` must be a RemoteToSMetadata.") + + # write to cache + try: + path.parent.mkdir(parents=True, exist_ok=True) + if metadata: + path.write_text(metadata.model_dump_json()) + else: + path.touch() + except PermissionError as exc: + # PermissionError: can't write to cache path + raise CondaToSPermissionError(path, channel) from exc + + return path + + +def get_remote_metadata( # noqa: C901 + channel: str | Channel, + *, + cache_timeout: int | float | None = None, +) -> RemoteToSMetadata: + """Get the metadata metadata for the given channel.""" + # argument validation/coercion + cache = get_cached_endpoint( + channel, + # when in offline mode cache_timeout is ignored + cache_timeout=float("inf") if context.offline else cache_timeout, + ) + + # return cached metadata + if cache: + try: + text = cache.read_text().strip() + if not text: + raise CondaToSMissingError(channel) + except FileNotFoundError as exc: + # FileNotFoundError: cache path doesn't exist + raise CondaToSMissingError(channel) from exc + except PermissionError as exc: + # PermissionError: can't read cache path + raise CondaToSPermissionError(cache, channel) from exc + + try: + return RemoteToSMetadata.model_validate_json(text) + except ValidationError as exc: + # ValidationError: invalid JSON schema + raise CondaToSInvalidError(channel) from exc + + # return remote metadata + try: + metadata = RemoteToSMetadata(**get_endpoint(channel).json()) + except CondaToSMissingError: + # CondaToSMissingError: no Terms of Service for this channel + # create an empty cache to prevent repeated requests + write_cached_endpoint(channel, None) + raise + except RuntimeError as exc: + # RuntimeError: potentially raised by CondaSession due to --offline + if "offline mode" in exc.args[0]: + write_cached_endpoint(channel, None) + raise CondaToSMissingError(channel) from exc + raise + except (AttributeError, TypeError, JSONDecodeError, ValidationError) as exc: + # AttributeError: response has no JSON + # TypeError: invalid JSON + # JSONDecodeError: invalid JSON + # ValidationError: invalid JSON schema + write_cached_endpoint(channel, None) + raise CondaToSInvalidError(channel) from exc + else: + write_cached_endpoint(channel, metadata) + return metadata diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/bin/conda-content-trust b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/bin/conda-content-trust new file mode 100644 index 0000000000000000000000000000000000000000..8a1b3400def7ff6433a31402517f46b28f8981a5 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/bin/conda-content-trust @@ -0,0 +1,11 @@ +#!/work/perseverance-python-buildout/croot/conda-content-trust_1728487058234/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/bin/python + +# -*- coding: utf-8 -*- +import re +import sys + +from conda_content_trust.cli import cli + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(cli()) diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/about.json b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..972648cf716d8160458ee498a3f1d39c66c8c14d --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/about.json @@ -0,0 +1,124 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main" + ], + "conda_build_version": "24.1.2", + "conda_version": "24.1.2", + "dev_url": "https://github.com/conda/conda-content-trust", + "doc_url": "https://github.com/conda/conda-content-trust/blob/main/README.md", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true + }, + "home": "https://github.com/conda/conda-content-trust", + "identifiers": [], + "keywords": [], + "license": "BSD-3-Clause", + "license_family": "BSD", + "license_file": "LICENSE", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "_openmp_mutex 5.1 1_gnu", + "archspec 0.2.1 pyhd3eb1b0_0", + "boltons 23.0.0 py39h06a4308_0", + "brotli-python 1.0.9 py39h6a678d5_7", + "bzip2 1.0.8 h7b6447c_0", + "c-ares 1.19.1 h5eee18b_0", + "charset-normalizer 2.0.4 pyhd3eb1b0_0", + "conda-content-trust 0.2.0 py39h06a4308_0", + "conda-package-handling 2.2.0 py39h06a4308_0", + "conda-package-streaming 0.9.0 py39h06a4308_0", + "fmt 9.1.0 hdb19cb5_0", + "icu 73.1 h6a678d5_0", + "idna 3.4 py39h06a4308_0", + "jsonpatch 1.32 pyhd3eb1b0_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "krb5 1.20.1 h143b758_1", + "ld_impl_linux-64 2.38 h1181459_1", + "libarchive 3.6.2 h6ac8c49_2", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_0", + "libgcc-ng 11.2.0 h1234567_1", + "libgomp 11.2.0 h1234567_1", + "libnghttp2 1.57.0 h2d74bed_0", + "libsolv 0.7.24 he621ea3_0", + "libssh2 1.10.0 hdbd6064_2", + "libstdcxx-ng 11.2.0 h1234567_1", + "libxml2 2.10.4 hf1b16e4_1", + "lz4-c 1.9.4 h6a678d5_0", + "ncurses 6.4 h6a678d5_0", + "packaging 23.1 py39h06a4308_0", + "pcre2 10.42 hebb0a14_0", + "pluggy 1.0.0 py39h06a4308_1", + "pybind11-abi 4 hd3eb1b0_1", + "pycosat 0.6.6 py39h5eee18b_0", + "pycparser 2.21 pyhd3eb1b0_0", + "pysocks 1.7.1 py39h06a4308_0", + "python 3.9.18 h955ad1f_0", + "readline 8.2 h5eee18b_0", + "reproc 14.2.4 h295c915_1", + "reproc-cpp 14.2.4 h295c915_1", + "ruamel.yaml 0.17.21 py39h5eee18b_0", + "ruamel.yaml.clib 0.2.6 py39h5eee18b_1", + "sqlite 3.41.2 h5eee18b_0", + "tk 8.6.12 h1ccaba5_0", + "tqdm 4.65.0 py39hb070fc8_0", + "wheel 0.41.2 py39h06a4308_0", + "yaml-cpp 0.8.0 h6a678d5_0", + "zlib 1.2.13 h5eee18b_0", + "zstandard 0.19.0 py39h5eee18b_0", + "zstd 1.5.5 hc292b87_0", + "attrs 23.1.0 py39h06a4308_0", + "beautifulsoup4 4.12.2 py39h06a4308_0", + "ca-certificates 2023.12.12 h06a4308_0", + "certifi 2024.2.2 py39h06a4308_0", + "cffi 1.16.0 py39h5eee18b_0", + "chardet 4.0.0 py39h06a4308_1003", + "click 8.1.7 py39h06a4308_0", + "conda 24.1.2 py39h06a4308_0", + "conda-build 24.1.2 py39h06a4308_0", + "conda-index 0.4.0 pyhd3eb1b0_0", + "conda-libmamba-solver 24.1.0 pyhd3eb1b0_0", + "cryptography 42.0.2 py39hdda0065_0", + "distro 1.8.0 py39h06a4308_0", + "filelock 3.13.1 py39h06a4308_0", + "jinja2 3.1.3 py39h06a4308_0", + "jsonschema 4.19.2 py39h06a4308_0", + "jsonschema-specifications 2023.7.1 py39h06a4308_0", + "libcurl 8.5.0 h251f7ec_0", + "libedit 3.1.20230828 h5eee18b_0", + "liblief 0.12.3 h6a678d5_0", + "libmamba 1.5.6 haf1ee3a_0", + "libmambapy 1.5.6 py39h2dafd23_0", + "markupsafe 2.1.3 py39h5eee18b_0", + "menuinst 2.0.2 py39h06a4308_0", + "more-itertools 10.1.0 py39h06a4308_0", + "openssl 3.0.13 h7f8727e_0", + "patch 2.7.6 h7b6447c_1001", + "patchelf 0.17.2 h6a678d5_0", + "pip 23.3.1 py39h06a4308_0", + "pkginfo 1.9.6 py39h06a4308_0", + "platformdirs 3.10.0 py39h06a4308_0", + "psutil 5.9.0 py39h5eee18b_0", + "py-lief 0.12.3 py39h6a678d5_0", + "pyopenssl 24.0.0 py39h06a4308_0", + "python-libarchive-c 2.9 pyhd3eb1b0_1", + "pytz 2023.3.post1 py39h06a4308_0", + "pyyaml 6.0.1 py39h5eee18b_0", + "referencing 0.30.2 py39h06a4308_0", + "requests 2.31.0 py39h06a4308_1", + "rpds-py 0.10.6 py39hb02cf49_0", + "setuptools 68.2.2 py39h06a4308_0", + "soupsieve 2.5 py39h06a4308_0", + "tomli 2.0.1 py39h06a4308_0", + "tzdata 2023d h04d1e81_0", + "urllib3 2.1.0 py39h06a4308_1", + "xz 5.4.5 h5eee18b_0", + "yaml 0.2.5 h7b6447c_0" + ], + "summary": "Signing and verification tools for conda", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/files b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/files new file mode 100644 index 0000000000000000000000000000000000000000..6ee1c15125b2ffb7113dc562dcb8b136cf85ea74 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/files @@ -0,0 +1,30 @@ +bin/conda-content-trust +lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/INSTALLER +lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/METADATA +lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/RECORD +lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/REQUESTED +lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/WHEEL +lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/direct_url.json +lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/entry_points.txt +lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/licenses/AUTHORS.md +lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/licenses/LICENSE +lib/python3.13/site-packages/conda_content_trust/__init__.py +lib/python3.13/site-packages/conda_content_trust/__main__.py +lib/python3.13/site-packages/conda_content_trust/__pycache__/__init__.cpython-313.pyc +lib/python3.13/site-packages/conda_content_trust/__pycache__/__main__.cpython-313.pyc +lib/python3.13/site-packages/conda_content_trust/__pycache__/__version__.cpython-313.pyc +lib/python3.13/site-packages/conda_content_trust/__pycache__/authentication.cpython-313.pyc +lib/python3.13/site-packages/conda_content_trust/__pycache__/cli.cpython-313.pyc +lib/python3.13/site-packages/conda_content_trust/__pycache__/common.cpython-313.pyc +lib/python3.13/site-packages/conda_content_trust/__pycache__/metadata_construction.cpython-313.pyc +lib/python3.13/site-packages/conda_content_trust/__pycache__/plugin.cpython-313.pyc +lib/python3.13/site-packages/conda_content_trust/__pycache__/root_signing.cpython-313.pyc +lib/python3.13/site-packages/conda_content_trust/__pycache__/signing.cpython-313.pyc +lib/python3.13/site-packages/conda_content_trust/__version__.py +lib/python3.13/site-packages/conda_content_trust/authentication.py +lib/python3.13/site-packages/conda_content_trust/cli.py +lib/python3.13/site-packages/conda_content_trust/common.py +lib/python3.13/site-packages/conda_content_trust/metadata_construction.py +lib/python3.13/site-packages/conda_content_trust/plugin.py +lib/python3.13/site-packages/conda_content_trust/root_signing.py +lib/python3.13/site-packages/conda_content_trust/signing.py diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/git b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/has_prefix b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/has_prefix new file mode 100644 index 0000000000000000000000000000000000000000..f0a983f8d6b78e70dc315ecf7556b03574f58a0a --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/has_prefix @@ -0,0 +1 @@ +/work/perseverance-python-buildout/croot/conda-content-trust_1728487058234/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla text bin/conda-content-trust diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/hash_input.json b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..54f8fb2da41bdb4962a008606b017773d2fef48e --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/hash_input.json @@ -0,0 +1,4 @@ +{ + "target_platform": "linux-64", + "channel_targets": "defaults" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/index.json b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..c6eb5b2782f4112e0f1e09e2ed4c5f8d3bddf6cc --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/index.json @@ -0,0 +1,17 @@ +{ + "arch": "x86_64", + "build": "py313h06a4308_1", + "build_number": 1, + "depends": [ + "cryptography >=41", + "python >=3.13,<3.14.0a0", + "python_abi 3.13.* *_cp313" + ], + "license": "BSD-3-Clause", + "license_family": "BSD", + "name": "conda-content-trust", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1728487079660, + "version": "0.2.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/licenses/LICENSE b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..bb7dfabecb7c07ab2f0fa0d46c6c87a5f64cb4f4 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/licenses/LICENSE @@ -0,0 +1,29 @@ +BSD License + +Copyright (c) 2019, Anaconda, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/paths.json b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..567aa4b846f7557afbf170923199f3297abcd537 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/paths.json @@ -0,0 +1,187 @@ +{ + "paths": [ + { + "_path": "bin/conda-content-trust", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "/work/perseverance-python-buildout/croot/conda-content-trust_1728487058234/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla", + "sha256": "f7eb89a73c12c4d17397c4c9f27bb824a660c9fd2c53b6fc3fd531522f6bef92", + "size_in_bytes": 474 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/INSTALLER", + "path_type": "hardlink", + "sha256": "d0edee15f91b406f3f99726e44eb990be6e34fd0345b52b910c568e0eef6a2a8", + "size_in_bytes": 5 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/METADATA", + "path_type": "hardlink", + "sha256": "7a8f35d551d263115a4d1efb23e4f81dd9a1588b633b80c3045fc456be18ab5f", + "size_in_bytes": 5708 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/RECORD", + "path_type": "hardlink", + "sha256": "6a222c8c97dfd2724b5eef1ab521e6ef93fdca28c859b935123552d58ba8d78a", + "size_in_bytes": 2496 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/REQUESTED", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/WHEEL", + "path_type": "hardlink", + "sha256": "d7215d7625cc9af60aed0613aad44db57eba589d0ccfc3d8122114a0e514c516", + "size_in_bytes": 87 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/direct_url.json", + "path_type": "hardlink", + "sha256": "0b58f3aeb7beeb0a4310701157f2ef35bd24fa82e7d83d42a71b2880917463b3", + "size_in_bytes": 113 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/entry_points.txt", + "path_type": "hardlink", + "sha256": "f2421f4d25769ae214a905748d9cd953e5d670b3a125e6ccd559a2383aaf4980", + "size_in_bytes": 126 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/licenses/AUTHORS.md", + "path_type": "hardlink", + "sha256": "33aeeb6f840b33de7ae4d6ba08766729e96310eb5ca3355c85a44fd35d4e1bfd", + "size_in_bytes": 281 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/licenses/LICENSE", + "path_type": "hardlink", + "sha256": "09dfa8272613416b4e2121ea9fdf9709a25e1abf144e4c17c81a975a6fd771c9", + "size_in_bytes": 1505 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__init__.py", + "path_type": "hardlink", + "sha256": "115bbaa1d16eea05d98fb4c3e0eda173d2dcf3390e1ff5603a5a76071bc8d5e5", + "size_in_bytes": 126 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__main__.py", + "path_type": "hardlink", + "sha256": "dbdd77abe5ad64fe105a698be07558ea8314457d68397bcdcd7c1ba4acc2e070", + "size_in_bytes": 122 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__pycache__/__init__.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "300895afb49072f51f883843f2a104a7c17f144b999c7444b0e5cfdb83a4e366", + "size_in_bytes": 194 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__pycache__/__main__.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "e644eedd208ae4ff125c16fb27002ca6940809724094408c00910fc9b1c2a0de", + "size_in_bytes": 252 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__pycache__/__version__.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "9cd0c2e17945a6aeeda87efeb335c2adf0568b3bcdf1f05fdbc412a3db240741", + "size_in_bytes": 572 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__pycache__/authentication.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "e04ff4f684ba4264af6ec8157341d7f3ee4af429db7871e655d24be890f48f2a", + "size_in_bytes": 14192 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__pycache__/cli.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "afe3275256829c80de08229fdbd36d167dee208d0cd47e20c24f4f7993ece668", + "size_in_bytes": 16203 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__pycache__/common.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "e5eeab2be8a9109d04b1b1bb73b1ba76af7def01698a3d6435e55cf43dd7190d", + "size_in_bytes": 32290 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__pycache__/metadata_construction.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "0cf9caa8df13189f3e94a63504801ae82207418b85810a15ddabf97d9bc185fb", + "size_in_bytes": 5483 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__pycache__/plugin.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "7f17c841115791bdd58bb6e909f0f55a1b068ac8f89dfc453306eb7466da1b90", + "size_in_bytes": 664 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__pycache__/root_signing.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "b22e15b06580bb70c55f085be0518937f969688e36d6452d09a461e1a810fdb3", + "size_in_bytes": 11286 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__pycache__/signing.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "c74059695814998298b9846df9ff3d6e32bf2265e5499f42eba6b8cc0b4c5bb1", + "size_in_bytes": 6117 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/__version__.py", + "path_type": "hardlink", + "sha256": "1feaacbebc42a5d85a433c9d751fb26a312a23bd613f12dae0ac73a4fdee4b58", + "size_in_bytes": 411 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/authentication.py", + "path_type": "hardlink", + "sha256": "b990fadee3daaf0ed8978d6093187a201060a9b1f758e6a1790b7cc4581fc101", + "size_in_bytes": 22695 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/cli.py", + "path_type": "hardlink", + "sha256": "5c6ff220d1c35a411e3228546b7130c69828ab1b1ef9c96478e9a5144b65ce09", + "size_in_bytes": 18553 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/common.py", + "path_type": "hardlink", + "sha256": "c36ded0c7d4398670d6cee8755ed5d695d6d02c11fbbdd8c4a196ff126307783", + "size_in_bytes": 33377 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/metadata_construction.py", + "path_type": "hardlink", + "sha256": "9e5a3d3669f2537315a067835e2746d10eac230e91e13d098556d6863c73b47e", + "size_in_bytes": 10325 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/plugin.py", + "path_type": "hardlink", + "sha256": "56b1707aca5ac95c91c0c3d55b154ce30ec38d9f1750e811e5881e867abd93d3", + "size_in_bytes": 326 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/root_signing.py", + "path_type": "hardlink", + "sha256": "7f02cea3c23c1ff9e72ed2552d9df006badabbfc964f62809c13d54ce5c3285b", + "size_in_bytes": 15395 + }, + { + "_path": "lib/python3.13/site-packages/conda_content_trust/signing.py", + "path_type": "hardlink", + "sha256": "676de0d96ff55ab44b0a92a929b17f61e0b71f3725011a791ddbc8725acd2ca6", + "size_in_bytes": 8741 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3f45ff3f2f9e3d8e3ec87dc3ec6802a48ffeef16 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/recipe/conda_build_config.yaml @@ -0,0 +1,108 @@ +VERBOSE_AT: V=1 +VERBOSE_CM: VERBOSE=1 +blas_impl: openblas +boost: '1.82' +boost_cpp: '1.82' +bootsrap: 'yes' +bzip2: '1.0' +c_compiler: gcc +c_compiler_version: 11.2.0 +cairo: '1.16' +cgo_compiler: go-cgo +cgo_compiler_version: '1.21' +channel_targets: defaults +clang_variant: clang +cpu_optimization_target: nocona +cran_mirror: https://mran.microsoft.com/snapshot/2018-01-01 +cuda_compiler: cuda-nvcc +cuda_compiler_version: '12.4' +cxx_compiler: gxx +cxx_compiler_version: 11.2.0 +cyrus_sasl: 2.1.28 +dbus: '1' +expat: '2' +extend_keys: +- pin_run_as_build +- extend_keys +- ignore_build_only_deps +- ignore_version +fontconfig: '2.14' +fortran_compiler: gfortran +fortran_compiler_version: 11.2.0 +freetype: '2.10' +g2clib: '1.6' +geos: 3.8.0 +giflib: '5' +glib: '2' +gmp: '6.2' +gnu: 2.12.2 +go_compiler: go-nocgo +go_compiler_version: '1.21' +gst_plugins_base: '1.14' +gstreamer: '1.14' +harfbuzz: 4.3.0 +hdf4: '4.2' +hdf5: 1.12.1 +hdfeos2: '2.20' +hdfeos5: '5.1' +icu: '73' +ignore_build_only_deps: +- numpy +- python +jpeg: '9' +libabseil: '20240116.2' +libcurl: 8.1.1 +libdap4: '3.19' +libffi: '3.4' +libgd: 2.3.3 +libgdal: 3.6.2 +libgrpc: 1.62.2 +libgsasl: '1.10' +libkml: '1.3' +libnetcdf: '4.8' +libpng: '1.6' +libprotobuf: 4.25.3 +libtiff: 4.5.0 +libwebp: 1.3.2 +libxml2: '2.13' +libxslt: '1.1' +llvm_variant: llvm +lua: '5' +lzo: '2' +mkl: 2023.* +mpfr: '4' +numpy: '2.1' +openblas: 0.3.21 +openjpeg: '2.3' +openssl: '3.0' +perl: '5.34' +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x + libboost: + max_pin: x.x.x +pixman: '0.40' +proj: 9.3.1 +proj4: 5.2.0 +python: '3.13' +python_impl: cpython +python_implementation: cpython +r_base: '3.5' +r_implementation: r-base +r_version: 3.5.0 +readline: '8.1' +rust_compiler: rust +rust_compiler_version: 1.71.1 +sqlite: '3' +target_platform: linux-64 +tk: '8.6' +xz: '5' +zip_keys: +- - python + - numpy +zlib: '1.2' +zstd: 1.5.2 diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/recipe/meta.yaml b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ad0e9bb8d0a3eede43310679e522f43e32a8aff2 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/recipe/meta.yaml @@ -0,0 +1,80 @@ +# This file created by conda-build 24.1.2 +# meta.yaml template originally from: +# /work/perseverance-python-buildout/aggregate/conda-content-trust-feedstock/recipe, last modified Tue Oct 8 10:19:13 2024 +# ------------------------------------------------ + +package: + name: conda-content-trust + version: 0.2.0 +source: + fn: conda-content-trust-0.2.0.tar.gz + sha256: ded769f69a0491bd1e002ce949a332ae5a47a60ce733adb8a724802c8fdfe02b + url: https://github.com/conda/conda-content-trust/archive/0.2.0.tar.gz +build: + entry_points: + - conda-content-trust = conda_content_trust.cli:cli + number: '1' + script: /work/perseverance-python-buildout/croot/conda-content-trust_1728487058234/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/bin/python + -m pip install . -vv --no-deps --no-build-isolation + string: py313h06a4308_1 +requirements: + host: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - bzip2 1.0.8 h5eee18b_6 + - ca-certificates 2024.9.24 h06a4308_0 + - expat 2.6.3 h6a678d5_0 + - hatch-vcs 0.3.0 py313h06a4308_1 + - hatchling 1.25.0 py313h06a4308_0 + - ld_impl_linux-64 2.40 h12ee557_0 + - libffi 3.4.4 h6a678d5_1 + - libgcc-ng 11.2.0 h1234567_1 + - libgomp 11.2.0 h1234567_1 + - libmpdec 4.0.0 h5eee18b_0 + - libstdcxx-ng 11.2.0 h1234567_1 + - libuuid 1.41.5 h5eee18b_0 + - ncurses 6.4 h6a678d5_0 + - openssl 3.0.15 h5eee18b_0 + - packaging 24.1 py313h06a4308_0 + - pathspec 0.10.3 py313h06a4308_0 + - pip 24.2 py313h06a4308_0 + - pluggy 1.0.0 py313h06a4308_1 + - python 3.13.0 hf623796_100_cp313 + - python_abi 3.13 0_cp313 + - readline 8.2 h5eee18b_0 + - setuptools 75.1.0 py313h06a4308_0 + - setuptools-scm 8.1.0 py313h06a4308_0 + - sqlite 3.45.3 h5eee18b_0 + - tk 8.6.14 h39e8969_0 + - trove-classifiers 2023.10.18 py313h06a4308_0 + - tzdata 2024b h04d1e81_0 + - wheel 0.44.0 py313h06a4308_0 + - xz 5.4.6 h5eee18b_1 + - zlib 1.2.13 h5eee18b_1 + run: + - cryptography >=41 + - python >=3.13,<3.14.0a0 + - python_abi 3.13.* *_cp313 +test: + commands: + - pip check + - conda-content-trust --help + imports: + - conda_content_trust + - conda_content_trust.authentication + - conda_content_trust.common + - conda_content_trust.root_signing + - conda_content_trust.signing + requires: + - pip +about: + dev_url: https://github.com/conda/conda-content-trust + doc_url: https://github.com/conda/conda-content-trust/blob/main/README.md + home: https://github.com/conda/conda-content-trust + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: Signing and verification tools for conda +extra: + copy_test_source_files: true + final: true diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/recipe/meta.yaml.template b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/recipe/meta.yaml.template new file mode 100644 index 0000000000000000000000000000000000000000..59d40c181d6833dee42e4ec42ee13803612de379 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/recipe/meta.yaml.template @@ -0,0 +1,51 @@ +{% set name = "conda-content-trust" %} +{% set version = "0.2.0" %} +{% set sha256 = "ded769f69a0491bd1e002ce949a332ae5a47a60ce733adb8a724802c8fdfe02b" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + fn: {{ name|lower }}-{{ version }}.tar.gz + url: https://github.com/conda/{{ name }}/archive/{{ version }}.tar.gz + sha256: {{ sha256 }} + +build: + number: 1 + skip: true # [py<38] + script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation + entry_points: + - conda-content-trust = conda_content_trust.cli:cli + +requirements: + host: + - python + - pip + - hatchling >=1.12.2 + - hatch-vcs >=0.2.0 + run: + - python + - cryptography >=41 + +test: + imports: + - conda_content_trust + - conda_content_trust.authentication + - conda_content_trust.common + - conda_content_trust.root_signing + - conda_content_trust.signing + requires: + - pip + commands: + - pip check + - conda-content-trust --help + +about: + home: https://github.com/conda/conda-content-trust + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: Signing and verification tools for conda + dev_url: https://github.com/conda/conda-content-trust + doc_url: https://github.com/conda/conda-content-trust/blob/main/README.md diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/repodata_record.json b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..bd1d9331685d67836f961deaaca32fc00659b723 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/repodata_record.json @@ -0,0 +1,24 @@ +{ + "arch": "x86_64", + "build": "py313h06a4308_1", + "build_number": 1, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [], + "depends": [ + "cryptography >=41", + "python >=3.13,<3.14.0a0", + "python_abi 3.13.* *_cp313" + ], + "fn": "conda-content-trust-0.2.0-py313h06a4308_1.conda", + "license": "BSD-3-Clause", + "license_family": "BSD", + "md5": "aefc551e21e13ecc1de44ee589aea77d", + "name": "conda-content-trust", + "platform": "linux", + "sha256": "4a9f6f94219e6e603a7e69beb3a391096a1cf9aec249e100f30dce3eac7a233e", + "size": 62054, + "subdir": "linux-64", + "timestamp": 1728487079000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/conda-content-trust-0.2.0-py313h06a4308_1.conda", + "version": "0.2.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/test/run_test.py b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/test/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..d909e2a68ec5d07b6a6174786443dd198d838796 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/test/run_test.py @@ -0,0 +1,15 @@ +print("import: 'conda_content_trust'") +import conda_content_trust + +print("import: 'conda_content_trust.authentication'") +import conda_content_trust.authentication + +print("import: 'conda_content_trust.common'") +import conda_content_trust.common + +print("import: 'conda_content_trust.root_signing'") +import conda_content_trust.root_signing + +print("import: 'conda_content_trust.signing'") +import conda_content_trust.signing + diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/test/run_test.sh b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..332a2f6b309937db9de96c34a2e92a3f77eb1408 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/test/run_test.sh @@ -0,0 +1,9 @@ + + +set -ex + + + +pip check +conda-content-trust --help +exit 0 diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/test/test_time_dependencies.json b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..215362c1832b66eb448cdeeadbb1db3470d5adb4 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["pip"] \ No newline at end of file diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/INSTALLER b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/METADATA b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..94a84fe1b86a82ccb244d48f95f8e8ecd5d84ba3 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/METADATA @@ -0,0 +1,120 @@ +Metadata-Version: 2.3 +Name: conda-content-trust +Version: 0.2.0 +Summary: Signing and verification tools, geared toward the conda ecosystem. +Project-URL: repository, https://github.com/conda/conda-content-trust +Project-URL: changelog, https://github.com/conda/conda-content-trust/blob/main/CHANGELOG.md +Author-email: "Anaconda, Inc." +License: BSD License + + Copyright (c) 2019, Anaconda, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. +License-File: AUTHORS.md +License-File: LICENSE +Keywords: authentication,compromise,conda,conda-authentication-resources,conda-content-trust,key,secure,signing,verify +Classifier: Development Status :: 4 - Beta +Classifier: Intended Audience :: Developers +Classifier: License :: OSI Approved :: BSD License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Requires-Python: >=3.8 +Requires-Dist: cryptography>=41 +Provides-Extra: gpgsigning +Requires-Dist: securesystemslib==0.13.1; extra == 'gpgsigning' +Description-Content-Type: text/markdown + +[ci-tests-badge]: https://github.com/conda/conda-content-trust/actions/workflows/tests.yml/badge.svg +[codecov-badge]: https://img.shields.io/codecov/c/github/conda/conda-content-trust/main.svg?label=coverage +[release-badge]: https://img.shields.io/github/release/conda/conda-content-trust.svg + +# Conda Content Trust: Signing and verification tools for Conda + +[![Tests (GitHub Actions)][ci-tests-badge]](https://github.com/conda/conda-content-trust/actions/workflows/tests.yml) +[![Codecov Status][codecov-badge]](https://codecov.io/gh/conda/conda-content-trust/branch/main) +[![latest release version][release-badge]](https://github.com/conda/conda-content-trust/releases) + +*What:* Based on [The Update Framework (TUF)](https://theupdateframework.io/), conda-content-trust is intended to ensure that when users in the conda ecosystem obtain a package or data about that package, they can know whether or not it is trustworthy (e.g. originally comes from a reliable source and has not been tampered with). A basic library and basic CLI are included to provide signing, verification, and trust delegation functionality. + +*Why:* This exists as an alteration of TUF because of the very particular needs of the conda ecosystem. (Developers are encouraged to *just use TUF* whenever possible!) + +*Where:* This tool is general purpose. It is currently used in conda 4.10.1+ to verify package metadata signatures when they are available ([announcement](https://www.anaconda.com/blog/conda-signature-verification), [instructions](https://docs.anaconda.com/anaconda-commercial/security)). + +## Installation + +Installation can be accomplished via conda: + +``` +conda install conda-content-trust +``` + +Or via pip: + +``` +pip install conda-content-trust +``` + +(If you intend to tinker with the code, feel free to use an editable install: `pip install -e .`) + +### Optional Dependencies for Producing Signatures with GPG Keys / YubiKeys + +If you intend to *create* *GPG* key signatures (as opposed to the typical non-GPG signatures), and/or you intend to use the YubiKey interface, you will need to install two optional dependencies: + +- `GPG` (any gpg client that provides command-line gpg functionality should do) +- `securesystemslib` (`pip install securesystemslib`) + +## Demonstration and Use + +Use of the command-line utility provides help functionality:: + +``` +conda-content-trust --help +``` + +You should be able to run the demo after installing: + +``` +python3 demo.py +``` + +(Portions of the demo may require the optional dependencies above.) + + +## Testing + +Each set of tests is a module in the `tests/` directory. These can all be run with: + +``` +pytest +``` diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/RECORD b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..f50d62ca90856561e9d9ca6cd7dd1f59504a58ab --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/RECORD @@ -0,0 +1,30 @@ +../../../bin/conda-content-trust,sha256=OfC4-yB1uYgSaGN2jMKM2Ple0ZiyrRxG4THIjwPfgIU,503 +conda_content_trust-0.2.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +conda_content_trust-0.2.0.dist-info/METADATA,sha256=eo811VHSYxFaTR77I-T4HdmhWItjO4DDBF_EVr4Yq18,5708 +conda_content_trust-0.2.0.dist-info/RECORD,, +conda_content_trust-0.2.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +conda_content_trust-0.2.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87 +conda_content_trust-0.2.0.dist-info/direct_url.json,sha256=C1jzrre-6wpDEHARV_LvNb0k-oLn2D1CpxsogJF0Y7M,113 +conda_content_trust-0.2.0.dist-info/entry_points.txt,sha256=8kIfTSV2muIUqQV0jZzZU-XWcLOhJebM1VmiODqvSYA,126 +conda_content_trust-0.2.0.dist-info/licenses/AUTHORS.md,sha256=M67rb4QLM9565Na6CHZnKeljEOtcozVchaRP011OG_0,281 +conda_content_trust-0.2.0.dist-info/licenses/LICENSE,sha256=Cd-oJyYTQWtOISHqn9-XCaJeGr8UTkwXyBqXWm_Xcck,1505 +conda_content_trust/__init__.py,sha256=EVu6odFu6gXZj7TD4O2hc9Lc8zkOH_VgOlp2BxvI1eU,126 +conda_content_trust/__main__.py,sha256=2913q-WtZP4QWmmL4HVY6oMURX1oOXvNzXwbpKzC4HA,122 +conda_content_trust/__pycache__/__init__.cpython-313.pyc,, +conda_content_trust/__pycache__/__main__.cpython-313.pyc,, +conda_content_trust/__pycache__/__version__.cpython-313.pyc,, +conda_content_trust/__pycache__/authentication.cpython-313.pyc,, +conda_content_trust/__pycache__/cli.cpython-313.pyc,, +conda_content_trust/__pycache__/common.cpython-313.pyc,, +conda_content_trust/__pycache__/metadata_construction.cpython-313.pyc,, +conda_content_trust/__pycache__/plugin.cpython-313.pyc,, +conda_content_trust/__pycache__/root_signing.cpython-313.pyc,, +conda_content_trust/__pycache__/signing.cpython-313.pyc,, +conda_content_trust/__version__.py,sha256=H-qsvrxCpdhaQzyddR-yajEqI71hPxLa4KxzpP3uS1g,411 +conda_content_trust/authentication.py,sha256=uZD63uParw7Yl41gkxh6IBBgqbH3WOaheQt8xFgfwQE,22695 +conda_content_trust/cli.py,sha256=XG_yINHDWkEeMihUa3Ewxpgoqxse-clkeOmlFEtlzgk,18553 +conda_content_trust/common.py,sha256=w23tDH1DmGcNbO6HVe1daV1tAsEfu92MShlv8SYwd4M,33377 +conda_content_trust/metadata_construction.py,sha256=nlo9NmnyU3MVoGeDXidG0Q6sIw6R4T0JhVbWhjxztH4,10325 +conda_content_trust/plugin.py,sha256=VrFwespayVyRwMPVWxVM4w7DjZ8XUOgR5Ygehnq9k9M,326 +conda_content_trust/root_signing.py,sha256=fwLOo8I8H_nnLtJVLZ3wBrrau_yWT2KAnBPVTOXDKFs,15395 +conda_content_trust/signing.py,sha256=Z23g2W_1WrRLCpKpKbF_YeC3HzclARp5HdvIclrNLKY,8741 diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/REQUESTED b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/WHEEL b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..cdd68a497cdfa8d3f2b837225beacef711b85047 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.25.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/direct_url.json b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..22024d4be5282cde1594db2afe7e8b0f824e221f --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///work/perseverance-python-buildout/croot/conda-content-trust_1728487058234/work"} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/entry_points.txt b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..b26481e6a0ae7224837e33038a4ddb0dfac3af7d --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/entry_points.txt @@ -0,0 +1,5 @@ +[console_scripts] +conda-content-trust = conda_content_trust.cli:cli + +[conda] +conda-content-trust = conda_content_trust.plugin diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/licenses/AUTHORS.md b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/licenses/AUTHORS.md new file mode 100644 index 0000000000000000000000000000000000000000..6f8b98dbad5b6b00b7d5090fa250adf02c0230ab --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/licenses/AUTHORS.md @@ -0,0 +1,13 @@ +All of the people who have made at least one contribution to conda-content-trust. +Authors are sorted alphabetically. + +* Bianca Henderson +* Cheng H. Lee +* Conda Bot +* Daniel Holth +* Jannis Leidel +* Ken Odegard +* Mike Sarahan +* Sebastien Awwad +* dependabot[bot] +* pre-commit-ci[bot] diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/licenses/LICENSE b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..bb7dfabecb7c07ab2f0fa0d46c6c87a5f64cb4f4 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust-0.2.0.dist-info/licenses/LICENSE @@ -0,0 +1,29 @@ +BSD License + +Copyright (c) 2019, Anaconda, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY +OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/__init__.py b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ec6bd53805d2e37a4b9d956f0b872b82959c24c1 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/__init__.py @@ -0,0 +1,3 @@ +# Copyright (C) 2019 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +from .__version__ import __version__ # noqa: F401 diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/__main__.py b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..cbf77a67ba3d03e02dd5b857f230cd066e2b609d --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/__main__.py @@ -0,0 +1,5 @@ +# Copyright (C) 2019 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +from conda_content_trust import cli + +cli.cli() diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/__version__.py b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/__version__.py new file mode 100644 index 0000000000000000000000000000000000000000..92bd625ef64bdc4d4c561f73fd9f401f9317ce92 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/__version__.py @@ -0,0 +1,16 @@ +# file generated by setuptools_scm +# don't change, don't track in version control +TYPE_CHECKING = False +if TYPE_CHECKING: + from typing import Tuple, Union + VERSION_TUPLE = Tuple[Union[int, str], ...] +else: + VERSION_TUPLE = object + +version: str +__version__: str +__version_tuple__: VERSION_TUPLE +version_tuple: VERSION_TUPLE + +__version__ = version = '0.2.0' +__version_tuple__ = version_tuple = (0, 2, 0) diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/authentication.py b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/authentication.py new file mode 100644 index 0000000000000000000000000000000000000000..d11a9d88ce85e28b12a8171395e7365ee6abc159 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/authentication.py @@ -0,0 +1,539 @@ +# Copyright (C) 2019 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +""" +This module contains functions that verify signatures and thereby authenticate +data. + +Function Manifest for this Module + verify_signature + verify_gpg_signature + verify_signable + verify_root + verify_delegation +""" +from binascii import unhexlify +from struct import pack + +import cryptography.exceptions +from cryptography.hazmat.primitives.asymmetric import ed25519 + +from .common import ( + MetadataVerificationError, + PublicKey, + SignatureError, + UnknownRoleError, + canonserialize, + checkformat_byteslike, + checkformat_delegating_metadata, + checkformat_gpg_signature, + checkformat_hex_key, + checkformat_signable, + is_gpg_signature, + is_hex_key, + is_hex_signature, + is_signable, + is_signature, +) + + +# TODO✅: Consider reversing this argument order? What's more intuitive? +def verify_root(trusted_current_root_metadata, untrusted_new_root_metadata): + """ + Given currently trusted root metadata, verify that new root metadata is + trustworthy per the currently trusted root metadata. + + This requires a root chaining process as specified in The Update Framework + specification. (Version N must be used in order to verify version N+1. + Versions cannot be skipped.) + + # TODO✅: Proper docstring. + """ + # TODO✅💣❌⚠️: Vet against root chaining algorithm we updated in TUF, + # and add the attack tests to tests/test_authentication.py. + + # TODO✅: More argument validation + checkformat_delegating_metadata(trusted_current_root_metadata) + checkformat_delegating_metadata(untrusted_new_root_metadata) + + if ( + trusted_current_root_metadata["signed"]["type"] != "root" + or untrusted_new_root_metadata["signed"]["type"] != "root" + ): + raise ValueError( + "Expected two instances of root metadata. Listed metadata " + "type in one or both pieces of metadata provided is not " + '"root".' + ) + + # Extract rules for root from old, trusted version of root. + root_expectations = trusted_current_root_metadata["signed"]["delegations"]["root"] + expected_threshold = root_expectations["threshold"] + authorized_pub_keys = root_expectations["pubkeys"] + + # Also extract new rules for root per new untrusted version of root. + # NOTE THAT it is important that a new root version be verified BOTH + # based on the prior, trusted version of root, and also based on ITSELF + # (the latter in order to reduce the odds of accidentally breaking the root + # trust chain). + new_root_expectations = untrusted_new_root_metadata["signed"]["delegations"]["root"] + new_expected_threshold = new_root_expectations["threshold"] + new_authorized_pub_keys = new_root_expectations["pubkeys"] + + trusted_root_version = trusted_current_root_metadata["signed"]["version"] + untrusted_root_version = untrusted_new_root_metadata["signed"]["version"] + + if trusted_root_version + 1 != untrusted_root_version: + # TODO ✅: Create a suitable error class for this. + raise MetadataVerificationError( + "Root chaining failure: we currently trust a version of root " + "that marks itself as version " + + str(trusted_root_version) + + ", and the provided new root metadata to verify marks itself " + "as version " + str(untrusted_root_version) + "; the new " + "version must be 1 more than the old version: root updates " + "MUST be processed one at a time for security reasons: no " + "root version may be skipped." + ) + + # Verify the new root metadata based on the prior, trusted root version. + verify_signable( + untrusted_new_root_metadata, authorized_pub_keys, expected_threshold, gpg=True + ) + + # Make sure that the signatures on the new root metadata would be + # sufficient to verify it using the new root metadata's own rules as well. + # Doing this helps avoid breaking the chain of trust. + verify_signable( + untrusted_new_root_metadata, + new_authorized_pub_keys, + new_expected_threshold, + gpg=True, + ) + + +# TODO ✅: Consider verify_untrusted_based_on_trusted(), a function that just +# takes the two roles and does the digging to fetch authorized keys +# and threshold for you, along with an argument specifying what role +# we're trying to verify (redundant, perhaps, but important to make +# explicit, to avoid bad patterns of trusting attackers in the calling +# code). +# The function should: +# - return if verification succeeds +# - raise UnknownRoleError if there's no matching delegation +# - raise a verification failure error if a signature is bad or +# signatures don't match expectations (threshold, wrong keys, +# etc.) +# - of course, raise ValueError if the arguments are invalid +# +# TODO ✅: Autodetect signature type rather than expecting an argument, +# and allow both OpenPGP-facilitated ed25519 and raw ed25519 +# signatures for any authority metadata (root, key_mgr, etc.) +# TODO ✅: Find way to specifically discourage anti-pattern of calling +# verify_delegation() directly to verify root metadata (instead of +# calling verify_root). We could add a _helper function and have +# both verify_delegation and verify_root call that, and each check +# to make sure the metadata type provided is/isn't root as +# appropriate, but I'd like to avoid adding another level of +# functions if possible. +# TODO ✅: Remove delegation_name and just take it from +# untrusted_delegating_metadata['signed']['type']. Consider utility +# of keeping argument, though... (allow enforcement, if you have +# reason to constrain the verifications? unlikely to be a useful arg) +def verify_delegation( + delegation_name, + untrusted_delegated_metadata, + trusted_delegating_metadata, + gpg=False, +): + """ + Verify that the given untrusted, delegated-to metadata is trustworthy, + based on the given trusted metadata's expectations (expected keys and + threshold). This function returns if verification succeeds. + + + In other words, check trusted_delegating_metadata's delegation + to delegation_name to find the expected signing keys and threshold for + delegation_name, and then check untrusted_delegated_metadata to see if it + is signed by enough of the right keys to be trustworthy. + + For example, using root metadata to verify key_mgr metadata looks like + this: + verify_delegation( + 'key_mgr', , ) + + Arguments: + (string) delegation_name is the name of the role delegated. + (dict) trusted_delegating_metadata is a signable JSON-serializable + object representing the full metadata that delegates to role + delegation_name. + (dict) untrusted_delegated_metadata is a signable JSON-serializable + object + (bool) gpg should be true if the signatures to be verified in the + delegated metadata are expected to be OpenPGP signatures + rather than the usual raw ed25519 signatures. + + Exceptions: + - raises UnknownRoleError if there's no matching delegation + - raises SignatureError if a signature is bad or signatures + don't match expectations (threshold, wrong keys, etc.) + # TODO: Consider exception handling to raise MetadataVerificationError instead? + - raises MetadataVerificationError if the metadata type is unexpected + - raises TypeError or ValueError if the arguments are invalid + """ + + # Argument validation + + if not isinstance(delegation_name, str): + raise TypeError( + "delegation_name must be a string, not a " + str(type(delegation_name)) + ) + + if gpg not in [True, False]: + raise TypeError( + 'Argument "gpg" must be a boolean.' + ) # should probably be ValueError + + checkformat_delegating_metadata(trusted_delegating_metadata) + + # Note that we don't really know the structure of the metadata we're + # verifying beyond that we expect it to be a signed envelope. + # We can't assume, for example, that it is itself delegating metadata also, + # (so no checkformat_delegating_metadata on it): while it could be + # that we're verifying key_mgr using root, it could also be that we're + # verifying some package metadata (which is not delegating metadata) using + # key_mgr. + # If, however, the untrusted_delegated_metadata *is* delegating metadata, + # we want to make sure that its type matches what the caller passed in as + # delegation_name. + checkformat_signable(untrusted_delegated_metadata) + try: + checkformat_delegating_metadata(untrusted_delegated_metadata) + except: + # If we can't verify that we're verifying more delegating metadata + # (e.g. we're using root to verify key_mgr), then we don't need to + # perform the type check, as it can just be any signed content we're + # verifying. + pass + else: + # If this is indeed more delegating metadata, make sure the type + # the caller expects matches what the metadata claims. + if delegation_name != untrusted_delegated_metadata["signed"]["type"]: + raise MetadataVerificationError( + "Instructed to verify provided metadata as if it is of " + 'type "' + delegation_name + '", but it claims to be of ' + 'type "' + untrusted_delegated_metadata["signed"]["type"] + '"!' + ) + + # Process the delegation. + delegations = trusted_delegating_metadata["signed"]["delegations"] + + if delegation_name not in delegations: + raise UnknownRoleError( + "Role " + delegation_name + " not found in the given " + "delegating metadata." + ) + + expected_keys = delegations[delegation_name]["pubkeys"] + threshold = delegations[delegation_name]["threshold"] + + verify_signable( + untrusted_delegated_metadata, + expected_keys, # drawn from trusted_delegating_metadata + threshold, # drawn from trusted_delegating_metadata + gpg=gpg, + ) # from argument to this func + + +# TODO ✅: Consider taking a hex public key instead of a key object, so that: +# 1: the API is simpler (verify_signature is part of the API) +# 2: we can remove PublicKey from the higher-level code, making it +# simpler. +# The tradeoff is that we can't later accept key objects that might +# be used as interfaces to hardware keys, for example. +def verify_signature(signature, public_key, data): + """ + Raises ❌cryptography.exceptions.InvalidSignature if signature is not a + correct signature by the given key over the given data. + + Raises ❌TypeError if public_key, signature, or data are not correctly + formatted. + + Otherwise, returns (nothing), indicating the signature was verified. + + Note that this does not use the generalized signature format (which would + be compatible with OpenPGP/GPG signatures as well as pyca/cryptography's + simple ed25519 sigs). + + Args: + - public_key must be an ed25519.Ed25519PublicKeyObject + - signature must be a hex string, length 128, representing a 64-byte + raw ed25519 signature + - data must be bytes + """ + if not isinstance(public_key, ed25519.Ed25519PublicKey): + raise TypeError( + "verify_signature expects a " + "cryptography.hazmat.primitives.asymmetric.ed25519ed25519.Ed25519PublicKey" + 'object as the "public_key" argument. Instead, received ' + + str(type(public_key)) + ) + + if not is_hex_signature(signature): + raise TypeError( + "verify_signature expects a hex string representing an " + 'ed25519 signature as the "signature" argument. Instead, ' + "received object of type " + str(type(signature)) + ) + + if not isinstance(data, bytes): + raise TypeError( + 'verify_signature expects a bytes object as the "signature" ' + "argument. Instead, received " + str(type(data)) + ) + + public_key.verify(unhexlify(signature), data) + + # If no error is raised, return, indicating success (Explicit for editors) + return + + +def verify_signable(signable, authorized_pub_keys, threshold, gpg=False): + """ + Raises a ❌SignatureError if signable does not include at least threshold + good signatures from (unique) keys with public keys listed in + authorized_pub_keys, over the data contained in signable['signed']. + + Raises ❌TypeError if the arguments are invalid. + + Else returns (nothing). + + Args: + - signable + common.is_a_signable(signable) must return true. + wrap_as_signable() produces output of this type. See those + functions. + + - authorized_pub_keys + a list of ed25519 public keys (32 bytes) expressed as 64-character + hex strings. This is the form in which they appear in authority + metadata (root.json, etc.) Only good signatures from keys listed + in authorized_pub_keys count against the threshold of signatures + required to verify the signable. + + - threshold + the number of good signatures from unique authorized keys required + in order to verify the signable. + + - gpg (boolean, default False) + If True, expects OpenPGP ed25519 signatures (see RFC 4880 bis-08) + instead of raw ed25519 signatures. + If False, expects raw ed25519 signatures. + """ + + # TODO: ✅ Be sure to check with the analogous code in the tuf reference + # implementation in case one of us had some clever gotcha there. + # Would be in tuf.sig or securesystemslib. See + # get_signature_status() there, in addition to any prettier + # verify_signable code I may have swapped in (dunno if that's in yet). + + # TODO: ✅ Consider allowing this func (or another) to accept public keys + # in the form of ed25519.Ed25519PublicKey objects (instead of just + # the hex string representation of the public key bytes). I think + # we'll mostly have the hex strings on hand, but.... + + # Argument validation + if not is_signable(signable): + raise TypeError( + "verify_signable expects a signable dictionary. " + "Given argument failed the test." + ) # TODO: Tidier / expressive. + if not ( + isinstance(authorized_pub_keys, list) + and all([is_hex_key(k) for k in authorized_pub_keys]) + ): + raise TypeError("authorized_pub_keys must be a list of hex strings ") + # if not (isinstance(authorized_pub_keys, list) and all( + # [isinstance(k, ed25519.Ed25519PublicKey) for k in authorized_pub_keys])): + # raise TypeError( + # 'authorized_pub_keys must be a list of ' + # 'ed25519.Ed25519PublicKeyobjects.') + if not isinstance(threshold, int) or threshold <= 0: + raise TypeError("threshold must be a positive integer.") + + # TODO: ✅⚠️ Metadata specification version compatibility check. + # Check to see if signable['signed']['metadata_spec_version'] + # is CLOSE ENOUGH to SECURITY_METADATA_SPEC_VERSION (same + # major version?). If it is not, raise an exception noting + # that the version cannot be verified because either it or the + # client are out of date. If versions are close enough, + # consider a warning instead. If the client is at major spec + # version x, and the metadata obtained is at major spec version + # x + 1, then proceed with a warning that the client must be + # updated. Note that root versions produced must never + # increase by more than one major spec version at a time, as a + # result. + + # Put the 'signed' portion of the data into the format it should be in + # before it is signed, so that we can verify the signatures. + signed_data = canonserialize(signable["signed"]) + + # Even though we're not returning this, we produce this dictionary (instead + # of just counting) to facilitate future checks and logging. + # TODO: ✅ Keep track of unknown keys and bad signatures for diagnostic and + # other logging purposes. + good_sigs_from_trusted_keys = {} + + for pubkey_hex, signature in signable["signatures"].items(): + # Validate the signature data first (make sure it looks right). + if not is_hex_key(pubkey_hex): + # TODO: ✅ Make this a warning instead. + print( + 'Ignoring signature from "key" with public key value that ' + "does not look like a key value: " + str(pubkey_hex) + ) + continue + + if gpg and not is_gpg_signature(signature): + # TODO: ✅ Make this a warning instead. + print( + 'Ignoring "signature" that does not look like a gpg ' + "signature value: " + str(signature) + ) + continue + + if pubkey_hex not in authorized_pub_keys: + # TODO: ✅ Make this an INFO-level log message. + print( + 'Ignoring signature from a key ("' + + str(pubkey_hex) + + '") that is not authorized to sign this metadata.' + ) + continue + + if not gpg: # normal ed25519 signatures using pyca/cryptography + if not is_signature(signature): + # TODO: ✅ Make this a warning instead. + print( + 'Ignoring "signature" that does not look like a hex ' + "signature value: " + str(signature) + ) + continue + + public = PublicKey.from_hex(pubkey_hex) + + try: + verify_signature(signature["signature"], public, signed_data) + + except cryptography.exceptions.InvalidSignature: + # TODO: ✅ Log at debug or info level. + continue + + else: + good_sigs_from_trusted_keys[pubkey_hex] = signature + + else: # expecting OpenPGP ed25519 signatures (RFC 4880-bis08) + assert gpg # code paranoia + + try: + verify_gpg_signature(signature, pubkey_hex, signed_data) + + except cryptography.exceptions.InvalidSignature: + # TODO: ✅ Log at debug or info level. + continue + + else: + good_sigs_from_trusted_keys[pubkey_hex] = signature + + # TODO: ✅ Logging or more detailed info (which keys). + if len(good_sigs_from_trusted_keys) < threshold: + raise SignatureError( + "Expected good signatures from at least " + + str(threshold) + + " unique keys from a set of " + + str(len(authorized_pub_keys)) + + " keys. Saw " + + str(len(signable["signatures"])) + + " signatures, only " + + str(len(good_sigs_from_trusted_keys)) + + " of which were good signatures over the given data from the " + "expected keys." + ) + + # Otherwise, return, indicating success. (Explicit for code editors) + return + + +def verify_gpg_signature(signature, key_value, data): + """ + Verifies a raw ed25519 signature that happens to have been produced by an + OpenPGP signing process (RFC4880). + + NOTE that this code DISREGARDS most OpenPGP semantics: is interested solely + in the verification of a signature over the given data, with the raw + ed25519 public key given (in the form of a hex string). This code does not + care about the GPG public key infrastructure, including key + self-revocation, expiry, or the relationship of any key with any other key + through OpenPGP (subkeys, key-to-key signoff, etc.). + + This codebase uses OpenPGP signatures solely as a means of facilitating a + TUF-style public key infrastructure, where the public key values are + trusted with specific privileges directly. + + + ⚠️💣 ABSOLUTELY DO NOT use this for general purpose verification of GPG + signatures!! It is for our root signatures only, where OpenPGP + signing is just a proxy for a simple ed25519 signature through a + hardware signing mechanism. + + + # TODO: ✅ Proper docstring modeled on verify_signature. + """ + + checkformat_gpg_signature(signature) + checkformat_hex_key(key_value) + checkformat_byteslike(data) + # if not isinstance(data, bytes): # TODO: ✅ use the byteslike checker in conda_content_trust.common. + # raise TypeError() + + public_key = PublicKey.from_hex(key_value) + + # ------- + # This next part takes advantage of code pulled from: + # securesystemslib.gpg.eddsa.verify_signature(), + # securesystemslib.gpg.eddsa.create_pubkey(), + # and securesystemslib.gpg.util.hash_object(). + # + # It has been unrolled, had formatting adjustments, variable + # renaming, unneeded code removal, etc. + # ------- + + # See RFC4880-bis8 14.8. EdDSA and 5.2.4 "Computing Signatures" + # digest = securesystemslib.gpg.util.hash_object( + # unhexlify(signature["other_headers"]), + # hasher(), data) + + # Additional headers in the OpenPGP signature (bleh). + additional_header_data = unhexlify(signature["other_headers"]) + + # As per RFC4880 Section 5.2.4., we need to hash the content, + # signature headers and add a very opinionated trailing header + hasher = cryptography.hazmat.primitives.hashes.Hash( + cryptography.hazmat.primitives.hashes.SHA256(), + cryptography.hazmat.backends.default_backend(), + ) + hasher.update(data) + hasher.update(additional_header_data) + hasher.update(b"\x04\xff") + hasher.update(pack(">I", len(additional_header_data))) + + digest = hasher.finalize() + + # # DEBUG 💣💥 + # # DEBUG 💣💥 + # print('Digest as produced by verify_gpg_signature: ' + str(digest)) + + # Raises cryptography.exceptions.InvalidSignature if not a valid signature. + public_key.verify(unhexlify(signature["signature"]), digest) + + # Return if we succeeded. + return # explicit for clarity diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/cli.py b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/cli.py new file mode 100644 index 0000000000000000000000000000000000000000..d1b1e5060218f336a2a8d2f1bb0c2a0779a04c57 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/cli.py @@ -0,0 +1,534 @@ +# Copyright (C) 2019 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +""" +This module provides the CLI interface for conda-content-trust. +This is intended to provide a command-line signing and metadata update +interface. +""" +from argparse import ArgumentParser +from copy import deepcopy +from json import dumps + +from . import __version__ +from . import authentication as cct_authentication +from . import root_signing as cct_root_signing +from . import signing as cct_signing +from .common import ( + CCT_Error, + PrivateKey, + is_gpg_fingerprint, + is_hex_key, + load_metadata_from_file, + write_metadata_to_file, +) + + +def cli(args=None): + parser = ArgumentParser( + description="Signing and verification tools for Conda", + conflict_handler="resolve", + ) + parser.add_argument( + "-V", + "--version", + action="version", + help="Show the conda-content-trust version number and exit.", + version="conda-content-trust %s" % __version__, + ) + + # Create separate parsers for the subcommands. + sp = parser.add_subparsers(title="subcommands", dest="subcommand_name") + + # subcommand: sign-artifacts + + p_signrepo = sp.add_parser( + "sign-artifacts", + help=( + "Given a repodata.json " + "file, produce signatures over the metadata for each artifact listed, " + "and update the repodata.json file with their individual signatures." + ), + ) + p_signrepo.add_argument( + "repodata_fname", + help=( + "the filename of a repodata.json file from " + "which to retrieve metadata for individual artifacts." + ), + ) + p_signrepo.add_argument( + "private_key_fname", + help=( + "the filename of a file containing a " + "hex string representation of an ed25519 private key to be used " + "to sign each artifact's metadata" + ), + ) + + # subcommand: verify-metadata + + p_verifymd = sp.add_parser( + "verify-metadata", + help=( + "Uses the first (trusted) metadata file " + "to verify the second (not yet trusted) metadata file. For " + "example, " + '"conda-content-trust verify-metadata 4.root.json 5.root.json"' + " to verify version 5 of root based on version 4 of root, or " + '"conda-content-trust verify-metadata 4.root.json key_mgr.json" ' + "to verify key manager metadata based on version 4 of root." + ), + ) + p_verifymd.add_argument( + "trusted_metadata_filename", + help=( + "the filename of the " + "already-trusted metadata file that sets the rules for verifying " + "the untrusted metadata file" + ), + ) + p_verifymd.add_argument( + "untrusted_metadata_filename", + help=("the filename of the " "(untrusted) metadata file to verify"), + ) + + # subcommand: modify-metadata + + p_modifymd = sp.add_parser( + "modify-metadata", + help=( + "Interactive metadata modification. Use " + "this to produce a new version of a metadata file (like root.json " + "or key_mgr.json), or correct an error in an unpublished metadata " + "file, or review and sign a metadata file. This increments " + "version number / timestamp, reports changes on console, etc. For " + 'example, "conda-content-trust modify-metadata 8.root.json" ' + "for assistance in " + "producing a new version of root (version 9) using version 8." + ), + ) + p_modifymd.add_argument( + "metadata_filename", + help=("the filename of the existing metadata " "file to modify"), + ) + + # If we're missing optional requirements for the next few options, note + # that in their help strings. + opt_reqs_str = "" + if not cct_root_signing.SSLIB_AVAILABLE: + opt_reqs_str = ( + "[Unavailable]: Requires optional " + "dependencies: securesystemslib and gpg. " + ) + + # subcommand: gpg-key-lookup + p_gpglookup = sp.add_parser( + "gpg-key-lookup", + help=( + opt_reqs_str + + "Given the OpenPGP fingerprint of an ed25519-type OpenPGP key, fetch " + "the actual ed25519 public key value of the underlying key." + ), + ) + p_gpglookup.add_argument( + "gpg_key_fingerprint", + help=( + "the 40-hex-character key fingerprint (long keyid) for the " + "OpenPGP/GPG key that you want to sign something with. Do not " + 'add prefix "0x".' + ), + ) + + # subcommand: gpg-sign + + p_gpgsign = sp.add_parser( + "gpg-sign", + help=( + opt_reqs_str + "Sign a given " + "piece of metadata using GPG instead of the usual signing " + "mechanisms. Takes an OpenPGP key fingerprint and a filename." + ), + ) + p_gpgsign.add_argument( + "gpg_key_fingerprint", + help=( + "the 40-hex-character key fingerprint (long keyid) for the " + "OpenPGP/GPG key that you want to sign something with. Do not " + 'add prefix "0x".' + ), + ) + p_gpgsign.add_argument( + "filename", help=("the filename of the file that will be signed") + ) + + args = parser.parse_args(args) + + if args.subcommand_name == "gpg-sign": + # TODO: Validate arguments. + + # Strip any whitespace from the key fingerprint and lowercase it. + # GPG pops out keys in a variety of whitespace arrangements and cases, + # so this is necessary for convenience. + gpg_key_fingerprint = "".join(args.gpg_key_fingerprint.split()).lower() + + cct_root_signing.sign_root_metadata_via_gpg(args.filename, gpg_key_fingerprint) + + elif args.subcommand_name == "sign-artifacts": + with open(args.private_key_fname) as key_fobj: + # Lower-case the hex string and ignore any whitespace before and + # after it (in case someone adds some). + private_key_hex = key_fobj.read().strip().lower() + + if not is_hex_key(private_key_hex): + print( + "ABORTED. Expected key file to contain only a hex string " + "representation of an ed25519 key. It does not." + ) + return + + cct_signing.sign_all_in_repodata(args.repodata_fname, args.private_key_hex) + + elif args.subcommand_name == "gpg-key-lookup": + gpg_key_fingerprint = "".join(args.gpg_key_fingerprint.split()).lower() + keyval = cct_root_signing.fetch_keyval_from_gpg(gpg_key_fingerprint) + print("Underlying ed25519 public key value: " + str(keyval)) + + elif args.subcommand_name == "modify-metadata": + # `conda-content-trust update-metadata ` + + # underlying functions: build_delegating_metadata, + # load_metadata_from_file + + # given a metadata file, increment the version number and timestamps, + # reporting the changes on the console + + # strip signatures + + # indicate what signatures are required + + # ask if the user wants to sign; query for the key hex or fname; + # ideally, offer this functionality for both root and non-root keys. + # For root metadata, we can (and should) also report which keys are + # expected / still needed in order for the metadata to be verifiable + # according to the old metadata and the new metadata + + old_metadata = load_metadata_from_file(args.metadata_filename) + + # new_metadata = cct_metadata_construction.interactive_modify_metadata(old_metadata) + # if new_metadata is not None and new_metadata: + # write_metadata_to_file(new_metadata, args.metadata_filename) + + interactive_modify_metadata(old_metadata) + + elif args.subcommand_name == "verify-metadata": + # `conda-content-trust verify-metadata <(optional) role name>` + + # underlying functions: cct_authentication.verify_delegation, + # load_metadata_from_file + + # takes two metadata files, the first being a trusted file that should + # provide the verification criteria (expected keys and expected number + # of keys) for the second file. This should support root-root + # verification (root chaining as currently implemented in + # conda-content-trust) and delegation from one metadata type to another + # (e.g. root to key_mgr) + + # conveys to the user whether or not the file is trusted, and for what + # role. e.g., would convey that the first file is (e.g.) a root + # metadata file, that it provides a delegation to , and that + # the file provides and is signed + # appropriately based on what the root metadata file requires of that + # delegation. + + untrusted_metadata = load_metadata_from_file(args.untrusted_metadata_filename) + + trusted_metadata = load_metadata_from_file(args.trusted_metadata_filename) + + # TODO✅: Argument validation via the check_format_* calls. + + metadata_type = untrusted_metadata["signed"]["type"] + + if metadata_type == "root": + # Verifying root has additional steps beyond verify_delegation. + try: + cct_authentication.verify_root(trusted_metadata, untrusted_metadata) + print("Root metadata verification successful.") + return 0 # success + + except CCT_Error as e: + errorcode = 10 + errorstring = str(e) + + else: + # Verifying anything other than root just uses verify_delegation + # directly. + try: + cct_authentication.verify_delegation( + delegation_name=metadata_type, + untrusted_delegated_metadata=untrusted_metadata, + trusted_delegating_metadata=trusted_metadata, + ) + print("Metadata verification successful.") + return 0 # success + + except CCT_Error as e: + errorcode = 20 + errorstring = str(e) + + # We should only get here if verification failed. + print( + "Verification of untrusted metadata failed. Metadata " + 'type was "' + metadata_type + '". Error reads:\n "' + errorstring + '"' + ) + return errorcode # failure; exit code + + else: + parser.print_help() + + +def interactive_modify_metadata(metadata): + """ """ + + # Update version if there is a version. + # Update timestamp if there is a timestamp. + # + # Show metadata contents ('signed') -- pprint? + # indicate updated version/timestamp + # + # Changes phase: + # Prompt to + # (m) modify a value, (a) add a new entry, (d) delete an entry, + # (r) revert to original, (f) finish and sign ((move on to signing + # prompts)) + # + # Signing phase: + # Show metadata again, ask if metadata looks right + # Show what keys the original was signed by and ask if those should be + # the keys used for the new version. + # ((Later: if root, vet against contents of new and old root versions)) + # Prompt for key (raw key file, raw key data, or gpg key fingerprint) + # Sign using the given key (gpg if gpg, else normal signing mechanism). + # Write (making sure not to overwrite, and -- if root -- making sure to + # prepend "." to root.json file. + + initial_metadata = metadata + metadata = deepcopy(initial_metadata) + + try: + import pygments + import pygments.formatters + import pygments.lexers + except ImportError: + print( + "interactive modify-metadata mode employs pygments for syntax " + "highlighting, if pygments is available. pygments was not " + "found, so the JSON contents will be... uglier than they " + "would otherwise be. If you would like syntax highlighting " + "and prettier printing of JSON, you may install pygments." + ) + pygments = None + from pprint import pprint + + # Build the modification options and prompt. + def promptfor(s): + return input(F_INSTRUCT + "\n----- Please provide " + s + ENDC + ": ") + + def fn_write(): + fname = promptfor("a filename to save this metadata as") + print("Writing to file....") + write_metadata_to_file(metadata, fname) + print("Modified metadata written!") + return 1 + + def fn_abort(): + # TODO✅: Ask to confirm. + print(RED + BOLD + "\nAborting!\n" + ENDC) + return 1 + + def fn_addsig(): + if not cct_root_signing.SSLIB_AVAILABLE: + print( + F_OPTS + "Signing. " + RED + "Please ABORT (control-c) if " + "the metadata above is not EXACTLY what you want to sign!" + ENDC + ) + key = promptfor( + "a key: either:\n - a 40-character-hex-string GPG PUBLIC " + "key fingerprint\n" + " for GPG keys (e.g. root YubiKeys), or \n - a " + "64-character-hex-string PRIVATE key value for normal " + "keys.\n\n Whitespace will be removed and characters will " + "be lowercased.\n Key" + ) + key = "".join(key.split()).lower() + + if is_hex_key(key): + private_key = PrivateKey.from_hex(key) + cct_signing.sign_signable(metadata, private_key) + print(F_OPTS + "\n\n--- Successfully signed! Please save." + ENDC) + + elif is_gpg_fingerprint(key): + try: + cct_root_signing.sign_root_metadata_dict_via_gpg(metadata, key) + except: + print( + F_OPTS + + "\n\n--- " + + RED + + "Signing FAILED." + + F_OPTS + + " Do you have this key loaded in GPG on " + "this system?" + ) + else: + print(F_OPTS + "\n\n--- Successfully signed! Please save." + ENDC) + + else: + print(F_OPTS + RED + "Unable to recognize key. Please try again." + ENDC) + return 0 + + def fn_remsig(): + return 0 + + def fn_update(): + return 0 + + def fn_adddel(): + return 0 + + def fn_remdel(): + return 0 + + def fn_thresh(): + delegation = promptfor( + "a delegation name (one of the entries in the" + '\n "delegations" dictionary in the metadata above). ' + "This will\n be the delegation whose threshold number of " + "required keys we\n will change." + ) + if delegation not in metadata["signed"]["delegations"]: + print( + F_OPTS + "\n\n--- " + RED + "Unable to find that delegation." + " Please try again." + ENDC + ) + return 0 + + new_thresh = promptfor( + "a new threshold value. The current value is " + + str(metadata["signed"]["delegations"][delegation]["threshold"]) + ) + + try: + new_thresh = int(new_thresh) + assert new_thresh >= 1 + except: + print( + F_OPTS + "\n--- " + RED + "Invalid value. Expecting integer " + "greater than or equal to 1. Please try again." + ENDC + ) + return 0 + + metadata["signed"]["delegations"][delegation]["threshold"] = new_thresh + + print(F_OPTS + "\n--- Threshold successfully updated." + ENDC) + + return 0 + + def fn_addkey(): + return 0 + + def fn_remkey(): + return 0 + + options = { + 0: [fn_write, "Done: write and save metadata"], + 1: [fn_abort, "Abort: discard changes -- abort without writing"], + 2: [fn_addsig, "Add a signature (sign with a key you have)"], + 3: [fn_remsig, "Remove a signature"], + 4: [fn_update, "Update any top-level dictionary entry"], + 5: [fn_adddel, "Add a delegation"], + 6: [fn_remdel, "Remove a delegation"], + 7: [fn_thresh, "Change the threshold number of keys for a delegation"], + 8: [fn_addkey, "Add an authorized key to a delegation"], + 9: [fn_remkey, "Remove an authorized key from a delegation"], + } + + option_text = ( + F_INSTRUCT + "\n--- Please choose an operation by entering its " + "number\n" + ENDC + ) + for index in options: + option_text += ( + " " + + F_LABEL + + str(index) + + ENDC + + ": " + + options[index][1] + + ENDC + + "\n" + ) + + done = False + while not done: + print( + F_OPTS + + BOLD + + "\n\n---------------------\n--- Current metadata:\n---------------------\n" + + ENDC + ) + + if pygments is not None: + formatted_metadata = dumps(metadata, sort_keys=True, indent=4) + print( + pygments.highlight( + formatted_metadata.encode("utf-8"), + pygments.lexers.JsonLexer(), + pygments.formatters.TerminalFormatter(), + ) + ) + else: + pprint(metadata) + + print(option_text) + selected = input(F_OPTS + "Choice: " + ENDC) + try: + selected = int(selected) + except: + print(RED + BOLD + "\nInvalid entry. Try again.\n" + ENDC) + continue + if selected not in options: + print(RED + BOLD + "\nInvalid entry. Try again.\n" + ENDC) + continue + + print(F_OPTS + '\nChose "' + options[selected][1] + '"' + ENDC) + + done = options[selected][0]() # Run the func associated with the option. + + # Pull modified from debugging script + # Pull modified from debugging script + # Pull modified from debugging script + + +# Basic text formatting string constants +PINK = "\033[95m" +BLUE = "\033[94m" +CYAN = "\033[96m" +GREEN = "\033[92m" +YELLOW = "\033[93m" +RED = "\033[91m" +ENDC = "\033[0m" +BOLD = "\033[1m" +UNDERLINE = "\033[4m" + +# Complete formats +F_LABEL = ENDC + UNDERLINE + BOLD + PINK +F_INSTRUCT = ENDC + BOLD + PINK +F_OPTS = ENDC + GREEN + + +if __name__ == "__main__": + import sys + + exit_status = cli(sys.argv[1:]) + sys.exit(exit_status) diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/common.py b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/common.py new file mode 100644 index 0000000000000000000000000000000000000000..862a1bceb5374ed7a3df57532a21331e26443edb --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/common.py @@ -0,0 +1,918 @@ +# Copyright (C) 2019 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +""" +This module contains functions that provide format validation, serialization, +and some key transformations for the pyca/cryptography library. These are used +across conda_content_trust modules. + +Function Manifest for this Module, by Category + +Encoding: + x canonserialize + +Formats and Validation: + PrivateKey -- extends cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PrivateKey + PublicKey -- extends cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PublicKey + checkformat_string + x is_hex_string + x is_hex_signature + r is_hex_key + r checkformat_hex_key + r checkformat_list_of_hex_keys + x is_signable + x checkformat_byteslike + x checkformat_natural_int + x checkformat_expiration_distance + x checkformat_utc_isoformat + x checkformat_gpg_fingerprint + is_gpg_fingerprint + x checkformat_gpg_signature + is_gpg_signature + checkformat_any_signature + checkformat_delegation + checkformat_delegations + checkformat_delegating_metadata + x iso8601_time_plus_delta + +Crypto Utility: + x sha512256 + x keyfiles_to_keys + x keyfiles_to_bytes + +Exceptions: + CCT_Error + SignatureError + MetadataVerificationError + UnknownRoleError +""" +from __future__ import annotations + +from binascii import hexlify, unhexlify +from datetime import datetime, timedelta +from json import dumps, load +from typing import Any, Protocol + +from cryptography.hazmat.primitives import serialization +from cryptography.hazmat.primitives.asymmetric import ed25519 + +# specification version for the metadata produced by conda-content-trust +# Details in the Conda Security Metadata Specification. Note that this +# version string is parsed via setuptools's packaging.version library, and so +# supports PEP 440; however, we should use a limited subset that is numerical +# only, and according to SemVer principles. +# PEP 440 compatibility: +# > None is not re.match(r'^([1-9]\d*!)?(0|[1-9]\d*)(\.(0|[1-9]\d*))*((a|b|rc)(0|[1-9]\d*))?(\.post(0|[1-9]\d*))?(\.dev(0|[1-9]\d*))?$', version_string) +# SemVer compatibility: +# > None is not re.match(r'^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$', version_string) +# Try, however, to keep to three simple numeric elements separated by periods, +# i.e., things that match this subset of SemVer: +# > None is not re.match(r'^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)$', version_string) +SECURITY_METADATA_SPEC_VERSION = "0.6.0" + +# The only types we're allowed to wrap as "signables" and sign are +# the JSON-serializable types. (There are further constraints to what is +# JSON-serializable in addition to these type constraints.) +SUPPORTED_SERIALIZABLE_TYPES = [dict, list, tuple, str, int, float, bool, type(None)] + +# These are the permissible strings in the "type" field of delegating metadata. +SUPPORTED_DELEGATING_METADATA_TYPES = ["root", "key_mgr"] # May be loosened later. + + +class CCT_Error(Exception): + """ + All errors we raise that are not ValueErrors, TypeErrors, or + certain errors from securesystemslib should be instances of this class or + of subclasses of this class. + """ + + +class SignatureError(CCT_Error): + """ + Indicates that a signable cannot be verified due to issues with the + signature(s) inside it. + """ + + +class MetadataVerificationError(CCT_Error): + """ + Indicates that a chain of authority metadata cannot be verified (e.g. + a metadata update is found on the repository, but could not be + authenticated). + """ + + +class UnknownRoleError(CCT_Error): + """ + Indicates that a piece of role metadata (like root.json, or key_mgr.json) + was expected but not found. + """ + + +def canonserialize(obj): + """ + Given a JSON-compatible object, does the following: + - serializes the dictionary as utf-8-encoded JSON, lazy-canonicalized + such that any dictionary keys in any dictionaries inside + are sorted and indentation is used and set to 2 spaces (using json lib) + + TODO: ✅ Implement the serialization checks from serialization document. + + Note that if the provided object includes a dictionary that is *indexed* + by both strings and integers, a TypeError will be raised complaining about + comparing strings and integers during the sort. (Each dictionary in an + object must be indexed only by strings or only by integers.) + """ + + # Try converting to a JSON string. + try: + # TODO: In the future, assess whether or not to employ more typical + # practice of using no whitespace (instead of NLs and 2-indent). + json_string = dumps(obj, indent=2, sort_keys=True) + except TypeError: + # TODO: ✅ Log or craft/use an appropriate exception class. + raise + + return json_string.encode("utf-8") + + +def load_metadata_from_file(fname): + # TODO ✅: Argument validation for fname. Consider adding "pathvalidate" + # as a dependency, and calling its sanitize_filename() here. + + with open(fname, "rb") as fobj: + metadata = load(fobj) + + # TODO ✅: Consider validating what is read here, for everywhere. + + return metadata + + +def write_metadata_to_file(metadata, filename): + """ + Canonicalizes and serializes JSON-friendly metadata, and writes that to the + given filename. + """ + + # TODO ✅: Argument validation for filename. Consider adding + # "pathvalidate" as a dependency, and calling its + # sanitize_filename() here. + + metadata = canonserialize(metadata) + + with open(filename, "wb") as fobj: + fobj.write(metadata) + + +class MixinKey: + """ + This is a mix-in (https://www.ianlewis.org/en/mixins-and-python) for the + PrivateKey and PublicKey classes, specifically. It provides some + convenience functions. + """ + + @classmethod + def to_hex(cls, key): + return hexlify(cls.to_bytes(key)).decode("utf-8") + + @classmethod + def is_equivalent_to(cls, k1, k2): + """ + Given Ed25519PrivateKey or Ed25519PublicKey objects, determines if the + underlying key data is identical. + """ + checkformat_key(k2) + if type(k1) is not type(k2): + return False + return cls.to_bytes(k1) == cls.to_bytes(k2) + + @classmethod # a class method for inheritors of this mix-in + def from_hex(cls, key_value_in_hex): + # from_private_bytes() and from_public_bytes() both check length (32), + # but do not produce helpful errors if the argument provided it is not + # the right type, so we'll do that here before calling them. + checkformat_hex_key(key_value_in_hex) + key_value_in_bytes = unhexlify(key_value_in_hex) + new_object = cls.from_bytes(key_value_in_bytes) + checkformat_key(new_object) + return new_object + + +class PrivateKey(MixinKey, ed25519.Ed25519PrivateKey): + """ + This class expands the class + cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PrivateKey + very slightly, adding some functionality from MixinKey. + + Note on the sign() method: + We preserve Ed25519PrivateKey's sign method unchanged. The sign() + method is deterministic and does not depend at any point on the ability + to generate random data (unlike the key generation). The returned + value for sign() is a length 64 bytes() object, a raw ed25519 + signature. + """ + + @classmethod + def to_bytes(cls, key): + return key.private_bytes( + encoding=serialization.Encoding.Raw, + format=serialization.PrivateFormat.Raw, + encryption_algorithm=serialization.NoEncryption(), + ) + + @classmethod + def from_bytes(cls, key_value_in_bytes): + """ + Constructs an object of the class based on the given key value. + The "cryptography" library provides from_public_bytes() and + from_private_bytes() class methods for Ed25519PublicKey and + Ed25519PrivateKey classes in place of constructors. We extend provide + a single API for those, and make the created objects objects of the + subclass using this mix-in. + """ + # from_private_bytes() and from_public_bytes() both check length (32), + # but do not produce helpful errors if the argument provided it is not + # the right type, so we'll do that here before calling them. + checkformat_byteslike(key_value_in_bytes) + return super().from_private_bytes(key_value_in_bytes) + + +class PublicKey(MixinKey, ed25519.Ed25519PublicKey): + """ + This class expands the class + cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PublicKey + very slightly, adding some functionality from MixinKey. + + We preserve Ed25519PublicKey's verify() method unchanged. + """ + + @classmethod + def to_bytes(cls, key): + """ + Pops out the nice, tidy bytes of a given ed25519 key object, public or + private. + """ + return key.public_bytes( + serialization.Encoding.Raw, serialization.PublicFormat.Raw + ) + + @classmethod + def from_bytes(cls, key_value_in_bytes): + """ + Constructs an object of the class based on the given key value. + The "cryptography" library provides from_public_bytes() and + from_private_bytes() class methods for Ed25519PublicKey and + Ed25519PrivateKey classes in place of constructors. We extend provide + a single API for those, and make the created objects objects of the + subclass using this mix-in. + """ + # from_private_bytes() and from_public_bytes() both check length (32), + # but do not produce helpful errors if the argument provided it is not + # the right type, so we'll do that here before calling them. + checkformat_byteslike(key_value_in_bytes) + return super().from_public_bytes(key_value_in_bytes) + + +# No.... For now, I'll stick with the raw dictionary representations. +# If function profusion makes it inconvenient for folks to use this library, +# it MAY then be time to make signatures into class objects... but it's +# probably best to avoid that potential complexity and confusion. +# class Signature(): +# def __init__(self, ): +# self.is_gpg_sig = False + + +# ✅ TODO: Consider a schema definitions module, e.g. PyPI project "schema" +def is_hex_string(hex_string: Any) -> bool: + """ + Returns True if hex is a hex string with no uppercase characters, no spaces, + etc. Else, False. + """ + try: + checkformat_hex_string(hex_string) + return True + except (ValueError, TypeError): + return False + + +HexString = str + + +def checkformat_hex_string(hex_string: Any) -> HexString: + """ + Throws TypeError if s is not a string. + Throws ValueError if the given string is not a string of hexadecimal + characters (upper-case not allowed to prevent redundancy). + """ + bytes.fromhex(hex_string) + # isalnum() checks for no whitespace which bytes.fromhex() would allow. + if not hex_string.isalnum() or hex_string.lower() != hex_string: + raise ValueError( + "Expected a hex string; non-hexadecimal or upper-case character found." + ) + + return hex_string + + +def is_hex_signature(hex_signature: Any) -> bool: + """ + Returns True if key is a hex string with no uppercase characters, no + spaces, no '0x' prefix(es), etc., and is 128 hexadecimal characters (the + correct length for an ed25519 signature, 64 bytes of raw data represented + as 128 hexadecimal characters). + Else, returns False. + """ + if is_hex_string(hex_signature) and len(hex_signature) == 128: + return True + + return False + + +def is_hex_key(hex_key: Any) -> bool: + """ + Returns True if key is a hex string with no uppercase characters, no + spaces, no '0x' prefix(es), etc., and is 64 hexadecimal characters (the + correct length for an ed25519 key, 32 bytes of raw data represented as 64 + hexadecimal characters). + Else, returns False. + """ + try: + checkformat_hex_key(hex_key) + return True + except (TypeError, ValueError): + return False + + +def is_signable(signable: Any) -> bool: + """ + Returns True if the given dictionary is a signable dictionary as produced + by wrap_as_signable. Note that there MUST be no additional elements beyond + 'signed' and 'signable' in the dictionary. (The only data in the envelope + outside the signed portion of the data should be the signatures; what's + outside of 'signed' is under attacker control.) + """ + return ( + isinstance(signable, dict) + and set(signable) == {"signatures", "signed"} + and isinstance(signable["signatures"], dict) + and type(signable["signed"]) in SUPPORTED_SERIALIZABLE_TYPES + ) + + +Signable = dict + + +# TODO: ✅ Consolidate: switch to use of this wherever is_a_signable is called +# and then an error is raised if the result is False. +def checkformat_signable(signable: Any) -> Signable: + if not is_signable(signable): + raise TypeError( + "Expected a signable dictionary, but the given argument " + "does not match expectations for a signable dictionary " + '(must be a dictionary containing only keys "signatures" and ' + '"signed", where the value for key "signatures" is a dict ' + 'and the value for key "signed" is a supported serializable ' + "type (" + str(SUPPORTED_SERIALIZABLE_TYPES) + ")" + ) + + return signable + + +class BytesLike(Protocol): + def decode(self, *args, **kwargs) -> str: + ... + + +def checkformat_byteslike(byteslike: Any) -> BytesLike: + if not hasattr(byteslike, "decode"): + raise TypeError("Expected a bytes-like object with a decode method.") + + return byteslike + + +def checkformat_natural_int(natural_int: Any) -> int: # Annotated[int, ">= 1"] + # Technically a TypeError or ValueError, depending, but meh. + if int(natural_int) != natural_int or natural_int < 1: + raise ValueError("Expected an integer >= 1.") + + return natural_int + + +# This is not yet widely used. +# TODO: ✅ See to it that anywhere we're checking for a string, we use this. +def checkformat_string(string: Any) -> str: + if not isinstance(string, str): + raise TypeError("Expecting a string") + + return string + + +def checkformat_expiration_distance(expiration_distance: Any) -> timedelta: + if not isinstance(expiration_distance, timedelta): + raise TypeError( + "Expiration distance must be a datetime.timedelta object. " + "Instead received a " + str(type(expiration_distance)) + ) + + return expiration_distance + + +HexKey = HexString # Annotated[HexString, "len() == 64"] + + +def checkformat_hex_key(hex_key: Any) -> HexKey: + checkformat_hex_string(hex_key) + + if 64 != len(hex_key): + raise ValueError("Expected a 64-character hex string representing a key value.") + + return hex_key + + +def checkformat_list_of_hex_keys(list_of_hex_keys: Any) -> list[HexKey]: + """ + Note that this rejects any list of keys that includes any exact duplicates. + """ + if not isinstance(list_of_hex_keys, list): + raise TypeError( + "Expected a list of 64-character hex strings representing keys." + ) + + for hex_key in list_of_hex_keys: + checkformat_hex_key(hex_key) + + if len(set(list_of_hex_keys)) != len(list_of_hex_keys): + raise ValueError( + "The given list of keys in hex string form contains duplicates. " + "Duplicates are not permitted." + ) + + return list_of_hex_keys + + +def checkformat_utc_isoformat(date_string: Any) -> str: + try: + datetime.strptime(date_string, "%Y-%m-%dT%H:%M:%SZ") + except ValueError: + # ValueError: date_string does not match format '%Y-%m-%dT%H:%M:%SZ' + raise TypeError( + "The provided string appears not to be a datetime string " + "formatted as an ISO8601 UTC-specific datetime (e.g. " + '"1999-12-31T23:59:59Z").' + ) from None + + return date_string + + +def is_gpg_fingerprint(gpg_fingerprint: Any) -> bool: + """ + True if the given value is a hex string of length 40 (representing a + 20-byte SHA-1 value, which is what OpenPGP/GPG uses as a key fingerprint). + """ + try: + checkformat_gpg_fingerprint(gpg_fingerprint) + return True + except (TypeError, ValueError): + return False + + +GPGFingerprint = HexKey # Annotated[HexKey, "len()==40"] + + +def checkformat_gpg_fingerprint(gpg_fingerprint: Any) -> GPGFingerprint: + """ + See is_gpg_fingerprint. Raises a TypeError if is_gpg_fingerprint is not + True. + """ + if len(gpg_fingerprint) != 40: + raise ValueError( + 'The given value, "' + str(gpg_fingerprint) + '", is not a full ' + "GPG fingerprint (40 hex characters)." + ) + + # ⚠️ Yes, the following is a redundant test. Please leave it here in case + # code changes elsewhere. + # Prevent multiple possible representations of keys. There are security + # implications. For example, we cannot permit two signatures from the + # same key -- with the key represented differently -- to count as two + # signatures from distinct keys. + # local hex test. isalnum() checks for no whitespace. + bytes.fromhex(gpg_fingerprint) + if not gpg_fingerprint.isalnum() or gpg_fingerprint.lower() != gpg_fingerprint: + raise ValueError( + "Expected a hex string; non-hexadecimal or upper-case character found." + ) + + return gpg_fingerprint + + +def is_gpg_signature(gpg_signature: Any) -> bool: + # TODO: ✅ docstring based on docstring from checkformat_gpg_signature + + try: + checkformat_gpg_signature(gpg_signature) + return True + except (ValueError, TypeError): + return False + + +GPGSignature = dict + + +def checkformat_gpg_signature(gpg_signature: Any) -> GPGSignature: + """ + Raises a TypeError if the given object is not a dictionary representing a + signature in a format that we expect. + + This is similar to BUT NOT THE SAME AS that produced by + securesystemslib.gpg.functions.create_signature(), conforming to + securesystemslib.formats.GPG_SIGNATURE_SCHEMA. + + We use a slightly different format in order to include the raw ed25519 + public key value. This is the format we expect for Root signatures. + + If the given object matches the format, returns silently. + """ + if not isinstance(gpg_signature, dict): + raise TypeError( + "OpenPGP signatures objects must be dictionaries. Received " + "type " + str(type(gpg_signature)) + " instead." + ) + + if sorted(list(gpg_signature.keys())) not in [ + ["other_headers", "signature"], + ["other_headers", "see_also", "signature"], + ]: + raise ValueError( + 'OpenPGP signature objects must include a "signature" and an ' + '"other_headers" entry, and may include a "see_also" entry. No ' + "other entries are permitted." + ) + + if not is_hex_string(gpg_signature["other_headers"]): + raise ValueError( + '"other_headers" entry in OpenPGP signature object must be a ' "hex string." + ) + # TODO ✅: Determine if we can constrain "other_headers" beyond + # limiting it to a hex string. (No length constraint is + # provided here, for example.) + + if not is_hex_signature(gpg_signature["signature"]): + raise ValueError( + '"signature" entry in OpenPGP signature obj must be a hex ' + "string representing an ed25519 signature, 128 hex characters " + "representing 64 bytes of data." + ) + + if "see_also" in gpg_signature: + checkformat_gpg_fingerprint(gpg_signature["see_also"]) + + return gpg_signature + + +def is_signature(signature: Any) -> bool: + """ + Returns True if signature_obj is a dictionary representing an ed25519 + signature, either in the conda-content-trust normal format, or + the format for a GPG signature. + + See conda_content_trust.common.checkformat_signature() docstring for more details. + """ + try: + checkformat_signature(signature) + return True + except (TypeError, ValueError): + return False + + +Signature = dict + + +def checkformat_signature(signature: Any) -> Signature: + """ + Raises a TypeError if the given object is not a dictionary. + Raises a ValueError if the given object is a dictionary, but is not in + our generalized signature format (supports both raw ed25519 signatures + OpenPGP/GPG signatures). + + If the given object matches the format, returns silently. + + The generalized signature format is: + { + (REQUIRED) 'signature': <64-byte value ed25519 signature, as 128 hex chars>, + (GPG SIGS ONLY) 'other_headers': , + (OPTIONAL) 'see_also': <40-hex-character SHA1 OpenPGP/GPG key identifier, for diagnostic purposes> + } + Examples: + { 'signature': 'deadbeef'*32} # normal ed25519 signature (no OpenPGP) + + { 'signature': 'deadbeef'*32, # OpenPGP ed25519 signature + 'other_headers': 'deadbeef'*??} # extra info OpenPGP insists on signing over + + { 'signature': 'deadbeef'*32, # OpenPGP ed25519 signature + 'other_headers': 'deadbeef'*??, + 'see_also': 'deadbeef'*10}} # listing an OpenPGP key fingerprint + """ + if not isinstance(signature, dict): + raise TypeError("Expected a signature object, of type dict.") + elif not ("signature" in signature and is_hex_signature(signature["signature"])): + # Even the minimal required element is not correct, so... + raise ValueError( + "Expected a dictionary representing an ed25519 signature as a " + "128-character hex string. This requires at least key " + '"signature", with value a 128-character hexadecimal string ' + "representing a (64-byte) ed25519 signature." + ) + + # simple ed25519 signature, not an OpenPGP signature + elif len(signature) == 1: + # If this is a simple ed25519 signature, and not an OpenPGP/GPG + # signature, then we're all set, since 'signature' is included and + # has a reasonable value. + return signature + + # Permit an OpenPGP (GPG / RFC 4880) signature noted as defined in + # function is_gpg_signature. + elif is_gpg_signature(signature): + return signature + + else: + raise ValueError( + "Provided signature does not have the correct format for a " + "signature object (neither simple ed25519 sig nor OpenPGP " + "ed25519 sig)." + ) + + +Delegation = dict + + +def checkformat_delegation(delegation: Any) -> Delegation: + """ + A dictionary specifying public key values and threshold of keys + e.g. + { 'pubkeys': ['ff'*32, '1e'*32], + 'threshold': 1} + threshold must be an integer >= 1. pubkeys must be a list of hexadecimal + representations of ed25519 public keys. + + Note that because drafts are allowed, we do not demand here that the list + of pubkeys include enough keys to meet threshold. Not listing pubkeys yet + is okay during writing, but when verifying metadata, one should not accept + delegations with impossible-to-meet requirements (len(pubkeys) < threshold) + """ + if not isinstance(delegation, dict): + raise TypeError( + "Delegation information must be a dictionary specifying " + '"pubkeys" and "threshold" elements.' + ) + elif not ( + set(delegation) == {"threshold", "pubkeys"} + and delegation["threshold"] >= 1 + and isinstance(delegation["pubkeys"], list) + and all([is_hex_key(k) for k in delegation["pubkeys"]]) + ): + raise ValueError( + "Delegation information must be a dictionary specifying " + 'exactly two elements: "pubkeys" (assigned a list of ' + "64-character hex strings representing individual ed25519 " + 'public keys) and "threshold", assigned an integer >= 1.' + ) + + # We have the right type, and the right keys. Check the values. + checkformat_list_of_hex_keys(delegation["pubkeys"]) + checkformat_natural_int(delegation["threshold"]) + + return delegation + + +def checkformat_delegations(delegations: Any) -> dict[str, Delegation]: + """ + A dictionary specifying a delegation for any number of role names. + Index: rolename. Value: delegation (see checkformat_delegation). + e.g. + { 'root.json': + {'pubkeys': ['01'*32, '02'*32, '03'*32], # each is a lower-case hex string w/ length 64 + 'threshold': 2}, # integer >= 1 + 'channeler.json': + {'pubkeys': ['04'*32], 'threshold': 1}} + """ + if not isinstance(delegations, dict): + raise TypeError( + '"Delegations" information must be a dictionary indexed by ' + "role names, with values equal to dictionaries that each " + 'specify elements "pubkeys" and "threshold".' + ) + + for index in delegations: + checkformat_string(index) + checkformat_delegation(delegations[index]) + + return delegations + + +DelegatingMetadata = Signable + + +def checkformat_delegating_metadata(metadata: Any) -> DelegatingMetadata: + """ + Validates argument "metadata" as delegating metadata. Passes if it is, + raises a TypeError or ValueError if it is not. + + The required format is a dictionary containing all contents of a delegating + metadata file, like root.json or key_mgr.json. (This includes both the + signatures portion and the signed contents portion, in the usual envelope + -- see also checkformat_signable.) + + The required structure: + { + 'signatures': {}, # for each entry in the 'signatures' dict: + # - the key must pass checkformat_hex_key + # - the value must pass checkformat_signature() + # or checkformat_gpg_signature() + 'signed': { + 'type': : # must match a string in SUPPORTED_DELEGATING_METADATA_TYPES (e.g. 'root') + 'metadata_spec_version': , + 'delegations': {}, # value must pass checkformat_delegations() + 'expiration': , # date must pass checkformat_utc_isoformat() + + # The 'signed' dict must always include either a 'timestamp' entry, + # a 'version' entry, or both. Further, in root metadata the + # 'signed' dict must always include a 'version' entry (to support + # root chaining). + + 'timestamp': , # if included, must pass checkformat_utc_isoformat() + 'version': # if included, must pass checkformat_natural_int(), i.e. be an integer >= 1 + } + } + + e.g. + { + "signatures": { # 0 or more signatures over the signed contents + : { + "other_headers": "04001608001d162104f075dd2f6f4cb3bd76134bbb81b6ca16ef9cd58905025f0bf546", + "signature": "ab3e03385f757da74e08b46f1bf82709fbc2ce21823c28e2f0e3452415e2a9f1e2c82e418cc44e2908618cf0c7375f32fe0a5a75494909a59a82875ebc703c02", + }, + ... + }, + "signed": { # signed contents + "delegations": { + "key_mgr.json": { + "pubkeys": [ + "013ddd714962866d12ba5bae273f14d48c89cf0773dee2dbf6d4561e521c83f7" + ], + "threshold": 1 + }, + "root.json": { + "pubkeys": [ + "bfbeb6554fca9558da7aa05c5e9952b7a1aa3995dede93f3bb89f0abecc7dc07" + ], + "threshold": 1 + } + }, + "expiration": "2021-07-13T05:46:45Z", + "metadata_spec_version": "0.1.0", + "timestamp": "2020-07-13T05:46:45Z", + "type": "root", + "version": 1 + } + } + """ + # Signing envelope required + checkformat_signable(metadata) + + for k in metadata["signatures"]: + checkformat_any_signature(metadata["signatures"][k]) + + contents = metadata["signed"] + + for entry in [ # required fields + "type", + "metadata_spec_version", + "delegations", + "expiration", + ]: + if entry not in contents: + raise ValueError( + 'Expected a "' + str(entry) + '" entry in the given ' + "delegating metadata." + ) + + checkformat_string(contents["type"]) + if contents["type"] not in SUPPORTED_DELEGATING_METADATA_TYPES: + raise ValueError( + 'Given type entry ("' + contents["type"] + '") is not ' + "one of the supported types of delegating metadata." + ) + + checkformat_string(contents["metadata_spec_version"]) + # TODO ✅⚠️: For metadata_spec_version, add semantic versioning checks: + # - check format + # - check for compatibility with common.SECURITY_METADATA_SPEC_VERSION + + checkformat_delegations(contents["delegations"]) + + checkformat_utc_isoformat(contents["expiration"]) + + # Timestamp and/or Version: + if "timestamp" not in contents and "version" not in contents: + raise ValueError( + 'All metadata must include a "version" entry, or a ' + '"timestamp" entry, or both.' + ) + + if contents["type"] == "root" and "version" not in contents: + raise ValueError("Root metadata must specify its version number.") + # Catch a possible future coding error at the PR stage, here where the + # assumption is being made. + assert "root" in SUPPORTED_DELEGATING_METADATA_TYPES + + if "timestamp" in contents: + checkformat_utc_isoformat(contents["timestamp"]) + if "version" in contents: # optional field for non-root metadata + checkformat_natural_int(contents["version"]) + # TODO ✅: Ensure that expiration > timestamp, to help people not shoot + # themselves in the foot. + + +def checkformat_any_signature(signature: Any) -> Signature | GPGSignature: + if not is_signature(signature) and not is_gpg_signature(signature): + raise ValueError( + "Expected either a hex string representing a raw ed25519 " + "signature (see checkformat_signature) or a dictionary " + "representing an OpenPGP/GPG signature " + "(see checkformat_gpg_signature)." + ) + + return signature + + +def keyfiles_to_bytes(name): + """ + Toy function. Import an ed25519 key pair, in the forms of raw public and + raw private keys, from name.pub and name.pri respectively. + + Cavalier about private key bytes. + Does not perform input validation ('/'...). + + Return the 32 bytes of the private key object and the 32 bytes of the + public key object, in that order. + """ + with open(name + ".pri", "rb") as fobj: + private_bytes = fobj.read() + + with open(name + ".pub", "rb") as fobj: + public_bytes = fobj.read() + + return private_bytes, public_bytes + + +def keyfiles_to_keys(name): + """ + Doesn't perform input validation. + Import an ed25519 key pair, in the forms of raw public key + bytes and raw private key bytes, from name.pub and name.pri respectively. + Cavalier about private key bytes. + Return a private key object and public key object, in that order. + """ + private_bytes, public_bytes = keyfiles_to_bytes(name) + + private = PrivateKey.from_bytes(private_bytes) + public = PublicKey.from_bytes(public_bytes) + + return private, public + + +def checkformat_key(key: Any) -> ed25519.Ed25519PublicKey | ed25519.Ed25519PrivateKey: + """ + Enforces expectation that argument is an object of type + cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PublicKey or + cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PrivateKey. + """ + if not isinstance(key, (ed25519.Ed25519PublicKey, ed25519.Ed25519PrivateKey)): + raise TypeError( + "Expected an Ed25519PublicKey or Ed25519PrivateKey object " + 'from the "cryptography" library. Received object of type ' + + str(type(key)) + + " instead." + ) + + return key + + +def iso8601_time_plus_delta(delta): + """ + Applies a datetime.timedelta to the current time in UTC with microseconds + stripped, then converts to ISO8601 format and appends a 'Z' indicating that + it is UTC time, not local time. We only deal with UTC times! + + This is used for two purposes: + - get current time in ISO8601 format, by passing in a 0 timedelta + - get ISO8601 UTC timestamp for expiration dates + + regex for time: '^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$' + """ + checkformat_expiration_distance(delta) + + unix_expiry = datetime.utcnow().replace(microsecond=0) + delta + + return unix_expiry.isoformat() + "Z" diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/metadata_construction.py b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/metadata_construction.py new file mode 100644 index 0000000000000000000000000000000000000000..b6ac50be43efe49b1a1ba8ca424575c7b2a20fa6 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/metadata_construction.py @@ -0,0 +1,277 @@ +# Copyright (C) 2019 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +""" +This module contains functions that construct metadata and generate signing +keys. + +Function Manifest for this Module + +Key Creation: + gen_keys + gen_and_write_keys + +Metadata Construction: + build_delegating_metadata + build_root_metadata (wraps build_delegating_metadata) +""" +from datetime import timedelta + +from .common import ( + SECURITY_METADATA_SPEC_VERSION, + PrivateKey, + PublicKey, + checkformat_delegations, + checkformat_natural_int, + checkformat_string, + checkformat_utc_isoformat, + iso8601_time_plus_delta, +) + +# Default expiration distance for repodata_verify.json. +REPODATA_VERIF_MD_EXPIRY_DISTANCE = timedelta(days=31) +ROOT_MD_EXPIRY_DISTANCE = timedelta(days=365) + + +def build_delegating_metadata( + metadata_type, delegations=None, version=1, timestamp=None, expiration=None +): + """ + # ✅ TODO: Docstring + + Builds delegating metadata, e.g. root.json, key_mgr.json. + + See metadata specification at: + anaconda.atlassian.net/wiki/spaces/AD/pages/285147281/Conda+Security+Metadata+Specification + + Arguments: + metadata_type: + The type of this metadata (e.g. root or key_mgr). This should + match the intended filename (without .json) + + delegations (default {} ) + a dictionary defining the delegations this metadata makes. + Each key is the role delegated to, with the value equal to a + dictionary listing the acceptable public keys and threshold + (number of signatures from distinct acceptable public keys) for the + delegated role. e.g. + { 'root.json': + {'pubkeys': ['01'*32, '02'*32, '03'*32], 'threshold': 2}, + 'key_mgr.json': + {'pubkeys': ['04'*32], 'threshold': 1}} + + If not provided, an empty dictionary (no delegations) will be used. + + version (default 1) + the version of the metadata; root metadata must advance one version + at a time (root chaining). For other types of metadata, versions + are advisory. + + timestamp (default: current system time) + UTC time associated with the production of this metadata, in + ISO8601 format (e.g. '2020-10-31T14:45:19Z') + + expiration (default: current system time plus ROOT_MD_EXPIRY_DISTANCE) + UTC time beyond which this metadata should be considered expired + and not verifiable by any client seeking new metadata + """ + + # Handle optional args + if delegations is None: + delegations = {} + if timestamp is None: + timestamp = iso8601_time_plus_delta(timedelta(0)) # now plus 0 + if expiration is None: + expiration = iso8601_time_plus_delta(ROOT_MD_EXPIRY_DISTANCE) + + # Argument validation. Note that this (checkformat_delegations) also + # checks for duplicates in lists of keys, which is important to reduce the + # odds of a developer introducing certain bugs that cause security issues + # (multiple signatures from same key being treated as two unique sigs, + # etc.) + checkformat_string(metadata_type) + # TODO: ✅⚠️ Consider a set of acceptable metadata types (root, key_mgr, + # channel_authority). Have to be careful about backward + # compatibility, though.... + checkformat_utc_isoformat(timestamp) + checkformat_utc_isoformat(expiration) + checkformat_natural_int(version) + checkformat_delegations(delegations) + + md = { + "type": metadata_type, + "version": version, + "metadata_spec_version": SECURITY_METADATA_SPEC_VERSION, + "timestamp": timestamp, + "expiration": expiration, + "delegations": delegations, + } + + # # This very redundant, but might be useful as defensive code. + # checkformat_delegating_metadata(wrap_as_signable(md) + + return md + + +def build_root_metadata( + root_version, + root_pubkeys, + root_threshold, + key_mgr_pubkeys, + key_mgr_threshold, + root_timestamp=None, + root_expiration=None, +): + """ + Wrapper for build_delegating_metadata(). Helpfully requires root to list + itself and key_mgr in its delegations. + + # ✅ TODO: Docstring + + # ✅ TODO: Expand build_root_metadata flexibility for + # directly-root-delegated roles (i.e. in addition to channeler). + """ + + # Note that argument validation is performed in the + # build_delegation_metadata call below. So is some of the optional + # argument default setting (timestamp). We set expiration explicitly here + # in case the defaults for generic delegating metadata and root metadata + # diverge later. + # Note that it is probably best to provide less revealing timestamps for + # root metadata generation (00:00:00 of a past day), since it is a manual + # process and patterns in that information might be somewhat useful to a + # sophisticated attacker. + if root_expiration is None: + root_expiration = iso8601_time_plus_delta(ROOT_MD_EXPIRY_DISTANCE) + # if channeler_pubkeys is None: + # channeler_pubkeys = [] + # if channeler_threshold = None: + # channeler_threshold = max(1, len(channeler_pubkeys)) + + delegations = { + "root": {"pubkeys": root_pubkeys, "threshold": root_threshold}, + "key_mgr": {"pubkeys": key_mgr_pubkeys, "threshold": key_mgr_threshold}, + } + + root_md = build_delegating_metadata( + metadata_type="root", + delegations=delegations, + version=root_version, + timestamp=root_timestamp, + expiration=root_expiration, + ) + + return root_md + + +def gen_and_write_keys(fname): + """ + Generate an ed25519 key pair, then write the key files to disk. + + Given fname, write the private key to fname.pri, and the public key to + fname.pub. Performs no filename validation, etc. Also returns the private + key object and the public key object, in that order. + """ + + # Create an ed25519 key pair, employing OS random generation. + # Note that this just has the private key sitting around. In the real + # implementation, we'll want to use an HSM equipped with an ed25519 key. + private, public = gen_keys() + + # Write the actual bytes of the key values to disk as requested. + # Note that where the private key is concerned, we're just grabbing the + # not-encrypted private key value. + with open(fname + ".pri", "wb") as fobj: + fobj.write(PrivateKey.to_bytes(private)) + with open(fname + ".pub", "wb") as fobj: + fobj.write(PublicKey.to_bytes(public)) + + return private, public + + +def gen_keys(): + """ + Generate an ed25519 key pair and return it (private key, public key). + + Returns two objects: + - a conda_content_trust.common.PrivateKey, a subclass of + cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PrivateKey + - a conda_content_trust.common.PublicKey, a subclass of + cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PublicKey + """ + # Create an ed25519 key pair, employing OS random generation. + # Note that this just has the private key sitting around. In the real + # implementation, we'll want to use an HSM equipped with an ed25519 key. + private = PrivateKey.generate() + public = private.public_key() + + return private, public + + +# This function is not in use. It's here for reference, in case it's useful +# again in the future. +# def build_repodata_verification_metadata( +# repodata_hashmap, channel=None, expiry=None, timestamp=None): +# """ +# # TODO: ✅ Full docstring. + +# # TODO: ✅ Contemplate the addition of "version" to this metadata. As yet, +# # the timestamp serves our purposes.... + +# Note that if expiry or timestamp are not provided or left as None, now is +# used for the timestamp, and expiry is produced using a default expiration +# distance, via iso8601_time_plus_delta(). (It does not mean no expiration!) + +# Channel may be optionally specified, and is only included if specified. + +# Sample input (repodata_hashmap): +# { +# "noarch/current_repodata.json": "908724926552827ab58dfc0bccba92426cec9f1f483883da3ff0d8664e18c0fe", +# "noarch/repodata.json": "...", +# "noarch/repodata_from_packages.json": "...", +# "osx-64/current_repodata.json": "...", +# "osx-64/repodata.json": "...", +# "osx-64/repodata_from_packages.json": "..." +# } + +# Sample output: +# See metadata specification (version defined by +# SECURITY_METADATA_SPEC_VERSION) for definition and samples of type +# "Repodata Verification Metadata". +# """ + +# if expiry is None: +# expiry = iso8601_time_plus_delta(REPODATA_VERIF_MD_EXPIRY_DISTANCE) + +# if timestamp is None: +# timestamp = iso8601_time_plus_delta(timedelta(0)) + +# # TODO: ✅ More argument validation: channel, +# checkformat_utc_isoformat(expiry) +# checkformat_utc_isoformat(timestamp) +# if not ( # dict with string keys and 32-byte-hash-as-hex-string values +# isinstance(repodata_hashmap, dict) +# and all([isinstance(x, string_types) for x in repodata_hashmap]) +# and all([is_hex_hash(repodata_hashmap[x]) for x in repodata_hashmap])): +# raise ValueError( +# 'Argument repodata_hashmap must be a dictionary with strings ' +# 'as keys (filenames of repodata.json files), and values that ' +# 'are 64-character hex strings representing 32-byte hashes (of ' +# 'those repodata.json files)') + +# # TODO: ✅ Really have to make TypeError and ValueError usages consistent +# # with norms throughout this codebase. + + +# rd_v_md = { +# 'type': 'repodata_verify', +# # (Take advantage of iso8601_time_plus_delta() to get current time +# # in the ISO8601 UTC format we want.) +# 'timestamp': timestamp, # version->timestamp in spec v 0.0.5 +# 'metadata_spec_version': SECURITY_METADATA_SPEC_VERSION, +# 'expiration': expiry, +# 'secured_files': repodata_hashmap} + +# if channel is not None: +# rd_v_md['channel'] = channel + +# return rd_v_md diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/plugin.py b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/plugin.py new file mode 100644 index 0000000000000000000000000000000000000000..4c87162bfcbad518cc9d1dc8404acc48316e5a37 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/plugin.py @@ -0,0 +1,14 @@ +# Copyright (C) 2019 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +import conda.plugins + +from .cli import cli + + +@conda.plugins.hookimpl +def conda_subcommands(): + yield conda.plugins.CondaSubcommand( + name="content-trust", + summary="Signing and verification tools for Conda", + action=cli, + ) diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/root_signing.py b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/root_signing.py new file mode 100644 index 0000000000000000000000000000000000000000..b6d3dae53d75a05c85105a86d06d3ef6d34f5596 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/root_signing.py @@ -0,0 +1,365 @@ +# Copyright (C) 2019 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +""" +This module contains functions that sign data in an OpenPGP-compliant (i.e. +GPG-friendly) way. Root metadata may be signed in this manner. Functions that +perform simpler, direct signing using raw ed25519 keys are provided in +conda_content_trust.signing instead. + +This library takes advantage of the securesystemslib library for its gpg +signing interface. + +Function Manifest for this Module: + sign_via_gpg # requires securesystemslib + sign_root_metadata_via_gpg # requires securesystemslib + fetch_keyval_from_gpg # requires securesystemslib + +Note that there is a function in conda_content_trust.authentication that verifies these +signatures without requiring securesystemslib. +""" +# securesystemslib is an optional dependency, and required only for signing +# root metadata via GPG. Verification of those signatures, and signing other +# metadata with raw ed25519 signatures, does not require securesystemslib. +try: + import securesystemslib.formats # noqa: F401 + from securesystemslib.gpg import functions as gpg_funcs + + SSLIB_AVAILABLE = True +except ImportError: # pragma: no cover + SSLIB_AVAILABLE = False + +from .common import ( + canonserialize, + checkformat_byteslike, + checkformat_gpg_fingerprint, + checkformat_hex_key, + is_signable, + load_metadata_from_file, + write_metadata_to_file, +) + + +def _check_sslib_available(): + if not SSLIB_AVAILABLE: + raise ImportError( + "The securesystemslib library is required, which appears to be unavailable." + ) + + +def sign_via_gpg(data_to_sign, gpg_key_fingerprint, include_fingerprint=False): + """ + + + This is an alternative to the conda_content_trust.common.PrivateKey.sign() method, for + use with OpenPGP keys, allowing us to use protected keys in YubiKeys + (which provide an OpenPGP interface) to sign data. + + The signature is not simply over data_to_sign, as is the case with the + PrivateKey.sign() function, but over an expanded payload with + metadata about the signature to be signed, as specified by the OpenPGP + standard (RFC 4880). See data_to_sign and Security Note below. + + This process is nominally deterministic, but varies with the precise + time, since there is a timestamp added by GPG into the signed payload. + Nonetheless, this process does not depend at any point on the ability + to generate random data (unlike key generation). + + This function requires securesystemslib, which is otherwise an optional + dependency. + + + + data_to_sign + The raw bytes of interest that will be signed by GPG. Note that + pursuant to the OpenPGP standard, GPG will add to this data: + specifically, it includes metadata about the signature that is + about to be made into the data that will be signed. We do not care + about that metadata, and we do not want to burden signature + verification with its processing, so we essentially ignore it. + This should have negligible security impact, but for more + information, see "A note on security" below. + + + gpg_key_fingerprint + This is a (fairly) unique identifier for an OpenPGP key pair. + Also Known as a "long" GPG keyid, a GPG fingerprint is + 40-hex-character string representing 20 bytes of raw data, the + SHA-1 hash of a collection of the GPG key's properties. + Internally, GPG uses the key fingerprint to identify keys the + client knows of. + + Note that an OpenPGP public key is a larger object identified by a + fingerprint. GPG public keys include two things, from our + perspective: + + - the raw bytes of the actual cryptographic key + (in our case the 32-byte value referred to as "q" for an ed25519 + public key) + + - lots of data that is totally extraneous to us, including a + timestamp, some representations of relationships with other keys + (subkeys, signed-by lists, etc.), Superman's real name + (see also https://bit.ly/38GcaGj), potential key revocations, + etc. + We do not care about this extra data because we are using the + OpenPGP standard not for its key-to-key semantics or any element + of its Public Key Infrastructure features (revocation, vouching + for other keys, key relationships, etc.), but simply as a means + of asking YubiKeys to sign data for us, with ed25519 keys whose + raw public key value ("q") we know to expect. + + + + Returns a dictionary representing a GPG signature. This is similar to + but not *quite* the same as + securesystemslib.formats.GPG_SIGNATURE_SCHEMA (which uses 'keyid' + as the key for the fingerprint, instead of 'gpg_key_fingerprint'). + + Specifically, this looks like: + {'gpg_key_fingerprint': , + 'other_headers': , + 'signature': } + + + This is unlike conda_content_trust.signing.sign(), which simply returns 64 bytes of raw + ed25519 signature. + + + + + A note on the security implications of this treatment of OpenPGP + signatures: + + TL;DR: + It is NOT easier for an attacker to find a collision; however, it + IS easier, IF an attacker CAN find a collision, to do so in a way + that presents a specific, arbitrary payload. + + Note that pursuant to the OpenPGP standard, GPG will add to the data we + ask it to sign (data_to_sign) before signing it. Specifically, GPG will + add, to the payload-to-be-signed, OpenPGP metadata about the signature + it is about to create. We do not care about that metadata, and we do + not want to burden signature verification with its processing (that is, + we do not want to use GPG to verify these signatures; conda will do + that with simpler code). As a result, we will ignore this data when + parsing the signed payload. This will mean that there will be many + different messages that have the same meaning to us: + + signed: + + + + Since we will not be processing the '123456...' above, '654321...' + would have the same effect: as long as the signature is verified, + we don't care what's in that portion of the payload. + + Since there are many, many payloads that mean the same thing to us, an + attacker has a vast space of options all with the same meaning to us in + which to search for (effectively) a useful SHA256 hash collision to + find different data that says something *specific* and still + *succeeds* in signature verification using the same signature. + While that is not ideal, it is difficult enough simply to find a SHA256 + collision that this is acceptable. + """ + _check_sslib_available() + + # Argument validation + checkformat_gpg_fingerprint(gpg_key_fingerprint) + checkformat_byteslike(data_to_sign) + + sig = gpg_funcs.create_signature(data_to_sign, gpg_key_fingerprint) + + # securesystemslib.gpg makes use of the GPG key fingerprint. We don't + # care about that as much -- we want to use the raw ed25519 public key + # value to refer to the key in a manner consistent with the way we refer to + # non-GPG (non-OpenPGP) keys. + keyval = fetch_keyval_from_gpg(gpg_key_fingerprint) + + # ssl gpg sigs look like this: + # + # {'keyid': , + # 'other_headers': , + # 'signature': } + # + # We want to store the real public key instead of just the gpg key + # fingerprint, so we add that, and we'll rename keyid to + # gpg_key_fingerprint. That gives us: + # + # {'gpg_key_fingerprint': , + # 'other_headers': , + # 'signature': } + + # sig['key'] = keyval # q, the 32-byte raw ed25519 public key value, expressed as 64 hex characters + + # The OpenPGP Fingerprint of the OpenPGP key used to sign. This is not + # required for verification, but it's useful for debugging and for + # root keyholder convenience. So it's optional. + if include_fingerprint: + sig["see_also"] = sig[ + "keyid" + ] # strictly not needed, useful for debugging; 20-byte sha1 gpg key identifier per OpenPGP spec, expressed as 40 hex characters + + del sig["keyid"] + + return sig + + +def sign_root_metadata_dict_via_gpg(root_signable, gpg_key_fingerprint): + # Signs root_signable in place, returns nothing. + + _check_sslib_available() + + # Make sure it's the right format. + if not is_signable(root_signable): + raise TypeError("Expected a signable dictionary.") + + # TODO: Add root-specific checks. + + # Canonicalize and serialize the data, putting it in the form we expect to + # sign over. Note that we'll canonicalize and serialize the whole thing + # again once the signatures have been added. + data_to_sign = canonserialize(root_signable["signed"]) + + sig_dict = sign_via_gpg(data_to_sign, gpg_key_fingerprint) + + # sig_dict looks like this: + # {'keyid': 'f075dd2f6f4cb3bd76134bbb81b6ca16ef9cd589', + # 'other_headers': '04001608001d162104f075dd2f6f4cb3bd76134bbb81b6ca16ef9cd58905025dbc3e68', + # 'signature': '29282a8fe75871f9d4cf10a5a9e8d92303f8c361ce4b474a0ce641c9b8a74e4baaf810cc383af318a8e21cbe252789c2c30894d94e8b0288c3c45ceacf6c1d0c'} + # pgp_pubkey looks like this: + # {'creation_time': 1571411344, + # 'hashes': ['pgp+SHA2'], + # 'keyid': 'f075dd2f6f4cb3bd76134bbb81b6ca16ef9cd589', + # 'keyval': {'private': '', + # 'public': {'q': 'bfbeb6554fca9558da7aa05c5e9952b7a1aa3995dede93f3bb89f0abecc7dc07'}}, + # 'method': 'pgp+eddsa-ed25519', + # 'type': 'eddsa'} + + # securesystemslib.gpg makes use of the GPG key fingerprint. We don't + # care about that as much -- we want to use the raw ed25519 public key + # value to refer to the key in a manner consistent with the way we refer to + # non-GPG (non-OpenPGP) keys. + # raw_pubkey = pgp_pubkey['keyval']['public']['q'] + raw_pubkey = fetch_keyval_from_gpg(gpg_key_fingerprint) + + # non-GPG signing here would look like this: + # signature_as_hexstr = serialize_and_sign(signable['signed'], private_key) + # public_key_as_hexstr = binascii.hexlify(key_to_bytes( + # private_key.public_key())).decode('utf-8') + + # Add signature in-place. + root_signable["signatures"][raw_pubkey] = sig_dict + + return root_signable + + +def sign_root_metadata_via_gpg(root_md_fname, gpg_key_fingerprint): + """ + # This is a higher-level function than sign_via_gpg, including code that + # deals with the filesystem. It is not actually limited to root metadata, + # and SHOULD BE RENAMED. + """ + # Read in json + root_signable = load_metadata_from_file(root_md_fname) + + root_signable = sign_root_metadata_dict_via_gpg(root_signable, gpg_key_fingerprint) + + # TODO: Consider removing write_metadata_to_file. It might be better for + # readers to see the canonserialize() call being made (again) here, + # and it's not that much longer.... + write_metadata_to_file(root_signable, root_md_fname) + + +def fetch_keyval_from_gpg(fingerprint): + """ + Retrieve the underlying 32-byte raw ed25519 public key for a GPG key. + + Given a GPG key fingerprint (40-character hex string), retrieve the GPG + key, parse it, and return "q", the 32-byte ed25519 key value. + + This takes advantage of the GPG key parser in securesystemslib. + + The fingerprint will be stripped of spaces and lowercased, so you can use + the GPG output even if it's in a funky format: + 94A3 EED0 806C 1F10 7754  A446 FDAD 11B8 2DD4 0E8C + 94A3 EED0 806C 1F10 7754 A446 FDAD 11B8 2DD4 0E8C # <-- No, this is actually not the same as the previous one, which uses \\xa0.... + 94A3EED0806C1F107754A446FDAD11B82DD40E8C + 94a3eed0806c1f107754a446fdad11b82dd40e8c + etc. + """ + _check_sslib_available() + + fingerprint = ( + fingerprint.lower().replace(" ", "").replace("\xa0", "") + ) # \xa0 is another space character that GPG sometimes outputs + + checkformat_gpg_fingerprint(fingerprint) + + key_parameters = gpg_funcs.export_pubkey(fingerprint) + + return key_parameters["keyval"]["public"]["q"] + + +def _gpg_pubkey_in_ssl_format(fingerprint, q): + """ + THIS IS PROVIDED ONLY FOR TESTING PURPOSES. + We do not need to convert pubkeys to securesystemslib's format, except to + try out securesystemslib's gpg signature verification (which we use only + for comparison during testing). + + Given a GPG key fingerprint (40 hex characters) and a q value (64 hex + characters representing a 32-byte ed25519 public key raw value), produces a + key object in a format that securesystemslib expects, so that we can use + securesystemslib.gpg.functions.verify_signature for part of the GPG + signature verification. For our purposes, this means that we should + produce a dictionary conforming to + securesystemslib.formats._GPG_ED25519_PUBKEY_SCHEMA. + + If securesystemslib.formats._GPG_ED25519_PUBKEY_SCHEMA changes, those + changes will likely need to be reflected here. + + Example value produced: + { + 'type': 'eddsa', + 'method': 'pgp+eddsa-ed25519', + 'hashes': ['pgp+SHA2'], + 'keyid': 'F075DD2F6F4CB3BD76134BBB81B6CA16EF9CD589', + 'keyval': { + 'public': {'q': 'bfbeb6554fca9558da7aa05c5e9952b7a1aa3995dede93f3bb89f0abecc7dc07'}, + 'private': ''} + } + } + """ + checkformat_gpg_fingerprint(fingerprint) + checkformat_hex_key(q) + + ssl_format_key = { + "type": "eddsa", + "method": securesystemslib.formats.GPG_ED25519_PUBKEY_METHOD_STRING, + "hashes": [securesystemslib.formats.GPG_HASH_ALGORITHM_STRING], + "keyid": fingerprint, + "keyval": {"private": "", "public": {"q": q}}, + } + + return ssl_format_key + + +# def _gpgsig_to_sslgpgsig(gpg_sig): +# +# conda_content_trust.common.checkformat_gpg_signature(gpg_sig) +# +# return { +# 'keyid': copy.deepcopy(gpg_sig['key_fingerprint']), +# 'other_headers': copy.deepcopy(gpg_sig[other_headers]), +# 'signature': copy.deepcopy(gpg_sig['signature'])} + + +# def _sslgpgsig_to_gpgsig(ssl_gpg_sig): +# +# securesystemslib.formats.GPG_SIGNATURE_SCHEMA.check_match(ssl_gpg_sig) +# +# return { +# 'key_fingerprint': copy.deepcopy(ssl_gpg_sig['keyid']), +# 'other_headers': copy.deepcopy(ssl_gpg_sig[other_headers]), +# 'signature': copy.depcopy(ssl_gpg_sig['signature']) +# } diff --git a/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/signing.py b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/signing.py new file mode 100644 index 0000000000000000000000000000000000000000..652ce42949607be1a8677b1545f2cb703013d793 --- /dev/null +++ b/miniconda3/pkgs/conda-content-trust-0.2.0-py313h06a4308_1/lib/python3.13/site-packages/conda_content_trust/signing.py @@ -0,0 +1,213 @@ +# Copyright (C) 2019 Anaconda, Inc +# SPDX-License-Identifier: BSD-3-Clause +""" +This module contains functions that sign data using ed25519 keys, via the +pyca/cryptography library. Functions that perform OpenPGP-compliant (e.g. GPG) +signing are provided instead in root_signing. + +Function Manifest for this Module: + serialize_and_sign + wrap_as_signable + sign_signable +""" +from binascii import hexlify +from copy import deepcopy + +from .common import ( + SUPPORTED_SERIALIZABLE_TYPES, + PrivateKey, + PublicKey, + canonserialize, + checkformat_hex_key, + checkformat_key, + checkformat_signable, + checkformat_signature, + checkformat_string, + load_metadata_from_file, + write_metadata_to_file, +) + + +def serialize_and_sign(obj, private_key): + """ + Given a JSON-compatible object, does the following: + - serializes the dictionary as utf-8-encoded JSON, lazy-canonicalized + such that any dictionary keys in any dictionaries inside + are sorted and indentation is used and set to 2 spaces (using json lib) + - creates a signature over that serialized result using private_key + - returns that signature as a hex string + + See comments in common.canonserialize() + + Arguments: + obj: a JSON-compatible object -- see common.canonserialize() + private_key: a conda_content_trust.common.PrivateKey object + + # TODO ✅: Consider taking the private key data as a hex string instead? + # On the other hand, it's useful to support an object that could + # obscure the key (or provide an interface to a hardware key). + """ + + # Try converting to a JSON string. + serialized = canonserialize(obj) + + signature_as_bytes = private_key.sign(serialized) + + signature_as_hexstr = hexlify(signature_as_bytes).decode("utf-8") + + return signature_as_hexstr + + +def wrap_as_signable(obj): + """ + Given a JSON-serializable object (dictionary, list, string, numeric, etc.), + returns a wrapped copy of that object: + + {'signatures': {}, + 'signed': } + + Expects strict typing matches (not duck typing), for no good reason. + (Trying JSON serialization repeatedly could be too time consuming.) + + TODO: ✅ Consider whether or not the copy can be shallow instead, for speed. + + Raises ❌TypeError if the given object is not a JSON-serializable type per + SUPPORTED_SERIALIZABLE_TYPES + """ + if not type(obj) in SUPPORTED_SERIALIZABLE_TYPES: + raise TypeError( + "wrap_dict_as_signable requires a JSON-serializable object, " + "but the given argument is of type " + str(type(obj)) + ", " + "which is not supported by the json library functions." + ) + + # TODO: ✅ Later on, consider switching back to TUF-style + # signatures-as-a-list. (Is there some reason it's saner?) + # Going with my sense of what's best now, which is dicts instead. + # It's simpler and it naturally avoids duplicates. We don't do it + # this way in TUF, but we also don't depend on it being an ordered + # list anyway, so a dictionary is probably better. + + return {"signatures": {}, "signed": deepcopy(obj)} + + +def sign_signable(signable, private_key): + """ + Given a JSON-compatible signable dictionary (as produced by calling + wrap_dict_as_signable with a JSON-compatible dictionary), calls + serialize_and_sign on the enclosed dictionary at signable['signed'], + producing a signature, and places the signature in + signable['signatures'], in an entry indexed by the public key + corresponding to the given private_key. + + Updates the given signable in place, returning nothing. + Overwrites if there is already an existing signature by the given key. + + # TODO ✅: Take hex string keys for sign_signable and serialize_and_sign + # instead of constructed PrivateKey objects? Add the comment + # below if so: + # # Unlike with lower-level functions, both signatures and public keys are + # # always written as hex strings. + + Raises ❌TypeError if the given object is not a JSON-serializable type per + SUPPORTED_SERIALIZABLE_TYPES + """ + # Argument checking + checkformat_key(private_key) + checkformat_signable(signable) + # if not is_a_signable(signable): + # raise TypeError( + # 'Expected a signable dictionary; the given argument of type ' + + # str(type(signable)) + ' failed the check.') + + # private_key = PrivateKey.from_hex(private_key_hex) + + signature_as_hexstr = serialize_and_sign(signable["signed"], private_key) + + public_key_as_hexstr = PublicKey.to_hex(private_key.public_key()) + + # To fit a general format, we wrap it this way, instead of just using the + # hexstring. This is because OpenPGP signatures that we use for root + # signatures look similar and have a few extra fields beyond the signature + # value itself. + signature_dict = {"signature": signature_as_hexstr} + + checkformat_signature(signature_dict) + + # TODO: ✅⚠️ Log a warning in whatever conda's style is (or conda-build): + # + # if public_key_as_hexstr in signable['signatures']: + # warn( # replace: log, 'warnings' module, print statement, whatever + # 'Overwriting existing signature by the same key on given ' + # 'signable. Public key: ' + public_key + '.') + + # Add signature in-place, in the usual signature format. + signable["signatures"][public_key_as_hexstr] = signature_dict + + +def sign_all_in_repodata(fname, private_key_hex): + """ + Given a repodata.json filename, reads the "packages" entries in that file, + and produces a signature over each artifact, with the given key. The + signatures are then placed in a "signatures" entry parallel to the + "packages" entry in the json file. The file is overwritten. + + Arguments: + fname: filename of a repodata.json file + private_key_hex: + a private ed25519 key value represented as a 64-char hex string + """ + checkformat_hex_key(private_key_hex) + checkformat_string(fname) + # TODO ✅⚠️: Consider filename validation. What does conda use for that? + + private = PrivateKey.from_hex(private_key_hex) + public_hex = PublicKey.to_hex(private.public_key()) + + # Loading the whole file at once instead of reading it as we go, because + # it's less complex and this only needs to run repository-side. + repodata = load_metadata_from_file(fname) + # with open(fname, 'rb') as fobj: + # repodata = json.load(fname) + + # TODO ✅: Consider more validation for the gross structure expected of + # repodata.json + if "packages" not in repodata: + raise ValueError('Expected a "packages" entry in given repodata file.') + + # Add an empty 'signatures' dict to repodata. + # If it's already there for whatever reason, we replace it entirely. This + # avoids leaving existing signatures that might not get replaced -- e.g. if + # the artifact is not in the "packages" dict, but is in the "signatures" + # dict for some reason. What comes out of this process will be limited to + # what we sign in this function. + repodata["signatures"] = {} + + for artifact_name, metadata in repodata["packages"].items(): + # TODO ✅: Further consider the significance of the artifact name + # itself not being part of the signed metadata. The info used + # to generate the name (package name + version + build) is + # part of the signed metadata, but the full name is not. + # Keep in mind attacks that swap metadata among artifacts; + # signatures would still read as correct in that circumstance. + signature_hex = serialize_and_sign(metadata, private) + + # To fit a general format, we wrap it this way, instead of just using + # the hexstring. This is because OpenPGP signatures that we use for + # root signatures look similar and have a few extra fields beyond the + # signature value itself. + signature_dict = {"signature": signature_hex} + + checkformat_signature(signature_dict) + + repodata["signatures"][artifact_name] = {public_hex: signature_dict} + + # Repeat for the .conda packages in 'packages.conda'. + for artifact_name, metadata in repodata.get("packages.conda", {}).items(): + signature_hex = serialize_and_sign(metadata, private) + repodata["signatures"][artifact_name] = { + public_hex: {"signature": signature_hex} + } + + # Note: takes >0.5s on a macbook for large files + write_metadata_to_file(repodata, fname) diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/about.json b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..b1b1edfcb5310e82eb1ebeeacea838a136477e97 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/about.json @@ -0,0 +1,163 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/msys2" + ], + "conda_build_version": "25.9.0", + "conda_version": "25.11.0", + "description": "The conda-libmamba-solver is a new solver for the conda package manager\nwhich uses the solver from the mamba project behind the scenes,\nwhile carefully implementing conda's functionality and expected behaviors on top.\nThe library used by mamba to do the heavy-lifting is called libsolv.\n", + "dev_url": "https://github.com/conda/conda-libmamba-solver", + "doc_url": "https://conda.github.io/conda-libmamba-solver/", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true, + "recipe-maintainers": [ + "jaimergp", + "jezdez", + "wolfv" + ], + "skip-lints": [ + "avoid_noarch", + "missing_pip_check" + ] + }, + "home": "https://github.com/conda/conda-libmamba-solver", + "identifiers": [], + "keywords": [], + "license": "BSD-3-Clause", + "license_family": "BSD", + "license_file": "src/LICENSE", + "root_pkgs": [ + "anaconda-anon-usage 0.7.3 py312hfc23b7f_100", + "anaconda_powershell_prompt 1.1.0 haa95532_1", + "anaconda_prompt 1.1.0 haa95532_1", + "annotated-types 0.6.0 py312haa95532_0", + "archspec 0.2.5 pyhd3eb1b0_0", + "argcomplete 3.6.2 py312haa95532_0", + "attrs 24.3.0 py312haa95532_0", + "beautifulsoup4 4.13.5 py312haa95532_0", + "boltons 25.0.0 py312haa95532_0", + "boto3 1.37.10 py312haa95532_0", + "botocore 1.37.10 py312haa95532_0", + "brotlicffi 1.0.9.2 py312h5da7b33_1", + "bzip2 1.0.8 h2bbff1b_6", + "ca-certificates 2025.11.4 haa95532_0", + "certifi 2025.11.12 py312haa95532_0", + "cffi 2.0.0 py312h02ab6af_0", + "chardet 5.2.0 py312haa95532_0", + "charset-normalizer 3.3.2 pyhd3eb1b0_0", + "click 8.2.1 py312haa95532_0", + "colorama 0.4.6 py312haa95532_0", + "conda 25.11.0 py312haa95532_0", + "conda-anaconda-telemetry 0.3.0 pyhd3eb1b0_1", + "conda-anaconda-tos 0.2.2 py312haa95532_1", + "conda-build 25.9.0 py312hcfce1f1_0", + "conda-content-trust 0.2.0 py312haa95532_1", + "conda-index 0.6.1 py312haa95532_0", + "conda-libmamba-solver 25.4.0 pyhd3eb1b0_0", + "conda-package-handling 2.4.0 py312haa95532_0", + "conda-package-streaming 0.12.0 py312haa95532_0", + "cpp-expected 1.1.0 h214f63a_0", + "cryptography 46.0.2 py312h114bc41_0", + "distro 1.9.0 py312haa95532_0", + "evalidate 2.0.3 py312haa95532_0", + "expat 2.7.1 h8ddb27b_0", + "filelock 3.17.0 py312haa95532_0", + "fmt 11.2.0 h58b7f6e_0", + "frozendict 2.4.2 py312haa95532_0", + "git 2.51.0 haa95532_1", + "idna 3.7 py312haa95532_0", + "jinja2 3.1.6 py312haa95532_0", + "jmespath 1.0.1 py312haa95532_0", + "jsonpatch 1.33 py312haa95532_1", + "jsonpointer 3.0.0 py312haa95532_0", + "jsonschema 4.25.0 py312haa95532_0", + "jsonschema-specifications 2023.7.1 py312haa95532_0", + "libarchive 3.8.1 h815d515_0", + "libcurl 8.15.0 h2300eb9_0", + "libffi 3.4.4 hd77b12b_1", + "libiconv 1.16 h2bbff1b_3", + "liblief 0.12.3 hd77b12b_0", + "libmamba 2.3.2 h7d9f7df_0", + "libmambapy 2.3.2 py312h5078c03_0", + "libsodium 1.0.20 h83e8143_0", + "libsolv 0.7.30 h23a355e_2", + "libssh2 1.11.1 h2addb87_0", + "libxml2 2.13.8 h866ff63_0", + "libzlib 1.3.1 h02ab6af_0", + "lz4-c 1.9.4 h2bbff1b_1", + "m2-msys2-runtime 2.5.0.17080.65c939c 3", + "m2-patch 2.7.5 2", + "markdown-it-py 4.0.0 py312haa95532_0", + "markupsafe 3.0.2 py312h827c3e9_0", + "mdurl 0.1.2 py312haa95532_0", + "menuinst 2.3.1 py312h5da7b33_0", + "msgpack-python 1.1.1 py312h5da7b33_0", + "msys2-conda-epoch 20160418 1", + "nlohmann_json 3.11.2 h6c2663c_0", + "openssl 3.0.18 h543e019_0", + "packaging 25.0 py312haa95532_0", + "pcre2 10.46 h5740b90_0", + "pip 25.2 pyhc872135_1", + "pkginfo 1.12.0 py312haa95532_0", + "platformdirs 4.3.7 py312haa95532_0", + "pluggy 1.5.0 py312haa95532_0", + "psutil 7.0.0 py312h02ab6af_0", + "py-lief 0.12.3 py312hd77b12b_0", + "pybind11-abi 5 hd3eb1b0_0", + "pycosat 0.6.6 py312h827c3e9_2", + "pycparser 2.23 py312haa95532_0", + "pydantic 2.11.9 py312haa95532_0", + "pydantic-core 2.33.2 py312h215eeae_0", + "pygments 2.19.1 py312haa95532_0", + "pynacl 1.6.0 py312h581ae37_0", + "pysocks 1.7.1 py312haa95532_0", + "python 3.12.12 h716150d_0", + "python-dateutil 2.9.0post0 py312haa95532_2", + "python-libarchive-c 5.1 pyhd3eb1b0_0", + "pytz 2025.2 py312haa95532_0", + "pyyaml 6.0.2 py312h827c3e9_0", + "referencing 0.30.2 py312haa95532_0", + "reproc 14.2.4 hd77b12b_2", + "reproc-cpp 14.2.4 hd77b12b_2", + "requests 2.32.5 py312haa95532_0", + "rich 14.2.0 py312haa95532_0", + "rpds-py 0.22.3 py312h636fa0f_0", + "ruamel.yaml 0.18.10 py312h827c3e9_0", + "ruamel.yaml.clib 0.2.12 py312h827c3e9_0", + "s3transfer 0.11.2 py312haa95532_0", + "setuptools 80.9.0 py312haa95532_0", + "simdjson 3.10.1 h214f63a_0", + "six 1.17.0 py312haa95532_0", + "soupsieve 2.5 py312haa95532_0", + "sqlite 3.50.2 hda9a48d_1", + "tk 8.6.15 hf199647_0", + "tomlkit 0.13.2 py312haa95532_0", + "tqdm 4.67.1 py312hfc267ef_0", + "truststore 0.10.1 py312haa95532_0", + "typing-extensions 4.15.0 py312haa95532_0", + "typing-inspection 0.4.2 py312haa95532_0", + "typing_extensions 4.15.0 py312haa95532_0", + "tzdata 2025b h04d1e81_0", + "ucrt 10.0.22621.0 haa95532_0", + "urllib3 2.5.0 py312haa95532_0", + "vc 14.3 h2df5915_10", + "vc14_runtime 14.44.35208 h4927774_10", + "vs2015_runtime 14.44.35208 ha6b5a95_10", + "wheel 0.45.1 py312haa95532_0", + "win_inet_pton 1.1.0 py312haa95532_0", + "xmltodict 0.14.2 py312haa95532_0", + "xz 5.6.4 h4754444_1", + "yaml 0.2.5 he774522_0", + "yaml-cpp 0.8.0 hd77b12b_1", + "yq 3.4.3 py312haa95532_0", + "zlib 1.3.1 h02ab6af_0", + "zstandard 0.24.0 py312he335c29_0", + "zstd 1.5.7 h56299aa_0" + ], + "summary": "The fast mamba solver, now in conda!", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/files b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/files new file mode 100644 index 0000000000000000000000000000000000000000..42d89e36398c2dd0118218217745681a81289481 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/files @@ -0,0 +1,23 @@ +site-packages/conda_libmamba_solver-25.11.0.dist-info/INSTALLER +site-packages/conda_libmamba_solver-25.11.0.dist-info/METADATA +site-packages/conda_libmamba_solver-25.11.0.dist-info/RECORD +site-packages/conda_libmamba_solver-25.11.0.dist-info/REQUESTED +site-packages/conda_libmamba_solver-25.11.0.dist-info/WHEEL +site-packages/conda_libmamba_solver-25.11.0.dist-info/direct_url.json +site-packages/conda_libmamba_solver-25.11.0.dist-info/entry_points.txt +site-packages/conda_libmamba_solver-25.11.0.dist-info/licenses/AUTHORS.md +site-packages/conda_libmamba_solver-25.11.0.dist-info/licenses/LICENSE +site-packages/conda_libmamba_solver/__init__.py +site-packages/conda_libmamba_solver/conda_build_exceptions.py +site-packages/conda_libmamba_solver/exceptions.py +site-packages/conda_libmamba_solver/index.py +site-packages/conda_libmamba_solver/mamba_utils.py +site-packages/conda_libmamba_solver/plugin.py +site-packages/conda_libmamba_solver/repoquery.py +site-packages/conda_libmamba_solver/shards.py +site-packages/conda_libmamba_solver/shards_cache.py +site-packages/conda_libmamba_solver/shards_subset.py +site-packages/conda_libmamba_solver/shards_typing.py +site-packages/conda_libmamba_solver/solver.py +site-packages/conda_libmamba_solver/state.py +site-packages/conda_libmamba_solver/utils.py diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/git b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/hash_input.json b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..1604815713cd9856bea046c75d100b7ac9137da1 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/hash_input.json @@ -0,0 +1,4 @@ +{ + "libmamba": "2.3", + "channel_targets": "defaults" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/index.json b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..9da0e2803c3bed7c64605b9b886433affd2e2227 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/index.json @@ -0,0 +1,22 @@ +{ + "arch": null, + "build": "pyhdf14ebd_0", + "build_number": 0, + "depends": [ + "boltons >=23.0.0", + "conda >=25.9", + "libmambapy >=2", + "msgpack-python >=1.1.1", + "python >=3.10", + "requests >=2.28.0,<3.0.0", + "zstandard >=0.15" + ], + "license": "BSD-3-Clause", + "license_family": "BSD", + "name": "conda-libmamba-solver", + "noarch": "python", + "platform": null, + "subdir": "noarch", + "timestamp": 1764245653398, + "version": "25.11.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/licenses/src/LICENSE b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/licenses/src/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..70fdcd18028fa237ed54c358cf64750ec9bae45e --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/licenses/src/LICENSE @@ -0,0 +1,32 @@ +BSD 3-Clause License + +Copyright (c) 2022, Anaconda, Inc. +Copyright (c) 2023, conda +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This work also includes code borrowed from mamba.utils v0.19, licensed as BSD 3-Clause diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/link.json b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/link.json new file mode 100644 index 0000000000000000000000000000000000000000..32bb6c422a257d7802fba7e2bdb9e80eebf31957 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/link.json @@ -0,0 +1,6 @@ +{ + "noarch": { + "type": "python" + }, + "package_metadata_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/paths.json b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..474be9e1052f90c220f738d626713e015892dd14 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/paths.json @@ -0,0 +1,143 @@ +{ + "paths": [ + { + "_path": "site-packages/conda_libmamba_solver-25.11.0.dist-info/INSTALLER", + "path_type": "hardlink", + "sha256": "d0edee15f91b406f3f99726e44eb990be6e34fd0345b52b910c568e0eef6a2a8", + "size_in_bytes": 5 + }, + { + "_path": "site-packages/conda_libmamba_solver-25.11.0.dist-info/METADATA", + "path_type": "hardlink", + "sha256": "a3fa018fc4562693825d87acd32ff11ef7746a1d48d3fc96a4ab52e76f7b710c", + "size_in_bytes": 5662 + }, + { + "_path": "site-packages/conda_libmamba_solver-25.11.0.dist-info/RECORD", + "path_type": "hardlink", + "sha256": "73b99a37ee9d86c5743b42734b9b332894ec8c2ac49fa2e2716a84e8ae257164", + "size_in_bytes": 3102 + }, + { + "_path": "site-packages/conda_libmamba_solver-25.11.0.dist-info/REQUESTED", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "site-packages/conda_libmamba_solver-25.11.0.dist-info/WHEEL", + "path_type": "hardlink", + "sha256": "aad0b0a12256807936d52d4a6f88a1773236ae527564a688bab4e3fe780e8724", + "size_in_bytes": 87 + }, + { + "_path": "site-packages/conda_libmamba_solver-25.11.0.dist-info/direct_url.json", + "path_type": "hardlink", + "sha256": "acd5a819b93b92c4c9d837c8663b1877e757c7c41495aa0c8afa50729d9854f5", + "size_in_bytes": 103 + }, + { + "_path": "site-packages/conda_libmamba_solver-25.11.0.dist-info/entry_points.txt", + "path_type": "hardlink", + "sha256": "24703165ad1fd520140a056ab8e75450e1aa49170ccb3deb9298972f53e5a1cf", + "size_in_bytes": 61 + }, + { + "_path": "site-packages/conda_libmamba_solver-25.11.0.dist-info/licenses/AUTHORS.md", + "path_type": "hardlink", + "sha256": "fcda2c2c271b0cdf4a4194905f24263fed2458a768c441eddcadce76872ecae1", + "size_in_bytes": 460 + }, + { + "_path": "site-packages/conda_libmamba_solver-25.11.0.dist-info/licenses/LICENSE", + "path_type": "hardlink", + "sha256": "b3973794ccbf1601c348aee5b4bfe0345c3bcd21dc0dc80a38441b99405febb0", + "size_in_bytes": 1663 + }, + { + "_path": "site-packages/conda_libmamba_solver/__init__.py", + "path_type": "hardlink", + "sha256": "12bd7767da49a50275a599daed60568d2daaf9958fe8c6d346f35bb6e13c195b", + "size_in_bytes": 564 + }, + { + "_path": "site-packages/conda_libmamba_solver/conda_build_exceptions.py", + "path_type": "hardlink", + "sha256": "b8f73b3ca9fd20df95e38c04a4a7991d9a688e21f6870b9029d07309f64710ad", + "size_in_bytes": 1396 + }, + { + "_path": "site-packages/conda_libmamba_solver/exceptions.py", + "path_type": "hardlink", + "sha256": "02a1129199a1bde44ac547d14e8f9048f11615bd4321e5fa5bcfb0619f6a86f3", + "size_in_bytes": 485 + }, + { + "_path": "site-packages/conda_libmamba_solver/index.py", + "path_type": "hardlink", + "sha256": "c537073bc96bdbd791af3fdedeab16941e2564e2eea037fc2c799a4534565cb4", + "size_in_bytes": 31625 + }, + { + "_path": "site-packages/conda_libmamba_solver/mamba_utils.py", + "path_type": "hardlink", + "sha256": "6962fe217a8fc7d6a46e493b8e039e2608e177360e059aa5b84cab47d2c9c421", + "size_in_bytes": 6879 + }, + { + "_path": "site-packages/conda_libmamba_solver/plugin.py", + "path_type": "hardlink", + "sha256": "fcfe8d5308a5eaf4c4b793e9d639bdaa42949aae2aa2ee6f78f05d7c6fc8d805", + "size_in_bytes": 1149 + }, + { + "_path": "site-packages/conda_libmamba_solver/repoquery.py", + "path_type": "hardlink", + "sha256": "d88af30c171f78ce86abbbcdd1f92624de5329630cf13befa5d1f57486e139ff", + "size_in_bytes": 7610 + }, + { + "_path": "site-packages/conda_libmamba_solver/shards.py", + "path_type": "hardlink", + "sha256": "44adc26b3d9ee36147b22f86a3c6fa794535a493253c4f47c1d4367d5039c5be", + "size_in_bytes": 24542 + }, + { + "_path": "site-packages/conda_libmamba_solver/shards_cache.py", + "path_type": "hardlink", + "sha256": "f8a47df24afc6adf3e940b7fc3572846631f4710862e8fbd044cfe4302631936", + "size_in_bytes": 5005 + }, + { + "_path": "site-packages/conda_libmamba_solver/shards_subset.py", + "path_type": "hardlink", + "sha256": "128ac8810003f9ff6b9a7125c18d7e0fdbc3ad7f1fcc88247823efa7e0ea3a89", + "size_in_bytes": 21890 + }, + { + "_path": "site-packages/conda_libmamba_solver/shards_typing.py", + "path_type": "hardlink", + "sha256": "c7178e4336fd9ea93480df1b272af46e133b237d26937455a72f357c18120035", + "size_in_bytes": 1574 + }, + { + "_path": "site-packages/conda_libmamba_solver/solver.py", + "path_type": "hardlink", + "sha256": "29293798dabe3dbcad65a092c2fae33b3d5ece379d026f8b1b4371647ffc9800", + "size_in_bytes": 48671 + }, + { + "_path": "site-packages/conda_libmamba_solver/state.py", + "path_type": "hardlink", + "sha256": "04f5adf0eef4e80ae5281b6e991b8624d90edd93452330378fe4dc5f63f39515", + "size_in_bytes": 33572 + }, + { + "_path": "site-packages/conda_libmamba_solver/utils.py", + "path_type": "hardlink", + "sha256": "428a2b69fa6eaad05b9f860f8668e9ac07a522ca7ed9222703ce33d10873b56d", + "size_in_bytes": 3833 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..e8aa23aaa896ad4b2feee0bbe2cffeffc5d9abd7 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/recipe/conda_build_config.yaml @@ -0,0 +1,30 @@ +c_compiler: vs2017 +channel_targets: defaults +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: vs2017 +extend_keys: +- ignore_build_only_deps +- extend_keys +- ignore_version +- pin_run_as_build +fortran_compiler: gfortran +ignore_build_only_deps: +- python +- numpy +libmamba: '2.3' +lua: '5' +numpy: '1.26' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +platform: win-64 +python: '3.12' +r_base: '3.4' +target_platform: win-64 +vc: '14' diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/recipe/meta.yaml b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5b98bfa01fe332f152a7c88591ef7e1b58bdfb99 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/recipe/meta.yaml @@ -0,0 +1,93 @@ +# This file created by conda-build 25.9.0 +# meta.yaml template originally from: +# C:\Users\task_176424547313736\conda-libmamba-solver-feedstock\recipe, last modified Thu Nov 27 12:13:07 2025 +# ------------------------------------------------ + +package: + name: conda-libmamba-solver + version: 25.11.0 +source: + url: https://github.com/conda/conda-libmamba-solver/archive/refs/tags/25.11.0.tar.gz + sha256: a187016471bc561405ea66266f26c0f81637f6e85b4d8663a6724717dc715f50 + folder: src/ +build: + number: '0' + noarch: python + script_env: + - SETUPTOOLS_SCM_PRETEND_VERSION=25.11.0 + script: C:\\miniconda3\\conda-bld\\conda-libmamba-solver_1764245615235\\_h_env\\python.exe + -m pip install src/ -vv --no-deps --no-build-isolation + string: pyhdf14ebd_0 +requirements: + host: + - bzip2 1.0.8 h2bbff1b_6 + - ca-certificates 2025.11.4 haa95532_0 + - expat 2.7.3 h9214b88_0 + - hatch-vcs 0.5.0 py314haa95532_0 + - hatchling 1.27.0 py314haa95532_1 + - libffi 3.4.4 hd77b12b_1 + - libmpdec 4.0.0 h827c3e9_0 + - libzlib 1.3.1 h02ab6af_0 + - lz4-c 1.9.4 h2bbff1b_1 + - openssl 3.0.18 h543e019_0 + - packaging 25.0 py314haa95532_1 + - pathspec 0.12.1 py314haa95532_1 + - pip 25.3 pyh0d26453_0 + - pluggy 1.5.0 py314haa95532_0 + - python 3.14.0 h3bc0a5a_101_cp314 + - python_abi 3.14 2_cp314 + - setuptools 80.9.0 py314haa95532_0 + - setuptools-scm 9.2.2 py314haa95532_0 + - sqlite 3.51.0 hda9a48d_0 + - tk 8.6.15 hf199647_0 + - trove-classifiers 2025.5.9.12 py314haa95532_0 + - tzdata 2025b h04d1e81_0 + - ucrt 10.0.22621.0 haa95532_0 + - vc 14.3 h2df5915_10 + - vc14_runtime 14.44.35208 h4927774_10 + - vs2015_runtime 14.44.35208 ha6b5a95_10 + - xz 5.6.4 h4754444_1 + - zlib 1.3.1 h02ab6af_0 + - zstd 1.5.7 h56299aa_0 + run: + - boltons >=23.0.0 + - conda >=25.9 + - libmambapy >=2 + - msgpack-python >=1.1.1 + - python >=3.10 + - requests >=2.28.0,<3.0.0 + - zstandard >=0.15 +test: + imports: + - conda_libmamba_solver + commands: + - python -c "from importlib.metadata import version; assert(version('conda-libmamba-solver')=='25.11.0')" + - conda create --solver libmamba -n test --dry-run scipy +about: + home: https://github.com/conda/conda-libmamba-solver + license: BSD-3-Clause + license_family: BSD + license_file: src/LICENSE + summary: The fast mamba solver, now in conda! + description: 'The conda-libmamba-solver is a new solver for the conda package manager + + which uses the solver from the mamba project behind the scenes, + + while carefully implementing conda''s functionality and expected behaviors on + top. + + The library used by mamba to do the heavy-lifting is called libsolv. + + ' + dev_url: https://github.com/conda/conda-libmamba-solver + doc_url: https://conda.github.io/conda-libmamba-solver/ +extra: + recipe-maintainers: + - jaimergp + - jezdez + - wolfv + skip-lints: + - avoid_noarch + - missing_pip_check + final: true + copy_test_source_files: true diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/recipe/meta.yaml.template b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/recipe/meta.yaml.template new file mode 100644 index 0000000000000000000000000000000000000000..e461d9cbb9f4359653163b48cb4741b20491f8e3 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/recipe/meta.yaml.template @@ -0,0 +1,67 @@ +{% set name = "conda-libmamba-solver" %} +{% set version = "25.11.0" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + url: https://github.com/conda/{{ name }}/archive/refs/tags/{{ version }}.tar.gz + sha256: a187016471bc561405ea66266f26c0f81637f6e85b4d8663a6724717dc715f50 + folder: src/ + +build: + number: 0 + # build as noarch to avoid circular dependency issues in conda when + # adding support for new Python versions + noarch: python + script_env: + - SETUPTOOLS_SCM_PRETEND_VERSION={{version}} + script: {{ PYTHON }} -m pip install src/ -vv --no-deps --no-build-isolation + +requirements: + host: + - python >=3.10 + - pip + - hatchling + - hatch-vcs + run: + - python >=3.10 + - conda >=25.9 + # present in the conda-libmamba-solver recipe file at recipe/meta.yaml but dropped in pyproject.toml because libmambapy is not available on PyPI. + - libmambapy >=2 + - boltons >=23.0.0 + - msgpack-python >=1.1.1 + - requests >=2.28.0,<3.0.0 + - zstandard >=0.15 + +test: + imports: + - conda_libmamba_solver + commands: + - python -c "from importlib.metadata import version; assert(version('{{ name }}')=='{{ version }}')" + - CONDA_SOLVER=libmamba conda create -n test --dry-run scipy # [not win] Not cross-platform. + - conda create --solver libmamba -n test --dry-run scipy + +about: + home: https://github.com/conda/conda-libmamba-solver + license: BSD-3-Clause + license_family: BSD + license_file: src/LICENSE + summary: The fast mamba solver, now in conda! + description: | + The conda-libmamba-solver is a new solver for the conda package manager + which uses the solver from the mamba project behind the scenes, + while carefully implementing conda's functionality and expected behaviors on top. + The library used by mamba to do the heavy-lifting is called libsolv. + dev_url: https://github.com/conda/conda-libmamba-solver + doc_url: https://conda.github.io/conda-libmamba-solver/ + +extra: + recipe-maintainers: + - jaimergp + - jezdez + - wolfv + skip-lints: + - avoid_noarch + - missing_pip_check \ No newline at end of file diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/repodata_record.json b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..43cdce89e183567d0a0f2db0074b3a7846411ec4 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/repodata_record.json @@ -0,0 +1,28 @@ +{ + "build": "pyhdf14ebd_0", + "build_number": 0, + "channel": "https://repo.anaconda.com/pkgs/main/noarch/", + "constrains": [], + "depends": [ + "boltons >=23.0.0", + "conda >=25.9", + "libmambapy >=2", + "msgpack-python >=1.1.1", + "python >=3.10", + "requests >=2.28.0,<3.0.0", + "zstandard >=0.15" + ], + "fn": "conda-libmamba-solver-25.11.0-pyhdf14ebd_0.conda", + "license": "BSD-3-Clause", + "license_family": "BSD", + "md5": "55ec979db3871d534aab09d7a06f71e6", + "name": "conda-libmamba-solver", + "noarch": "python", + "package_type": "noarch_python", + "sha256": "1c44d897ecf2cf2324d972d699e3a1f32e5df57dd15ebdb3e9d028e7e99fb0b7", + "size": 55219, + "subdir": "noarch", + "timestamp": 1764245653000, + "url": "https://repo.anaconda.com/pkgs/main/noarch/conda-libmamba-solver-25.11.0-pyhdf14ebd_0.conda", + "version": "25.11.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/test/run_test.bat b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/test/run_test.bat new file mode 100644 index 0000000000000000000000000000000000000000..e1a694322cbb69a7a6f3d902ae73bc4e08a2d9a7 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/test/run_test.bat @@ -0,0 +1,9 @@ + + + + +python -c "from importlib.metadata import version; assert(version('conda-libmamba-solver')=='25.11.0')" +IF %ERRORLEVEL% NEQ 0 exit /B 1 +conda create --solver libmamba -n test --dry-run scipy +IF %ERRORLEVEL% NEQ 0 exit /B 1 +exit /B 0 diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/test/run_test.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/test/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..33898deee51d798b7e239bde0a6794e18ceea328 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/test/run_test.py @@ -0,0 +1,3 @@ +print("import: 'conda_libmamba_solver'") +import conda_libmamba_solver + diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/test/run_test.sh b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..aebe15c73ee048c7351912e7d8311062bc2ecfe2 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/info/test/run_test.sh @@ -0,0 +1,9 @@ + + +set -ex + + + +python -c "from importlib.metadata import version; assert(version('conda-libmamba-solver')=='25.11.0')" +conda create --solver libmamba -n test --dry-run scipy +exit 0 diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/INSTALLER b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/METADATA b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..658a7637871919fad01ae60e30c42bc9cc4fa2ab --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/METADATA @@ -0,0 +1,85 @@ +Metadata-Version: 2.4 +Name: conda-libmamba-solver +Version: 25.11.0 +Summary: The fast mamba solver, now in conda +Project-URL: homepage, https://github.com/conda/conda-libmamba-solver +Author-email: "Anaconda, Inc." +License: BSD 3-Clause License + + Copyright (c) 2022, Anaconda, Inc. + Copyright (c) 2023, conda + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + --- + + This work also includes code borrowed from mamba.utils v0.19, licensed as BSD 3-Clause +License-File: AUTHORS.md +License-File: LICENSE +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3 :: Only +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: 3.12 +Classifier: Programming Language :: Python :: 3.13 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Requires-Python: >=3.10 +Requires-Dist: boltons>=23.0.0 +Requires-Dist: conda>=25.9 +Requires-Dist: msgpack>=1.1.1 +Requires-Dist: requests<3,>=2.28.0 +Requires-Dist: zstandard>=0.15 +Description-Content-Type: text/markdown + +# conda-libmamba-solver + +The fast mamba solver, now in conda! + +## What is this exactly? + +conda-libmamba-solver is a new solver for the +[conda package manager](https://docs.conda.io/) which uses the solver from the +[mamba project](https://mamba.readthedocs.io/) behind the scenes, while +carefully implementing conda's functionality and expected behaviors on top. +The library used by mamba to do the heavy-lifting is called [libsolv](https://github.com/openSUSE/libsolv). + +Additional information about the project can be found in the blog post on Anaconda's weblog: +[A Faster Solver for Conda: Libmamba](https://www.anaconda.com/blog/a-faster-conda-for-a-growing-community). + +## Documentation + +Check the [documentation](https://conda.github.io/conda-libmamba-solver/) for +instructions on how to install, use and make the most out the new conda solver! + + +## Build status + +| [![Build status](https://github.com/conda/conda-libmamba-solver/actions/workflows/tests.yml/badge.svg)](https://github.com/conda/conda-libmamba-solver/actions/workflows/tests.yml?query=branch%3Amain) [![Docs status](https://github.com/conda/conda-libmamba-solver/actions/workflows/docs.yml/badge.svg)](https://github.com/conda/conda-libmamba-solver/actions/workflows/docs.yml?query=branch%3Amain) [![codecov](https://codecov.io/gh/conda/conda-libmamba-solver/branch/main/graph/badge.svg)](https://codecov.io/gh/conda/conda-libmamba-solver) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/conda/conda-libmamba-solver/main.svg)](https://results.pre-commit.ci/latest/github/conda/conda-libmamba-solver/main) [![CalVer version used YY.MM.MICRO](https://img.shields.io/badge/calver-YY.MM.MICRO-22bfda.svg?style=flat-square)](https://calver.org) | [![Anaconda-Server Badge](https://anaconda.org/conda-canary/conda-libmamba-solver/badges/latest_release_date.svg)](https://anaconda.org/conda-canary/conda-libmamba-solver) | +| --- | :-: | +| [`conda install defaults::conda-libmamba-solver`](https://anaconda.org/anaconda/conda-libmamba-solver) | [![Anaconda-Server Badge](https://anaconda.org/anaconda/conda-libmamba-solver/badges/version.svg)](https://anaconda.org/anaconda/conda-libmamba-solver) | +| [`conda install conda-forge::conda-libmamba-solver`](https://anaconda.org/conda-forge/conda-libmamba-solver) | [![Anaconda-Server Badge](https://anaconda.org/conda-forge/conda-libmamba-solver/badges/version.svg)](https://anaconda.org/conda-forge/conda-libmamba-solver) | +| [`conda install conda-canary/label/dev::conda-libmamba-solver`](https://anaconda.org/conda-canary/conda-libmamba-solver) | [![Anaconda-Server Badge](https://anaconda.org/conda-canary/conda-libmamba-solver/badges/version.svg)](https://anaconda.org/conda-canary/conda-libmamba-solver) | diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/RECORD b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..e3c3f9d776e094e2d73e75d07a67c378c33804bc --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/RECORD @@ -0,0 +1,37 @@ +conda_libmamba_solver-25.11.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +conda_libmamba_solver-25.11.0.dist-info/METADATA,sha256=o_oBj8RWJpOCXYes0y_xHvd0ah1I0_yWpKtS5297cQw,5662 +conda_libmamba_solver-25.11.0.dist-info/RECORD,, +conda_libmamba_solver-25.11.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +conda_libmamba_solver-25.11.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87 +conda_libmamba_solver-25.11.0.dist-info/direct_url.json,sha256=rNWoGbk7ksTJ2DfIZjsYd-dXx8QUlaoMivpQcp2YVPU,103 +conda_libmamba_solver-25.11.0.dist-info/entry_points.txt,sha256=JHAxZa0f1SAUCgVquOdUUOGqSRcMyz3rkpiXL1Ploc8,61 +conda_libmamba_solver-25.11.0.dist-info/licenses/AUTHORS.md,sha256=_NosLCcbDN9KQZSQXyQmP-0kWKdoxEHt3K3OdocuyuE,460 +conda_libmamba_solver-25.11.0.dist-info/licenses/LICENSE,sha256=s5c3lMy_FgHDSK7ltL_gNFw7zSHcDcgKOEQbmUBf67A,1663 +conda_libmamba_solver/__init__.py,sha256=Er13Z9pJpQJ1pZna7WBWjS2q-ZWP6MbTRvNbtuE8GVs,564 +conda_libmamba_solver/__pycache__/__init__.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/conda_build_exceptions.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/exceptions.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/index.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/mamba_utils.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/plugin.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/repoquery.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/shards.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/shards_cache.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/shards_subset.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/shards_typing.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/solver.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/state.cpython-314.pyc,, +conda_libmamba_solver/__pycache__/utils.cpython-314.pyc,, +conda_libmamba_solver/conda_build_exceptions.py,sha256=uPc7PKn9IN-V44wEpKeZHZpojiH2hwuQKdBzCfZHEK0,1396 +conda_libmamba_solver/exceptions.py,sha256=AqESkZmhveRKxUfRTo-QSPEWFb1DIeX6W8-wYZ9qhvM,485 +conda_libmamba_solver/index.py,sha256=xTcHO8lr29eRrz_e3qsWlB4lZOLuoDf8LHmaRTRWXLQ,31625 +conda_libmamba_solver/mamba_utils.py,sha256=aWL-IXqPx9akbkk7jgOeJgjhdzYOBZqluEyrR9LJxCE,6879 +conda_libmamba_solver/plugin.py,sha256=_P6NUwil6vTEt5Pp1jm9qkKUmq4qou5vePBdfG_I2AU,1149 +conda_libmamba_solver/repoquery.py,sha256=2IrzDBcfeM6Gq7vN0fkmJN5TKWMM8TvvpdH1dIbhOf8,7610 +conda_libmamba_solver/shards.py,sha256=RK3Caz2e42FHsi-Go8b6eUU1pJMlPE9HwdQ2fVA5xb4,24542 +conda_libmamba_solver/shards_cache.py,sha256=-KR98kr8at8-lAt_w1coRmMfRxCGLo-9BEz-QwJjGTY,5005 +conda_libmamba_solver/shards_subset.py,sha256=EorIgQAD-f9rmnElwY1-D9vDrX8fzIgkeCPvp-DqOok,21890 +conda_libmamba_solver/shards_typing.py,sha256=xxeOQzb9nqk0gN8bJyr0bhM7I30mk3RVpy81fBgSADU,1574 +conda_libmamba_solver/solver.py,sha256=KSk3mNq-PbytZaCSwvrjOz1ezjedAm-LG0NxZH_8mAA,48671 +conda_libmamba_solver/state.py,sha256=BPWt8O706ArlKBtumRuGJNkO3ZNFIzA3j-TcX2PzlRU,33572 +conda_libmamba_solver/utils.py,sha256=QoorafpuqtBbn4YPhmjprAelIsp-2SInA84z0QhztW0,3833 diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/REQUESTED b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/WHEEL b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..12228d414b6cfed7c39d3781c85c63256a1d7fb5 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: hatchling 1.27.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/direct_url.json b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..4d30df6a4bee0031fb0524608eb58f4cf9c67a4d --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///C:/miniconda3/conda-bld/conda-libmamba-solver_1764245615235/work/src"} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/entry_points.txt b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..4423474395b8f751cbe687c9fe1d6a598a7ca838 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/entry_points.txt @@ -0,0 +1,2 @@ +[conda] +conda-libmamba-solver = conda_libmamba_solver.plugin diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/licenses/AUTHORS.md b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/licenses/AUTHORS.md new file mode 100644 index 0000000000000000000000000000000000000000..1ccc2c01627b7c6a4c98d0d48236ae019d6e3bd9 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/licenses/AUTHORS.md @@ -0,0 +1,22 @@ +All of the people who have made at least one contribution to conda-libmamba-solver. +Authors are sorted alphabetically. + +* Agriya Khetarpal +* Albert DeFusco +* Christopher Ostrouchov +* Daniel Holth +* Jaime Rodríguez-Guerra +* Jannis Leidel +* John Kirkham +* Jonathan J. Helmus +* Julien Jerphanion +* Ken Odegard +* Kevin Markham +* Klaus Zimmermann +* Matthew R. Becker +* Stacy Noland +* Thomas Lam +* Travis Hathaway +* conda-bot +* dependabot[bot] +* pre-commit-ci[bot] diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/licenses/LICENSE b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..70fdcd18028fa237ed54c358cf64750ec9bae45e --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver-25.11.0.dist-info/licenses/LICENSE @@ -0,0 +1,32 @@ +BSD 3-Clause License + +Copyright (c) 2022, Anaconda, Inc. +Copyright (c) 2023, conda +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +This work also includes code borrowed from mamba.utils v0.19, licensed as BSD 3-Clause diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/__init__.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..d02862b91df94a84d4d535adbc2b280ba4f20f40 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/__init__.py @@ -0,0 +1,21 @@ +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +try: + from ._version import version as __version__ +except ImportError: + try: + from importlib.metadata import version + + __version__ = version("conda_libmamba_solver") + del version + except ImportError: + __version__ = "0.0.0.unknown" + + +def get_solver_class(key: str = "libmamba"): + if key == "libmamba": + from .solver import LibMambaSolver + + return LibMambaSolver + raise ValueError("Key must be 'libmamba'") diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/conda_build_exceptions.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/conda_build_exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..da68fe937adfd5eacaf1e02d74337694ff85c671 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/conda_build_exceptions.py @@ -0,0 +1,46 @@ +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +""" +This exception is only used in conda-build, so we can't import it directly. +conda_build is not a dependency, but we only import this when conda-build is calling the +solver, so it's fine to import it here. +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from collections.abc import Iterable + + from conda.models.match_spec import MatchSpec + +from conda_build.exceptions import DependencyNeedsBuildingError + + +class ExplainedDependencyNeedsBuildingError(DependencyNeedsBuildingError): + """ + We need to subclass this to add the explanation to the error message. + We also add a couple of attributes to make it easier to set up. + """ + + def __init__( + self, + matchspecs: Iterable[MatchSpec] | None = None, + explanation: str | None = None, + *args, + **kwargs, + ): + super().__init__(*args, **kwargs) + self.matchspecs = self.matchspecs or matchspecs or [] + self.explanation = explanation + + def __str__(self) -> str: + msg = self.message + if not self.explanation: + # print simple message in log.warning() calls + return msg + return "\n".join([msg, self.explanation]) diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/exceptions.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..ab72895e345f09b9d09576bd0af68d82079e8c5d --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/exceptions.py @@ -0,0 +1,17 @@ +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +""" +Exceptions used in conda-libmamba-solver +""" + +from conda.exceptions import UnsatisfiableError + + +class LibMambaUnsatisfiableError(UnsatisfiableError): + """An exception to report unsatisfiable dependencies. + The error message is passed directly as a str. + """ + + def __init__(self, message: str, **kwargs): + super(UnsatisfiableError, self).__init__(str(message)) diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/index.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/index.py new file mode 100644 index 0000000000000000000000000000000000000000..fffdc42ce791eb84ac1233dff9a86759679a863d --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/index.py @@ -0,0 +1,780 @@ +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +""" +This module provides a convenient interface between `libmamba.Solver` +and conda's `PrefixData`. In other words, it allows to expose channels +loaded in `conda` to the `libmamba` machinery without using the +`libmamba` networking stack. + +Internally, the `libmamba`'s index is made of: + +- A 'Pool' object, exposed to libsolv. +- The pool is made of `Repo` objects. +- Each repo corresponds to a repodata.json file. +- Each repodata comes from a channel+subdir combination. + +Some notes about channels +------------------------- + +In a way, conda channels are an abstraction over a collection of +channel subdirs. For example, when the user wants 'conda-forge', it +actually means 'repodata.json' files from the configured platform subdir +and 'noarch'. Some channels are actually 'MultiChannel', which provide +a collection of channels. The most common example is 'defaults', which +includes 'main', 'r' and 'msys2'. + +So, for conda-forge on Linux amd64 we get: + +- https://conda.anaconda.org/conda-forge/linux-64 +- https://conda.anaconda.org/conda-forge/noarch + +For defaults on macOS with Apple Silicon (M1 and friends): + +- https://repo.anaconda.org/main/osx-arm64 +- https://repo.anaconda.org/main/noarch +- https://repo.anaconda.org/r/osx-arm64 +- https://repo.anaconda.org/r/noarch +- https://repo.anaconda.org/msys2/osx-arm64 +- https://repo.anaconda.org/msys2/noarch + +However, users will just say 'defaults' or 'conda-forge', for convenience. +This means that we need to deal with several formats of channel information, +which ultimately lead to a collection of subdir-specific URLs: + +- Channel names from the CLI or configuration files / env-vars +- Channel URLs if names are not available (channel not served in anaconda.org) +- conda.models.channel.Channel objects + +Their origins can be: + +- Specified by the user on the command-line (-c arguments) +- Specified by the configuration files (.condarc) or environment vars (context object) +- Added from channel-specific MatchSpec (e.g. `conda-forge::python`) +- Added from installed packages in target environment (e.g. a package that was installed + from a non-default channel remembers where it comes from) + +Also note that a channel URL might have authentication in the form: + +- https://user:password@server.com/channel +- https://server.com/t/your_token_goes_here/channel + +Finally, a channel can be mounted in a local directory and referred to via +a regular path, or a file:// URL, with or without normalization on Windows. + +The approach +------------ +We pass the subdir-specific, authenticated URLs to conda's 'SubdirData.repo_patch', +which download the JSON files but do not process them to PackageRecords. +Once the cache has been populated, we can instantiate 'libmamba.Repo' objects directly. +We maintain a map of subdir-specific URLs to `conda.model.channel.Channel` +and `libmamba.Repo` objects. +""" + +from __future__ import annotations + +import logging +import os +from dataclasses import dataclass +from functools import partial +from pathlib import Path +from typing import TYPE_CHECKING + +from conda.base.constants import KNOWN_SUBDIRS, REPODATA_FN, ChannelPriority +from conda.base.context import context +from conda.common.compat import on_win +from conda.common.io import DummyExecutor, ThreadLimitedThreadPoolExecutor, time_recorder +from conda.common.url import path_to_url, remove_auth, split_anaconda_token +from conda.core.package_cache_data import PackageCacheData +from conda.core.subdir_data import SubdirData +from conda.models.channel import Channel +from conda.models.match_spec import MatchSpec +from conda.models.records import PackageRecord +from libmambapy import MambaNativeException, Query +from libmambapy.solver.libsolv import ( + Database, + PackageTypes, + PipAsPythonDependency, + Priorities, + RepodataOrigin, +) +from libmambapy.specs import ( + Channel as LibmambaChannel, +) +from libmambapy.specs import ( + ChannelResolveParams, + CondaURL, + NoArchType, + PackageInfo, +) + +from conda_libmamba_solver.shards_subset import build_repodata_subset + +from .mamba_utils import logger_callback + +if TYPE_CHECKING: + from collections.abc import Callable, Iterable + from typing import Any, Literal + + from conda.common.path import PathsType + from conda.gateways.repodata import RepodataState + from libmambapy import QueryResult + from libmambapy.solver.libsolv import RepoInfo + + from conda_libmamba_solver.shards import ShardBase + + from .shards_typing import PackageRecordDict + from .state import SolverInputState + + +log = logging.getLogger(f"conda.{__name__}") + + +@dataclass +class _ChannelRepoInfo: + "A dataclass mapping conda Channels, libmamba Repos and URLs" + + channel: Channel | None + repo: RepoInfo + url_w_cred: str + url_no_cred: str + + @property + def canonical_name(self) -> str: + if self.channel: + return self.channel.canonical_name + url_parts = self.url_no_cred.split("/") + if url_parts[-1] in KNOWN_SUBDIRS: + return url_parts[-2] + return url_parts[-1] + + +def _is_sharded_repodata_enabled(): + """ + Flag to see whether we should check for sharded repodata. + """ + return context.plugins.use_sharded_repodata is True # type: ignore + + +_SUPPORTS_PYTHON_SITE_PACKAGES = hasattr(PackageInfo, "python_site_packages_path") + + +def _package_info_from_package_dict( + record: PackageRecordDict, filename: str, url: str, channel_id: str +) -> PackageInfo: + """ + Build libmamba PackageInfo from an unprocessed repodata "packages", "packages.conda" entry. + """ + if (noarch := record.get("noarch")) in ("python", "generic"): + noarch = NoArchType(noarch.title()) + else: + noarch = NoArchType("No") + # include the python_site_packages_path attribute if libmambapy includes support + if _SUPPORTS_PYTHON_SITE_PACKAGES: + extra = { + "python_site_packages_path": record.get("python_site_packages_path") or "", + } + else: + extra = {} + + # the dict has not been "enriched" with channel, subdir, url, filename + + # channel examples + # 'https://repo.anaconda.com/pkgs/main' + # Channel("pkgs/main"), Channel('@') + + # package_url examples, full URL to package or "" for a virtual package, + # possibly a local package + + # filename, the key from repodata + + return PackageInfo( + name=record["name"], + version=record["version"], + build_string=record.get("build", ""), + build_number=record.get("build_number", 0), + channel=channel_id, + package_url=url, + platform=record.get("subdir") or "", + filename=filename, + license=record.get("license") or "", # does the solver use this? + md5=record.get("md5") or "", + sha256=record.get("sha256") or "", + signatures=record.get("signatures") or "", + # conda can have list or tuple, but libmamba only accepts lists + track_features=list(record.get("track_features") or []), + depends=list(record.get("depends") or []), + constrains=list(record.get("constrains") or []), + defaulted_keys=list(record.get("defaulted_keys") or []), + noarch=noarch, + size=record.get("size") or 0, + timestamp=int( + (record.get("timestamp") or 0) * 1000 + ), # XXX packages may have either seconds or milliseconds timestamps, see convert-if-out-of-range code in conda + **extra, + ) + + +class LibMambaIndexHelper: + """ + Interface between conda and libmamba for the purpose of building the "index". + The index is the collection of package records that can be part of a solution. + It is built by collecting all the repodata.json files from channels and their + subdirs. For existing environments, the installed packages are also added to + the index (this helps with simplifying solutions and outputs). The local cache + can also be added as a "channel", which is useful in offline mode or with no + channels configured. + """ + + def __init__( + self, + channels: Iterable[Channel], + subdirs: Iterable[str] = (), + repodata_fn: str = REPODATA_FN, + installed_records: Iterable[PackageRecord] = (), + pkgs_dirs: PathsType = (), + in_state: SolverInputState | None = None, + ): + platform_less_channels = [] + for channel in channels: + if channel.platform: + # When .platform is defined, .urls() will ignore subdirs kw. Remove! + log.info( + "Platform-aware channels are not supported. " + "Ignoring platform %s from channel %s. " + "Use subdirs keyword if necessary.", + channel.platform, + channel, + ) + channel = Channel(**{k: v for k, v in channel.dump().items() if k != "platform"}) + platform_less_channels.append(channel) + self.channels = platform_less_channels + self.subdirs = subdirs or context.subdirs + self.repodata_fn = repodata_fn + self.in_state = in_state + self.db = self._init_db() + + self.repos: list[_ChannelRepoInfo] = self._load_channels() + if pkgs_dirs: + self.repos.extend(self._load_pkgs_cache(pkgs_dirs)) + if installed_records: + self.repos.append(self._load_installed(installed_records)) + self._set_repo_priorities() + + # These are to support lazy self.repos, but it's not currently lazy. + self._pkgs_dirs = pkgs_dirs + self._installed_records = installed_records + + @classmethod + def from_platform_aware_channel(cls, channel: Channel) -> LibMambaIndexHelper: + if not channel.platform: + raise ValueError(f"Channel {channel} must define 'platform' attribute.") + subdir = channel.platform + channel = Channel(**{k: v for k, v in channel.dump().items() if k != "platform"}) + return cls(channels=(channel,), subdirs=(subdir,)) + + def n_packages( + self, + repos: Iterable[RepoInfo] | None = None, + filter_: Callable | None = None, + ) -> int: + repos = repos or [repo_info.repo for repo_info in self.repos] + count = 0 + for repo in repos: + if filter_: + for pkg in self.db.packages_in_repo(repo): + if filter_(pkg): + count += 1 + else: + count += len(self.db.packages_in_repo(repo)) + return count + + def reload_channel(self, channel: Channel) -> None: + urls = {} + for url in channel.urls(with_credentials=False, subdirs=self.subdirs): + for repo_info in self.repos: + if repo_info.url_no_cred == url: + log.debug("Reloading repo %s", repo_info.url_no_cred) + urls[repo_info.url_w_cred] = channel + self.db.remove_repo(repo_info.repo) + for new_repo_info in self._load_channels(urls, try_solv=False): + for repo_info in self.repos: + if repo_info.url_no_cred == new_repo_info.url_no_cred: + repo_info.repo = new_repo_info.repo + self._set_repo_priorities() + + def _init_db(self) -> Database: + custom_channels = { + # Add custom channels as a workaround for this weird conda behavior + # See https://github.com/conda/conda/issues/13501 + **{c.name: c for c in self.channels if c.location != context.channel_alias.location}, + **context.custom_channels, + } + custom_channels = { + name: LibmambaChannel( + url=CondaURL.parse(channel.base_url.replace(" ", "%20")), + display_name=name, + platforms=set(self.subdirs), + ) + for (name, channel) in custom_channels.items() + if channel.base_url + } + custom_multichannels = { + channel_name: [ + custom_channels.get( + channel.name, + LibmambaChannel( + url=CondaURL.parse(channel.base_url.replace(" ", "%20")), + display_name=channel.name, + platforms=set(self.subdirs), + ), + ) + for channel in channels + if channel.base_url + ] + for channel_name, channels in context.custom_multichannels.items() + } + params = ChannelResolveParams( + platforms=set(self.subdirs), + channel_alias=CondaURL.parse(str(context.channel_alias)), + custom_channels=ChannelResolveParams.ChannelMap(custom_channels), + custom_multichannels=ChannelResolveParams.MultiChannelMap(custom_multichannels), + home_dir=str(Path.home()), + current_working_dir=os.getcwd(), + ) + db = Database(params) + db.set_logger(logger_callback) + return db + + def _load_channels( + self, + urls_to_channel: dict[str, Channel] | None = None, + try_solv: bool = True, + ) -> list[_ChannelRepoInfo]: + if urls_to_channel is None: + urls_to_channel = self._channel_urls() + + # conda.common.url.path_to_url does not %-encode spaces + encoded_urls_to_channel = {} + for url, channel in urls_to_channel.items(): + if url.startswith("file://"): + url = url.replace(" ", "%20") + encoded_urls_to_channel[url] = channel + urls_to_channel = encoded_urls_to_channel + + # Prefer sharded repodata loading if it's enabled + if self.in_state and _is_sharded_repodata_enabled(): + # TODO: It may be better to directly pass channel objects without URL encoding + return self._load_channel_repo_info_shards(urls_to_channel) + + # Fallback to repodata.json loading + return self._load_channel_repo_info_json(urls_to_channel, try_solv) + + def _load_channel_repo_info_shards( + self, urls_to_channel: dict[str, Channel] + ) -> list[_ChannelRepoInfo]: + """ + Load repository information from sharded repodata cache. + """ + # make a subset of possible dependencies + root_packages = (*self.in_state.installed.keys(), *self.in_state.requested) + channel_data = build_repodata_subset(root_packages, urls_to_channel) + channel_repo_infos = self._load_repo_info_from_repodata_dict(channel_data) + + return channel_repo_infos + + def _load_channel_repo_info_json( + self, urls_to_channel: dict[str, Channel], try_solv: bool + ) -> list[_ChannelRepoInfo]: + """ + Load repository information from repodata.json files. + """ + urls_to_json_path_and_state = self._fetch_repodata_jsons(tuple(urls_to_channel.keys())) + + channel_repo_infos = [] + for url_w_cred, (json_path, state) in urls_to_json_path_and_state.items(): + url_no_token, _ = split_anaconda_token(url_w_cred) + url_no_cred = remove_auth(url_no_token) + repo = self._load_repo_info_from_json_path( + json_path, + url_no_cred, + state, + try_solv=(try_solv and not self.in_state), + ) + channel_repo_infos.append( + _ChannelRepoInfo( + channel=urls_to_channel[url_w_cred], + repo=repo, + url_w_cred=url_w_cred, + url_no_cred=url_no_cred, + ) + ) + return channel_repo_infos + + def _channel_urls(self) -> dict[str, Channel]: + "Maps authenticated URLs to channel objects" + urls = {} + seen_noauth = set() + channels_with_subdirs = [] + for channel in self.channels: + for url in channel.urls(with_credentials=True, subdirs=self.subdirs): + channels_with_subdirs.append(Channel(url)) + for channel in channels_with_subdirs: + noauth_urls = [ + url + for url in channel.urls(with_credentials=False) + if url.endswith(tuple(self.subdirs)) + ] + if seen_noauth.issuperset(noauth_urls): + continue + auth_urls = [ + url.replace(" ", "%20") + for url in channel.urls(with_credentials=True) + if url.endswith(tuple(self.subdirs)) + ] + if noauth_urls != auth_urls: # authed channel always takes precedence + urls.update({url: channel for url in auth_urls}) + seen_noauth.update(noauth_urls) + continue + # at this point, we are handling an unauthed channel; in some edge cases, + # an auth'd variant of the same channel might already be present in `urls`. + # we only add them if we haven't seen them yet + for url in noauth_urls: + if url not in seen_noauth: + urls[url] = channel + seen_noauth.add(url) + return urls + + def _fetch_repodata_jsons(self, urls: Iterable[str]) -> dict[str, tuple[str, RepodataState]]: + Executor = ( + DummyExecutor + if context.debug or context.repodata_threads == 1 + else partial(ThreadLimitedThreadPoolExecutor, max_workers=context.repodata_threads) + ) + with Executor() as executor: + return { + url: (str(path), state) + for (url, path, state) in executor.map(self._fetch_one_repodata_json, urls) + } + + def _fetch_one_repodata_json(self, url: str) -> tuple[str, os.PathLike, RepodataState]: + channel = Channel.from_url(url) + if not channel.subdir: + raise ValueError("Channel URLs must specify a subdir!") + + if "PYTEST_CURRENT_TEST" in os.environ: + # Workaround some testing issues - TODO: REMOVE + # Fix conda.testing.helpers._patch_for_local_exports by removing last line + for key, cached in list(SubdirData._cache_.items()): + if not isinstance(key, tuple): + continue # should not happen, but avoid IndexError just in case + if key[:2] == (url, self.repodata_fn) and cached._mtime == float("inf"): + del SubdirData._cache_[key] + # /Workaround + + subdir_data = SubdirData(channel, repodata_fn=self.repodata_fn) + if context.offline or context.use_index_cache: + # This might not exist (yet, anymore), but that's ok because we'll check + # for existence later and safely ignore if needed + json_path = subdir_data.cache_path_json + state = subdir_data.repo_cache.load_state() + else: + # TODO: This method loads reads the whole JSON file (does not parse) + json_path, state = subdir_data.repo_fetch.fetch_latest_path() + return url, json_path, state + + def _load_repo_info_from_json_path( + self, json_path: str, channel_url: str, state: RepodataState | None, try_solv: bool = True + ) -> RepoInfo | None: + if try_solv and on_win: + # .solv loading is so slow on Windows is not even worth it. Use JSON instead. + # https://github.com/mamba-org/mamba/pull/2753#issuecomment-1739122830 + log.debug("Overriding truthy 'try_solv' as False on Windows for performance reasons.") + try_solv = False + json_path = Path(json_path) + solv_path = json_path.with_suffix(".solv") + if state: + repodata_origin = RepodataOrigin(url=channel_url, etag=state.etag, mod=state.mod) + else: + repodata_origin = None + channel = Channel(channel_url) + channel_id = self._channel_to_id(channel) + if try_solv and repodata_origin: + try: + log.debug( + "Loading %s (%s) from SOLV repodata at %s", channel_id, channel_url, solv_path + ) + return self.db.add_repo_from_native_serialization( + path=str(solv_path), + expected=repodata_origin, + channel_id=channel_id, + add_pip_as_python_dependency=PipAsPythonDependency( + context.add_pip_as_python_dependency + ), + ) + except Exception as exc: + log.debug("Failed to load from SOLV. Trying JSON.", exc_info=exc) + try: + log.debug( + "Loading %s (%s) from JSON repodata at %s", channel_id, channel_url, json_path + ) + repo = self.db.add_repo_from_repodata_json( + path=str(json_path), + url=channel_url, + channel_id=channel_id, + add_pip_as_python_dependency=PipAsPythonDependency( + context.add_pip_as_python_dependency + ), + package_types=( + PackageTypes.TarBz2Only + if context.use_only_tar_bz2 + else PackageTypes.CondaOrElseTarBz2 + ), + ) + except MambaNativeException as exc: + if "does not exist" in str(exc) and context.offline: + # Ignore errors in offline mode. This is needed to pass + # tests/test_create.py::test_offline_with_empty_index_cache. + # In offline mode, with no repodata cache available, conda can still + # create a channel from the pkgs/ content. For that to work, we must + # not error out this early. If the package is still not found, the solver + # will complain that the package cannot be found. + log.warning("Could not load repodata for %s.", channel_id) + log.debug("Ignored MambaNativeException in offline mode: %s", exc, exc_info=exc) + return None + raise exc + if try_solv and repodata_origin: + try: + self.db.native_serialize_repo( + repo=repo, path=str(solv_path), metadata=repodata_origin + ) + except MambaNativeException as exc: + log.debug("Ignored SOLV writing error for %s", channel_id, exc_info=exc) + return repo + + def _channel_to_id(self, channel: Channel): + channel_id = channel.canonical_name + if channel_id in context.custom_multichannels: + # In multichannels, the canonical name of a "subchannel" is the multichannel name + # which makes it ambiguous for `channel::specs`. In those cases, take the channel + # regular name; e.g. for repo.anaconda.com/pkgs/main, do not take defaults, but + # pkgs/main instead. + channel_id = channel.name + return channel_id + + def _load_installed(self, records: Iterable[PackageRecord]) -> _ChannelRepoInfo: + packages = [self._package_info_from_package_record(record) for record in records] + repo = self.db.add_repo_from_packages( + packages=packages, + name="installed", + add_pip_as_python_dependency=PipAsPythonDependency.No, + ) + self.db.set_installed_repo(repo) + return _ChannelRepoInfo( + channel=None, repo=repo, url_w_cred="installed", url_no_cred="installed" + ) + + def _load_pkgs_cache(self, pkgs_dirs: PathsType) -> list[RepoInfo]: + repos = [] + for path in pkgs_dirs: + package_cache_data = PackageCacheData(path) + package_cache_data.load() + packages = [ + self._package_info_from_package_record(record) + for record in package_cache_data.values() + ] + repo = self.db.add_repo_from_packages(packages=packages, name=path) + # path_to_url does not %-encode spaces + path_as_url = path_to_url(path).replace(" ", "%20") + repos.append( + _ChannelRepoInfo( + channel=None, repo=repo, url_w_cred=path_as_url, url_no_cred=path_as_url + ) + ) + return repos + + @time_recorder(module_name=__name__) + def _load_repo_info_from_repodata_dict( + self, repodata_subset: dict[str, ShardBase] + ) -> list[_ChannelRepoInfo]: + """ + Load repository information from deserialized repodata.json-like + structures. + """ + repos = [] + for channel_url, shardlike in repodata_subset.items(): + repodata = shardlike.build_repodata() + # Don't like going back and forth between channel objects and URLs; + # build_repodata_subset() expands channels into per-subdir URLs as + # part of fetch: + channel_object = Channel(channel_url) + channel_id = self._channel_to_id(channel_object) + # must be appropriate for string concatenation: + base_url = shardlike.base_url + + packages = [] + for package_group in ("packages", "packages.conda"): + for filename, record in repodata.get(package_group, {}).items(): + package = _package_info_from_package_dict( + record, + filename, + url=f"{base_url}{filename}", + channel_id=channel_id, + ) + packages.append(package) + + repo = self.db.add_repo_from_packages(packages=packages, name=channel_url) + repos.append( + _ChannelRepoInfo( + channel=channel_object, + repo=repo, + url_w_cred=channel_url, + url_no_cred=channel_url, + ) + ) + + return repos + + def _package_info_from_package_record(self, record: PackageRecord) -> PackageInfo: + if record.get("noarch", None) and record.noarch.value in ("python", "generic"): + noarch = NoArchType(record.noarch.value.title()) + else: + noarch = NoArchType("No") + # include the python_site_packages_path attribute if libmambapy includes support + if _SUPPORTS_PYTHON_SITE_PACKAGES: + extra = { + "python_site_packages_path": record.get("python_site_packages_path") or "", + } + else: + extra = {} + + return PackageInfo( + name=record.name, + version=record.version, + build_string=record.build or "", + build_number=record.build_number or 0, + channel=str(record.channel), + package_url=record.get("url") or "", + platform=record.subdir, + filename=record.fn or f"{record.name}-{record.version}-{record.build or ''}", + license=record.get("license") or "", + md5=record.get("md5") or "", + sha256=record.get("sha256") or "", + signatures=record.get("signatures") or "", + # conda can have list or tuple, but libmamba only accepts lists + track_features=list(record.get("track_features") or []), + depends=list(record.get("depends") or []), + constrains=list(record.get("constrains") or []), + defaulted_keys=list(record.get("defaulted_keys") or []), + noarch=noarch, + size=record.get("size") or 0, + timestamp=int((record.get("timestamp") or 0) * 1000), + **extra, + ) + + def _set_repo_priorities(self) -> None: + has_priority = context.channel_priority in ( + ChannelPriority.STRICT, + ChannelPriority.FLEXIBLE, + ) + + subprio_index = len(self.repos) + if has_priority: + # max channel priority value is the number of unique channels + channel_prio = len({repo.canonical_name for repo in self.repos}) + current_channel_name = self.repos[0].canonical_name + + for repo_info in self.repos: + if repo_info.repo is None: + continue + if has_priority: + if repo_info.canonical_name != current_channel_name: + channel_prio -= 1 + current_channel_name = repo_info.canonical_name + priority = channel_prio + else: + priority = 0 + if has_priority: + # NOTE: -- This was originally 0, but we need 1. + # Otherwise, conda/conda @ test_create::test_force_remove fails :shrug: + subpriority = 1 + else: + subpriority = subprio_index + subprio_index -= 1 + + log.debug( + "Channel: %s, prio: %s : %s", + repo_info.url_no_cred, + priority, + subpriority, + ) + self.db.set_repo_priority(repo_info.repo, Priorities(priority, subpriority)) + + # region Repoquery + ################# + + def search( + self, + queries: Iterable[str | MatchSpec] | str | MatchSpec, + return_type: Literal["records", "dict", "raw"] = "records", + ) -> list[PackageRecord] | dict[str, Any] | QueryResult: + if isinstance(queries, (str, MatchSpec)): + queries = [queries] + queries = list(map(str, queries)) + result = Query.find(self.db, queries) + return self._process_query_result(result, return_type) + + def depends( + self, + query: str | MatchSpec, + tree: bool = False, + return_type: Literal["records", "dict", "raw"] = "records", + ) -> list[PackageRecord] | dict[str, Any] | QueryResult: + query = str(query) + result = Query.depends(self.db, query, tree) + return self._process_query_result(result, return_type) + + def whoneeds( + self, + query: str | MatchSpec, + tree: bool = False, + return_type: Literal["records", "dict", "raw"] = "records", + ) -> list[PackageRecord] | dict[str, Any] | QueryResult: + query = str(query) + result = Query.whoneeds(self.db, query, tree) + return self._process_query_result(result, return_type) + + def explicit_pool(self, specs: Iterable[MatchSpec]) -> tuple[str, ...]: + """ + Returns all the package names that (might) depend on the passed specs + """ + explicit_pool: set[str] = set() + for spec in specs: + pkg_records = self.depends(spec.dist_str()) + for record in pkg_records: + explicit_pool.add(record.name) + return tuple(explicit_pool) + + def _process_query_result( + self, + result: QueryResult, + return_type: Literal["records", "dict", "raw"] = "records", + ) -> list[PackageRecord] | dict[str, Any] | QueryResult: + if return_type == "raw": + return result + result = result.to_dict() + if result.get("result", {}).get("status") != "OK": + query_type = result.get("query", {}).get("type", "") + query = result.get("query", {}).get("query", "") + error_msg = result.get("result", {}).get("msg", f"Faulty response: {result.json()}") + raise ValueError(f"{query_type} query '{query}' failed: {error_msg}") + if return_type == "records": + pkg_records = [] + for pkg in result["result"]["pkgs"]: + record = PackageRecord(**pkg) + pkg_records.append(record) + return pkg_records + # return_type == "dict" + return result + + # endregion diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/mamba_utils.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/mamba_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..0fc4ee6c981372fb6a5214ae1201a538cc26f16d --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/mamba_utils.py @@ -0,0 +1,183 @@ +# Copyright (C) 2019 QuantStack and the Mamba contributors. +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause + +# TODO: Temporarily vendored from mamba.utils v0.19 on 2021.12.02 +# Decide what to do with it when we split into a plugin +# 2022.02.15: updated vendored parts to v0.21.2 +# 2022.11.14: only keeping channel prioritization and context initialization logic now +# 2024.09.24: parameterize init_api_context + +from __future__ import annotations + +import os +import logging +import sys +from collections.abc import Iterable +from functools import lru_cache +from importlib.metadata import version +from pathlib import Path +from typing import TYPE_CHECKING, Iterable + +import libmambapy +from conda.base.constants import ChannelPriority +from conda.base.context import context +from conda.common.compat import on_win + +if TYPE_CHECKING: + from .index import _ChannelRepoInfo + + + +log = logging.getLogger(f"conda.{__name__}") +_db_log = logging.getLogger("conda.libmamba.db") +_libmamba_context = None + +@lru_cache(maxsize=1) +def mamba_version() -> str: + return version("libmambapy") + + +def _get_base_url(url: str, name: str | None = None) -> str: + tmp = url.rsplit("/", 1)[0] + if name: + if tmp.endswith(name): + return tmp.rsplit("/", 1)[0] + return tmp + + +def init_libmamba_context( + channels: Iterable[str] | None = None, + platform: str | None = None, + target_prefix: str | None = None, +) -> libmambapy.Context: + global _libmamba_context + if _libmamba_context is None: + # This function has to be called BEFORE 1st initialization of the context + _libmamba_context = libmambapy.Context( + libmambapy.ContextOptions( + enable_signal_handling=False, + enable_logging=True, + ) + ) + libmamba_context = _libmamba_context + + # Output params + libmamba_context.output_params.json = context.json + if libmamba_context.output_params.json: + libmambapy.cancel_json_output(libmamba_context) + libmamba_context.output_params.quiet = context.quiet + libmamba_context.output_params.verbosity = context.verbosity + libmamba_context.set_log_level( + { + 4: libmambapy.LogLevel.TRACE, + 3: libmambapy.LogLevel.DEBUG, + 2: libmambapy.LogLevel.INFO, + 1: libmambapy.LogLevel.WARNING, + 0: libmambapy.LogLevel.ERROR, + }[context.verbosity] + ) + + # Prefix params + libmamba_context.prefix_params.conda_prefix = context.conda_prefix + libmamba_context.prefix_params.root_prefix = context.root_prefix + libmamba_context.prefix_params.target_prefix = str( + target_prefix if target_prefix is not None else context.target_prefix + ) + + # Networking params -- we always operate offline from libmamba's perspective + libmamba_context.remote_fetch_params.user_agent = context.user_agent + libmamba_context.local_repodata_ttl = context.local_repodata_ttl + libmamba_context.offline = True + libmamba_context.use_index_cache = True + + # General params + libmamba_context.add_pip_as_python_dependency = context.add_pip_as_python_dependency + libmamba_context.always_yes = context.always_yes + libmamba_context.dry_run = context.dry_run + libmamba_context.envs_dirs = context.envs_dirs + libmamba_context.pkgs_dirs = context.pkgs_dirs + libmamba_context.use_lockfiles = False + libmamba_context.use_only_tar_bz2 = context.use_only_tar_bz2 + + # Channels and platforms + libmamba_context.platform = platform if platform is not None else context.subdir + libmamba_context.channels = list(channels) if channels is not None else context.channels + libmamba_context.channel_alias = str( + _get_base_url(context.channel_alias.url(with_credentials=True)) + ) + + RESERVED_NAMES = {"local", "defaults"} + additional_custom_channels = {} + for el in context.custom_channels: + if context.custom_channels[el].canonical_name not in RESERVED_NAMES: + additional_custom_channels[el] = _get_base_url( + context.custom_channels[el].url(with_credentials=True), el + ) + libmamba_context.custom_channels = additional_custom_channels + + additional_custom_multichannels = { + "local": list(context.conda_build_local_paths), + "defaults": [channel.url(with_credentials=True) for channel in context.default_channels], + } + for el in context.custom_multichannels: + if el not in RESERVED_NAMES: + additional_custom_multichannels[el] = [] + for c in context.custom_multichannels[el]: + additional_custom_multichannels[el].append( + _get_base_url(c.url(with_credentials=True)) + ) + libmamba_context.custom_multichannels = additional_custom_multichannels + + libmamba_context.default_channels = [ + _get_base_url(x.url(with_credentials=True)) for x in context.default_channels + ] + + if context.channel_priority is ChannelPriority.STRICT: + libmamba_context.channel_priority = libmambapy.ChannelPriority.Strict + elif context.channel_priority is ChannelPriority.FLEXIBLE: + libmamba_context.channel_priority = libmambapy.ChannelPriority.Flexible + elif context.channel_priority is ChannelPriority.DISABLED: + libmamba_context.channel_priority = libmambapy.ChannelPriority.Disabled + + return libmamba_context + + +def logger_callback(level: libmambapy.solver.libsolv.LogLevel, msg: str, logger: logging.Logger =_db_log) -> None: + # from libmambapy.solver.libsolv import LogLevel + # levels = { + # LogLevel.Debug: logging.DEBUG, # 0 -> 10 + # LogLevel.Warning: logging.WARNING, # 1 -> 30 + # LogLevel.Error: logging.ERROR, # 2 -> 40 + # LogLevel.Fatal: logging.FATAL, # 3 -> 50 + # } + if level.value == 0: + # This incurs a large performance hit! + logger.debug(msg) + else: + logger.log((level.value + 2) * 10, msg) + + +def palettes_and_formats() -> tuple[libmambapy.solver.ProblemsMessageFormat, libmambapy.solver.ProblemsMessageFormat]: + # _indents = ["│ ", " ", "├─ ", "└─ "] + if os.getenv("NO_COLOR"): + use_color = False + elif os.getenv("FORCE_COLOR"): + use_color = True + else: + use_color = all([sys.stdout.isatty(), sys.stdin.isatty()]) + palette_no_color = libmambapy.Palette.no_color() + problems_format_nocolor = libmambapy.solver.ProblemsMessageFormat() + problems_format_nocolor.unavailable = palette_no_color.failure + problems_format_nocolor.available = palette_no_color.success + problems_format_auto = ( + libmambapy.solver.ProblemsMessageFormat() + if use_color + else problems_format_nocolor + ) + + return problems_format_auto, problems_format_nocolor + + +problems_format_auto, problems_format_nocolor = palettes_and_formats() diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/plugin.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/plugin.py new file mode 100644 index 0000000000000000000000000000000000000000..61dd314e171486d1e93fba590ded9dc209aa336d --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/plugin.py @@ -0,0 +1,46 @@ +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +""" +Entry points for the conda plugin system +""" + +from conda.common.configuration import PrimitiveParameter +from conda.plugins import hookimpl +from conda.plugins.types import CondaSetting, CondaSolver, CondaSubcommand + +from .repoquery import configure_parser, repoquery +from .solver import LibMambaSolver + + +@hookimpl +def conda_solvers(): + """ + The conda plugin hook implementation to load the solver into conda. + """ + yield CondaSolver( + name="libmamba", + backend=LibMambaSolver, + ) + + +@hookimpl +def conda_subcommands(): + yield CondaSubcommand( + name="repoquery", + summary="Advanced search for repodata.", + action=repoquery, + configure_parser=configure_parser, + ) + + +@hookimpl +def conda_settings(): + """ + Define all settings specific to the conda-libmamba-solver plugin. + """ + yield CondaSetting( + name="use_sharded_repodata", + description="Enable use of sharded repodata when available.", + parameter=PrimitiveParameter(False, element_type=bool), + ) diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/repoquery.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/repoquery.py new file mode 100644 index 0000000000000000000000000000000000000000..fcc708cd4f5acc8cd865ea64d9f242c1c882385b --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/repoquery.py @@ -0,0 +1,216 @@ +# Copyright (C) 2019, QuantStack +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +""" +Implementation of the 'conda repoquery' subcommand. + +Based on 'mamba repoquery' for v1.x. +""" + +import argparse +import json +import sys +from itertools import chain + +from conda.base.context import context +from conda.cli import conda_argparse +from conda.core.prefix_data import PrefixData +from conda.exceptions import CondaError +from conda.models.channel import Channel +from conda.models.match_spec import MatchSpec +from conda.reporters import get_spinner +from libmambapy import Context as LibmambaContext + +from .index import LibMambaIndexHelper + + +def configure_parser(parser: argparse.ArgumentParser): + package_cmds = argparse.ArgumentParser(add_help=False) + package_cmds.add_argument("specs", help="The target package(s).", nargs="+") + package_grp = package_cmds.add_argument_group("Subcommand options") + package_grp.add_argument( + "-i", + "--installed", + action="store_true", + default=True, + help=argparse.SUPPRESS, + ) + package_grp.add_argument( + "-p", + "--platform", + default=context.subdir, + help="Platform/subdir to search packages for. Defaults to current platform.", + ) + package_grp.add_argument( + "--no-installed", action="store_true", help="Do not search currently installed packages." + ) + package_grp.add_argument( + "--pretty", action="store_true", help="Prettier output with more details." + ) + + package_grp.add_argument( + "-a", + "--all-channels", + action="store_true", + help="Look at all channels (for depends / whoneeds).", + ) + package_grp.add_argument( + "--use-cache-only", + action="store_true", + help="Search in pkgs_dirs too", + ) + + view_cmds = argparse.ArgumentParser(add_help=False) + view_grp = view_cmds.add_argument_group("Dependency options") + view_grp.add_argument( + "-t", "--tree", action="store_true", help="Show dependencies in a tree-like format." + ) + view_grp.add_argument( + "--recursive", action="store_true", help="Show dependencies recursively." + ) + + subparser = parser.add_subparsers(dest="subcmd") + + whoneeds = subparser.add_parser( + "whoneeds", + help="Show packages that depend on this package.", + parents=[package_cmds, view_cmds], + ) + + depends = subparser.add_parser( + "depends", + help="Show dependencies of this package.", + parents=[package_cmds, view_cmds], + ) + + search = subparser.add_parser( + "search", + help="Show all available package versions.", + parents=[package_cmds], + ) + + for cmd in (whoneeds, search, depends): + conda_argparse.add_parser_channels(cmd) + conda_argparse.add_parser_networking(cmd) + conda_argparse.add_parser_known(cmd) + conda_argparse.add_parser_json(cmd) + + +def repoquery(args: argparse.Namespace) -> int: + if not args.subcmd: + print("repoquery needs a subcommand (search, depends or whoneeds), e.g.:", file=sys.stderr) + print(" conda repoquery search python\n", file=sys.stderr) + return 1 + + cli_flags = [getattr(args, attr, False) for attr in ("tree", "recursive", "pretty")] + if sum([context.json, *cli_flags]) > 1: + print("Use only one of --json, --tree, --recursive and --pretty.", file=sys.stderr) + return 1 + + if hasattr(args, "channel"): + channels = args.channel + else: + channels = None + if args.all_channels or channels is None: + if channels: + print("WARNING: Using all channels instead of configured channels\n", file=sys.stderr) + channels = context.channels + + use_installed = args.installed + if args.no_installed: + use_installed = False + + # if we're asking for depends and channels are given, disregard + # installed packages to prevent weird mixing + if args.subcmd in ("depends", "whoneeds") and use_installed and channels: + use_installed = False + + if args.subcmd == "search" and not args.installed: + only_installed = False + elif args.all_channels or (channels and len(channels)): + only_installed = False + else: + only_installed = True + + if only_installed and args.no_installed: + print("No channels selected. Use -a to search all channels.", file=sys.stderr) + return 1 + + if use_installed: + prefix_data = PrefixData(context.target_prefix) + prefix_data.load() + installed_records = prefix_data.iter_records() + else: + installed_records = () + + if args.use_cache_only: + with get_spinner("Collecting package metadata from pkgs_dirs"): + index = LibMambaIndexHelper( + installed_records=(), + channels=(), + subdirs=(args.platform, "noarch"), + repodata_fn=context.repodata_fns[-1], + pkgs_dirs=context.pkgs_dirs, + ) + else: + channels_from_specs = [] + for spec in args.specs: + ms = MatchSpec(spec) + channel = ms.get_exact_value("channel") + if channel: + channels_from_specs.append(channel) + with get_spinner("Collecting package metadata"): + index = LibMambaIndexHelper( + installed_records=installed_records, + channels=[ + Channel(c) for c in chain(channels or (), dict.fromkeys(channels_from_specs)) + ], + subdirs=(args.platform, "noarch"), + repodata_fn=context.repodata_fns[-1], + ) + + if args.subcmd == "search": + result = index.search(args.specs, return_type="raw") + if context.json: + print(json.dumps(result.groupby("name").to_dict(), indent=2)) + elif getattr(args, "pretty", None): + print(result.pretty(show_all_builds=True)) + else: + print(result.groupby("name").table()) + elif args.subcmd == "depends": + if len(args.specs) > 1: + raise CondaError("Only one query supported for 'depends'.") + result = index.depends( + args.specs[0], + tree=getattr(args, "tree", False) or getattr(args, "recursive", False), + return_type="raw", + ) + if context.json: + print(json.dumps(result.to_dict(), indent=2)) + elif getattr(args, "tree", None) or getattr(args, "pretty", None): + # TODO: Report upstream + raise CondaError("--tree currently not available for this subcommand.") + print(result.tree(LibmambaContext.instance().graphics_params)) + else: + print(result.sort("name").table()) + elif args.subcmd == "whoneeds": + if len(args.specs) > 1: + raise CondaError("Only one query supported for 'whoneeds'.") + result = index.whoneeds( + args.specs[0], + tree=getattr(args, "tree", False) or getattr(args, "recursive", False), + return_type="raw", + ) + if context.json: + print(json.dumps(result.to_dict(), indent=2)) + elif getattr(args, "tree", None) or getattr(args, "pretty", None): + # TODO: Report upstream + raise CondaError("--tree currently not available for this subcommand.") + print(result.tree(LibmambaContext.instance().graphics_params)) + else: + print(result.sort("name").table()) + else: + raise CondaError(f"Unrecognized subcommand: {args.subcmd}") + + return 0 diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/shards.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/shards.py new file mode 100644 index 0000000000000000000000000000000000000000..ccdbc539cd2021e4294e7f667b2664c89477275e --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/shards.py @@ -0,0 +1,708 @@ +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +""" +Models for sharded repodata, and to make monolithic repodata look like sharded +repodata. +""" + +from __future__ import annotations + +import abc +import concurrent.futures +import functools +import json +import logging +from collections import defaultdict +from pathlib import Path +from typing import TYPE_CHECKING +from urllib.parse import urljoin + +import conda.gateways.repodata +import msgpack +import zstandard +from conda.base.context import context +from conda.core.subdir_data import SubdirData +from conda.gateways.connection.session import get_session +from conda.gateways.repodata import ( + _add_http_value_to_dict, + conda_http_errors, +) +from conda.models.channel import Channel +from libmambapy.bindings import specs +from requests import HTTPError + +from . import shards_cache + +log = logging.getLogger(__name__) + + +if TYPE_CHECKING: + from collections.abc import Iterable, KeysView + + from conda.gateways.repodata import RepodataCache + from requests import Response + + from conda_libmamba_solver.shards_typing import RepodataDict, ShardsIndexDict + + from .shards_typing import PackageRecordDict, ShardDict + +SHARDS_CONNECTIONS_DEFAULT = 10 +ZSTD_MAX_SHARD_SIZE = 2**20 * 16 # maximum size necessary when compressed data has no size header +# For reference, the largest shard "conda-forge/linux-64/vim" is 2608283 bytes +# or < 2**19*5 decompressed (486155 bytes compressed); the index is 575219 bytes +# decompressed (514039 bytes compressed) and is mostly uncompressible hash data. + + +def _shards_connections() -> int: + """ + If context.repodata_threads is not set, find the size of the connection pool + in a typical https:// session. This should significantly reduce dropped + connections. We match requests' default 10. + + Is this shared between all sessions? Or do we get a different pool for a + different get_session(url)? + + Other adapters (file://, s3://) used in conda would have different + concurrency behavior; we are not prepared to have separate threadpools per + connection type. + """ + if context.repodata_threads is not None: + return context.repodata_threads + return SHARDS_CONNECTIONS_DEFAULT + + +def ensure_hex_hash(record: PackageRecordDict): + """ + Convert bytes checksums to hex; leave unchanged if already str. + """ + for hash_type in "sha256", "md5": + if hash_value := record.get(hash_type): + if not isinstance(hash_value, str): + record[hash_type] = bytes(hash_value).hex() + return record + + +@functools.cache +def spec_to_package_name(spec: str) -> str: + """ + Given a dependency spec, return the package name. + """ + # Note: hope for no MatchSpec-without-name in repodata, although it is + # possible in the MatchSpec grammar. + parsed_spec = specs.MatchSpec.parse(spec) + name = str(parsed_spec.name) + return name + + +def shard_mentioned_packages(shard: ShardDict) -> Iterable[str]: + """ + Return all dependency names mentioned in a shard, not including the shard's + own package name. + """ + unique_specs = set() + for package in (*shard["packages"].values(), *shard["packages.conda"].values()): + ensure_hex_hash(package) # otherwise we could do this at serialization + for spec in (*package.get("depends", ()),): # , *package.get("constrains", ())): + if spec in unique_specs: + continue + unique_specs.add(spec) + name = spec_to_package_name(spec) + yield name # not much improvement from only yielding unique names + + +class ShardBase(abc.ABC): + """ + Abstract base class for shard-like objects. + + Defines the common interface for both sharded repodata (Shards) + and traditional repodata presented as shards (ShardLike). + """ + + url: str + repodata_no_packages: RepodataDict + visited: dict[str, ShardDict | None] + _base_url: str + + @property + @abc.abstractmethod + def package_names(self) -> KeysView[str]: + """Return the names of all packages available in this shard collection.""" + ... + + @property + def base_url(self) -> str: + """ + Return self.url joined with base_url from repodata, or self.url if no + base_url was present. Packages are found here. + + Note base_url can be a relative or an absolute url. + The double urljoin ensures proper URL normalization: + first join with _base_url, then with "." to add trailing slash + if needed. + """ + return urljoin(urljoin(self.url, self._base_url), ".") + + def __contains__(self, package: str) -> bool: + """Check if a package is available in this shard collection.""" + return package in self.package_names + + @abc.abstractmethod + def shard_url(self, package: str) -> str: + """ + Return shard URL for a given package. For monolithic repodata, should + not be fetched but is a unique identifier. + + Raise KeyError if package is not in the index. + """ + ... + + @abc.abstractmethod + def shard_loaded(self, package: str) -> bool: + """ + Return True if the given package's shard is in memory. + """ + ... + + def visit_package(self, package: str) -> ShardDict: + """ + Return a shard that is already loaded in memory and mark as visited. + """ + ... + + def visit_shard(self, package: str, shard: ShardDict): + """ + Store new shard data in the visited dict. + """ + self.visited[package] = shard + + @abc.abstractmethod + def fetch_shard(self, package: str) -> ShardDict: + """ + Fetch an individual shard for the given package. + """ + ... + + @abc.abstractmethod + def fetch_shards(self, packages: Iterable[str]) -> dict[str, ShardDict]: + """ + Fetch multiple shards in one go. + """ + ... + + def build_repodata(self) -> RepodataDict: + """ + Return monolithic repodata including all visited shards. + """ + repodata = self.repodata_no_packages.copy() + repodata.update({"packages": {}, "packages.conda": {}}) + for _, shard in self.visited.items(): + if shard is None: + continue # recorded visited but not available shards + for package_group in ("packages", "packages.conda"): + repodata[package_group].update(shard[package_group]) + return repodata + + +class ShardLike(ShardBase): + """ + Present a "classic" repodata.json as per-package shards. + """ + + def __init__(self, repodata: RepodataDict, url: str = ""): + """ + url: must be unique for all ShardLike used together. + """ + self.repodata_no_packages: RepodataDict = { + **repodata, + "packages": {}, + "packages.conda": {}, + } + all_packages = { + "packages": repodata.get("packages", {}), + "packages.conda": repodata.get("packages.conda", {}), + } + self.url = url + + shards = defaultdict(lambda: {"packages": {}, "packages.conda": {}}) + + for group_name, group in all_packages.items(): + for package, record in group.items(): + name = record["name"] + shards[name][group_name][package] = record + + # defaultdict behavior no longer wanted + self.shards: dict[str, ShardDict] = dict(shards) # type: ignore + + # used to write out repodata subset + self.visited: dict[str, ShardDict | None] = {} + + # alternate location for packages, if not self.url + try: + base_url = self.repodata_no_packages["info"]["base_url"] + if not isinstance(base_url, str): + log.warning(f'repodata["info"]["base_url"] was not a str, got {type(base_url)}') + raise TypeError() + self._base_url = base_url + except KeyError: + self._base_url = "" + + def __repr__(self): + left, right = super().__repr__().split(maxsplit=1) + return f"{left} {self.url} {right}" + + @property + def package_names(self) -> KeysView[str]: + return self.shards.keys() + + def shard_url(self, package: str) -> str: + """ + Return shard URL for a given package. + + Raise KeyError if package is not in the index. + """ + self.shards[package] + return f"{self.url}#{package}" + + def shard_loaded(self, package: str) -> bool: + """ + Return True if the given package's shard is in memory. + """ + return package in self.shards + + def visit_package(self, package: str) -> ShardDict: + """ + Return a shard that is already in memory and mark as visited. + """ + shard = self.fetch_shard(package) + assert shard is not None + return shard + + def fetch_shard(self, package: str) -> ShardDict: + """ + "Fetch" an individual shard. + + Update self.visited with all not-None packages. + + Raise KeyError if package is not in the index. + """ + shard = self.shards[package] + self.visited[package] = shard + return shard + + def fetch_shards(self, packages: Iterable[str]) -> dict[str, ShardDict]: + """ + Fetch multiple shards in one go. + + Update self.visited with all not-None packages. + """ + return {package: self.fetch_shard(package) for package in packages} + + +def _shards_base_url(url, shards_base_url) -> str: + """ + Return shards_base_url joined with base_url and url. + Note shards_base_url can be a relative or an absolute url. + """ + if shards_base_url and not shards_base_url.endswith("/"): + shards_base_url += "/" + return urljoin(urljoin(url, shards_base_url), ".") + + +class Shards(ShardBase): + """ + Handle repodata_shards.msgpack.zst and individual per-package shards. + """ + + # cache for shards_base_url() + _shards_base_url = "" + _shards_base_url_key = (None, None) + + def __init__(self, shards_index: ShardsIndexDict, url: str, cache: shards_cache.ShardCache): + """ + Args: + shards_index: raw parsed msgpack dict + url: URL of repodata_shards.msgpack.zst + """ + self.shards_index = shards_index + self.url = url + self.shards_cache = cache + + # Use the channel's base URL to share session amongst subdir locations + channel_base_url = Channel(self.shards_base_url).base_url + self.session = get_session(channel_base_url) + + self.repodata_no_packages = { + "info": shards_index["info"], + "packages": {}, + "packages.conda": {}, + "repodata_version": 2, + } + + # used to write out repodata subset + # not used in traversal algorithm + self.visited: dict[str, ShardDict | None] = {} + + # https://github.com/conda/conda-index/pull/209 ensures that sharded + # repodata will always include base_url, even if it is an empty string; + # rattler/pixi require these keys. + self._base_url = shards_index["info"]["base_url"] + + @property + def package_names(self): + return self.packages_index.keys() + + @property + def packages_index(self): + return self.shards_index["shards"] + + @property + def shards_base_url(self) -> str: + """ + Return self.url joined with shards_base_url. + Note shards_base_url can be a relative or an absolute url. + """ + # could be simplified by restricting self.shards_index assignment + shards_base_url_ = self.shards_index["info"].get("shards_base_url", "") + cache_key = (self.url, shards_base_url_) + if self._shards_base_url_key != cache_key: + self._shards_base_url_key = cache_key + self._shards_base_url = _shards_base_url(self.url, shards_base_url_) + return self._shards_base_url + + def shard_url(self, package: str) -> str: + """ + Return shard URL for a given package. + + Raise KeyError if package is not in the index. + """ + shard_name = f"{bytes(self.packages_index[package]).hex()}.msgpack.zst" + # "Individual shards are stored under the URL .msgpack.zst" + return f"{self.shards_base_url}{shard_name}" + + def shard_loaded(self, package: str) -> bool: + """ + Return True if the given package's shard is in memory. + """ + return package in self.visited + + def visit_package(self, package: str) -> ShardDict: + """ + Return a shard that is already in memory and mark as visited. + """ + shard = self.visited[package] + return shard + + def fetch_shard(self, package: str) -> ShardDict: + """ + Fetch an individual shard for the given package. + + Default implementation calls fetch_shards() with a single package. + Subclasses may override for more efficient single-fetch operations. + + Raise KeyError if package is not in the index. + """ + return self.fetch_shards([package])[package] + + def fetch_shards(self, packages: Iterable[str]) -> dict[str, ShardDict]: + """ + Return mapping of *package names* to Shard for given packages. + + If a shard is already in self.visited, it is not fetched again. + """ + results = {} + + def fetch(s, url, package_to_fetch): + response = s.get(url) + response.raise_for_status() + data = response.content + + return shards_cache.AnnotatedRawShard( + url=url, package=package_to_fetch, compressed_shard=data + ) + + packages = sorted(list(packages)) + urls_packages = {} # package shards to fetch + for package in packages: + if package in self.visited: + results[package] = self.visited[package] + else: + urls_packages[self.shard_url(package)] = package + + with concurrent.futures.ThreadPoolExecutor(max_workers=_shards_connections()) as executor: + futures = { + executor.submit(fetch, self.session, url, package): (url, package) + for url, package in urls_packages.items() + if package not in results + } + for future in concurrent.futures.as_completed(futures): + log.debug(". %s", futures[future]) + url, package = futures[future] + self._process_fetch_result(future, url, package, results) + + self.visited.update(results) + + return results + + def _process_fetch_result(self, future, url, package, results): + """ + Process a single fetched shard. + """ + with conda_http_errors(url, package): + fetch_result = future.result() + + # Decompress and save record + results[fetch_result.package] = msgpack.loads( + zstandard.decompress( + fetch_result.compressed_shard, max_output_size=ZSTD_MAX_SHARD_SIZE + ) + ) + + # Cache fetched shard + self.shards_cache.insert(fetch_result) + + +def repodata_shards(url, cache: RepodataCache) -> bytes: + """ + Fetch shards index with cache. + + Update cache state. + + Return shards data, either newly fetched or from cache. + """ + session = get_session(url) + + state = cache.state + headers = {} + etag = state.etag + last_modified = state.mod + if etag: + headers["If-None-Match"] = str(etag) + if last_modified: + headers["If-Modified-Since"] = str(last_modified) + filename = "repodata_shards.msgpack.zst" + + with conda_http_errors(url, filename): + timeout = ( + context.remote_connect_timeout_secs, + context.remote_read_timeout_secs, + ) + response: Response = session.get( + url, headers=headers, proxies=session.proxies, timeout=timeout + ) + response.raise_for_status() + response_bytes = response.content + + if response.status_code == 304: + # should we save cache-control to state here to put another n + # seconds on the "make a remote request" clock and/or touch cache + # mtime + return cache.cache_path_shards.read_bytes() + + saved_fields = {conda.gateways.repodata.URL_KEY: url} + for header, key in ( + ("Etag", conda.gateways.repodata.ETAG_KEY), + ( + "Last-Modified", + conda.gateways.repodata.LAST_MODIFIED_KEY, + ), + ("Cache-Control", conda.gateways.repodata.CACHE_CONTROL_KEY), + ): + _add_http_value_to_dict(response, header, saved_fields, key) + + state.update(saved_fields) + + # should we return the response and let caller save cache data to state? + return response_bytes + + +def fetch_shards_index( + sd: SubdirData, cache: shards_cache.ShardCache | None = None +) -> Shards | None: + """ + Check a SubdirData's URL for shards. + + Return shards index bytes from cache or network. + Return None if not found; caller should fetch normal repodata. + + TODO: If this function fails to retrieve the sharded repodata index file, it will + mark it is as not supporting this feature in cache. This can problematic + because sometimes server errors can happen which will lead it to wrongly + assuming the channel doesn't support sharding. We need to rethink our + logic for determining shard support. + """ + + fetch = sd.repo_fetch + repo_cache = fetch.repo_cache + + # cache.load_state() will clear the file on JSONDecodeError but cache.load() + # will raise the exception. + # repo_cache.load_state( + # binary=True + # ) # won't succeed when .msgpack.zst is missing as it wants to compare the timestamp (returns empty state) + + # Load state ourselves to avoid clearing when binary cached data is missing. + # If we fall back to monolithic repodata.json, the standard fetch code will + # load the state again in text mode. + try: + with repo_cache.lock("r+") as state_file: + # cannot use pathlib.read_text / write_text on any locked file, as + # it will release the lock early + state = json.loads(state_file.read()) + repo_cache.state.update(state) + except (FileNotFoundError, json.JSONDecodeError): + pass + + cache_state = repo_cache.state + + if cache is None: + cache = shards_cache.ShardCache(Path(conda.gateways.repodata.create_cache_dir())) + + if cache_state.should_check_format("shards"): + # look for shards index + shards_data = None + shards_index_url = f"{sd.url_w_subdir}/repodata_shards.msgpack.zst" + + if not repo_cache.cache_path_shards.exists(): + # avoid 304 not modified if we don't have the file + cache_state.etag = "" + cache_state.mod = "" + elif not repo_cache.stale(): + # load from cache without network request + shards_data = repo_cache.cache_path_shards.read_bytes() + + if shards_data is None: + try: + shards_data = repodata_shards(shards_index_url, repo_cache) + cache_state.set_has_format("shards", True) + # this will also set state["refresh_ns"] = time.time_ns(); we could + # call cache.refresh() if we got a 304 instead: + repo_cache.save(shards_data) + except (HTTPError, conda.gateways.repodata.RepodataIsEmpty): + # fetch repodata.json / repodata.json.zst instead + cache_state.set_has_format("shards", False) + repo_cache.refresh() + + if shards_data: + # basic parse (move into caller?) + shards_index: ShardsIndexDict = msgpack.loads( + zstandard.decompress(shards_data, max_output_size=ZSTD_MAX_SHARD_SIZE) + ) # type: ignore + shards = Shards(shards_index, shards_index_url, cache) + return shards + + return None + + +def batch_retrieve_from_cache(sharded: list[Shards], packages: list[str]): + """ + Given a list of Shards objects and a list of package names, fetch all URLs + from a shared local cache, and update Shards with those per-package shards. + Return the remaining URLs that must be fetched from the network. + """ + sharded = [shardlike for shardlike in sharded if isinstance(shardlike, Shards)] + + wanted = [] + # XXX update batch_retrieve_from_cache to work with (Shards, package name) + # tuples instead of broadcasting across shards itself. + for shard in sharded: + for package_name in packages: + if package_name in shard: # and not package_name in shard.visited + wanted.append((shard, package_name, shard.shard_url(package_name))) + + log.debug("%d shards to fetch", len(wanted)) + + if not sharded: + log.debug("No sharded channels found.") + return wanted + + shared_shard_cache = sharded[0].shards_cache + from_cache = shared_shard_cache.retrieve_multiple([shard_url for *_, shard_url in wanted]) + + # add fetched Shard objects to Shards objects visited dict + for shard, package, shard_url in wanted: + if from_cache_shard := from_cache.get(shard_url): + shard.visit_shard(package, from_cache_shard) + + return wanted + + +def batch_retrieve_from_network(wanted: list[tuple[Shards, str, str]]): + """ + Given a list of (Shards, package name, shard URL) tuples, group by Shards and call fetch_shards + with a list of all URLs for that Shard. + """ + shard_packages: dict[Shards, list[str]] = defaultdict(list) + for shard, package, _ in wanted: + shard_packages[shard].append(package) + + # XXX it might be better to pull networking and Session() out of Shards(), + # so that we can e.g. use the same session for a Channel(); typically a + # noarch+arch pair of subdirs. + # Could we share a ThreadPoolExecutor and see better session utilization? + for shard, packages in shard_packages.items(): + shard.fetch_shards(packages) + + +def fetch_channels(channels: Iterable[Channel | str]) -> dict[str, ShardBase]: + """ + Return a dict mapping of a channel URL to a `Shard` or `ShardLike` object. + + Attempt to fetch the sharded index first and then fall back to retrieving + a traditional `repodata.json` file. + """ + # metaclass returns same channel, or casts to channel. + channels = [Channel(c) for c in channels] # type: ignore + + # Eliminate duplicates for example if this class is called with + # channels=[Channel(f"{load_channel}/linux-64")], + # subdirs=( + # "noarch", + # "linux-64", + # ), + url_to_channel = dict( + (channel_url, Channel(channel_url)) + for channel in channels + for channel_url in channel.urls(True, context.subdirs) + ) + + channel_data: dict[str, ShardBase] = {} + + # share single disk cache for all Shards() instances + cache = shards_cache.ShardCache(Path(conda.gateways.repodata.create_cache_dir())) + + # The parallel version may reorder channels, does this matter? + + with concurrent.futures.ThreadPoolExecutor(max_workers=_shards_connections()) as executor: + futures = { + executor.submit(fetch_shards_index, SubdirData(channel), cache): channel_url + for (channel_url, channel) in url_to_channel.items() + } + futures_non_sharded = {} + + for future in concurrent.futures.as_completed(futures): + channel_url = futures[future] + found = future.result() + if found: + channel_data[channel_url] = found + else: + futures_non_sharded[ + executor.submit( + SubdirData(Channel(channel_url)).repo_fetch.fetch_latest_parsed + ) + ] = channel_url + + # if all are None then don't do ShardLike... + + for future in concurrent.futures.as_completed(futures_non_sharded): + channel_url = futures_non_sharded[future] + repodata_json, _ = future.result() + # the filename is not strictly repodata.json since we could have + # fetched the same data from repodata.json.zst; but makes the + # urljoin consistent with shards which end with + # /repodata_shards.msgpack.zst + url = f"{channel_url}/repodata.json" + found = ShardLike(repodata_json, url) + channel_data[channel_url] = found + + return channel_data diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/shards_cache.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/shards_cache.py new file mode 100644 index 0000000000000000000000000000000000000000..e682d2b02ed0bd06c2592215e1075d294640c593 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/shards_cache.py @@ -0,0 +1,159 @@ +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +""" +Cache suitable for shards, not allowed to change because they are named +after their own sha256 hash. +""" + +from __future__ import annotations + +import logging +import sqlite3 +from dataclasses import dataclass +from typing import TYPE_CHECKING + +import msgpack +import zstandard +from conda.gateways.disk.delete import unlink_or_rename_to_trash + +if TYPE_CHECKING: + from pathlib import Path + + from .shards_typing import ShardDict + +log = logging.getLogger(__name__) + +SHARD_CACHE_NAME = "repodata_shards.db" +ZSTD_MAX_SHARD_SIZE = 2**20 * 16 # maximum size necessary when compresed data has no size header + + +@dataclass +class AnnotatedRawShard: + def __init__(self, url: str, package: str, compressed_shard: bytes): + # prevent easy mistake of swapping url, package + assert "://" in url + assert "://" not in package + + self.url = url + self.package = package # remove this field to avoid confusion? + self.compressed_shard = compressed_shard + + url: str + package: str + compressed_shard: bytes + + +def connect(dburi="cache.db"): + """ + Get database connection. + + dburi: uri-style sqlite database filename; accepts certain ?= parameters. + """ + conn = sqlite3.connect(dburi, uri=True) + conn.row_factory = sqlite3.Row + conn.execute("PRAGMA foreign_keys = ON") + return conn + + +class ShardCache: + """ + Handle caching for individual shards (not the index of shards). + """ + + def __init__(self, base: Path, create=True): + """ + base: directory and filename prefix for cache. + """ + self.base = base + self.connect() + + def copy(self): + """ + Copy cache with new connection. Useful for threads. + """ + return ShardCache(self.base, create=False) + + def connect(self, create=True): + """ + Args: + create: if True, create table if not exists. + """ + dburi = (self.base / SHARD_CACHE_NAME).as_uri() + self.conn = connect(dburi) + if not create: + return + # this schema will also get confused if we merge packages into a single + # shard, but the package name should be advisory. + self.conn.execute( + "CREATE TABLE IF NOT EXISTS shards (" + "url TEXT PRIMARY KEY, package TEXT, shard BLOB, " + "timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP)" + ) + + def insert(self, raw_shard: AnnotatedRawShard): + """ + Args: + url: of shard + package: package name + raw_shard: msgpack.zst compressed shard data + """ + # decompress and return shard for convenience, also to validate? unless + # caller would rather retrieve the shard from another thread. + with self.conn as c: + c.execute( + "INSERT OR IGNORE INTO SHARDS (url, package, shard) VALUES (?, ?, ?)", + (raw_shard.url, raw_shard.package, raw_shard.compressed_shard), + ) + + def retrieve(self, url) -> ShardDict | None: + with self.conn as c: + row = c.execute("SELECT shard FROM shards WHERE url = ?", (url,)).fetchone() + return ( + msgpack.loads( + zstandard.decompress(row["shard"], max_output_size=ZSTD_MAX_SHARD_SIZE) + ) + if row + else None + ) # type: ignore + + def retrieve_multiple(self, urls: list[str]) -> dict[str, ShardDict | None]: + """ + Query database for cached shard urls. + + Return a dict of urls in cache mapping to the Shard or None if not present. + """ + if not urls: + return {} # this optimization does not save a noticeable amount of time. + + # In one test reusing the context saves difference between .006s and .01s + # We could make this a threadlocal. + dctx = zstandard.ZstdDecompressor() + + query = f"SELECT url, shard FROM shards WHERE url IN ({','.join(('?',) * len(urls))}) ORDER BY url" + with self.conn as c: + result: dict[str, ShardDict | None] = { + row["url"]: msgpack.loads( + dctx.decompress(row["shard"], max_output_size=ZSTD_MAX_SHARD_SIZE) + ) + if row + else None + for row in c.execute(query, urls) # type: ignore + } + return result + + def clear_cache(self): + """ + Truncate the database by removing all rows from tables + """ + with self.conn as c: + c.execute("DELETE FROM shards") + + def remove_cache(self): + """ + Remove the sharded cache database. + """ + # This function appears to support `Path()` except on Windows + # `os.rename(path, path + ".conda_trash")` fails: + self.conn.close() + unlink_or_rename_to_trash(str(self.base / SHARD_CACHE_NAME)) diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/shards_subset.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/shards_subset.py new file mode 100644 index 0000000000000000000000000000000000000000..913bff289f33563d65fcf53c3e556186d476d747 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/shards_subset.py @@ -0,0 +1,590 @@ +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +""" +Sharded repodata subsets. + +Traverse dependencies of installed and to-be-installed packages to generate a +useful subset for the solver. + +The algorithm developed here is a direct result of the following CEP: + +- https://conda.org/learn/ceps/cep-0016 (Sharded Repodata) + +In this algorithm we treat a (channel, package name) as a node, its dependencies +as edges. We then traverse all edges to discover all reachable (channel, package +name) tuples. The solver should be able to find a solution with only this +subset. + +This subset is overgenerous since the user is unlikely to want to install very +old packages and their dependencies. If this is too slow, we could deploy +heuristics that automatically ignore older package versions. We could also allow +the user to configure minimum versions of common packages and ignore older +versions and their dependencies, falling back to a full solve if unsatisfiable. + +We treat both sharded and monolithic repodata as if they were made up of +per-package shards, computing a subset of both. This is because it is possible +for the monolithic repodata to mention packages that exist in the true sharded +repodata but would not be found by only traversing the shards. + +We treat all repodata as sharded, even if no actual sharded repodata has been +found. + +## Example usage + +The following constructs several repodata (`noarch` and `linux-64`) from a +single channel name and a list of root packages: + +``` from conda.models.channel import Channel from +conda_libmamba_solver.shards_subset import build_repodata_subset + +channel = Channel("conda-forge-sharded/linux-64") channel_data = +build_repodata_subset(["python", "pandas"], [channel.url()]) repodata = {} + +for url in channel_data: + repodata[url] = channel_data.build_repodata() + +# ... this is what's fed to the solver ``` + +""" + +from __future__ import annotations + +import functools +import logging +import queue +import sys +import threading +from collections import deque +from concurrent.futures import Future, ThreadPoolExecutor +from contextlib import suppress +from dataclasses import dataclass +from pathlib import Path +from queue import SimpleQueue +from typing import TYPE_CHECKING + +import conda.gateways.repodata +import msgpack +import zstandard + +from conda_libmamba_solver import shards_cache +from conda_libmamba_solver.shards_cache import AnnotatedRawShard + +from .shards import ( + ZSTD_MAX_SHARD_SIZE, + Shards, + _shards_connections, + batch_retrieve_from_cache, + batch_retrieve_from_network, + fetch_channels, + shard_mentioned_packages, +) + +log = logging.getLogger(__name__) + +if TYPE_CHECKING: + from collections.abc import Iterable, Iterator, Sequence + from queue import SimpleQueue as Queue + from typing import Literal, TypeVar + + from conda.models.channel import Channel + + from conda_libmamba_solver.shards_cache import ShardCache + from conda_libmamba_solver.shards_typing import ShardDict + + from .shards import ( + ShardBase, + ) + +# Waiting for worker threads to shutdown cleanly, or raise error. +THREAD_WAIT_TIMEOUT = 5 # seconds +REACHABLE_PIPELINED_MAX_TIMEOUTS = 10 # number of times we can timeout waiting for shards + + +@dataclass(order=True) +class Node: + distance: int = sys.maxsize + package: str = "" + channel: str = "" + visited: bool = False + shard_url: str = "" + + def to_id(self) -> NodeId: + return NodeId(self.package, self.channel, self.shard_url) + + +@dataclass(order=True, eq=True, frozen=True) +class NodeId: + package: str + channel: str + shard_url: str = "" + + def __hash__(self): + return hash((self.package, self.channel, self.shard_url)) + + +def _nodes_from_packages( + root_packages: list[str], shardlikes: Iterable[ShardBase] +) -> Iterator[tuple[NodeId, Node]]: + """ + Yield (NodeId, Node) for all root packages found in shardlikes. + """ + for package in root_packages: + for shardlike in shardlikes: + if package in shardlike: + node = Node(0, package, shardlike.url, shard_url=shardlike.shard_url(package)) + node_id = node.to_id() + yield node_id, node + + +@dataclass +class RepodataSubset: + nodes: dict[NodeId, Node] + shardlikes: Sequence[ShardBase] + DEFAULT_STRATEGY = "pipelined" + + def __init__(self, shardlikes: Iterable[ShardBase]): + self.nodes = {} + self.shardlikes = list(shardlikes) + + @classmethod + def has_strategy(cls, strategy: str) -> bool: + """ + Return True if this class provides the named shard traversal strategy. + """ + return hasattr(cls, f"reachable_{strategy}") + + def neighbors(self, node: Node) -> Iterator[Node]: + """ + Retrieve all unvisited neighbors of a node + + Neighbors in the context are dependencies of a package + """ + discovered = set() + + for shardlike in self.shardlikes: + if node.package not in shardlike: + continue + + # check that we don't fetch the same shard twice... + shard = shardlike.fetch_shard( + node.package + ) # XXX this is the only place that in-memory (repodata.json) shards are found for the first time + + for package in shard_mentioned_packages(shard): + node_id = NodeId(package, shardlike.url) + + if node_id not in self.nodes: + self.nodes[node_id] = Node(node.distance + 1, package, shardlike.url) + yield self.nodes[node_id] + + if package not in discovered: + # now this is per package name, not per (name, channel) tuple + discovered.add(package) + + def outgoing(self, node: Node): + """ + All nodes that can be reached by this node, plus cost. + """ + # If we set a greater cost for sharded repodata than the repodata that + # is already in memory and tracked nodes as (channel, package) tuples, + # we might be able to find more shards-to-fetch-in-parallel more + # quickly. On the other hand our goal is that the big channels will all + # be sharded. + for n in self.neighbors(node): + yield n, 1 + + def reachable_bfs(self, root_packages): + """ + Fetch all packages reachable from `root_packages`' by following + dependencies using the "breadth-first search" algorithm. + + Update associated `self.shardlikes` to contain enough data to build a + repodata subset. + """ + self.nodes = dict(_nodes_from_packages(root_packages, self.shardlikes)) + + node_queue = deque(self.nodes.values()) + sharded = [s for s in self.shardlikes if isinstance(s, Shards)] + + while node_queue: + # Batch fetch all nodes at current level + to_retrieve = {node.package for node in node_queue if not node.visited} + if to_retrieve: + not_in_cache = batch_retrieve_from_cache(sharded, sorted(to_retrieve)) + batch_retrieve_from_network(not_in_cache) + + # Process one level + level_size = len(node_queue) + for _ in range(level_size): + node = node_queue.popleft() + if node.visited: # pragma: no cover + continue # we should never add visited nodes to node_queue + node.visited = True + + for next_node, _ in self.outgoing(node): + if not next_node.visited: + node_queue.append(next_node) + + def reachable_pipelined(self, root_packages): + """ + Fetch all packages reachable from `root_packages`' by following + dependencies. + + Build repodata subset using concurrent threads to follow dependencies, + fetch from cache, and fetch from network. + """ + + # Ignore cache on shards object, use our own. Necessary if there are no + # sharded channels. + cache = shards_cache.ShardCache(Path(conda.gateways.repodata.create_cache_dir())) + + cache_in_queue: SimpleQueue[list[NodeId] | None] = SimpleQueue() + shard_out_queue: SimpleQueue[list[tuple[NodeId, ShardDict]] | Exception] = SimpleQueue() + cache_miss_queue: SimpleQueue[list[NodeId] | None] = SimpleQueue() + + cache_thread = threading.Thread( + target=cache_fetch_thread, + args=(cache_in_queue, shard_out_queue, cache_miss_queue, cache), + daemon=True, # may have to set to False if we ever want to run in a subinterpreter + ) + + network_thread = threading.Thread( + target=network_fetch_thread, + args=(cache_miss_queue, shard_out_queue, cache, self.shardlikes), + daemon=True, + ) + + try: + cache_thread.start() + network_thread.start() + self.pipelined_main_thread( + root_packages, cache_in_queue, shard_out_queue, cache_thread, network_thread + ) + finally: + cache_in_queue.put(None) + # These should finish almost immediately, but if not, raise an error: + cache_thread.join(THREAD_WAIT_TIMEOUT) + network_thread.join(THREAD_WAIT_TIMEOUT) + + def pipelined_main_thread( + self, root_packages, cache_in_queue, shard_out_queue, cache_thread, network_thread + ): + """ + Run reachibility algorithm given queues to submit and receive shards. + """ + shardlikes_by_url = {s.url: s for s in self.shardlikes} + pending: set[NodeId] = set() + in_flight: set[NodeId] = set() + timeouts = 0 + shutdown_initiated = False + + self.nodes = {} + + # create start condition + parent_node = Node(0) + self.visit_node(pending, parent_node, root_packages) + + def pump(): + """ + Find shards we already have and those we need. Submit those need to + cache_in_queue, those we have to shard_out_queue. + """ + have, need = self.drain_pending(pending, shardlikes_by_url) + if need: + in_flight.update(need) + cache_in_queue.put(need) + if have: + in_flight.update(node_id for node_id, _ in have) + shard_out_queue.put(have) + return len(have) + len(need) + + running = True + while running: + pump() + try: + new_shards = shard_out_queue.get(timeout=1) + if new_shards is None: + running = False + continue # or break + if isinstance(new_shards, Exception): # error propagated from worker thread + raise new_shards + except queue.Empty: + pump_count = pump() + log.debug("Shard timeout %s, pump_count=%d", timeouts, pump_count) + log.debug("pending: %s...", sorted(str(node_id) for node_id in pending)[:10]) + log.debug("in_flight: %s...", sorted(str(node_id) for node_id in in_flight)[:10]) + log.debug("nodes: %d", len(self.nodes)) + log.debug("cache_thread.is_alive(): %s", cache_thread.is_alive()) + log.debug("network_thread.is_alive(): %s", network_thread.is_alive()) + log.debug("shard_out_queue.qsize(): %s", shard_out_queue.qsize()) + if not pending and not in_flight: + log.debug("All shards have finished processing") + break + timeouts += 1 + if timeouts > REACHABLE_PIPELINED_MAX_TIMEOUTS: + raise TimeoutError( + f"Timeout waiting for shard_out_queue after {timeouts} attempts. " + f"pending={len(pending)}, in_flight={len(in_flight)}, " + f"cache_thread_alive={cache_thread.is_alive()}, " + f"network_thread_alive={network_thread.is_alive()}" + ) + continue # immediately calls pump() at top of loop + + for node_id, shard in new_shards: + in_flight.remove(node_id) + + # add shard to appropriate ShardLike + parent_node = self.nodes[node_id] + shardlike = shardlikes_by_url[node_id.channel] + shardlike.visit_shard(node_id.package, shard) + + self.visit_node(pending, parent_node, shard_mentioned_packages(shard)) + + if not pending and not in_flight and not shutdown_initiated: + log.debug("Initiating shutdown: sending None to cache_in_queue") + cache_in_queue.put(None) + shutdown_initiated = True + + def visit_node( + self, pending: set[NodeId], parent_node: Node, mentioned_packages: Iterable[str] + ): + """Broadcast mentioned packages across channels to pending.""" + # NOTE we have visit for Nodes which is used in the graph traversal + # algorithm, and a separate visit for ShardBase which means "include + # this package in the output repodata". + for package in mentioned_packages: + for shardlike in self.shardlikes: + if package in shardlike: + new_node_id = NodeId(package, shardlike.url, shardlike.shard_url(package)) + if new_node_id not in self.nodes: + new_node = Node( + distance=parent_node.distance + 1, + package=new_node_id.package, + channel=new_node_id.channel, + shard_url=new_node_id.shard_url, + ) + self.nodes[new_node_id] = new_node + pending.add(new_node_id) + + parent_node.visited = True + + def drain_pending( + self, pending: set[NodeId], shardlikes_by_url: dict[str, ShardBase] + ) -> tuple[list[tuple[NodeId, ShardDict]], list[NodeId]]: + """ + Check pending for in-memory shards. + Clear pending. + + Return a list of shards we have and shards we need to fetch. + """ + shards_need = [] + shards_have = [] + for node_id in pending: + # we should already have these nodes. + shardlike = shardlikes_by_url[node_id.channel] + if shardlike.shard_loaded(node_id.package): # for monolithic repodata + shards_have.append((node_id, shardlike.visit_package(node_id.package))) + else: + if self.nodes[node_id].visited: # pragma: no cover + log.debug("Skip visited, should not be reached") + continue + shards_need.append(node_id) + pending.clear() + return shards_have, shards_need + + +def build_repodata_subset( + root_packages: Iterable[str], + channels: dict[str, Channel], + algorithm: Literal["bfs", "pipelined"] = RepodataSubset.DEFAULT_STRATEGY, +) -> dict[str, ShardBase]: + """ + Retrieve all necessary information to build a repodata subset. + + Params: + root_packages: iterable of installed and requested package names + channels: iterable of Channel objects + algorithm: desired traversal algorithm + """ + if isinstance(channels, dict): # True when called by LibMambaIndexHelper + channels_: list[Channel] = list(channels.values()) + else: + channels_ = channels + channel_data = fetch_channels(channels_) + + subset = RepodataSubset((*channel_data.values(),)) + getattr(subset, f"reachable_{algorithm}")(root_packages) + log.debug("%d (channel, package) nodes discovered", len(subset.nodes)) + + return channel_data + + +# region workers + +if TYPE_CHECKING: + _T = TypeVar("_T") + + +def combine_batches_until_none( + in_queue: Queue[Sequence[_T] | None], +) -> Iterator[Sequence[_T]]: + """ + Combine lists from in_queue until we see None. Yield combined lists. + """ + running = True + while running: + try: + # Add timeout to prevent indefinite blocking if producer thread fails + batch = in_queue.get(timeout=5) + if batch is None: + break + except queue.Empty: + # If we timeout, continue waiting - producer might still send data + continue + + node_ids = list(batch) + with suppress(queue.Empty): + while True: # loop exits with break or queue.Empty exception + batch = in_queue.get_nowait() + if batch is None: + # do the work but then quit + running = False + break + else: + node_ids.extend(batch) + yield node_ids + + +def exception_to_queue(func): + """ + Decorator to send unhandled exceptions to the second argument out_queue. + """ + + @functools.wraps(func) + def wrapper(in_queue, out_queue, *args, **kwargs): + try: + return func(in_queue, out_queue, *args, **kwargs) + except Exception as e: + in_queue.put(None) # signal termination + out_queue.put(e) + + return wrapper + + +@exception_to_queue +def cache_fetch_thread( + in_queue: Queue[Sequence[NodeId] | None], + shard_out_queue: Queue[Sequence[tuple[NodeId, ShardDict] | Exception] | None], + network_out_queue: Queue[Sequence[NodeId] | None], + cache: ShardCache, +): + """ + Fetch batches of shards from cache until in_queue sees None. Enqueue found + shards to shard_out_queue, and not found shards to network_out_queue. + + When we see None on in_queue, send None to both out queues and exit. + + Args: + in_queue: NodeId (URLs) to fetch. + shard_out_queue: fetched shards sent to queue. + network_out_queue: cache misses forwarded to queue. Same queue is + network_fetch_thread's in_queue. + cache: used to retrieve shards. + """ + cache = cache.copy() + + for node_ids in combine_batches_until_none(in_queue): + cached = cache.retrieve_multiple([node_id.shard_url for node_id in node_ids]) + + # should we add this into retrieve_multiple? + found: list[tuple[NodeId, ShardDict]] = [] + not_found: list[NodeId] = [] + for node_id in node_ids: + if shard := cached.get(node_id.shard_url): + found.append((node_id, shard)) + else: + not_found.append(node_id) + + # Might wake up the network thread by calling it first: + if not_found: + network_out_queue.put(not_found) + if found: + shard_out_queue.put(found) + + network_out_queue.put(None) + shard_out_queue.put(None) + + +@exception_to_queue +def network_fetch_thread( + in_queue: Queue[Sequence[NodeId | Future] | None], + shard_out_queue: Queue[list[tuple[NodeId, ShardDict] | Exception] | None], + cache: ShardCache, + shardlikes: list[ShardBase], +): + """ + Fetch shards from the network that are received on in_queue, until we see + None. + + Unhandled exceptions also go to shard_out_queue, and exit this thread. + + Args: + in_queue: NodeId (URLs) to fetch. + shard_out_queue: fetched shards sent to queue. + cache: once shards are decoded they are stored in cache. + shardlikes: list of (network-only) shard index objects. + """ + cache = cache.copy() + dctx = zstandard.ZstdDecompressor(max_window_size=ZSTD_MAX_SHARD_SIZE) + shardlikes_by_url = {s.url: s for s in shardlikes} + + def fetch(s, url: str, node_id: NodeId): + response = s.get(url) + response.raise_for_status() + data = response.content + return url, node_id, data + + def submit(node_id: NodeId): + # this worker should only receive network node_id's: + shardlike = shardlikes_by_url[node_id.channel] + if not isinstance(shardlike, Shards): + raise TypeError("network_fetch_thread got non-network shardlike") + session = shardlike.session + url = shardlikes_by_url[node_id.channel].shard_url(node_id.package) + return executor.submit(fetch, session, url, node_id) + + def handle_result(future: Future): + url, node_id, data = future.result() + log.debug("Fetch thread got %s (%s bytes)", url, len(data)) + # Decompress and parse. If it decodes as + # msgpack.zst, insert into cache. Then put "known + # good" shard into out queue. + shard: ShardDict = msgpack.loads( + dctx.decompress(data, max_output_size=ZSTD_MAX_SHARD_SIZE) + ) # type: ignore[assign] + # We could send this back into the cache thread instead to + # serialize access to sqlite3 if lock contention becomes an issue. + cache.insert(AnnotatedRawShard(url, node_id.package, data)) + shard_out_queue.put([(node_id, shard)]) + + def result_to_in_queue(future: Future): + # Simplify waiting by putting responses back into in_queue. This + # function is called in the ThreadPoolExecutor's thread, but we want to + # serialize result processing in the network_fetch_thread. + in_queue.put([future]) + + with ThreadPoolExecutor(max_workers=_shards_connections()) as executor: + for node_ids_and_results in combine_batches_until_none(in_queue): + for node_id_or_result in node_ids_and_results: + if isinstance(node_id_or_result, Future): + handle_result(node_id_or_result) + else: + future = submit(node_id_or_result) + future.add_done_callback(result_to_in_queue) + # TODO call executor.shutdown(cancel_futures=True) on error or otherwise + # prevent new HTTP requests from being started e.g. "skip" flag in + # fetch() function. Also possible to shutdown(wait=False). + + +# endregion diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/shards_typing.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/shards_typing.py new file mode 100644 index 0000000000000000000000000000000000000000..e022694ff8a777177fcc6ce3b11f115d7be0a335 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/shards_typing.py @@ -0,0 +1,68 @@ +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +""" +TypedDict declarations for shards. + +These are helpful for auto-complete, but do not validate at runtime and are not +normative. They are intentionally not shared with another project (conda) to +reduce coupling. +""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, TypedDict + +if TYPE_CHECKING: + from typing import NotRequired + + +class PackageRecordDict(TypedDict): + """ + Basic package attributes that this module cares about. + """ + + name: str + version: str + build: str + build_number: int + sha256: NotRequired[str | bytes] + md5: NotRequired[str | bytes] + depends: list[str] + constrains: NotRequired[list[str]] + noarch: NotRequired[str] + + +# in this style because "packages.conda" is not a Python identifier +ShardDict = TypedDict( + "ShardDict", + { + "packages": dict[str, PackageRecordDict], + "packages.conda": dict[str, PackageRecordDict], + }, +) + + +class RepodataInfoDict(TypedDict): # noqa: F811 + base_url: str # where packages are stored + shards_base_url: str # where shards are stored + subdir: str + + +class RepodataDict(ShardDict): + """ + Packages plus info. + """ + + info: RepodataInfoDict + repodata_version: int + + +class ShardsIndexDict(TypedDict): + """ + Shards index as deserialized from repodata_shards.msgpack.zst + """ + + info: RepodataInfoDict + version: int # TODO conda-index currently uses 'repodata_version' here + shards: dict[str, bytes] diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/solver.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/solver.py new file mode 100644 index 0000000000000000000000000000000000000000..ac2aec2c4b7ec64e8484092ea836fc8c6e32b86e --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/solver.py @@ -0,0 +1,1107 @@ +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (C) 2024 conda +# SPDX-License-Identifier: BSD-3-Clause +""" +This module defines the conda.core.solve.Solver interface and its immediate helpers +""" + +from __future__ import annotations + +import json +import logging +import os +import re +import sys +from collections import defaultdict +from contextlib import suppress +from functools import cache +from inspect import stack +from itertools import chain +from textwrap import dedent +from typing import TYPE_CHECKING + +from conda import __version__ as _conda_version +from conda.base.constants import ( + PREFIX_FROZEN_FILE, + REPODATA_FN, + UNKNOWN_CHANNEL, + ChannelPriority, +) +from conda.base.context import context +from conda.common.constants import NULL +from conda.common.io import time_recorder +from conda.common.path import paths_equal +from conda.common.url import percent_decode +from conda.core.solve import Solver +from conda.exceptions import ( + CondaValueError, + PackagesNotFoundError, + UnsatisfiableError, +) +from conda.models.channel import Channel +from conda.models.match_spec import MatchSpec +from conda.models.records import PackageRecord, PrefixRecord +from conda.models.version import VersionOrder +from conda.reporters import get_spinner +from libmambapy.solver import Request, Solution +from libmambapy.solver.libsolv import Solver as LibsolvSolver +from libmambapy.specs import MatchSpec as LibmambaMatchSpec +from libmambapy.specs import NoArchType + +from . import __version__ +from .exceptions import LibMambaUnsatisfiableError +from .index import LibMambaIndexHelper +from .mamba_utils import ( + init_libmamba_context, + mamba_version, + problems_format_auto, + problems_format_nocolor, +) +from .state import SolverInputState, SolverOutputState + +if TYPE_CHECKING: + from collections.abc import Iterable, Mapping, Sequence + + from boltons.setutils import IndexedSet + from conda.auxlib import _Null + from conda.base.constants import ( + DepsModifier, + UpdateModifier, + ) + from conda.common.path import PathType + from libmambapy.solver.libsolv import Database, UnSolvable + from libmambapy.specs import PackageInfo + +log = logging.getLogger(f"conda.{__name__}") + + +class LibMambaSolver(Solver): + MAX_SOLVER_ATTEMPTS_CAP = 10 + _uses_ssc = False + + @staticmethod + @cache + def user_agent() -> str: + """ + Expose this identifier to allow conda to extend its user agent if required + """ + return f"conda-libmamba-solver/{__version__} libmambapy/{mamba_version()}" + + def __init__( + self, + prefix: PathType, + channels: Iterable[Channel | str], + subdirs: Iterable[str] = (), + specs_to_add: Iterable[MatchSpec | str] = (), + specs_to_remove: Iterable[MatchSpec | str] = (), + repodata_fn: str = REPODATA_FN, + command: str | _Null = NULL, + ): + if specs_to_add and specs_to_remove: + raise ValueError( + "Only one of `specs_to_add` and `specs_to_remove` can be set at a time" + ) + if specs_to_remove and command is NULL: + command = "remove" + + super().__init__( + os.fspath(prefix), + channels, + subdirs=subdirs, + specs_to_add=specs_to_add, + specs_to_remove=specs_to_remove, + repodata_fn=repodata_fn, + command=command, + ) + if self.subdirs is NULL or not self.subdirs: + self.subdirs = context.subdirs + if "noarch" not in self.subdirs: + # Problem: Conda build generates a custom index which happens to "forget" about + # noarch on purpose when creating the build/host environments, since it merges + # both as if they were all in the native subdir. This causes package-not-found + # errors because we are not using the patched index. + # Fix: just add noarch to subdirs because it should always be there anyway. + self.subdirs = (*self.subdirs, "noarch") + + self._repodata_fn = self._maybe_ignore_current_repodata() + self._libmamba_context = init_libmamba_context( + channels=tuple(c.canonical_name for c in self.channels), + platform=next(s for s in self.subdirs if s != "noarch"), + target_prefix=str(self.prefix), + ) + + def solve_final_state( + self, + update_modifier: UpdateModifier | _Null = NULL, + deps_modifier: DepsModifier | _Null = NULL, + prune: bool | _Null = NULL, + ignore_pinned: bool | _Null = NULL, + force_remove: bool | _Null = NULL, + should_retry_solve: bool = False, + ) -> IndexedSet[PackageRecord]: + self._log_info() + in_state = SolverInputState( + prefix=self.prefix, + requested=self.specs_to_add or self.specs_to_remove, + update_modifier=update_modifier, + deps_modifier=deps_modifier, + prune=prune, + ignore_pinned=ignore_pinned, + force_remove=force_remove, + command=self._command, + ) + out_state = SolverOutputState(solver_input_state=in_state) + + # These tasks do _not_ require a solver... + maybe_final_state = out_state.early_exit() + if maybe_final_state is not None: + return maybe_final_state + + channels = self._collect_channel_list(in_state) + conda_build_channels = self._collect_channels_subdirs_from_conda_build(seen=set(channels)) + with get_spinner( + self._collect_all_metadata_spinner_message(channels, conda_build_channels), + ): + # only called here by c-l-s + index = self._collect_all_metadata( + channels=channels, + conda_build_channels=conda_build_channels, + subdirs=self.subdirs, + in_state=in_state, + ) + out_state.check_for_pin_conflicts(index) + + with get_spinner( + self._solving_loop_spinner_message(), + ): + # This function will copy and mutate `out_state` + # Make sure we get the latest copy to return the correct solution below + out_state = self._solving_loop(in_state, out_state, index) + self.neutered_specs = tuple(out_state.neutered.values()) + solution = out_state.current_solution + + # Check whether conda can be updated; this is normally done in .solve_for_diff() + # but we are doing it now so we can reuse the index + self._notify_conda_outdated(None, index, solution) + + return solution + + # region Metadata collection + ############################ + + def _collect_all_metadata_spinner_message( + self, + channels: Iterable[Channel], + conda_build_channels: Iterable[Channel | str] = (), + ) -> str: + if self._called_from_conda_build(): + msg = "Reloading output folder" + if conda_build_channels: + names = list( + dict.fromkeys([Channel(c).canonical_name for c in conda_build_channels]) + ) + msg += f" ({', '.join(names)})" + return msg + + canonical_names = list(dict.fromkeys([c.canonical_name for c in channels])) + canonical_names_dashed = "\n - ".join(canonical_names) + return ( + f"Channels:\n" + f" - {canonical_names_dashed}\n" + f"Platform: {context.subdir}\n" + f"Collecting package metadata ({self._repodata_fn})" + ) + + def _collect_channel_list(self, in_state: SolverInputState) -> list[Channel]: + # Aggregate channels and subdirs + deduped_channels = {} + for channel in chain( + self.channels, in_state.channels_from_specs(), in_state.maybe_free_channel() + ): + if channel_platform := getattr(channel, "platform", None): + if channel_platform not in self.subdirs: + log.info( + "Channel %s defines platform %s which is not part of subdirs=%s. " + "Ignoring platform attribute...", + channel, + channel_platform, + self.subdirs, + ) + # Remove 'Channel.platform' to avoid missing subdirs. Channel.urls() will ignore + # our explicitly passed subdirs if .platform is defined! + channel = Channel(**{k: v for k, v in channel.dump().items() if k != "platform"}) + deduped_channels[channel] = None + return list(deduped_channels) + + def _collect_channels_subdirs_from_conda_build( + self, + seen: set[Channel] | None = None, + ) -> list[Channel]: + if self._called_from_conda_build(): + seen = seen or set() + # We need to recover the local dirs (conda-build's local, output_folder, etc) + # from the index. This is a bit of a hack, but it works. + conda_build_channels = {} + for record in self._index or {}: + if record.channel.scheme == "file": + # Remove 'Channel.platform' to avoid missing subdirs. Channel.urls() + # will ignore our explicitly passed subdirs if .platform is defined! + channel = Channel( + **{k: v for k, v in record.channel.dump().items() if k != "platform"} + ) + if channel not in seen: + conda_build_channels.setdefault(channel) + return list(conda_build_channels) + return [] + + @time_recorder(module_name=__name__) + def _collect_all_metadata( + self, + channels: Iterable[Channel], + conda_build_channels: Iterable[Channel], + subdirs: Iterable[str], + in_state: SolverInputState | None, + ) -> LibMambaIndexHelper: + index = LibMambaIndexHelper( + channels=[*conda_build_channels, *channels], + subdirs=subdirs, + repodata_fn=self._repodata_fn, + installed_records=( + *in_state.installed.values(), + *in_state.virtual.values(), + ), + pkgs_dirs=context.pkgs_dirs if context.offline else (), + in_state=in_state, + ) + for channel in conda_build_channels: + index.reload_channel(channel) + return index + + # endregion + + # region Solving + ################ + + def _solving_loop_spinner_message(self) -> str: + """This shouldn't be our responsibility, but the CLI / app's...""" + prefix_name = os.path.basename(self.prefix) + if self._called_from_conda_build(): + if "_env" in prefix_name: + env_name = "_".join(prefix_name.split("_")[:3]) + return f"Solving environment ({env_name})" + else: + # https://github.com/conda/conda-build/blob/e0884b626a/conda_build/environ.py#L1035-L1036 + return "Getting pinned dependencies" + return "Solving environment" + + @time_recorder(module_name=__name__) + def _solving_loop( + self, + in_state: SolverInputState, + out_state: SolverOutputState, + index: LibMambaIndexHelper, + ) -> IndexedSet[PackageRecord]: + for attempt in range(1, self._max_attempts(in_state) + 1): + try: + solved, outcome = self._solve_attempt(in_state, out_state, index, attempt=attempt) + if solved: + break + except (UnsatisfiableError, PackagesNotFoundError): + solved = False + break # try with last attempt + else: # didn't solve yet, but can retry + out_state = SolverOutputState( + solver_input_state=in_state, + records=dict(out_state.records), + for_history=dict(out_state.for_history), + neutered=dict(out_state.neutered), + conflicts=dict(out_state.conflicts), + pins=dict(out_state.pins), + ) + if not solved: + log.debug("Last attempt: reporting all installed as conflicts") + out_state.conflicts.update( + { + name: record.to_match_spec() + for name, record in in_state.installed.items() + if not record.is_unmanageable + } + ) + solved, outcome = self._solve_attempt(in_state, out_state, index, attempt=attempt + 1) + if not solved: + message = self._prepare_problems_message(outcome, index.db, out_state) + exc = LibMambaUnsatisfiableError(message) + exc.allow_retry = False + raise exc + + # We didn't fail? Nice, let's return the calculated state + self._export_solution(index, out_state, outcome) + + # Run post-solve tasks + out_state.post_solve(solver=self) + + return out_state + + def _solve_attempt( + self, + in_state: SolverInputState, + out_state: SolverOutputState, + index: LibMambaIndexHelper, + attempt: int = 1, + ) -> tuple[bool, Solution | UnSolvable]: + log.info("Solver attempt: #%d", attempt) + log.debug("Current conflicts (including learnt ones): %r", out_state.conflicts) + flags = self._solver_flags(in_state) + jobs = self._specs_to_request_jobs(in_state, out_state) + request = Request(jobs=jobs, flags=flags) + solver = LibsolvSolver() + outcome = solver.solve(index.db, request) + if isinstance(outcome, Solution): + out_state.conflicts.clear() + return True, outcome + old_conflicts = out_state.conflicts.copy() + new_conflicts = self._maybe_raise_for_problems(outcome, index, out_state, old_conflicts) + if log.isEnabledFor(logging.DEBUG): + problems_as_str = outcome.problems_to_str(index.db) + log.debug( + "Attempt %d failed with %s conflicts:\n%s", + attempt, + len(new_conflicts), + problems_as_str, + ) + out_state.conflicts.update(new_conflicts) + return False, outcome + + def _solver_flags(self, in_state: SolverInputState) -> Request.Flags: + flags = { + "allow_downgrade": True, + # About flags.allow_uninstall = True: + # We used to set this to False on a global basis and then add jobs + # individually with ALLOW_UNINSTALL=True. Libmamba v2 has a Keep job instead now. + "allow_uninstall": True, + "force_reinstall": in_state.force_reinstall, + "keep_dependencies": True, + "keep_user_specs": True, + # we do the sorting ourselves, but we need it as True anyway to + # make test_solver.py::test_pytorch_gpu pass + "order_request": True, + "strict_repo_priority": context.channel_priority is ChannelPriority.STRICT, + } + if log.isEnabledFor(logging.DEBUG): + log.debug("Using solver flags:\n%s", json.dumps(flags, indent=2)) + return Request.Flags(**flags) + + def _specs_to_request_jobs( + self, + in_state: SolverInputState, + out_state: SolverOutputState, + ) -> list[Request.Job]: + if in_state.is_removing: + jobs = self._specs_to_request_jobs_remove(in_state, out_state) + elif self._called_from_conda_build(): + jobs = self._specs_to_request_jobs_conda_build(in_state, out_state) + else: + jobs = self._specs_to_request_jobs_add(in_state, out_state) + + request_jobs = [] + json_friendly = {} + for JobType, specs in jobs.items(): + for idx, conda_spec in enumerate(specs, 1): + libmamba_spec = self._conda_spec_to_libmamba_spec(conda_spec) + request_jobs.append(JobType(libmamba_spec)) + if log.isEnabledFor(logging.INFO): + json_friendly.setdefault(JobType.__name__, []).append(str(conda_spec)) + if JobType == Request.Pin: + conda_spec = MatchSpec(conda_spec) + out_state.pins[f"pin-{idx}"] = conda_spec + if log.isEnabledFor(logging.INFO): + json_str = json.dumps(json_friendly, indent=2) + log.info("The solver will handle these requests:\n%s", json_str) + return request_jobs + + def _specs_to_request_jobs_add( + self, + in_state: SolverInputState, + out_state: SolverOutputState, + ) -> dict[Request, list[MatchSpec | str]]: + tasks = defaultdict(list) + + # Protect history and aggressive updates from being uninstalled if possible. From libsolv + # docs: "The matching installed packages are considered to be installed by a user, thus not + # installed to fulfill some dependency. This is needed input for the calculation of + # unneeded packages for jobs that have the SOLVER_CLEANDEPS flag set." + user_installed = { + pkg + for pkg in ( + *in_state.history, + *in_state.aggressive_updates, + *in_state.pinned, + *in_state.do_not_remove, + ) + if pkg in in_state.installed + } + + # Fast-track python version changes (Part 1/2) + # ## When the Python version changes, this implies all packages depending on + # ## python will be reinstalled too. This can mean that we'll have to try for every + # ## installed package to result in a conflict before we get to actually solve everything + # ## A workaround is to let all non-noarch python-depending specs to "float" by marking + # ## them as a conflict preemptively + python_version_might_change = False + installed_python = in_state.installed.get("python") + to_be_installed_python = out_state.specs.get("python") + if installed_python and to_be_installed_python: + python_version_might_change = not to_be_installed_python.match(installed_python) + + for name in out_state.specs: + installed: PackageRecord = in_state.installed.get(name) + if installed: + installed_spec = self._check_spec_compat(installed.to_match_spec()) + else: + installed_spec = None + requested: MatchSpec = self._check_spec_compat(in_state.requested.get(name)) + history: MatchSpec = self._check_spec_compat(in_state.history.get(name)) + pinned: MatchSpec = self._check_spec_compat(in_state.pinned.get(name)) + conflicting: MatchSpec = self._check_spec_compat(out_state.conflicts.get(name)) + + if name in user_installed and not in_state.prune and not conflicting: + tasks[Request.Keep].append(installed_spec) + + # These specs are explicit in some sort of way + if pinned and not pinned.is_name_only_spec: + # these are the EXPLICIT pins; conda also uses implicit pinning to + # constrain updates too but those can be overridden in case of conflicts. + # name-only pins are treated as locks when installed, see below + tasks[Request.Pin].append(pinned) + # in libmamba, pins and installs are compatible tasks (pin only constrains, + # does not 'request' a package). In classic, pins were actually targeted installs + # so they were exclusive + if requested: + if requested.is_name_only_spec and pinned and not pinned.is_name_only_spec: + # for name-only specs, this is a no-op; we already added the pin above + # but we will constrain it again in the install task to have better + # error messages if not solvable + spec = pinned + else: + spec = requested + if installed: + tasks[Request.Update].append(spec) + if name not in (MatchSpec(spec).name for spec in tasks[Request.Keep]): + tasks[Request.Keep].append(name) + else: + tasks[Request.Install].append(spec) + elif name in in_state.always_update: + tasks[Request.Update].append(name) + # These specs are "implicit"; the solver logic massages them for better UX + # as long as they don't cause trouble + elif in_state.prune: + continue + elif name == "python" and installed and not pinned: + pyver = ".".join(installed.version.split(".")[:2]) + tasks[Request.Pin].append(f"python {pyver}.*") + elif history: + if conflicting and history.strictness == 3: + # relax name-version-build (strictness=3) history specs that cause conflicts + # this is called neutering and makes test_neutering_of_historic_specs pass + version = str(history.version or "") + if version.startswith("=="): + spec_str = f"{name} {version[2:]}" + elif version.startswith(("!=", ">", "<")): + spec_str = f"{name} {version}" + elif version: + spec_str = f"{name} {version}.*" + else: + spec_str = name + tasks[Request.Install].append(spec_str) + else: + tasks[Request.Install].append(history) + elif installed: + if conflicting: + # NOTE: We don't do anything now with conflicting installed. + # We rely on Flags.allow_uninstall = True doing the right thing. + # We are protecting important things with Keep or Freeze instead. + pass + else: + # we freeze everything else as installed + lock = in_state.update_modifier.FREEZE_INSTALLED + if pinned and pinned.is_name_only_spec: + # name-only pins are treated as locks when installed + lock = True + if python_version_might_change and installed.noarch is None: + for dep in installed.depends: + if MatchSpec(dep).name in ("python", "python_abi"): + lock = False + break + if lock: + tasks[Request.Freeze].append(installed_spec) + # enabling this else branch makes + # conda/conda's tests/core/test_solve.py::test_freeze_deps_1[libmamba] fail + # else: + # tasks[Request.Keep].append(name) + + # Sort tasks by priority + # This ensures that more important tasks are added to the solver first + returned_tasks = {} + for task_type in ( + Request.Pin, + Request.Install, + Request.Update, + Request.Keep, + Request.Freeze, + ): + if task_type in tasks: + returned_tasks[task_type] = tasks[task_type] + return returned_tasks + + def _specs_to_request_jobs_remove( + self, in_state: SolverInputState, out_state: SolverOutputState + ) -> dict[Request, list[MatchSpec | str]]: + # TODO: Consider merging add/remove in a single logic this so there's no split + + tasks = defaultdict(list) + + # Protect history and aggressive updates from being uninstalled if possible + for name, record in out_state.records.items(): + if name in in_state.history or name in in_state.aggressive_updates: + # MatchSpecs constructed from PackageRecords get parsed too + # strictly if exported via str(). Use .conda_build_form() directly. + spec = record.to_match_spec().conda_build_form() + tasks[Request.Keep].append(spec) + + # No complications here: delete requested and their deps + # TODO: There are some flags to take care of here, namely: + # --all + # --no-deps + # --deps-only + for name, spec in in_state.requested.items(): + spec = self._check_spec_compat(spec) + tasks[Request.Remove].append(str(spec)) + + return dict(tasks) + + def _specs_to_request_jobs_conda_build( + self, in_state: SolverInputState, out_state: SolverOutputState + ) -> dict[Request, list[MatchSpec | str]]: + tasks = defaultdict(list) + for name, spec in in_state.requested.items(): + if name.startswith("__"): + continue + spec = self._check_spec_compat(spec) + spec = self._fix_version_field_for_conda_build(spec) + tasks[Request.Install].append(spec.conda_build_form()) + + return dict(tasks) + + # endregion + + # region Export to conda + ######################## + + def _export_solution( + self, + index: LibMambaIndexHelper, + out_state: SolverOutputState, + solution: Solution, + ) -> SolverOutputState: + for action in solution.actions: + record_to_install: PackageInfo = getattr(action, "install", None) + record_to_remove: PackageInfo = getattr(action, "remove", None) + if record_to_install: + if record_to_install.name.startswith("__"): + continue + record = self._package_info_to_package_record(record_to_install, index) + out_state.records[record.name] = record + elif record_to_remove: + if record_to_remove.name.startswith("__"): + continue + record = self._package_info_to_package_record(record_to_remove, index) + out_state.records.pop(record.name, None) + return out_state + + def _package_info_to_package_record( + self, + pkg: PackageInfo, + index: LibMambaIndexHelper, + ) -> PackageRecord: + if pkg.noarch == NoArchType.Python: + noarch = "python" + elif pkg.noarch == NoArchType.Generic: + noarch = "generic" + else: + noarch = None + # The package download logic needs the URL with credentials + for repo_info in index.repos: + if pkg.package_url.startswith(repo_info.url_no_cred): + url = pkg.package_url.replace(repo_info.url_no_cred, repo_info.url_w_cred) + break + else: + url = pkg.package_url + url = percent_decode(url) + + # Signature verification requires channel information _with_ subdir data + channel = Channel(pkg.channel) + if not channel.subdir: + # conda caches channels created using single values + # Avoid the cache by using keyword arguments + channel = Channel( + scheme=channel.scheme, + auth=channel.auth, + location=channel.location, + token=channel.token, + name=channel.name, + platform=pkg.platform, + package_filename=channel.package_filename, + ) + + return PackageRecord( + name=pkg.name, + version=pkg.version, + build=pkg.build_string, # NOTE: Different attribute name + build_number=pkg.build_number, + channel=channel, + url=url, + subdir=pkg.platform, # NOTE: Different attribute name + fn=pkg.filename, # NOTE: Different attribute name + license=pkg.license, + python_site_packages_path=getattr(pkg, "python_site_packages_path", "") or None, + md5=pkg.md5, + sha256=pkg.sha256, + signatures=pkg.signatures, + track_features=pkg.track_features, + depends=pkg.dependencies, # NOTE: Different attribute name + constrains=pkg.constrains, + defaulted_keys=pkg.defaulted_keys, + noarch=noarch, + size=pkg.size, + timestamp=pkg.timestamp, + ) + + # endregion + + # region Error reporting + ######################## + + @classmethod + def _parse_problems(cls, unsolvable: UnSolvable, db: Database) -> Mapping[str, MatchSpec]: + """ + Problems can signal either unsatisfiability or unavailability. + First will raise LibmambaUnsatisfiableError. + Second will raise PackagesNotFoundError. + + Libmamba can return spec strings in two formats: + - With dashes, e.g. package-1.2.3-h5487548_0 + - à la conda-build, e.g. package 1.2.* * + - just names, e.g. package + """ + conflicts = [] + not_found = [] + problems = [] + has_unsupported = False + for problem in unsolvable.problems(db): + if problem == "unsupported request": + has_unsupported = True + else: + problems.append(problem) + if has_unsupported: # we put it at the end to prioritize other more meaningful problems + problems.append("unsupported request") + + try: + explained_problems = unsolvable.explain_problems(db, problems_format_nocolor) + except Exception as exc: + log.debug("Cannot explain problems", exc_info=exc) + explained_problems = "" + for line in problems: + words = line.split() + if "none of the providers can be installed" in line: + if words[0] != "package" or words[2] != "requires": + raise ValueError(f"Unknown message: {line}") + conflicts.append(cls._matchspec_from_error_str(words[1])) + end = words.index("but") + conflicts.append(cls._matchspec_from_error_str(words[3:end])) + elif "nothing provides" in line: + start, marker = None, None + for i, word in enumerate(words): + if word == "needed": + marker = i + elif word == "provides": + start = i + 1 + if marker is not None: + conflicts.append(cls._matchspec_from_error_str(words[-1])) + not_found.append(cls._matchspec_from_error_str(words[start:marker])) + elif "has constraint" in line and "conflicting with" in line: + # package libzlib-1.2.11-h4e544f5_1014 has constraint zlib 1.2.11 *_1014 + # conflicting with zlib-1.2.13-h998d150_0 + conflicts.append(cls._matchspec_from_error_str(words[-1])) + elif "cannot install both pin-" in line and "and pin-" in line: + # a pin is in conflict with another pin + pin_a = words[3].rsplit("-", 1)[0] + pin_b = words[5].rsplit("-", 1)[0] + conflicts.append(MatchSpec(pin_a)) + conflicts.append(MatchSpec(pin_b)) + elif "is excluded by strict repo priority" in line: + # package python-3.7.6-h0371630_2 is excluded by strict repo priority + conflicts.append(cls._matchspec_from_error_str(words[1])) + elif line == "unsupported request": + # libmamba v2 has this message for package not found errors + # we need to double check with the explained problem + for explained_line in explained_problems.splitlines(): + explained_line = explained_line.lstrip("│├└─ ").strip() + explained_words = explained_line.split() + if "does not exist" in explained_line and "which" not in explained_line: + end = explained_words.index("does") + not_found.append(cls._matchspec_from_error_str(explained_words[:end])) + break + else: + log.debug("! Problem line not recognized: %s", line) + + return { + "conflicts": {s.name: s for s in conflicts}, + "not_found": {s.name: s for s in not_found}, + } + + def _maybe_raise_for_problems( + self, + unsolvable: UnSolvable, + index: LibMambaIndexHelper, + out_state: SolverOutputState, + previous_conflicts: Mapping[str, MatchSpec] = None, + ) -> None: + parsed_problems = self._parse_problems(unsolvable, index.db) + # We allow conda-build (if present) to process the exception early + self._maybe_raise_for_conda_build( + {**parsed_problems["conflicts"], **parsed_problems["not_found"]}, + message=self._prepare_problems_message(unsolvable, index.db, out_state), + ) + + unsatisfiable = parsed_problems["conflicts"] + not_found = parsed_problems["not_found"] + if not unsatisfiable and not_found: + if log.isEnabledFor(logging.DEBUG): + log.debug( + "Inferred PackagesNotFoundError %s from conflicts:\n%s", + tuple(not_found.keys()), + unsolvable.explain_problems(index.db, problems_format_nocolor), + ) + # This is not a conflict, but a missing package in the channel + exc = PackagesNotFoundError(tuple(not_found.values()), tuple(index.channels)) + exc.allow_retry = False + raise exc + + previous = previous_conflicts or {} + previous_set = set(previous.values()) + current_set = set(unsatisfiable.values()) + + diff = current_set.difference(previous_set) + if len(diff) > 1 and "python" in unsatisfiable: + # Only report python as conflict if it's the only conflict reported + # This helps us prioritize neutering for other dependencies first + unsatisfiable.pop("python") + + if (previous and (previous_set == current_set)) or len(diff) >= 10: + # We have same or more (up to 10) unsatisfiable now! Abort to avoid recursion + message = self._prepare_problems_message(unsolvable, index.db, out_state) + exc = LibMambaUnsatisfiableError(message) + # do not allow conda.cli.install to try more things + exc.allow_retry = False + raise exc + return unsatisfiable + + def _prepare_problems_message( + self, unsolvable: UnSolvable, db: Database, out_state: SolverOutputState + ) -> str: + message = unsolvable.problems_to_str(db) + explain = True + if " - " not in message: + # This makes 'explain_problems()' crash. Anticipate. + message = "Failed with empty error message." + explain = False + elif "is excluded by strict repo priority" in message: + # This will cause a lot of warnings until implemented in detail explanations + log.info("Skipping error explanation. Excluded by strict repo priority.") + explain = False + + if explain: + try: + explained_errors = unsolvable.explain_problems(db, problems_format_auto) + message += "\n" + explained_errors + except Exception as exc: + log.warning("Failed to explain problems", exc_info=exc) + if out_state.pins and "pin on " in message: # add info about pins for easier debugging + pin_message = "Pins seem to be involved in the conflict. Currently pinned specs:\n" + for _, spec in out_state.pins.items(): + pin_message += f" - {spec}\n" + message += f"\n\n{pin_message}" + return message + + def _maybe_raise_for_conda_build( + self, + conflicting_specs: Mapping[str, MatchSpec], + message: str = None, + ) -> None: + # TODO: Remove this hack for conda-build compatibility >_< + # conda-build expects a slightly different exception format + # good news is that we don't need to retry much, because all + # conda-build envs are fresh - if we found a conflict, we report + # right away to let conda build handle it + if not self._called_from_conda_build(): + return + if not conflicting_specs: + return + from .conda_build_exceptions import ExplainedDependencyNeedsBuildingError + + # the patched index should contain the arch we are building this env for + # if the index is empty, we default to whatever platform we are running on + subdir = next((subdir for subdir in self.subdirs if subdir != "noarch"), context.subdir) + exc = ExplainedDependencyNeedsBuildingError( + packages=list(conflicting_specs.keys()), + matchspecs=list(conflicting_specs.values()), + subdir=subdir, + explanation=message, + ) + raise exc + + # endregion + + # region General helpers + ######################## + + def _log_info(self) -> None: + log.info("conda version: %s", _conda_version) + log.info("conda-libmamba-solver version: %s", __version__) + log.info("libmambapy version: %s", mamba_version()) + log.info("Target prefix: %r", self.prefix) + log.info("Command: %s", sys.argv) + + def _called_from_conda_build(self) -> bool: + """ + conda build calls the solver via `conda.plan.install_actions`, which + overrides Solver._index (populated in the classic solver, but empty for us) + with a custom index. We can use this to detect whether conda build is in use + and apply some compatibility fixes. + """ + return ( + # conda_build.environ.get_install_actions will always pass a custom 'index' + # which conda.plan.install_actions uses to override our null Solver._index + getattr(self, "_index", None) + # Is conda build in use? In that case, it should have been imported + and "conda_build" in sys.modules + # Confirm conda_build.environ's 'get_install_actions' and conda.plan's + # 'install_actions' are in the call stack. We don't check order or + # contiguousness, but what are the chances at this point...? + # frame[3] contains the name of the function in that frame of the stack + and {"install_actions", "get_install_actions"} <= {frame[3] for frame in stack()} + ) + + def _check_spec_compat(self, spec: MatchSpec | None) -> MatchSpec | None: + if spec is None: + return + spec_fields = {} + for field in spec.FIELD_NAMES: + value = spec.get_raw_value(field) + if value: + if field == "channel": + if str(value) == "": + continue + if not getattr(value, "name", ""): + # channels like http://localhost:8000 don't have a name + # this makes mamba choke so we should skip it + # however the subdir is still useful information; keep it! + if getattr(value, "platform", ""): + spec_fields["subdir"] = value.platform + continue + spec_fields[field] = value + return MatchSpec(**spec_fields) + + def _conda_spec_to_libmamba_spec(self, spec: MatchSpec) -> LibmambaMatchSpec: + return LibmambaMatchSpec.parse(str(spec)) + + @staticmethod + def _fix_version_field_for_conda_build(spec: MatchSpec) -> MatchSpec: + """Fix taken from mambabuild""" + if spec.version: + only_dot_or_digit_re = re.compile(r"^[\d\.]+$") + version_str = str(spec.version) + if re.match(only_dot_or_digit_re, version_str): + spec_fields = spec.conda_build_form().split() + if version_str.count(".") <= 1: + spec_fields[1] = version_str + ".*" + else: + spec_fields[1] = version_str + "*" + return MatchSpec(" ".join(spec_fields)) + return spec + + @staticmethod + def _matchspec_from_error_str(spec: str | Sequence[str]) -> MatchSpec: + try: + if isinstance(spec, str): + name, version, build = spec.rsplit("-", 2) + return MatchSpec(name=name, version=version, build=build) + else: + kwargs = {"name": spec[0].rstrip(",")} + if len(spec) >= 2 and spec[1] != "=*": + if spec[1].startswith("==") or not spec[1].startswith("="): + kwargs["version"] = spec[1].rstrip(",") + else: + kwargs["version"] = spec[1][1:].rstrip(",") + ".*" + if len(spec) == 3 and spec[2] != "*": + kwargs["build"] = spec[2].rstrip(",") + return MatchSpec(**kwargs) + except Exception as exc: + raise ValueError(f"Could not parse spec: {spec}") from exc + + def _maybe_ignore_current_repodata(self) -> str: + is_repodata_fn_set = False + for config in context.collect_all().values(): + for key, value in config.items(): + if key == "repodata_fns" and value: + is_repodata_fn_set = True + break + if self._repodata_fn == "current_repodata.json" and not is_repodata_fn_set: + log.debug( + "Ignoring repodata_fn='current_repodata.json', defaulting to %s", + REPODATA_FN, + ) + return REPODATA_FN + return self._repodata_fn + + def _max_attempts(self, in_state: SolverInputState, default: int = 1) -> int: + from_env_var = os.environ.get("CONDA_LIBMAMBA_SOLVER_MAX_ATTEMPTS") + installed_count = len(in_state.installed) + if from_env_var: + try: + max_attempts_from_env = int(from_env_var) + except ValueError: + raise CondaValueError( + f"CONDA_LIBMAMBA_SOLVER_MAX_ATTEMPTS='{from_env_var}'. Must be int." + ) + if max_attempts_from_env < 1: + raise CondaValueError( + f"CONDA_LIBMAMBA_SOLVER_MAX_ATTEMPTS='{max_attempts_from_env}'. Must be >=1." + ) + elif max_attempts_from_env > installed_count: + log.warning( + "CONDA_LIBMAMBA_SOLVER_MAX_ATTEMPTS='%s' is higher than the number of " + "installed packages (%s). Using that one instead.", + max_attempts_from_env, + installed_count, + ) + return installed_count + else: + return max_attempts_from_env + elif in_state.update_modifier.FREEZE_INSTALLED and installed_count: + # this the default, but can be overriden with --update-specs + # we cap at MAX_SOLVER_ATTEMPTS_CAP attempts to avoid things + # getting too slow in large environments + return min(self.MAX_SOLVER_ATTEMPTS_CAP, installed_count) + else: + return default + + def _notify_conda_outdated( + self, + link_precs: Iterable[PackageRecord], + index: LibMambaIndexHelper | None = None, + final_state: Iterable[PackageRecord] | None = None, + ) -> None: + """ + We are overriding the base class implementation, which gets called in + Solver.solve_for_diff() once 'link_precs' is available. However, we + are going to call it before (in .solve_final_state(), right after the solve). + That way we can reuse the IndexHelper and SolverOutputState instances we have + around, which contains the channel and env information we need, before losing them. + """ + if index is None and final_state is None: + # The parent class 'Solver.solve_for_diff()' method will call this method again + # with only 'link_precs' as the argument, because that's the original method signature. + # We have added two optional kwargs (index and final_state) so we can call this method + # earlier, in .solve_final_state(), while we still have access to the index helper + # (which allows us to query the available packages in the channels quickly, without + # reloading the channels with conda) and the final_state (which gives the list of + # packages to be installed). So, if both index and final_state are None, we return + # because that means that the method is being called from .solve_for_diff() and at + # that point we will have already called it from .solve_for_state(). + return + if not context.notify_outdated_conda or context.quiet: + # This check can be silenced with a specific option in the context or in quiet mode + return + + # manually check base prefix since `PrefixData(...).get("conda", None) is expensive + # once prefix data is lazy this might be a different situation + current_conda_prefix_rec = None + conda_self_installed = False + conda_frozen_file_found = os.path.exists( + os.path.join(context.root_prefix, PREFIX_FROZEN_FILE) + ) + conda_meta_prefix_directory = os.path.join(context.root_prefix, "conda-meta") + with suppress(OSError, ValueError): + if os.path.lexists(conda_meta_prefix_directory): + for entry in os.scandir(conda_meta_prefix_directory): + if entry.is_file() and entry.name.endswith(".json"): + package_name = entry.name.rsplit("-", 2)[0] + if package_name == "conda": + with open(entry.path) as f: + current_conda_prefix_rec = PrefixRecord(**json.loads(f.read())) + elif package_name == "conda-self": + conda_self_installed = True + if conda_self_installed and current_conda_prefix_rec is not None: + # conda-self is installed and current conda has been found, no more information needed + break + + if not current_conda_prefix_rec: + # We are checking whether conda can be found in the environment conda is + # running from. Unless something is really wrong, this should never happen. + return + + channel_name = current_conda_prefix_rec.channel.canonical_name + if channel_name in (UNKNOWN_CHANNEL, "@", "", "pypi"): + channel_name = "defaults" + + # only check the loaded index if it contains the channel conda should come from + # otherwise ignore + index_channels = {getattr(chn, "canonical_name", chn) for chn in index.channels} + if channel_name not in index_channels: + return + + # we only want to check if a newer conda is available in the channel we installed it from + conda_newer_str = f"{channel_name}::conda>{_conda_version}" + conda_newer_spec = MatchSpec(conda_newer_str) + + # if target prefix is the same conda is running from + # maybe the solution we are proposing already contains + # an updated conda! in that case, we don't need to check further + if paths_equal(self.prefix, context.conda_prefix): + if any(conda_newer_spec.match(record) for record in final_state): + return + + # check if the loaded index contains records that match a more recent conda version + conda_newer_records = index.search(conda_newer_str) + + # print instructions to stderr if we found a newer conda + if conda_newer_records: + newest = max(conda_newer_records, key=lambda x: VersionOrder(x.version)) + conda_update_message = f"conda update -n base -c {channel_name} conda" + if conda_frozen_file_found: + if conda_self_installed: + conda_update_message = "conda self update" + else: + conda_update_message += " --override-frozen" + + print( + dedent( + f""" + + ==> WARNING: A newer version of conda exists. <== + current version: {_conda_version} + latest version: {newest.version} + + Please update conda by running + + $ {conda_update_message} + + """ + ), + file=sys.stderr, + ) + + # endregion diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/state.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/state.py new file mode 100644 index 0000000000000000000000000000000000000000..3214fa76f8ef2b8bd958f22666c119c8b9aecdf3 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/state.py @@ -0,0 +1,782 @@ +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +""" +Solver-agnostic logic to compose the requests passed to the solver +and accumulate its results. + +The state exposed to the solver is handled by two objects whose primary +function is to serve read-only information to the solver and its other helpers. + +- ``SolverInputState``: fully solver agnostic. It handles: + - The local state on disk, namely the prefix state. This includes the + already installed packages in the prefix (if any), the explicit requests + made in that prefix in the past (history), its pinned specs, packages + configured as aggressive updates and others. + - The runtime context, determined by the configuration file(s), + `CONDA_*` environment variables, command line flags and the requested + specs (if any). +- ``IndexHelper``: can be subclassed to add solver-specific logic + (e.g. custom index building). It should, provide, at least, a method to + query the index for the _explicit pool_ of packages for a given spec (e.g. + its potential dependency tree). Note that the IndexHelper might need + pieces of ``SolverInputState`` to build the index (e.g. installed packages, + configured channels and subdirs...) + +.. todo:: + + Embed IndexHelper in SolverInputState? + +Since ``conda`` follows an iterative approach to solve a request, +in addition the _input_ state, the Solver itself can store additional state +in a separate helper: the ``SolverOutputState`` object. This is meant to help +accumulate the following pieces of data: + +- ``specs``: a mapping of package names to its corresponding ``MatchSpec`` + objects. These objects are passed to the actual Solver, hoping it will return + a solution. +- ``records``: a mapping of package names to ``PackageRecord`` objects. It will + end up containing the list of package records that will compose the final state + of the prefix (the _solution_). Its default value is set to the currently installed + packages in the prefix. The solver will alter this list as needed to accommodate + the final solution. + +If the algorithm was not iterative, the sole purpose of the solver would be to turn +the ``specs`` into ``records``. However, ``conda``'s logic will try to constrain the +solution to mimic the initial state as much as possible to reduce the amount of +changes in the prefix. Sometimes, the initial request is too constrained, which results +in a number of conflicts. These conflicts are then stored in the ``conflicts`` mapping, +which will determine which ``specs`` are relaxed in the next attempt. Additionally, +``conda`` stores other solve artifacts: + +- ``for_history``: The explicitly requested specs in the command-line should end up + in the history. Some modifier flags can affect how this mapping is populated (e.g. + ``--update-deps``.) +- ``neutered``: Pieces of history that were found to be conflicting in the future and + were annotated as such to avoid falling in the same conflict again. + +The mappings stored in ``SolverOutputState`` are backed by ``TrackedMap`` objects, +which allow to keep the reasons _why_ those specs or records were added to the mappings, +as well as richer logging for each action. +""" +# TODO: This module could be part of conda-core once if we refactor the classic logic + +from __future__ import annotations + +import logging +from types import MappingProxyType +from typing import TYPE_CHECKING + +from boltons.setutils import IndexedSet +from conda.auxlib import NULL +from conda.base.constants import DepsModifier, UpdateModifier +from conda.base.context import context +from conda.common.path import paths_equal +from conda.core.index import Index +from conda.core.prefix_data import PrefixData +from conda.core.solve import get_pinned_specs +from conda.exceptions import PackagesNotFoundError, SpecsConfigurationConflictError +from conda.history import History +from conda.models.channel import Channel +from conda.models.match_spec import MatchSpec +from conda.models.prefix_graph import PrefixGraph + +if TYPE_CHECKING: + from collections.abc import Iterable + from os import PathLike + from typing import Any + + from conda.core.solve import Solver + from conda.models.records import PackageRecord + + from .index import LibMambaIndexHelper + +from .utils import EnumAsBools, compatible_specs + +log = logging.getLogger(f"conda.{__name__}") + + +class SolverInputState: + """ + Helper object to provide the input data needed to compute the state that will be + exposed to the solver. + + Parameters + ---------- + prefix + Path to the prefix we are operating on. This will be used to expose + ``PrefixData``, ``History``, pinned specs, among others. + requested + The MatchSpec objects required by the user (either in the command line or + through the Python API). + update_modifier + A value of ``UpdateModifier``, which has an effect on which specs are added + to the final list. The default value here must match the default value in the + ``context`` object. + deps_modifier + A value of ``DepsModifier``, which has an effect on which specs are added + to the final list. The default value here must match the default value in the + ``context`` object. + ignore_pinned + Whether pinned specs can be ignored or not. The default value here must match + the default value in the ``context`` object. + force_remove + Remove the specs without solving the environment (which would also remove their) + dependencies. The default value here must match the default value in the + ``context`` object. + force_reinstall + Uninstall and install the computed records even if they were already satisfied + in the given prefix. The default value here must match the default value in the + ``context`` object. + prune + Remove dangling dependencies that ended up orphan. The default value here must + match the default value in the ``context`` object. + command + The subcommand used to invoke this operation (e.g. ``create``, ``install``, ``remove``...). + It can have an effect on the computed list of records. + _pip_interop_enabled + Internal only. Whether ``PrefixData`` will also expose packages not installed by + ``conda`` (e.g. ``pip`` and others can put Python packages in the prefix). + """ + + _ENUM_STR_MAP = { + "NOT_SET": DepsModifier.NOT_SET, + "NO_DEPS": DepsModifier.NO_DEPS, + "ONLY_DEPS": DepsModifier.ONLY_DEPS, + "SPECS_SATISFIED_SKIP_SOLVE": UpdateModifier.SPECS_SATISFIED_SKIP_SOLVE, + "FREEZE_INSTALLED": UpdateModifier.FREEZE_INSTALLED, + "UPDATE_DEPS": UpdateModifier.UPDATE_DEPS, + "UPDATE_SPECS": UpdateModifier.UPDATE_SPECS, + "UPDATE_ALL": UpdateModifier.UPDATE_ALL, + } + _DO_NOT_REMOVE_NAMES = ( + "anaconda", + "conda", + "conda-build", + "python.app", + "console_shortcut", + "powershell_shortcut", + ) + + def __init__( + self, + prefix: str | bytes | PathLike, + requested: Iterable[str | MatchSpec] | None = (), + update_modifier: UpdateModifier | None = UpdateModifier.UPDATE_SPECS, + deps_modifier: DepsModifier | None = DepsModifier.NOT_SET, + ignore_pinned: bool | None = None, + force_remove: bool | None = False, + force_reinstall: bool | None = False, + prune: bool | None = False, + command: str | None = None, + _pip_interop_enabled: bool | None = None, + ): + self.prefix = prefix + self._prefix_data = PrefixData(prefix, interoperability=_pip_interop_enabled) + self._pip_interop_enabled = _pip_interop_enabled + self._history = History(prefix).get_requested_specs_map() + self._pinned = {spec.name: spec for spec in get_pinned_specs(prefix)} + self._aggressive_updates = {spec.name: spec for spec in context.aggressive_update_packages} + + virtual = Index().system_packages + self._virtual = {record.name: record for record in virtual} + + self._requested = {} + for spec in requested: + spec = MatchSpec(spec) + self._requested[spec.name] = spec + + self._update_modifier = self._default_to_context_if_null( + "update_modifier", update_modifier + ) + if prune and self._update_modifier == UpdateModifier.FREEZE_INSTALLED: + self._update_modifier = UpdateModifier.UPDATE_SPECS # revert to default + self._deps_modifier = self._default_to_context_if_null("deps_modifier", deps_modifier) + self._ignore_pinned = self._default_to_context_if_null("ignore_pinned", ignore_pinned) + self._force_remove = self._default_to_context_if_null("force_remove", force_remove) + self._force_reinstall = self._default_to_context_if_null( + "force_reinstall", force_reinstall + ) + self._prune = prune + self._command = command + + # special cases + self._do_not_remove = {p: MatchSpec(p) for p in self._DO_NOT_REMOVE_NAMES} + + def _default_to_context_if_null(self, name, value, context=context) -> Any: + "Obtain default value from the context if value is set to NULL; otherwise leave as is" + return getattr(context, name) if value is NULL else self._ENUM_STR_MAP.get(value, value) + + @property + def prefix_data(self) -> PrefixData: + """ + A direct reference to the ``PrefixData`` object for the given ``prefix``. + You will usually use this object through the ``installed`` property. + """ + return self._prefix_data + + # Prefix state pools + + @property + def installed(self) -> dict[str, PackageRecord]: + """ + This exposes the installed packages in the prefix. Note that a ``PackageRecord`` + can generate an equivalent ``MatchSpec`` object with ``.to_match_spec()``. + Records are toposorted. + """ + return MappingProxyType(dict(sorted(self.prefix_data._prefix_records.items()))) + + @property + def history(self) -> dict[str, MatchSpec]: + """ + These are the specs that the user explicitly asked for in previous operations + on the prefix. See :class:`History` for more details. + """ + return MappingProxyType(self._history) + + @property + def pinned(self) -> dict[str, MatchSpec]: + """ + These specs represent hard constrains on what package versions can be installed + on the environment. The packages here returned don't need to be already installed. + + If ``ignore_pinned`` is True, this returns an empty dictionary. + """ + if self.ignore_pinned: + return MappingProxyType({}) + return MappingProxyType(self._pinned) + + @property + def virtual(self) -> dict[str, MatchSpec]: + """ + System properties exposed as virtual packages (e.g. ``__glibc=2.17``). These packages + cannot be (un)installed, they only represent constrains for other packages. By convention, + their names start with a double underscore. + """ + return MappingProxyType(dict(sorted(self._virtual.items()))) + + @property + def aggressive_updates(self) -> dict[str, MatchSpec]: + """ + Packages that the solver will always try to update. As such, they will never have an + associated version or build constrain. Note that the packages here returned do not need to + be installed. + """ + return MappingProxyType(self._aggressive_updates) + + @property + def always_update(self) -> dict[str, MatchSpec]: + """ + Merged lists of packages that should always be updated, depending on the flags, including: + - aggressive_updates + - conda if auto_update_conda is true and we are on the base env + - almost all packages if update_all is true + - etc + """ + installed = self.installed + pinned = self.pinned + pkgs = {pkg: MatchSpec(pkg) for pkg in self.aggressive_updates if pkg in installed} + if context.auto_update_conda and paths_equal(self.prefix, context.root_prefix): + pkgs.setdefault("conda", MatchSpec("conda")) + if self.update_modifier.UPDATE_ALL: + for pkg in installed: + if pkg != "python" and pkg not in pinned: + pkgs.setdefault(pkg, MatchSpec(pkg)) + return MappingProxyType(pkgs) + + @property + def do_not_remove(self) -> dict[str, MatchSpec]: + """ + Packages that are protected by the solver so they are not accidentally removed. This list + is not configurable, but hardcoded for legacy reasons. + """ + return MappingProxyType(self._do_not_remove) + + @property + def requested(self) -> dict[str, MatchSpec]: + """ + Packages that the user has explicitly asked for in this operation. + """ + return MappingProxyType(self._requested) + + # Types of commands + + @property + def is_installing(self) -> bool: + """ + True if the used subcommand was ``install``. + """ + return self._command == "install" + + @property + def is_updating(self) -> bool: + """ + True if the used subcommand was ``update``. + """ + return self._command == "update" + + @property + def is_creating(self) -> bool: + """ + True if the used subcommand was ``create``. + """ + return self._command == "create" + + @property + def is_removing(self) -> bool: + """ + True if the used subcommand was ``remove``. + """ + return self._command == "remove" + + # modifiers + + @property + def update_modifier(self) -> EnumAsBools: + """ + Use attribute access to test whether the modifier is set to that value + + >>> update_modifier = EnumAsBools(context.update_modifier) + >>> update_modifier.UPDATE_SPECS + True + >>> update_modifier.UPDATE_DEPS + False + """ + return EnumAsBools(self._update_modifier) + + @property + def deps_modifier(self) -> EnumAsBools: + """ + Use attribute access to test whether the modifier is set to that value + + >>> deps_modifier = EnumAsBools(context.deps_modifier) + >>> deps_modifier.NOT_SET + True + >>> deps_modifier.DEPS_ONLY + False + """ + return EnumAsBools(self._deps_modifier) + + # Other flags + + @property + def ignore_pinned(self) -> bool: + return self._ignore_pinned + + @property + def force_remove(self) -> bool: + return self._force_remove + + @property + def force_reinstall(self) -> bool: + return self._force_reinstall + + @property + def prune(self) -> bool: + return self._prune + + #  Utility methods + + def channels_from_specs(self) -> Iterable[Channel]: + """ + Collect all channels added with the `channel::package=*` syntax. For now, + we only collect those specifically requested by the user in the current command + (same as conda), but we should investigate whether history keeps channels around + too. + """ + for spec in self.requested.values(): + channel = spec.get_exact_value("channel") + if channel: + if spec.original_spec_str and spec.original_spec_str.startswith("file://"): + # Handle MatchSpec roundtrip issue with local channels + channel = Channel(spec.original_spec_str.split("::")[0]) + yield channel + + def maybe_free_channel(self) -> Iterable[Channel]: + # FUTURE: conda 25.9+ remove restore_free_channel + if channel := getattr(context, "_restore_free_channel", None): + context.custom_multichannels # force deprecation warning + elif channel is None: + channel = getattr(context, "restore_free_channel", None) + + if channel: + yield Channel.from_url("https://repo.anaconda.com/pkgs/free") + + +class SolverOutputState: + """ + This is the main mutable object we will massage before passing the result of the computation + (the ``specs`` mapping) to the solver. It will also store the result of the solve (in + ``records``). + + Parameters + ---------- + solver_input_state + This instance provides the initial state for the output. + records + Dict of package names to ``PackageRecord`` objects. If not provided, it will be + initialized from the ``installed`` records in ``solver_input_state``. + for_history + Dict of package names to ``MatchSpec`` objects. These specs will be written to + the prefix history once the solve is complete. Its default initial value is taken from the + explicitly requested packages in the ``solver_input_state`` instance. + neutered + Dict of package names to ``MatchSpec`` objects. These specs are also written to + the prefix history, as part of the neutered specs. If not provided, their default value is + a blank mapping. + conflicts + If a solve attempt is not successful, conflicting specs are kept here for further + relaxation of the version and build constrains. If not provided, their default value is a + blank mapping. + pins + Packages that ended up being pinned. Mostly used for reporting and debugging. Deprecated. + + Notes + ----- + Almost all the attributes in this object map package names (``str``) to ``MatchSpec`` + (_specs_ in short) objects. The only mapping with different values is ``records``, which + stores ``PackageRecord`` objects. A quick note on these objects: + + * ``MatchSpec`` objects are a query language for packages, based on the ``PackageRecord`` + schema. ``PackageRecord`` objects is how packages that are already installed are + represented. This is what you get from ``PrefixData.iter_records()``. Since they are + related, ``MatchSpec`` objects can be created from a ``PackageRecord`` with + ``.to_match_spec()``. + * ``MatchSpec`` objects also feature fields like ``target`` and ``optional``. These are, + essentially, used by the low-level classic solver (:class:`conda.resolve.Resolve`) to + mark specs as items it can optionally play with to satisfy the solver constrains. A + ``target`` marked spec is _soft-pinned_ in the sense that the solver will try to satisfy + that but it will stop trying if it gets in the way, so you might end up a different + version or build. ``optional`` seems to be in the same lines, but maybe the entire spec + can be dropped from the request? The key idea here is that these two fields might not be + directly usable by the solver, but it might need some custom adaptation. For example, for + ``libmamba`` we might need a separate pool that can be configured as a flexible task. See + more details in the first comment of ``conda.core.solve.classic.Solver._add_specs`` + """ + + def __init__( + self, + *, + solver_input_state: SolverInputState, + records: dict[str, PackageRecord] | None = None, + for_history: dict[str, MatchSpec] | None = None, + neutered: dict[str, MatchSpec] | None = None, + conflicts: dict[str, MatchSpec] | None = None, + pins: dict[str, MatchSpec] | None = None, + ): + self.solver_input_state: SolverInputState = solver_input_state + self.records: dict[str, PackageRecord] = records or dict(solver_input_state.installed) + self.for_history: dict[str, MatchSpec] = for_history or dict(solver_input_state.requested) + self.neutered: dict[str, MatchSpec] = neutered or {} + self.conflicts: dict[str, MatchSpec] = conflicts or {} + self.pins: dict[str, MatchSpec] = pins or {} + + @property + def current_solution(self) -> IndexedSet[PackageRecord]: + """ + Massage currently stored records so they can be returned as the type expected by the + solver API. This is what you should return in ``Solver.solve_final_state()``. + """ + return IndexedSet(PrefixGraph(self.records.values()).graph) + + @property + def specs(self) -> dict[str, MatchSpec]: + """ + Merge all possible sources of input package specs, sorted by their input category and + strictness. It's just meant to be an enumeration of all possible inputs, not a ready-to-use + list of specs for a solver. + """ + sis = self.solver_input_state + specs_by_strictness = {} + for group in ( + "requested", + "pinned", + "history", + "aggressive_updates", + ): + for name, spec in sorted( + getattr(sis, group).items(), + key=sort_by_spec_strictness, + reverse=True, + ): + specs_by_strictness.setdefault(name, spec) + for record_group in ("installed", "virtual"): + for name, record in getattr(sis, record_group).items(): + specs_by_strictness.setdefault(name, record.to_match_spec()) + return specs_by_strictness + + @property + def real_specs(self) -> dict[str, MatchSpec]: + """ + Specs that are _not_ virtual. + """ + return {name: spec for name, spec in self.specs.items() if not name.startswith("__")} + + @property + def virtual_specs(self) -> dict[str, MatchSpec]: + """ + Specs that are virtual. + """ + return {name: spec for name, spec in self.specs.items() if name.startswith("__")} + + def early_exit(self) -> IndexedSet[PackageRecord] | None: + """ + Operations that do not need a solver and might result in returning + early are collected here. + """ + sis = self.solver_input_state + if sis.is_removing: + # Make sure that requested packages to be removed match + # an installed record. Otherwise, raise an error. + # When 'remove --force' is set, remove the package without solving. + if sis.force_remove: + force_remove_solution = self.current_solution + not_installed: list[MatchSpec] = [] + for name, spec in sis.requested.items(): + for record in sis.installed.values(): + if spec.match(record): + if sis.force_remove: + force_remove_solution.remove(record) + break + else: + not_installed.append(spec) + + if not_installed: + exc = PackagesNotFoundError(not_installed) + exc.allow_retry = False + raise exc + + if sis.force_remove: + return force_remove_solution + elif sis.update_modifier.SPECS_SATISFIED_SKIP_SOLVE: + for name, spec in sis.requested.items(): + if name not in sis.installed: + break + if not any(spec.match(record) for record in sis.installed.values()): + break + else: + # All specs match a package in the current environment. + # Return early, with the current solution (at this point, .records is set + # to the map of installed packages) + return self.current_solution + + def check_for_pin_conflicts(self, index: LibMambaIndexHelper) -> None: + """ + Last part of the logic, common to addition and removal of packages. Originally, + the legacy logic will also minimize the conflicts here by doing a pre-solve + analysis, but so far we have opted for a different approach in libmamba: let the + solver try, fail with conflicts, and annotate those as such so they are unconstrained. + + Now, this method only ensures that the pins do not cause conflicts. + """ + # ## Inconsistency analysis ### + # here we would call conda.core.solve.classic.Solver._find_inconsistent_packages() + + # ## Check pin and requested are compatible + sis = self.solver_input_state + requested_and_pinned = set(sis.requested).intersection(sis.pinned) + for name in requested_and_pinned: + requested = sis.requested[name] + pin = sis.pinned[name] + installed = sis.installed.get(name) + if ( + # name-only pins lock to installed; requested spec must match it + (pin.is_name_only_spec and installed and not requested.match(installed)) + # otherwise, the pin needs to be compatible with the requested spec + or not compatible_specs(index, (requested, pin)) + ): + pinned_specs = [ + (sis.installed.get(name, pin) if pin.is_name_only_spec else pin) + for name, pin in sorted(sis.pinned.items()) + ] + exc = SpecsConfigurationConflictError( + requested_specs=sorted(sis.requested.values(), key=lambda x: x.name), + pinned_specs=pinned_specs, + prefix=sis.prefix, + ) + exc.allow_retry = False + raise exc + + def post_solve(self, solver: Solver) -> None: + """ + These tasks are performed _after_ the solver has done its work. It essentially + post-processes the ``records`` mapping. + + Parameters + ---------- + solver_cls + The class used to instantiate the Solver. If not provided, defaults to the one + specified in the context configuration. + + Notes + ----- + This method could be solver-agnostic but unfortunately ``--update-deps`` requires a + second solve; that's why this method needs a solver class to be passed as an argument. + """ + # After a solve, we still need to do some refinement + sis = self.solver_input_state + + # ## Record history ### + # user requested specs need to be annotated in history + # we control that in .for_history + self.for_history.update(sis.requested) + + # ## Neutered ### + # annotate overridden history specs so they are written to disk + for name, spec in sis.history.items(): + record = self.records.get(name) + if record and not spec.match(record): + self.neutered[name] = MatchSpec(name, version=record.version) + + # ## Add inconsistent packages back ### + # direct result of the inconsistency analysis above + + # ## Deps modifier ### + # handle the different modifiers (NO_DEPS, ONLY_DEPS, UPDATE_DEPS) + # this might mean removing different records by hand or even calling + # the solver a 2nd time + + if sis.deps_modifier.NO_DEPS: + # In the NO_DEPS case, we need to start with the original list of packages in the + # environment, and then only modify packages that match the requested specs + # + # Help information notes that use of NO_DEPS is expected to lead to broken + # environments. + original_state = dict(sis.installed) + only_change_these = {} + for name, spec in sis.requested.items(): + for record in self.records.values(): + if spec.match(record): + only_change_these[name] = record + + if sis.is_removing: + # TODO: This could be a pre-solve task to save time in forced removes? + for name in only_change_these: + del original_state[name] + else: + for name, record in only_change_these.items(): + original_state[name] = record + + self.records.clear() + self.records.update(original_state) + + elif sis.deps_modifier.ONLY_DEPS and not sis.update_modifier.UPDATE_DEPS: + # Using a special instance of PrefixGraph to remove youngest child nodes that match + # the original requested specs. It's important to remove only the *youngest* child + # nodes, because a typical use might be `conda install --only-deps python=2 flask`, + # and in that case we'd want to keep python. + # + # What are we supposed to do if flask was already in the environment? + # We can't be removing stuff here that's already in the environment. + # + # What should be recorded for the user-requested specs in this case? Probably all + # direct dependencies of flask. + + graph = PrefixGraph(self.records.values(), sis.requested.values()) + # this method below modifies the graph inplace _and_ returns the removed nodes + # (like dict.pop()) + would_remove = graph.remove_youngest_descendant_nodes_with_specs() + + # We need to distinguish the behavior between `conda remove` and the rest + to_remove = [] + if sis.is_removing: + for record in would_remove: + # do not remove records that were not requested but were installed + if record.name not in sis.requested and record.name in sis.installed: + continue + to_remove.append(record.name) + else: + for record in would_remove: + for dependency in record.depends: + spec = MatchSpec(dependency) + if spec.name not in self.specs: + # following https://github.com/conda/conda/pull/8766 + self.for_history[spec.name] = spec + to_remove.append(record.name) + + for name in to_remove: + installed = sis.installed.get(name) + if installed: + self.records[name] = installed + else: + self.records.pop(name, None) + + elif sis.update_modifier.UPDATE_DEPS: + # Here we have to SAT solve again :( It's only now that we know the dependency + # chain of specs_to_add. + # + # UPDATE_DEPS is effectively making each spec in the dependency chain a + # user-requested spec. For all other specs, we drop all information but name, drop + # target, and add them to `requested` so it gets recorded in the history file. + # + # It's like UPDATE_ALL, but only for certain dependency chains. + new_specs = {} + + graph = PrefixGraph(self.records.values()) + for name, spec in sis.requested.items(): + record = graph.get_node_by_name(name) + for ancestor in graph.all_ancestors(record): + new_specs[ancestor.name] = MatchSpec(ancestor.name) + + # Remove pinned_specs + for name, spec in sis.pinned.items(): + new_specs.pop(name, None) + # Follow major-minor pinning business rule for python + if "python" in new_specs: + record = sis.installed["python"] + version = ".".join(record.version.split(".")[:2]) + ".*" + new_specs["python"] = MatchSpec(name="python", version=version) + # Add in the original `requested` on top. + new_specs.update(sis.requested) + + if sis.is_removing: + specs_to_add = () + specs_to_remove = list(new_specs.keys()) + else: + specs_to_add = list(new_specs.values()) + specs_to_remove = () + + with context._override("quiet", False): + # Create a new solver instance to perform a 2nd solve with deps added We do it + # like this to avoid overwriting state accidentally. Instead, we will import + # the needed state bits manually. + records = solver.__class__( + prefix=solver.prefix, + channels=solver.channels, + subdirs=solver.subdirs, + specs_to_add=specs_to_add, + specs_to_remove=specs_to_remove, + command="recursive_call_for_update_deps", + ).solve_final_state( + update_modifier=UpdateModifier.UPDATE_SPECS, # avoid recursion! + deps_modifier=sis._deps_modifier, + ignore_pinned=sis.ignore_pinned, + force_remove=sis.force_remove, + prune=sis.prune, + ) + records = {record.name: record for record in records} + + self.records.clear() + self.records.update(records) + self.for_history.clear() + self.for_history.update(new_specs) + + # Disable pruning regardless the original value + # TODO: Why? Dive in https://github.com/conda/conda/pull/7719 + sis._prune = False + + # ## Prune ### + # remove orphan leaves in the graph + if sis.prune: + graph = PrefixGraph(list(self.records.values()), list(sis.requested.values())) + graph.prune() + self.records.clear() + self.records.update({record.name: record for record in graph.graph}) + + +def sort_by_spec_strictness(key_value_tuple: tuple[str, MatchSpec]) -> tuple[int, str]: + """ + Helper function to sort a list of (key, value) tuples by spec strictness + """ + name, spec = key_value_tuple + return getattr(spec, "strictness", 0), name diff --git a/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/utils.py b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..9fa5c4038c39b2cad1daaacee7ebf2c69875a520 --- /dev/null +++ b/miniconda3/pkgs/conda-libmamba-solver-25.11.0-pyhdf14ebd_0/site-packages/conda_libmamba_solver/utils.py @@ -0,0 +1,118 @@ +# Copyright (C) 2022 Anaconda, Inc +# Copyright (C) 2023 conda +# SPDX-License-Identifier: BSD-3-Clause +""" +Miscellaneous utilities +""" + +from __future__ import annotations + +from logging import getLogger +from typing import TYPE_CHECKING +from urllib.parse import quote + +from conda.common.compat import on_win +from conda.common.url import urlparse +from conda.exceptions import PackagesNotFoundError + +if TYPE_CHECKING: + from collections.abc import Iterable + from enum import Enum + + from conda.models.match_spec import MatchSpec + + from .index import LibMambaIndexHelper + +log = getLogger(f"conda.{__name__}") + + +def escape_channel_url(channel: str) -> str: + if channel.startswith("file:"): + if "%" in channel: # it's escaped already + return channel + if on_win: + channel = channel.replace("\\", "/") + parts = urlparse(channel) + if parts.scheme: + components = parts.path.split("/") + if on_win: + if parts.netloc and len(parts.netloc) == 2 and parts.netloc[1] == ":": + # with absolute paths (e.g. C:/something), C:, D:, etc might get parsed as netloc + path = "/".join([parts.netloc] + [quote(p) for p in components]) + parts = parts.replace(netloc="") + else: + path = "/".join(components[:2] + [quote(p) for p in components[2:]]) + else: + path = "/".join([quote(p) for p in components]) + parts = parts.replace(path=path) + return str(parts) + return channel + + +def compatible_specs( + index: LibMambaIndexHelper, specs: Iterable[MatchSpec], raise_not_found: bool = True +) -> bool: + """ + Assess whether the given specs are compatible with each other. + This is done by querying the index for each spec and taking the + intersection of the results. If the intersection is empty, the + specs are incompatible. + + If raise_not_found is True, a PackagesNotFoundError will be raised + when one of the specs is not found. Otherwise, False will be returned + because the intersection will be empty. + """ + if not len(specs) >= 2: + raise ValueError("Must specify at least two specs") + + matched = None + for spec in specs: + results = set(index.search(spec)) + if not results: + if raise_not_found: + exc = PackagesNotFoundError([spec], index.channels) + exc.allow_retry = False + raise exc + return False + if matched is None: + # First spec, just set matched to the results + matched = results + continue + # Take the intersection of the results + matched &= results + if not matched: + return False + + return bool(matched) + + +class EnumAsBools: + """ + Allows an Enum to be bool-evaluated with attribute access. + + >>> update_modifier = UpdateModifier("update_deps") + >>> update_modifier_as_bools = EnumAsBools(update_modifier) + >>> update_modifier == UpdateModifier.UPDATE_DEPS # from this + True + >>> update_modidier_as_bools.UPDATE_DEPS # to this + True + >>> update_modifier_as_bools.UPDATE_ALL + False + """ + + def __init__(self, enum: Enum): + self._enum = enum + self._names = {v.name for v in self._enum.__class__.__members__.values()} + + def __getattr__(self, name: str) -> bool: + if name in ("name", "value"): + return getattr(self._enum, name) + if name in self._names: + return self._enum.name == name + raise AttributeError(f"'{name}' is not a valid name for {self._enum.__class__.__name__}") + + def __eq__(self, obj: object) -> bool: + return self._enum.__eq__(obj) + + def _dict(self) -> dict[str, bool]: + return {name: self._enum.name == name for name in self._names} diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/bin/cph b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/bin/cph new file mode 100644 index 0000000000000000000000000000000000000000..69740851290a34411dbd89913fd2a0015214968e --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/bin/cph @@ -0,0 +1,11 @@ +#!/home/task_176236637997838/conda-bld/conda-package-handling_1762366405159/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/bin/python + +# -*- coding: utf-8 -*- +import re +import sys + +from conda_package_handling.cli import main + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/about.json b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..18da071ae3a1ddf6ced282405f1e64f07d8f0c41 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/about.json @@ -0,0 +1,163 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/r", + "https://repo.anaconda.com/pkgs/r" + ], + "conda_build_version": "25.1.2", + "conda_version": "25.1.1", + "description": "`conda` and `conda-build` use `conda_package_handling.api` to create and extract\nconda packages. This package also provides the `cph` command line tool to\nextract, create, and convert between formats.\n", + "dev_url": "https://github.com/conda/conda-package-handling", + "doc_url": "https://conda.github.io/conda-package-handling/", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true, + "recipe-maintainers": [ + "beckermr", + "dbast", + "dholth", + "jezdez" + ] + }, + "home": "https://github.com/conda/conda-package-handling", + "identifiers": [], + "keywords": [], + "license": "BSD-3-Clause", + "license_family": "BSD", + "license_file": "LICENSE", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "ca-certificates 2025.9.9 h06a4308_0", + "ld_impl_linux-64 2.40 h12ee557_0", + "libstdcxx-ng 11.2.0 h1234567_1", + "nlohmann_json 3.11.2 h6a678d5_0", + "pybind11-abi 5 hd3eb1b0_0", + "tzdata 2025a h04d1e81_0", + "libgomp 11.2.0 h1234567_1", + "_openmp_mutex 5.1 1_gnu", + "libgcc-ng 11.2.0 h1234567_1", + "bzip2 1.0.8 h5eee18b_6", + "c-ares 1.19.1 h5eee18b_0", + "cpp-expected 1.1.0 hdb19cb5_0", + "expat 2.6.4 h6a678d5_0", + "fmt 9.1.0 hdb19cb5_1", + "icu 73.1 h6a678d5_0", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_1", + "libuuid 1.41.5 h5eee18b_0", + "lz4-c 1.9.4 h6a678d5_1", + "ncurses 6.4 h6a678d5_0", + "liblief 0.12.3 h6a678d5_0", + "reproc 14.2.4 h6a678d5_2", + "simdjson 3.10.1 hdb19cb5_0", + "xz 5.4.6 h5eee18b_1", + "yaml-cpp 0.8.0 h6a678d5_1", + "zlib 1.2.13 h5eee18b_1", + "libedit 3.1.20230828 h5eee18b_0", + "libnghttp2 1.57.0 h2d74bed_0", + "libssh2 1.11.1 h251f7ec_0", + "libxml2 2.13.5 hfdd30dd_0", + "pcre2 10.42 hebb0a14_1", + "readline 8.2 h5eee18b_0", + "reproc-cpp 14.2.4 h6a678d5_2", + "spdlog 1.11.0 hdb19cb5_0", + "tk 8.6.14 h39e8969_0", + "zstd 1.5.6 hc292b87_0", + "krb5 1.20.1 h143b758_1", + "libarchive 3.7.7 hfab0078_0", + "libsolv 0.7.30 he621ea3_1", + "sqlite 3.45.3 h5eee18b_0", + "libcurl 8.11.1 hc9e6f67_0", + "python 3.12.9 h5148396_0", + "libmamba 2.0.5 haf1ee3a_1", + "menuinst 2.2.0 py312h06a4308_1", + "anaconda-anon-usage 0.5.0 py312hfc0e8ea_100", + "annotated-types 0.6.0 py312h06a4308_0", + "archspec 0.2.3 pyhd3eb1b0_0", + "boltons 24.1.0 py312h06a4308_0", + "brotli-python 1.0.9 py312h6a678d5_9", + "charset-normalizer 3.3.2 pyhd3eb1b0_0", + "distro 1.9.0 py312h06a4308_0", + "frozendict 2.4.2 py312h06a4308_0", + "idna 3.7 py312h06a4308_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "libmambapy 2.0.5 py312hdb19cb5_1", + "mdurl 0.1.0 py312h06a4308_0", + "packaging 24.2 py312h06a4308_0", + "platformdirs 3.10.0 py312h06a4308_0", + "pluggy 1.5.0 py312h06a4308_0", + "pycosat 0.6.6 py312h5eee18b_2", + "pycparser 2.21 pyhd3eb1b0_0", + "pygments 2.15.1 py312h06a4308_1", + "pysocks 1.7.1 py312h06a4308_0", + "ruamel.yaml.clib 0.2.8 py312h5eee18b_0", + "setuptools 75.8.0 py312h06a4308_0", + "tqdm 4.67.1 py312he106c6f_0", + "truststore 0.10.0 py312h06a4308_0", + "typing_extensions 4.12.2 py312h06a4308_0", + "wheel 0.45.1 py312h06a4308_0", + "cffi 1.17.1 py312h1fdaa30_1", + "jsonpatch 1.33 py312h06a4308_1", + "markdown-it-py 2.2.0 py312h06a4308_1", + "pip 25.0 py312h06a4308_0", + "ruamel.yaml 0.18.6 py312h5eee18b_0", + "typing-extensions 4.12.2 py312h06a4308_0", + "urllib3 2.3.0 py312h06a4308_0", + "cryptography 43.0.3 py312h7825ff9_1", + "pydantic-core 2.27.1 py312h4aa5aa6_0", + "requests 2.32.3 py312h06a4308_1", + "rich 13.9.4 py312h06a4308_0", + "zstandard 0.23.0 py312h2c38b39_1", + "conda-content-trust 0.2.0 py312h06a4308_1", + "conda-package-streaming 0.11.0 py312h06a4308_0", + "pydantic 2.10.3 py312h06a4308_0", + "conda-package-handling 2.4.0 py312h06a4308_0", + "conda 25.1.1 py312h06a4308_0", + "conda-anaconda-tos 0.1.2 py312h06a4308_0", + "conda-libmamba-solver 25.1.1 pyhd3eb1b0_0", + "libsodium 1.0.20 heac8642_0", + "openssl 3.0.18 hd6dcaed_0", + "patch 2.8 hb25bd0a_0", + "patchelf 0.17.2 h6a678d5_0", + "yaml 0.2.5 h7b6447c_0", + "argcomplete 3.6.2 py312h06a4308_0", + "attrs 24.3.0 py312h06a4308_0", + "certifi 2025.8.3 py312h06a4308_0", + "chardet 5.2.0 py312h06a4308_0", + "click 8.2.1 py312h06a4308_0", + "filelock 3.17.0 py312h06a4308_0", + "jmespath 1.0.1 py312h06a4308_0", + "markupsafe 3.0.2 py312h5eee18b_0", + "more-itertools 10.3.0 py312h06a4308_0", + "pkginfo 1.12.0 py312h06a4308_0", + "psutil 7.0.0 py312hee96239_0", + "py-lief 0.12.3 py312h6a678d5_0", + "python-libarchive-c 5.1 pyhd3eb1b0_0", + "pytz 2025.2 py312h06a4308_0", + "pyyaml 6.0.2 py312h5eee18b_0", + "rpds-py 0.22.3 py312h4aa5aa6_0", + "six 1.17.0 py312h06a4308_0", + "soupsieve 2.5 py312h06a4308_0", + "tomlkit 0.13.2 py312h06a4308_0", + "xmltodict 0.14.2 py312h06a4308_0", + "jinja2 3.1.6 py312h06a4308_0", + "python-dateutil 2.9.0post0 py312h06a4308_2", + "referencing 0.30.2 py312h06a4308_0", + "yq 3.4.3 py312h06a4308_0", + "beautifulsoup4 4.13.5 py312h06a4308_0", + "botocore 1.37.10 py312h06a4308_0", + "jsonschema-specifications 2023.7.1 py312h06a4308_0", + "pynacl 1.5.0 py312h2630517_2", + "jsonschema 4.25.0 py312h06a4308_0", + "s3transfer 0.11.2 py312h06a4308_0", + "boto3 1.37.10 py312h06a4308_0", + "conda-anaconda-telemetry 0.3.0 pyhd3eb1b0_1", + "conda-index 0.5.0 py312h06a4308_0", + "conda-build 25.1.2 py312h06a4308_0" + ], + "summary": "Create and extract conda packages of various formats.", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/files b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/files new file mode 100644 index 0000000000000000000000000000000000000000..f7006d8a2aa40b3b12f0049acfe0e0e0d014c500 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/files @@ -0,0 +1,33 @@ +bin/cph +lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/INSTALLER +lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/METADATA +lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/RECORD +lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/REQUESTED +lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/WHEEL +lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/direct_url.json +lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/entry_points.txt +lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/licenses/AUTHORS.md +lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/licenses/LICENSE +lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/top_level.txt +lib/python3.13/site-packages/conda_package_handling/__init__.py +lib/python3.13/site-packages/conda_package_handling/__main__.py +lib/python3.13/site-packages/conda_package_handling/__pycache__/__init__.cpython-313.pyc +lib/python3.13/site-packages/conda_package_handling/__pycache__/__main__.cpython-313.pyc +lib/python3.13/site-packages/conda_package_handling/__pycache__/api.cpython-313.pyc +lib/python3.13/site-packages/conda_package_handling/__pycache__/cli.cpython-313.pyc +lib/python3.13/site-packages/conda_package_handling/__pycache__/conda_fmt.cpython-313.pyc +lib/python3.13/site-packages/conda_package_handling/__pycache__/exceptions.cpython-313.pyc +lib/python3.13/site-packages/conda_package_handling/__pycache__/interface.cpython-313.pyc +lib/python3.13/site-packages/conda_package_handling/__pycache__/streaming.cpython-313.pyc +lib/python3.13/site-packages/conda_package_handling/__pycache__/tarball.cpython-313.pyc +lib/python3.13/site-packages/conda_package_handling/__pycache__/utils.cpython-313.pyc +lib/python3.13/site-packages/conda_package_handling/__pycache__/validate.cpython-313.pyc +lib/python3.13/site-packages/conda_package_handling/api.py +lib/python3.13/site-packages/conda_package_handling/cli.py +lib/python3.13/site-packages/conda_package_handling/conda_fmt.py +lib/python3.13/site-packages/conda_package_handling/exceptions.py +lib/python3.13/site-packages/conda_package_handling/interface.py +lib/python3.13/site-packages/conda_package_handling/streaming.py +lib/python3.13/site-packages/conda_package_handling/tarball.py +lib/python3.13/site-packages/conda_package_handling/utils.py +lib/python3.13/site-packages/conda_package_handling/validate.py diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/git b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/has_prefix b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/has_prefix new file mode 100644 index 0000000000000000000000000000000000000000..4c0d2a534aaf4716e3ea2f3b7ceef3d8220483ec --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/has_prefix @@ -0,0 +1 @@ +/home/task_176236637997838/conda-bld/conda-package-handling_1762366405159/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac text bin/cph diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/hash_input.json b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..54f8fb2da41bdb4962a008606b017773d2fef48e --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/hash_input.json @@ -0,0 +1,4 @@ +{ + "target_platform": "linux-64", + "channel_targets": "defaults" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/index.json b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..5d082f4726387f49355d656943d0738df8414829 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/index.json @@ -0,0 +1,18 @@ +{ + "arch": "x86_64", + "build": "py313h06a4308_1", + "build_number": 1, + "depends": [ + "conda-package-streaming >=0.9.0", + "python >=3.13,<3.14.0a0", + "python_abi 3.13.* *_cp313", + "zstandard >=0.15" + ], + "license": "BSD-3-Clause", + "license_family": "BSD", + "name": "conda-package-handling", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1762366426064, + "version": "2.4.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/licenses/LICENSE b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..eb2f3f5caf1ffbd7a91b22c6a757ab1f31616621 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/licenses/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2019, Conda +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/paths.json b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..6502d362b9029b7b6236dd4920706c24110280e9 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/paths.json @@ -0,0 +1,205 @@ +{ + "paths": [ + { + "_path": "bin/cph", + "file_mode": "text", + "path_type": "hardlink", + "prefix_placeholder": "/home/task_176236637997838/conda-bld/conda-package-handling_1762366405159/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac", + "sha256": "c96ad68d415ee975152c83a9a089da0d99c3316932c279bb80f9569122233496", + "size_in_bytes": 479 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/INSTALLER", + "path_type": "hardlink", + "sha256": "d0edee15f91b406f3f99726e44eb990be6e34fd0345b52b910c568e0eef6a2a8", + "size_in_bytes": 5 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/METADATA", + "path_type": "hardlink", + "sha256": "fd8ccd67293729c80c5c195480bfabbc0ab61a2a2ef15d1fe0f35adf52231a14", + "size_in_bytes": 1977 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/RECORD", + "path_type": "hardlink", + "sha256": "7d57e42fdafabe4d33dc37a9da114f6ca381aca703e932fc2a85ecdaccf1c437", + "size_in_bytes": 2774 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/REQUESTED", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/WHEEL", + "path_type": "hardlink", + "sha256": "ff309ddcdd65ebd02bc724dbf2bcc4a0ff53a5b61792a44548d383e4ebb19d3b", + "size_in_bytes": 91 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/direct_url.json", + "path_type": "hardlink", + "sha256": "35f49322ac6d695392aa4ae4236a076203b3c3d8a9ce9ff7000c3b733b930b12", + "size_in_bytes": 112 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/entry_points.txt", + "path_type": "hardlink", + "sha256": "e2005ded93aff6fe8fdd522223abde570817cca0aefdf5223aac2a55bd154e7a", + "size_in_bytes": 56 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/licenses/AUTHORS.md", + "path_type": "hardlink", + "sha256": "207fd49bcbc6b57d96df30dea26c170561bed0c5a3e4b62d08699d39f3a1a12a", + "size_in_bytes": 494 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/licenses/LICENSE", + "path_type": "hardlink", + "sha256": "b7fece5b9cad61c6a6842ed67766c138068bead39a295ba94749bcb3322b5e75", + "size_in_bytes": 1505 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/top_level.txt", + "path_type": "hardlink", + "sha256": "df6f745b783c31b23284c4ba8a70b7a13cd2cc8c1e63903650a93ffc066b9d26", + "size_in_bytes": 23 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__init__.py", + "path_type": "hardlink", + "sha256": "c8b685bddf8af34aecfc295155850b4ad8a392893845f61269a9c8b7f13e68a3", + "size_in_bytes": 22 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__main__.py", + "path_type": "hardlink", + "sha256": "6bc38c98b112dc5977034f7b1a7f1580297aa91d1bd332fa3ce37beac8e78a4f", + "size_in_bytes": 60 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__pycache__/__init__.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "425dc2998e0c473803c751fd03843ef442132d93bbd95fbcd21ed2d627fd536b", + "size_in_bytes": 186 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__pycache__/__main__.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "5607d09e164fd5e9ed3163fb5bd97de7fb574838b4fb62e6c54371a159f005a6", + "size_in_bytes": 271 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__pycache__/api.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "d948c71362793dbe44877d6969862152b59a4a3260f8a1bb92df712cbecf3ab0", + "size_in_bytes": 11223 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__pycache__/cli.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "bcfe7518e85b612cdb87c0976d46911ca3e02e1321c2b0c76a6f555be6cc096d", + "size_in_bytes": 7463 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__pycache__/conda_fmt.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "c3a46fed30889e4eefa1492efd441fa4ba3736c809ceba2e697de27fa13a5e2a", + "size_in_bytes": 11424 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__pycache__/exceptions.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "b15dfd1d5b5ee37a74f3812483e8f6aa759e7c3b739d087d59ecdb668854f6cc", + "size_in_bytes": 3051 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__pycache__/interface.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "47c391de8352eaac771fe8f25a9ed823331b2e1574fb5f1bf58815d3da832dcc", + "size_in_bytes": 1732 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__pycache__/streaming.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "c5219239e129ebb9d72703a502422f21ac7d77d865f73c4bcc8d6131e0349028", + "size_in_bytes": 3960 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__pycache__/tarball.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "8c1183fa12cbc710fc81cc1080c475d97acbd449fa32dfc46b99596641f7f396", + "size_in_bytes": 5785 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__pycache__/utils.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "cd0a9b5051e91ab6c40b5fffa7d76ea2499f0607892824d1d048aa9fd53bed31", + "size_in_bytes": 20105 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/__pycache__/validate.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "749ed5ee0ea7aabce501b57cc6ca7542150928704736f51d1bb9fe11bfd98b7a", + "size_in_bytes": 5304 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/api.py", + "path_type": "hardlink", + "sha256": "d66cac96c6eb2c896efe8521fff5eaca857fea2e38d5355bcbc459afc4d1bef2", + "size_in_bytes": 8085 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/cli.py", + "path_type": "hardlink", + "sha256": "7a2858a21a0fceaf3320d475bbeadbbd18c8bab5b8780b6cde6936f21f0b7f1e", + "size_in_bytes": 6047 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/conda_fmt.py", + "path_type": "hardlink", + "sha256": "c20f6a36986fa03faf6c750da5922260975a3cc96d99c20a3b37d9d047e31bd4", + "size_in_bytes": 7786 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/exceptions.py", + "path_type": "hardlink", + "sha256": "120dbf1ac136a09aa9787be0f7c6183bab5f1cff16bf432b57b092e79c516aed", + "size_in_bytes": 1893 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/interface.py", + "path_type": "hardlink", + "sha256": "6243435d7bf5dae089b63097cf9ba15871a447faf338b54d89167e11ac2fdd88", + "size_in_bytes": 796 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/streaming.py", + "path_type": "hardlink", + "sha256": "ad3be3558d73ad0beed08b9eaa1fc717a15ce3ec752d643785f36c3f05c1c236", + "size_in_bytes": 3071 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/tarball.py", + "path_type": "hardlink", + "sha256": "c626f3ce58e79011684474ff046edc78da275fa8ae0be6ea86be05c92157e88c", + "size_in_bytes": 3271 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/utils.py", + "path_type": "hardlink", + "sha256": "c6125fa201f258eeccc71d72e0e9877075c4b95110211f7d6cc5593fe63466a9", + "size_in_bytes": 16707 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_handling/validate.py", + "path_type": "hardlink", + "sha256": "e3c82489d92e526d496c2c4b4e1da36c9e1380cbbdb406ac96d6fe50ed91eb69", + "size_in_bytes": 3652 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bf1d76afa9afb04ad6e8af289bc16aff98683c70 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/recipe/conda_build_config.yaml @@ -0,0 +1,28 @@ +c_compiler: gcc +channel_targets: defaults +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: gxx +extend_keys: +- ignore_build_only_deps +- pin_run_as_build +- ignore_version +- extend_keys +fortran_compiler: gfortran +ignore_build_only_deps: +- numpy +- python +lua: '5' +numpy: '1.26' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +platform: linux-64 +python: '3.13' +r_base: '3.5' +target_platform: linux-64 diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/recipe/meta.yaml b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6ef12b108a07b407564c7e34525a3e2764a5efea --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/recipe/meta.yaml @@ -0,0 +1,127 @@ +# This file created by conda-build 25.1.2 +# meta.yaml template originally from: +# /home/task_176236637997838/conda-package-handling-feedstock/recipe, last modified Wed Nov 5 18:13:13 2025 +# ------------------------------------------------ + +package: + name: conda-package-handling + version: 2.4.0 +source: + sha256: a68d23d795704f1b687559b89c98e73d0dbebcab077592c60bffc1dc408b72e9 + url: https://github.com/conda/conda-package-handling/archive/2.4.0.tar.gz +build: + entry_points: + - cph = conda_package_handling.cli:main + number: '1' + script: /home/task_176236637997838/conda-bld/conda-package-handling_1762366405159/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/bin/python + -m pip install . --no-deps --no-build-isolation -vv + string: py313h06a4308_1 +requirements: + build: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - bzip2 1.0.8 h5eee18b_6 + - ca-certificates 2025.11.4 h06a4308_0 + - expat 2.7.3 h3385a95_0 + - ld_impl_linux-64 2.44 h153f514_2 + - libffi 3.4.4 h6a678d5_1 + - libgcc-ng 11.2.0 h1234567_1 + - libgomp 11.2.0 h1234567_1 + - libmpdec 4.0.0 h5eee18b_0 + - libstdcxx-ng 11.2.0 h1234567_1 + - libuuid 1.41.5 h5eee18b_0 + - libxcb 1.17.0 h9b100fa_0 + - libzlib 1.3.1 hb25bd0a_0 + - ncurses 6.5 h7934f7d_0 + - openssl 3.0.18 hd6dcaed_0 + - pthread-stubs 0.3 h0ce48e5_1 + - python 3.13.9 h7e8bc2b_100_cp313 + - python_abi 3.13 1_cp313 + - readline 8.3 hc2a1206_0 + - sqlite 3.50.2 hb25bd0a_1 + - tk 8.6.15 h54e0aa7_0 + - tzdata 2025b h04d1e81_0 + - xorg-libx11 1.8.12 h9b100fa_1 + - xorg-libxau 1.0.12 h9b100fa_0 + - xorg-libxdmcp 1.1.5 h9b100fa_0 + - xorg-xorgproto 2024.1 h5eee18b_1 + - xz 5.6.4 h5eee18b_1 + - zlib 1.3.1 hb25bd0a_0 + host: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - bzip2 1.0.8 h5eee18b_6 + - ca-certificates 2025.11.4 h06a4308_0 + - expat 2.7.3 h3385a95_0 + - ld_impl_linux-64 2.44 h153f514_2 + - libffi 3.4.4 h6a678d5_1 + - libgcc-ng 11.2.0 h1234567_1 + - libgomp 11.2.0 h1234567_1 + - libmpdec 4.0.0 h5eee18b_0 + - libstdcxx-ng 11.2.0 h1234567_1 + - libuuid 1.41.5 h5eee18b_0 + - libxcb 1.17.0 h9b100fa_0 + - libzlib 1.3.1 hb25bd0a_0 + - ncurses 6.5 h7934f7d_0 + - openssl 3.0.18 hd6dcaed_0 + - pip 25.2 pyhc872135_1 + - pthread-stubs 0.3 h0ce48e5_1 + - python 3.13.9 h7e8bc2b_100_cp313 + - python_abi 3.13 1_cp313 + - readline 8.3 hc2a1206_0 + - setuptools 80.9.0 py313h06a4308_0 + - sqlite 3.50.2 hb25bd0a_1 + - tk 8.6.15 h54e0aa7_0 + - tzdata 2025b h04d1e81_0 + - wheel 0.45.1 py313h06a4308_0 + - xorg-libx11 1.8.12 h9b100fa_1 + - xorg-libxau 1.0.12 h9b100fa_0 + - xorg-libxdmcp 1.1.5 h9b100fa_0 + - xorg-xorgproto 2024.1 h5eee18b_1 + - xz 5.6.4 h5eee18b_1 + - zlib 1.3.1 hb25bd0a_0 + run: + - conda-package-streaming >=0.9.0 + - python >=3.13,<3.14.0a0 + - python_abi 3.13.* *_cp313 + - zstandard >=0.15 +test: + commands: + - pip check + - pytest -v --cov=conda_package_handling --color=yes tests/ + imports: + - conda_package_handling + - conda_package_handling.api + requires: + - bottle + - mock + - pip + - pytest + - pytest-cov + - pytest-mock + source_files: + - tests +about: + description: '`conda` and `conda-build` use `conda_package_handling.api` to create + and extract + + conda packages. This package also provides the `cph` command line tool to + + extract, create, and convert between formats. + + ' + dev_url: https://github.com/conda/conda-package-handling + doc_url: https://conda.github.io/conda-package-handling/ + home: https://github.com/conda/conda-package-handling + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: Create and extract conda packages of various formats. +extra: + copy_test_source_files: true + final: true + recipe-maintainers: + - beckermr + - dbast + - dholth + - jezdez diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/recipe/meta.yaml.template b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/recipe/meta.yaml.template new file mode 100644 index 0000000000000000000000000000000000000000..64cc0e46534b1a7dff9da06efc2ec46ab2011467 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/recipe/meta.yaml.template @@ -0,0 +1,69 @@ +{% set name = "conda-package-handling" %} +{% set version = "2.4.0" %} + +package: + name: {{ name }} + version: {{ version }} + +source: + url: https://github.com/conda/conda-package-handling/archive/{{ version }}.tar.gz + sha256: a68d23d795704f1b687559b89c98e73d0dbebcab077592c60bffc1dc408b72e9 + +build: + number: 1 + skip: true # [py<38] + script: {{ PYTHON }} -m pip install . --no-deps --no-build-isolation -vv + entry_points: + - cph = conda_package_handling.cli:main + +requirements: + # Use this build section with python to avoid an Unexpected conda error on CI + build: + - python + host: + - python + - pip + - setuptools + - wheel + run: + - python + - zstandard >=0.15 + - conda-package-streaming >=0.9.0 + +test: + source_files: + - tests + requires: + - mock + - pip + - pytest + - pytest-cov + - pytest-mock + - bottle + imports: + - conda_package_handling + - conda_package_handling.api + commands: + - pip check + - pytest -v --cov=conda_package_handling --color=yes tests/ + +about: + home: https://github.com/conda/conda-package-handling + dev_url: https://github.com/conda/conda-package-handling + doc_url: https://conda.github.io/conda-package-handling/ + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: Create and extract conda packages of various formats. + description: | + `conda` and `conda-build` use `conda_package_handling.api` to create and extract + conda packages. This package also provides the `cph` command line tool to + extract, create, and convert between formats. + + +extra: + recipe-maintainers: + - beckermr + - dbast + - dholth + - jezdez diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/repodata_record.json b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..1acd4159e5d99a69c4b42903b031a4f3b763401d --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/repodata_record.json @@ -0,0 +1,25 @@ +{ + "arch": "x86_64", + "build": "py313h06a4308_1", + "build_number": 1, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [], + "depends": [ + "conda-package-streaming >=0.9.0", + "python >=3.13,<3.14.0a0", + "python_abi 3.13.* *_cp313", + "zstandard >=0.15" + ], + "fn": "conda-package-handling-2.4.0-py313h06a4308_1.conda", + "license": "BSD-3-Clause", + "license_family": "BSD", + "md5": "8df01d8631f16021fe6e7f0093de07db", + "name": "conda-package-handling", + "platform": "linux", + "sha256": "d1e652dbd4390b12bcf938ece3e85636c12ab54d91a25de7dd1ac8ca84b1b8b1", + "size": 284840, + "subdir": "linux-64", + "timestamp": 1762366426000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/conda-package-handling-2.4.0-py313h06a4308_1.conda", + "version": "2.4.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/run_test.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..c623826081d03e0d46b02db654fac1a50ae34e77 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/run_test.py @@ -0,0 +1,6 @@ +print("import: 'conda_package_handling'") +import conda_package_handling + +print("import: 'conda_package_handling.api'") +import conda_package_handling.api + diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/run_test.sh b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..c9429ae14960bada0d82511dbea35b0dbb7a93be --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/run_test.sh @@ -0,0 +1,9 @@ + + +set -ex + + + +pip check +pytest -v --cov=conda_package_handling --color=yes tests/ +exit 0 diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/test_time_dependencies.json b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..bcde3cc76c0dc20d8750be598949c4b1ed98e54d --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["pip", "pytest-mock", "mock", "pytest", "bottle", "pytest-cov"] \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/__init__.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/conftest.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..5ba5f85e4855f7fae7707f80152780c182be1257 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/conftest.py @@ -0,0 +1,87 @@ +from __future__ import annotations + +import os +import shutil +import threading +import typing +import wsgiref.simple_server +from pathlib import Path +from typing import Any + +import bottle +import pytest + +if typing.TYPE_CHECKING: + import wsgiref.types # added in 3.11 + + +@pytest.fixture(scope="function") +def testing_workdir(tmpdir, request): + """Create a workdir in a safe temporary folder; cd into dir above before test, cd out after + + :param tmpdir: py.test fixture, will be injected + :param request: py.test fixture-related, will be injected (see pytest docs) + """ + + saved_path = os.getcwd() + + tmpdir.chdir() + # temporary folder for profiling output, if any + tmpdir.mkdir("prof") + + def return_to_saved_path(): + if os.path.isdir(os.path.join(saved_path, "prof")): + profdir = tmpdir.join("prof") + files = profdir.listdir("*.prof") if profdir.isdir() else [] + + for f in files: + shutil.copy(str(f), os.path.join(saved_path, "prof", f.basename)) + os.chdir(saved_path) + + request.addfinalizer(return_to_saved_path) + + return str(tmpdir) + + +datadir = Path(__file__).parent / "data" + + +@bottle.route("/", "GET") +def serve_file(filename): + mimetype = "auto" + # from https://repo.anaconda.com/ behavior: + if filename.endswith(".tar.bz2"): + mimetype = "application/x-tar" + elif filename.endswith(".conda"): + mimetype = "binary/octet-stream" + return bottle.static_file(filename, root=datadir.as_posix(), mimetype=mimetype) + + +class ServerThread(threading.Thread): + server: Any + app: Any + + +def get_server_thread(): + """ + Return test server thread with additional .server, .app properties. + + Call .start() to serve in the background. + """ + app: wsgiref.types.WSGIApplication = bottle.app() + server = wsgiref.simple_server.make_server("127.0.0.1", 0, app) + t = ServerThread(daemon=True, target=server.serve_forever) + t.app = app + t.server = server # server.application == app + return t + + +@pytest.fixture(scope="session") +def localserver(): + thread = get_server_thread() + thread.start() + yield f"http://{thread.server.server_address[0]}:{thread.server.server_address[1]}" + + +if __name__ == "__main__": + bottle.run(port=8080) diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/memory_test.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/memory_test.py new file mode 100644 index 0000000000000000000000000000000000000000..dc2f3e9e03de0d6a7a57ca38cef56dfac77df847 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/memory_test.py @@ -0,0 +1,19 @@ +""" +Simple test for evaluating zstandard binding memory usage. +""" + +import io +import sys + +import zstandard + +if __name__ == "__main__": + times = 100 + if len(sys.argv) == 3: + times = int(sys.argv[2]) + + for i in range(times): + compressor = zstandard.ZstdCompressor(level=int(sys.argv[1])) + writer = compressor.stream_writer(io.BytesIO()) + writer.write(b"hello") + writer.close() diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/recipes/cph_test_data/build.sh b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/recipes/cph_test_data/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..540e1fb95eadb6098fff7e99c7236ed94788c602 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/recipes/cph_test_data/build.sh @@ -0,0 +1,34 @@ +cd "${PREFIX}" +umask 022 + +mkdir -p bin lib libexec share/terminfo +mkdir -p lib/{python3.10,alibrary} + +echo -e '#/bin/sh\necho hello world' > bin/hello-1.0 +chmod 755 bin/hello-1.0 + +echo -n "" >share/terminfo/xterm.dat +chmod 644 share/terminfo/xterm.dat + +echo -n "" >lib/alibrary/alib.lib +echo -n "" >lib/python3.10/amodule.py + +# Tests for symlink... +pushd bin >/dev/null +ln -sn hello-1.0 hello # ...to file in same dir +popd >/dev/null + +pushd libexec >/dev/null +ln -sn ../bin/hello greetings # ...to file in another dir +popd >/dev/null + +pushd share >/dev/null +ln -sn terminfo termcap # ...to subdir in same dir +popd >/dev/null + +pushd lib >/dev/null +ln -sn alibrary alib # ...to subdir in same dir +ln -sn python3.10 python3.1 # ...to subdir in same dir +ln -sn ../share/terminfo terminfo # ...to subdir of another dir +ln -sn libdangle.lib.1 libdangle.lib # ...dangling link +popd >/dev/null diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/recipes/cph_test_data/meta.yaml b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/recipes/cph_test_data/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d6187cbb3cc6ecbb2788a89c62ab753fe920928e --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/recipes/cph_test_data/meta.yaml @@ -0,0 +1,6 @@ +package: + name: cph_test_data + version: 0.0.1 + +build: + noarch: generic diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_api.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_api.py new file mode 100644 index 0000000000000000000000000000000000000000..d71a19a794fd15c927ce106ab862a2011a8e4709 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_api.py @@ -0,0 +1,481 @@ +import json +import os +import pathlib +import platform +import shutil +import sys +import tarfile +import time +import zipfile +from datetime import datetime +from tempfile import TemporaryDirectory + +import pytest + +import conda_package_handling +import conda_package_handling.tarball +from conda_package_handling import api, exceptions + +this_dir = os.path.dirname(__file__) +data_dir = os.path.join(this_dir, "data") +version_file = pathlib.Path(this_dir).parent / "src" / "conda_package_handling" / "__init__.py" +test_package_name = "mock-2.0.0-py37_1000" +test_package_name_2 = "cph_test_data-0.0.1-0" + + +@pytest.mark.skipif( + bool(os.environ.get("GITHUB_ACTIONS", False)), reason="Fails on GitHub Actions" +) +@pytest.mark.skipif(not version_file.exists(), reason=f"Could not find {version_file}") +def test_correct_version(): + """ + Prevent accidentally running tests against a globally installed different version. + """ + assert conda_package_handling.__version__ in version_file.read_text() + + +def test_api_extract_tarball_implicit_path(testing_workdir): + tarfile = os.path.join(data_dir, test_package_name + ".tar.bz2") + local_tarfile = os.path.join(testing_workdir, os.path.basename(tarfile)) + shutil.copy2(tarfile, local_tarfile) + api.extract(local_tarfile) + assert os.path.isfile(os.path.join(testing_workdir, test_package_name, "info", "index.json")) + + +def test_api_tarball_details(testing_workdir): + tarfile = os.path.join(data_dir, test_package_name + ".tar.bz2") + results = api.get_pkg_details(tarfile) + assert results["size"] == 106576 + assert results["md5"] == "0f9cce120a73803a70abb14bd4d4900b" + assert results["sha256"] == "34c659b0fdc53d28ae721fd5717446fb8abebb1016794bd61e25937853f4c29c" + + +def test_api_conda_v2_details(testing_workdir): + condafile = os.path.join(data_dir, test_package_name + ".conda") + results = api.get_pkg_details(condafile) + assert results["size"] == 113421 + assert results["sha256"] == "181ec44eb7b06ebb833eae845bcc466ad96474be1f33ee55cab7ac1b0fdbbfa3" + assert results["md5"] == "23c226430e35a3bd994db6c36b9ac8ae" + + +def test_api_extract_tarball_explicit_path(testing_workdir): + tarfile = os.path.join(data_dir, test_package_name + ".tar.bz2") + local_tarfile = os.path.join(testing_workdir, os.path.basename(tarfile)) + shutil.copy2(tarfile, local_tarfile) + + api.extract(local_tarfile, "manual_path") + assert os.path.isfile(os.path.join(testing_workdir, "manual_path", "info", "index.json")) + + +def test_api_extract_conda_v2_implicit_path(testing_workdir): + condafile = os.path.join(data_dir, test_package_name + ".conda") + local_condafile = os.path.join(testing_workdir, os.path.basename(condafile)) + shutil.copy2(condafile, local_condafile) + api.extract(local_condafile) + assert os.path.isfile(os.path.join(testing_workdir, test_package_name, "info", "index.json")) + + +def test_api_extract_conda_v2_no_destdir_relative_path(testing_workdir): + cwd = os.getcwd() + os.chdir(testing_workdir) + try: + condafile = os.path.join(data_dir, test_package_name + ".conda") + local_condafile = os.path.join(testing_workdir, os.path.basename(condafile)) + shutil.copy2(condafile, local_condafile) + + condafile = os.path.basename(local_condafile) + assert os.path.exists(condafile) + # cli passes dest=None, prefix=None + api.extract(condafile, None, prefix=None) + finally: + os.chdir(cwd) + + +def test_api_extract_conda_v2_explicit_path(testing_workdir): + condafile = os.path.join(data_dir, test_package_name + ".conda") + local_condafile = os.path.join(testing_workdir, os.path.basename(condafile)) + shutil.copy2(condafile, local_condafile) + + api.extract(condafile, "manual_path") + assert os.path.isfile(os.path.join(testing_workdir, "manual_path", "info", "index.json")) + + +def test_api_extract_conda_v2_explicit_path_prefix(testing_workdir): + tarfile = os.path.join(data_dir, test_package_name + ".conda") + api.extract(tarfile, prefix=os.path.join(testing_workdir, "folder")) + assert os.path.isfile( + os.path.join(testing_workdir, "folder", test_package_name, "info", "index.json") + ) + + api.extract(tarfile, dest_dir="steve", prefix=os.path.join(testing_workdir, "folder")) + assert os.path.isfile(os.path.join(testing_workdir, "folder", "steve", "info", "index.json")) + + +def test_api_extract_dest_dir_and_prefix_both_abs_raises(): + tarfile = os.path.join(data_dir, test_package_name + ".conda") + with pytest.raises(ValueError): + api.extract(tarfile, prefix=os.path.dirname(tarfile), dest_dir=os.path.dirname(tarfile)) + + +def test_api_extract_info_conda_v2(testing_workdir): + condafile = os.path.join(data_dir, test_package_name + ".conda") + local_condafile = os.path.join(testing_workdir, os.path.basename(condafile)) + shutil.copy2(condafile, local_condafile) + api.extract(local_condafile, "manual_path", components="info") + assert os.path.isfile(os.path.join(testing_workdir, "manual_path", "info", "index.json")) + assert not os.path.isdir(os.path.join(testing_workdir, "manual_path", "lib")) + + +def check_conda_v2_metadata(condafile): + with zipfile.ZipFile(condafile) as zf: + d = json.loads(zf.read("metadata.json")) + assert d["conda_pkg_format_version"] == 2 + + +def test_api_transmute_tarball_to_conda_v2(testing_workdir): + tarfile = os.path.join(data_dir, test_package_name + ".tar.bz2") + # lower compress level makes the test run much faster, even 15 is much + # better than 22 + errors = api.transmute(tarfile, ".conda", testing_workdir, zstd_compress_level=3) + assert not errors + condafile = os.path.join(testing_workdir, test_package_name + ".conda") + assert os.path.isfile(condafile) + check_conda_v2_metadata(condafile) + + +def test_api_transmute_tarball_info_sorts_first(testing_workdir): + test_packages = [test_package_name] + test_packages_with_symlinks = [test_package_name_2] + if sys.platform != "win32": + test_packages += test_packages_with_symlinks + for test_package in test_packages: + test_file = os.path.join(data_dir, test_package + ".tar.bz2") + + # transmute/convert doesn't re-sort files; extract to folder. + api.extract(test_file, testing_workdir) + out_fn = os.path.join(testing_workdir, test_package + ".tar.bz2") + out = api.create(testing_workdir, None, out_fn) + assert out == out_fn + + # info must be first + with tarfile.open(out_fn, "r:bz2") as repacked: + info_seen = False + not_info_seen = False + for member in repacked: + if member.name.startswith("info"): + assert ( + not_info_seen is False + ), f"{test_package} package info/ must sort first, " + f"but {[m.name for m in repacked.getmembers()]}" + info_seen = True + else: + not_info_seen = True + assert info_seen, "package had no info/ files" + + +@pytest.mark.skipif(sys.platform == "win32", reason="windows and symlinks are not great") +def test_api_transmute_to_conda_v2_contents(testing_workdir): + def _walk(path): + for entry in os.scandir(path): + if entry.is_dir(follow_symlinks=False): + yield from _walk(entry.path) + continue + yield entry + + tar_path = os.path.join(data_dir, test_package_name_2 + ".tar.bz2") + conda_path = os.path.join(testing_workdir, test_package_name_2 + ".conda") + api.transmute(tar_path, ".conda", testing_workdir, zstd_compress_level=3) + + # Verify original contents were all put in the right place + pkg_tarbz2 = tarfile.open(tar_path, mode="r:bz2") + info_items = [item for item in pkg_tarbz2.getmembers() if item.path.startswith("info/")] + pkg_items = [item for item in pkg_tarbz2.getmembers() if not item.path.startswith("info/")] + + errors = [] + for component, expected in (("info", info_items), ("pkg", pkg_items)): + with TemporaryDirectory() as root: + api.extract(conda_path, root, components=component) + + contents = { + os.path.relpath(entry.path, root): { + "is_symlink": entry.is_symlink(), + "target": os.readlink(entry.path) if entry.is_symlink() else None, + } + for entry in _walk(root) + } + + for item in expected: + if item.path not in contents: + errors.append(f"'{item.path}' not found in {component} contents") + continue + + ct = contents.pop(item.path) + if item.issym(): + if not ct["is_symlink"] or ct["target"] != item.linkname: + errors.append( + f"{item.name} -> {item.linkname} incorrect in {component} contents" + ) + elif not item.isfile(): + # Raise an exception rather than appending to `errors` + # because getting to this point is an indication that our + # test data (i.e., .tar.bz2 package) is corrupt, rather + # than the `.transmute` function having problems (which is + # what `errors` is meant to track). For context, conda + # packages should only contain regular files and symlinks. + raise ValueError(f"unexpected item '{item.path}' in test .tar.bz2") + if contents: + errors.append(f"extra files [{', '.join(contents)}] in {component} contents") + assert not errors + + +def test_api_transmute_conda_v2_to_tarball(testing_workdir): + condafile = os.path.join(data_dir, test_package_name + ".conda") + outfile = pathlib.Path(testing_workdir, test_package_name + ".tar.bz2") + # one quiet=True in the test suite for coverage + api.transmute(condafile, ".tar.bz2", testing_workdir, quiet=True) + assert outfile.is_file() + + # test that no-force keeps file, and force overwrites file + for force in False, True: + mtime = outfile.stat().st_mtime + time.sleep(2 if platform.platform() == "Windows" else 0) + api.transmute(condafile, ".tar.bz2", testing_workdir, force=force) + mtime2 = outfile.stat().st_mtime + assert (mtime2 == mtime) != force + + +def test_warning_when_bundling_no_metadata(testing_workdir): + pass + + +@pytest.mark.skipif(sys.platform == "win32", reason="windows and symlinks are not great") +def test_create_package_with_uncommon_conditions_captures_all_content(testing_workdir): + os.makedirs("src/a_folder") + os.makedirs("src/empty_folder") + os.makedirs("src/symlink_stuff") + with open("src/a_folder/text_file", "w") as f: + f.write("weee") + open("src/empty_file", "w").close() + os.link("src/a_folder/text_file", "src/a_folder/hardlink_to_text_file") + os.symlink("../a_folder", "src/symlink_stuff/symlink_to_a") + os.symlink("../empty_file", "src/symlink_stuff/symlink_to_empty_file") + os.symlink("../a_folder/text_file", "src/symlink_stuff/symlink_to_text_file") + + with tarfile.open("pinkie.tar.bz2", "w:bz2") as tf: + + def add(source, target): + tf.add(source, target, recursive=False) + + add("src/empty_folder", "empty_folder") + add("src/empty_file", "empty_file") + add("src/a_folder", "a_folder") + add("src/a_folder/text_file", "a_folder/text_file") + add("src/a_folder/hardlink_to_text_file", "a_folder/hardlink_to_text_file") + add("src/symlink_stuff/symlink_to_a", "symlink_stuff/symlink_to_a") + add( + "src/symlink_stuff/symlink_to_empty_file", + "symlink_stuff/symlink_to_empty_file", + ) + add( + "src/symlink_stuff/symlink_to_text_file", + "symlink_stuff/symlink_to_text_file", + ) + + api.create("src", None, "thebrain.tar.bz2") + + # test against both archives created manually and those created by cph. + # They should be equal in all ways. + for fn in ("pinkie.tar.bz2", "thebrain.tar.bz2"): + api.extract(fn) + target_dir = fn[:-8] + flist = [ + "empty_folder", + "empty_file", + "a_folder/text_file", + "a_folder/hardlink_to_text_file", + "symlink_stuff/symlink_to_a", + "symlink_stuff/symlink_to_text_file", + "symlink_stuff/symlink_to_empty_file", + ] + + # no symlinks on windows + if sys.platform != "win32": + # not directly included but checked symlink + flist.append("symlink_stuff/symlink_to_a/text_file") + + missing_content = [] + for f in flist: + path_that_should_be_there = os.path.join(testing_workdir, target_dir, f) + if not ( + os.path.exists(path_that_should_be_there) + or os.path.lexists(path_that_should_be_there) # noqa + ): + missing_content.append(f) + if missing_content: + print("missing files in output package") + print(missing_content) + sys.exit(1) + + # hardlinks should be preserved, but they're currently not with libarchive + # hardlinked_file = os.path.join(testing_workdir, target_dir, 'a_folder/text_file') + # stat = os.stat(hardlinked_file) + # assert stat.st_nlink == 2 + + hardlinked_file = os.path.join(testing_workdir, target_dir, "empty_file") + stat = os.stat(hardlinked_file) + if sys.platform != "win32": + assert stat.st_nlink == 1 + + +@pytest.mark.skipif( + datetime.now() <= datetime(2020, 12, 1), + reason="Don't understand why this doesn't behave. Punt.", +) +def test_secure_refusal_to_extract_abs_paths(testing_workdir): + with tarfile.open("pinkie.tar.bz2", "w:bz2") as tf: + open("thebrain", "w").close() + tf.add(os.path.join(testing_workdir, "thebrain"), "/naughty/abs_path") + try: + tf.getmember("/naughty/abs_path") + except KeyError: + pytest.skip("Tar implementation does not generate unsafe paths in archive.") + + with pytest.raises(api.InvalidArchiveError): + api.extract("pinkie.tar.bz2") + + +def tests_secure_refusal_to_extract_dotdot(testing_workdir): + with tarfile.open("pinkie.tar.bz2", "w:bz2") as tf: + open("thebrain", "w").close() + tf.add(os.path.join(testing_workdir, "thebrain"), "../naughty/abs_path") + + with pytest.raises(api.InvalidArchiveError): + api.extract("pinkie.tar.bz2") + + +def test_api_bad_filename(testing_workdir): + with pytest.raises(ValueError): + api.extract("pinkie.rar", testing_workdir) + + +def test_details_bad_extension(): + with pytest.raises(ValueError): + # TODO this function should not exist + api.get_pkg_details("pinkie.rar") + + +def test_convert_bad_extension(testing_workdir): + api._convert("pinkie.rar", ".conda", testing_workdir) + + +def test_convert_keyerror(tmpdir, mocker): + tarfile = os.path.join(data_dir, test_package_name + ".tar.bz2") + + mocker.patch( + "conda_package_streaming.transmute.transmute", + side_effect=KeyboardInterrupt(), + ) + + # interrupted before ".conda" was created + with pytest.raises(KeyboardInterrupt): + api._convert(tarfile, ".conda", tmpdir) + + def create_file_and_raise(*args, **kwargs): + out_fn = pathlib.Path(tmpdir, pathlib.Path(tarfile[: -len(".tar.bz2")] + ".conda").name) + print("out fn", out_fn) + out_fn.write_text("") + raise KeyboardInterrupt() + + mocker.patch("conda_package_streaming.transmute.transmute", side_effect=create_file_and_raise) + + # interrupted after ".conda" was created + with pytest.raises(KeyboardInterrupt): + api._convert(tarfile, ".conda", tmpdir) + + +def test_create_filelist(tmpdir, mocker): + # another bad API, tested for coverage + filelist = pathlib.Path(tmpdir, "filelist.txt") + filelist.write_text("\n".join(["filelist.txt", "anotherfile"])) + + # when looking for filelist-not-found.txt + with pytest.raises(FileNotFoundError): + api.create(str(tmpdir), "filelist-not-found.txt", str(tmpdir / "newconda.conda")) + + # when adding anotherfile + with pytest.raises(FileNotFoundError): + api.create(str(tmpdir), str(filelist), str(tmpdir / "newconda.conda")) + + # unrecognized target extension + with pytest.raises(ValueError): + api.create(str(tmpdir), str(filelist), str(tmpdir / "newpackage.rar")) + + def create_file_and_raise(prefix, file_list, out_fn, *args, **kwargs): + pathlib.Path(prefix, out_fn).write_text("") + raise KeyboardInterrupt() + + mocker.patch( + "conda_package_handling.conda_fmt.CondaFormat_v2.create", + side_effect=create_file_and_raise, + ) + + # failure inside inner create() + with pytest.raises(KeyboardInterrupt): + api.create(str(tmpdir), str(filelist), str(tmpdir / "newpackage.conda")) + + +def test_api_transmute_fail_validation(tmpdir, mocker): + package = os.path.join(data_dir, test_package_name + ".conda") + + # this code is only called for .conda -> .tar.bz2; a streaming validate for + # .tar.bz2 -> .conda would be a good idea. + mocker.patch( + "conda_package_handling.validate.validate_converted_files_match_streaming", + return_value=(str(package), {"missing-file.txt"}, {"mismatched-size.txt"}), + ) + + errors = api.transmute(package, ".tar.bz2", tmpdir) + assert errors + + +def test_api_transmute_fail_validation_to_conda(tmpdir, mocker): + package = os.path.join(data_dir, test_package_name + ".tar.bz2") + + mocker.patch( + "conda_package_handling.validate.validate_converted_files_match_streaming", + return_value=(str(package), {"missing-file.txt"}, {"mismatched-size.txt"}), + ) + + errors = api.transmute(package, ".conda", tmpdir, zstd_compress_level=3) + assert errors + + +def test_api_transmute_fail_validation_2(tmpdir, mocker): + package = os.path.join(data_dir, test_package_name + ".conda") + tmptarfile = tmpdir / pathlib.Path(package).name + shutil.copy(package, tmptarfile) + + mocker.patch( + "conda_package_handling.validate.validate_converted_files_match_streaming", + side_effect=Exception("not today"), + ) + + # run with out_folder=None + errors = api.transmute(str(tmptarfile), ".tar.bz2") + assert errors + + +def test_api_translates_exception(mocker, tmpdir): + from conda_package_streaming.extract import exceptions as cps_exceptions + + tarfile = os.path.join(data_dir, test_package_name + ".tar.bz2") + + # translates their exception to our exception of the same name + mocker.patch( + "conda_package_streaming.package_streaming.stream_conda_component", + side_effect=cps_exceptions.CaseInsensitiveFileSystemError(), + ) + + # should this be exported from the api or inherit from InvalidArchiveError? + with pytest.raises(exceptions.CaseInsensitiveFileSystemError): + api.extract(tarfile, tmpdir) diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_cli.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_cli.py new file mode 100644 index 0000000000000000000000000000000000000000..ea1931e73a3b3b2176347b8efd68f98e36a51d47 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_cli.py @@ -0,0 +1,124 @@ +import os +from pathlib import Path + +import pytest + +import conda_package_handling.cli as cli + +from .test_api import data_dir, test_package_name + + +def test_cli(tmpdir, mocker): + """ + Code coverage for the cli. + """ + for command in [ + [ + "x", + str(Path(data_dir, test_package_name + ".tar.bz2")), + f"--prefix={tmpdir}", + ], + [ + "x", + str(Path(data_dir, test_package_name + ".conda")), + "--info", + f"--prefix={tmpdir}", + ], + [ + "c", + str(Path(tmpdir, test_package_name)), + ".tar.bz2", + f"--out-folder={tmpdir}", + ], + ]: + cli.main(args=command) + + # XXX difficult to get to this error handling code through the actual CLI; + # for example, a .tar.bz2 that can't be extracted raises OSError instead of + # returning errors. Designed for .tar.bz2 -> .conda conversions that somehow + # omit files? + mocker.patch( + "conda_package_handling.api.transmute", + return_value=set("that is why you fail".split()), + ) + with pytest.raises(SystemExit): + command = [ + "t", + str(Path(data_dir, test_package_name + ".tar.bz2")), + ".conda", + f"--out-folder={tmpdir}", + ] + cli.main(args=command) + + +def test_import_main(): + """ + e.g. python -m conda_package_handling + """ + with pytest.raises(SystemExit): + import conda_package_handling.__main__ # noqa + + +@pytest.mark.parametrize( + "artifact,n_files", + [("mock-2.0.0-py37_1000.conda", 43), ("mock-2.0.0-py37_1000.tar.bz2", 43)], +) +def test_list(artifact, n_files, capsys): + "Integration test to ensure `cph list` works correctly." + cli.main(["list", os.path.relpath(os.path.join(data_dir, artifact), os.getcwd())]) + stdout, stderr = capsys.readouterr() + assert n_files == sum(bool(line.strip()) for line in stdout.splitlines()) + + # test verbose flag + cli.main( + [ + "list", + "--verbose", + os.path.join(data_dir, artifact), + ] + ) + stdout, stderr = capsys.readouterr() + assert n_files == sum(bool(line.strip()) for line in stdout.splitlines()) + + with pytest.raises(ValueError): + cli.main(["list", "setup.py"]) + + cli.main(["list", os.path.join(data_dir, artifact), "--components=pkg"]) + stdout, stderr = capsys.readouterr() + listed_files = sum(bool(line.strip()) for line in stdout.splitlines()) + if artifact.endswith(".conda"): + assert listed_files < n_files # info folder filtered out + else: + assert listed_files == n_files # no info filtering in tar.bz2 + + +@pytest.mark.parametrize( + "fn,n_files", + [ + ("mock-2.0.0-py37_1000.conda", 43), + ("mock-2.0.0-py37_1000.tar.bz2", -1), + ], +) +def test_list_remote(capsys, localserver, fn, n_files): + "Integration test to ensure `cph list ` works correctly." + url = "/".join([localserver, fn]) + if url.endswith(".tar.bz2"): + # This is not supported in streaming mode + with pytest.raises(ValueError): + cli.main(["list", url]) + return + + cli.main(["list", url]) + stdout, _ = capsys.readouterr() + assert n_files == sum(bool(line.strip()) for line in stdout.splitlines()) + + # Local list should be the same as a 'remote' list + cli.main(["list", str(Path(__file__).parent / "data" / fn)]) + stdout_local, _ = capsys.readouterr() + assert list(map(str.strip, stdout_local.splitlines())) == list( + map(str.strip, stdout.splitlines()) + ) + + cli.main(["list", url, "-v"]) + stdout_verbose, _ = capsys.readouterr() + assert n_files == sum(bool(line.strip()) for line in stdout_verbose.splitlines()) diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_degraded.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_degraded.py new file mode 100644 index 0000000000000000000000000000000000000000..ca8af288502f957b0a0de39d9d627e325eb48f0a --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_degraded.py @@ -0,0 +1,55 @@ +""" +Test conda-package-handling can work in `.tar.bz2`-only mode if zstandard is not +available. (Giving the user a chance to immediately install zstandard.) +""" + +import importlib +import subprocess +import sys +import warnings + + +def test_degraded(): + try: + sys.modules["zstandard"] = None # type: ignore + sys.modules["conda_package_streaming.transmute"] = None # type: ignore + sys.modules["conda_package_handling.conda_fmt"] = None # type: ignore + + # this is only testing conda_package_handling's code, and does not test + # that conda_package_streaming works without zstandard. + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") # Ensure warnings are sent + import conda_package_handling.api + + importlib.reload(conda_package_handling.api) + + assert len(w) == 1 + assert issubclass(w[-1].category, UserWarning) + assert "zstandard" in str(w[-1].message) + assert conda_package_handling.api.libarchive_enabled is False + + finally: + sys.modules.pop("zstandard", None) + sys.modules.pop("conda_package_handling.conda_fmt", None) + sys.modules.pop("conda_package_streaming.transmute", None) + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") # Ensure warnings are sent + import conda_package_handling.api + + importlib.reload(conda_package_handling.api) + assert len(w) == 0 + assert conda_package_handling.api.libarchive_enabled is True + + +def test_degraded_subprocess(): + """ + More reliable way to mock 'zstandard not available' + """ + subprocess.check_call( + [ + sys.executable, + "-c", + "import sys; sys.modules['zstandard'] = None; import conda_package_handling.api", + ] + ) diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_interface.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_interface.py new file mode 100644 index 0000000000000000000000000000000000000000..24b8fef25d5e60032c966f2de8bca4ba66896c3e --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_interface.py @@ -0,0 +1,56 @@ +""" +Test format classes. + +(Some of their code is unreachable through api.py) +""" + +import os +from pathlib import Path + +import pytest + +from conda_package_handling.conda_fmt import CondaFormat_v2 +from conda_package_handling.tarball import CondaTarBZ2 + +from .test_api import data_dir, test_package_name + +TEST_CONDA = Path(data_dir, test_package_name + ".conda") +TEST_TARBZ = Path(data_dir, test_package_name + ".tar.bz2") + + +def test_extract_create(tmpdir): + for format, infile, outfile in ( + (CondaFormat_v2, TEST_CONDA, "newmock.conda"), + (CondaTarBZ2, TEST_TARBZ, "newmock.tar.bz2"), + ): + both_path = Path(tmpdir, f"mkdirs-{outfile.split('.', 1)[-1]}") + + # these old APIs don't guarantee Path-like's + format.extract(infile, str(both_path)) + assert sorted(os.listdir(both_path)) == sorted(["lib", "info"]) + + if format == CondaFormat_v2: + info_path = Path(tmpdir, "info-only") + format.extract_info(TEST_CONDA, str(info_path)) # type: ignore + assert os.listdir(info_path) == ["info"] + + filelist = [str(p.relative_to(both_path)) for p in both_path.rglob("*")] + format.create( + both_path, + filelist, + tmpdir / outfile, + # compression_tuple is for libarchive compatibility. Instead, pass + # compressor=(compressor factory function) + compression_tuple=(".tar.zst", "zstd", "zstd:compression-level=1"), + ) + + assert (tmpdir / outfile).exists() + + with pytest.raises(ValueError): + CondaFormat_v2.create( + "", + [], + "", + compressor=True, + compression_tuple=("1", "2", "3"), # type: ignore + ) diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_utils.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_utils.py new file mode 100644 index 0000000000000000000000000000000000000000..9d66b12b5134e57523d8bedd3ea2acf289c0436e --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_utils.py @@ -0,0 +1,51 @@ +import os +import sys +from errno import EACCES, ENOENT, EPERM, EROFS + +import pytest + +from conda_package_handling import utils + + +def test_rm_rf_file(testing_workdir): + with open("dummy", "w") as f: + f.write("weeee") + utils.rm_rf("dummy") + + with open("dummy", "w") as f: + f.write("weeee") + utils.rm_rf(os.path.join(testing_workdir, "dummy")) + + +@pytest.mark.parametrize("errno", (ENOENT, EACCES, EPERM, EROFS)) +def test_rename_to_trash(testing_workdir, mocker, errno): + unlink = mocker.patch("os.unlink") + unlink.side_effect = EnvironmentError(errno, "") + with open("dummy", "w") as f: + f.write("weeee") + utils.unlink_or_rename_to_trash("dummy") + assert os.path.isfile("dummy.conda_trash") + + # force a second error for the inner rename try (after unlink fails) + if sys.platform == "win32": + with open("dummy", "w") as f: + f.write("weeee") + mocker.patch("os.rename") + unlink.side_effect = EnvironmentError(errno, "") + utils.unlink_or_rename_to_trash("dummy") + assert os.path.isfile("dummy.conda_trash") + + +def test_delete_trash(testing_workdir, mocker): + isdir = mocker.patch("conda_package_handling.utils.isdir") + isdir.return_value = True + lexists = mocker.patch("conda_package_handling.utils.lexists") + lexists.return_value = False + mocker.patch("conda_package_handling.utils.rmdir") + + os.makedirs("folder") + with open("folder/dummy.conda_trash", "w") as f: + f.write("weeee") + + utils.rm_rf("folder") + assert not os.path.isfile("folder/dummy.conda_trash") diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_validate.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_validate.py new file mode 100644 index 0000000000000000000000000000000000000000..58ac7708b88a8927b19880013b49c41ceef6f42e --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/info/test/tests/test_validate.py @@ -0,0 +1,50 @@ +from pathlib import Path + +from conda_package_handling.validate import validate_converted_files_match_streaming + +from .test_api import data_dir, test_package_name, test_package_name_2 + + +def test_validate_streaming(): + assert validate_converted_files_match_streaming( + Path(data_dir, test_package_name + ".conda"), + Path(data_dir, test_package_name + ".tar.bz2"), + strict=False, + ) == (Path(data_dir, test_package_name + ".conda"), [], []) + + # old converted files don't match uname, gname, mtime + assert validate_converted_files_match_streaming( + Path(data_dir, test_package_name + ".conda"), + Path(data_dir, test_package_name + ".tar.bz2"), + strict=True, + ) != (Path(data_dir, test_package_name + ".conda"), [], []) + + src, missing, mismatched = validate_converted_files_match_streaming( + Path(data_dir, test_package_name_2 + ".tar.bz2"), + Path(data_dir, test_package_name + ".conda"), + strict=False, + ) + + assert src == Path(data_dir, test_package_name_2 + ".tar.bz2") + # not that critical exactly what mismatches; we are comparing separate packages + assert len(missing) == 47 + assert mismatched == [ + "info/hash_input.json", + "info/files", + "info/index.json", + "info/paths.json", + "info/about.json", + "info/git", + "info/recipe/meta.yaml", + "info/recipe/conda_build_config.yaml", + "info/recipe/meta.yaml.template", + "info/hash_input.json", + "info/index.json", + "info/files", + "info/about.json", + "info/paths.json", + "info/git", + "info/recipe/meta.yaml.template", + "info/recipe/conda_build_config.yaml", + "info/recipe/meta.yaml", + ] diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/INSTALLER b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/METADATA b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..18b827d5ef2f8bd7b277c636e866dbc45ab6d16f --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/METADATA @@ -0,0 +1,55 @@ +Metadata-Version: 2.4 +Name: conda-package-handling +Version: 2.4.0 +Summary: Create and extract conda packages of various formats. +Home-page: https://github.com/conda/conda-package-handling +Author: Anaconda, Inc. +Author-email: conda@anaconda.com +Keywords: conda-package-handling +Classifier: Programming Language :: Python :: 3 +Requires-Python: >=3.8 +Description-Content-Type: text/markdown +License-File: LICENSE +License-File: AUTHORS.md +Requires-Dist: conda-package-streaming>=0.9.0 +Provides-Extra: docs +Requires-Dist: furo; extra == "docs" +Requires-Dist: sphinx; extra == "docs" +Requires-Dist: sphinx-argparse; extra == "docs" +Requires-Dist: myst-parser; extra == "docs" +Requires-Dist: mdit-py-plugins>=0.3.0; extra == "docs" +Provides-Extra: test +Requires-Dist: mock; extra == "test" +Requires-Dist: pytest; extra == "test" +Requires-Dist: pytest-cov; extra == "test" +Requires-Dist: pytest-mock; extra == "test" +Requires-Dist: bottle; extra == "test" +Dynamic: author +Dynamic: author-email +Dynamic: classifier +Dynamic: description +Dynamic: description-content-type +Dynamic: home-page +Dynamic: keywords +Dynamic: license-file +Dynamic: provides-extra +Dynamic: requires-dist +Dynamic: requires-python +Dynamic: summary + +# conda-package-handling + +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/conda/conda-package-handling/main.svg)](https://results.pre-commit.ci/latest/github/conda/conda-package-handling/main) + +Create and extract conda packages of various formats. + +`conda` and `conda-build` use `conda_package_handling.api` to create and extract +conda packages. This package also provides the `cph` command line tool to +extract, create, and convert between formats. + +See also +[conda-package-streaming](https://conda.github.io/conda-package-streaming), an +efficient library to read from new and old format .conda and .tar.bz2 conda +packages. + +Full documentation at [https://conda.github.io/conda-package-handling/](https://conda.github.io/conda-package-handling/) diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/RECORD b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..f040e97f09e41d982fe2d136ddab14fc496964c2 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/RECORD @@ -0,0 +1,33 @@ +../../../bin/cph,sha256=8l-Rp9U9E5wfHY3n_BLjFjyH8PFAmQcUH9ZDEFXjjYs,481 +conda_package_handling-2.4.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +conda_package_handling-2.4.0.dist-info/METADATA,sha256=_YzNZyk3KcgMXBlUgL-rvAq2Giou8V0f4PNa31IjGhQ,1977 +conda_package_handling-2.4.0.dist-info/RECORD,, +conda_package_handling-2.4.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +conda_package_handling-2.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91 +conda_package_handling-2.4.0.dist-info/direct_url.json,sha256=NfSTIqxtaVOSqkrkI2oHYgOzw9ipzp_3AAw7czuTCxI,112 +conda_package_handling-2.4.0.dist-info/entry_points.txt,sha256=4gBd7ZOv9v6P3VIiI6veVwgXzKCu_fUiOqwqVb0VTno,56 +conda_package_handling-2.4.0.dist-info/licenses/AUTHORS.md,sha256=IH_Um8vGtX2W3zDeomwXBWG-0MWj5LYtCGmdOfOhoSo,494 +conda_package_handling-2.4.0.dist-info/licenses/LICENSE,sha256=t_7OW5ytYcamhC7Wd2bBOAaL6tOaKVupR0m8szIrXnU,1505 +conda_package_handling-2.4.0.dist-info/top_level.txt,sha256=3290W3g8MbIyhMS6inC3oTzSzIweY5A2UKk__AZrnSY,23 +conda_package_handling/__init__.py,sha256=yLaFvd-K80rs_ClRVYULStijkok4RfYSaanIt_E-aKM,22 +conda_package_handling/__main__.py,sha256=a8OMmLES3Fl3A097Gn8VgCl6qR0b0zL6PON76sjnik8,60 +conda_package_handling/__pycache__/__init__.cpython-313.pyc,, +conda_package_handling/__pycache__/__main__.cpython-313.pyc,, +conda_package_handling/__pycache__/api.cpython-313.pyc,, +conda_package_handling/__pycache__/cli.cpython-313.pyc,, +conda_package_handling/__pycache__/conda_fmt.cpython-313.pyc,, +conda_package_handling/__pycache__/exceptions.cpython-313.pyc,, +conda_package_handling/__pycache__/interface.cpython-313.pyc,, +conda_package_handling/__pycache__/streaming.cpython-313.pyc,, +conda_package_handling/__pycache__/tarball.cpython-313.pyc,, +conda_package_handling/__pycache__/utils.cpython-313.pyc,, +conda_package_handling/__pycache__/validate.cpython-313.pyc,, +conda_package_handling/api.py,sha256=1myslsbrLIlu_oUh__XqyoV_6i441TVby8RZr8TRvvI,8085 +conda_package_handling/cli.py,sha256=eihYohoPzq8zINR1u-rbvRjIurW4eAts3mk28h8Lfx4,6047 +conda_package_handling/conda_fmt.py,sha256=wg9qNphvoD-vbHUNpZIiYJdaPMltmcIKOzfZ0EfjG9Q,7786 +conda_package_handling/exceptions.py,sha256=Eg2_GsE2oJqpeHvg98YYO6tfHP8Wv0MrV7CS55xRau0,1893 +conda_package_handling/interface.py,sha256=YkNDXXv12uCJtjCXz5uhWHGkR_rzOLVNiRZ-Eawv3Yg,796 +conda_package_handling/streaming.py,sha256=rTvjVY1zrQvu0Iueqh_HF6Fc4-x1LWQ3hfNsPwXBwjY,3071 +conda_package_handling/tarball.py,sha256=xibzzljnkBFoRHT_BG7ceNonX6iuC-bqhr4FySFX6Iw,3271 +conda_package_handling/utils.py,sha256=xhJfogHyWO7Mxx1y4OmHcHXEuVEQIR99bMVZP-Y0Zqk,16707 +conda_package_handling/validate.py,sha256=48gkidkuUm1JbCxLTh2jbJ4TgMu9tAasltb-UO2R62k,3652 diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/REQUESTED b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/WHEEL b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..e7fa31b6f3f78deb1022c1f7927f07d4d16da822 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/WHEEL @@ -0,0 +1,5 @@ +Wheel-Version: 1.0 +Generator: setuptools (80.9.0) +Root-Is-Purelib: true +Tag: py3-none-any + diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/direct_url.json b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..88857d546616e736d35febe1d6572f9a750e7054 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/task_176236637997838/conda-bld/conda-package-handling_1762366405159/work"} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/entry_points.txt b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/entry_points.txt new file mode 100644 index 0000000000000000000000000000000000000000..9fdb1861f943c5c8c0b96afb0e2ea40f88f30649 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/entry_points.txt @@ -0,0 +1,2 @@ +[console_scripts] +cph = conda_package_handling.cli:main diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/licenses/AUTHORS.md b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/licenses/AUTHORS.md new file mode 100644 index 0000000000000000000000000000000000000000..1e1f7b4dd7a8e1ff3b3ecf67cfb28f12ce49d5d8 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/licenses/AUTHORS.md @@ -0,0 +1,26 @@ +All of the people who have made at least one contribution to conda-package-handling. +Authors are sorted alphabetically. + +* Alan Du +* Cheng H. Lee +* Chris Burr +* Christopher Barber +* Conda Bot +* Daniel Bast +* Daniel Holth +* Eli Uriegas +* Jannis Leidel +* John Lee +* Jonathan J. Helmus +* Justin Wood (Callek) +* Ken Odegard +* Marius van Niekerk +* Matthew R. Becker +* Michael Sarahan +* Nehal J Wani +* Pure Software +* Ray Donnelly +* Tobias "Tobi" Koch +* Vadim Zayakin +* jaimergp +* pre-commit-ci[bot] diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/licenses/LICENSE b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..eb2f3f5caf1ffbd7a91b22c6a757ab1f31616621 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/licenses/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2019, Conda +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/top_level.txt b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/top_level.txt new file mode 100644 index 0000000000000000000000000000000000000000..b18d594baf030474c9e1b3a2f0cc4b86c453686b --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling-2.4.0.dist-info/top_level.txt @@ -0,0 +1 @@ +conda_package_handling diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/__init__.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..3d67cd6bb497cf0c862b60ff30e8b273aae5d851 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/__init__.py @@ -0,0 +1 @@ +__version__ = "2.4.0" diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/__main__.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/__main__.py new file mode 100644 index 0000000000000000000000000000000000000000..dde91ff0efe062c13395035b31d275e499d967de --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/__main__.py @@ -0,0 +1,3 @@ +from conda_package_handling import cli + +cli.main(args=None) diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/api.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/api.py new file mode 100644 index 0000000000000000000000000000000000000000..47881ce4a1330e1011fc7c241114a77985094034 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/api.py @@ -0,0 +1,236 @@ +from __future__ import annotations + +import functools as _functools +import os as _os +import warnings as _warnings +from glob import glob as _glob + +# expose these two exceptions as part of the API. Everything else should feed into these. +from .exceptions import ConversionError, InvalidArchiveError # NOQA +from .interface import AbstractBaseFormat +from .tarball import CondaTarBZ2 as _CondaTarBZ2 +from .utils import ensure_list, filter_info_files +from .utils import get_executor as _get_executor +from .utils import rm_rf as _rm_rf + +SUPPORTED_EXTENSIONS: dict[str, type[AbstractBaseFormat]] = {".tar.bz2": _CondaTarBZ2} + +libarchive_enabled = False #: Old API meaning "can extract .conda" (now without libarchive) + +try: + from .conda_fmt import ZSTD_COMPRESS_LEVEL, ZSTD_COMPRESS_THREADS + from .conda_fmt import CondaFormat_v2 as _CondaFormat_v2 + + SUPPORTED_EXTENSIONS[".conda"] = _CondaFormat_v2 + + libarchive_enabled = True + +except ImportError: + _warnings.warn("Install zstandard Python bindings for .conda support") + +THREADSAFE_EXTRACT = True #: Not present in conda-package-handling<2.0. + + +def _collect_paths(prefix): + dir_paths, file_paths = [], [] + for dp, dn, filenames in _os.walk(prefix): + for f in filenames: + file_paths.append(_os.path.relpath(_os.path.join(dp, f), prefix)) + dir_paths.extend(_os.path.relpath(_os.path.join(dp, _), prefix) for _ in dn) + file_list = file_paths + [ + dp for dp in dir_paths if not any(f.startswith(dp + _os.sep) for f in file_paths) + ] + return file_list + + +def get_default_extracted_folder(in_file, abspath=True): + dirname = None + for ext in SUPPORTED_EXTENSIONS: + if in_file.endswith(ext): + dirname = in_file[: -len(ext)] + if dirname and not abspath: + dirname = _os.path.basename(dirname) + return dirname + + +def extract(fn, dest_dir=None, components=None, prefix=None): + if dest_dir: + if _os.path.isabs(dest_dir) and prefix: + raise ValueError( + "dest_dir and prefix both provided as abs paths. If providing both, " + "prefix can be abspath, but dest dir must be relative (relative to " + "prefix)" + ) + if not _os.path.isabs(dest_dir): + dest_dir = _os.path.normpath(_os.path.join(prefix or _os.getcwd(), dest_dir)) + else: + dest_dir = _os.path.join( + prefix or _os.path.dirname(fn), + get_default_extracted_folder(fn, abspath=False), + ) + + if not _os.path.isdir(dest_dir): + _os.makedirs(dest_dir) + + for format in SUPPORTED_EXTENSIONS.values(): + if format.supported(fn): + format.extract(fn, dest_dir, components=components) + break + else: + raise ValueError( + "Didn't recognize extension for file '{}'. Supported extensions are: {}".format( + fn, list(SUPPORTED_EXTENSIONS.keys()) + ) + ) + + +def create(prefix, file_list, out_fn, out_folder=None, **kw): + if not out_folder: + out_folder = _os.getcwd() + + # simplify arguments to format.create() + if _os.path.isabs(out_fn): + out_folder = _os.path.dirname(out_fn) + out_fn = _os.path.basename(out_fn) + + if file_list is None: + file_list = _collect_paths(prefix) + elif isinstance(file_list, str): + try: + with open(file_list) as f: + data = f.readlines() + file_list = [_.strip() for _ in data] + except: + raise + + out = None + for format in SUPPORTED_EXTENSIONS.values(): + if format.supported(out_fn): + try: + out = format.create(prefix, file_list, out_fn, out_folder, **kw) + break + except BaseException as err: + # don't leave broken files around + abs_out_fn = _os.path.join(out_folder, out_fn) + if _os.path.isfile(abs_out_fn): + _rm_rf(abs_out_fn) + raise err + else: + raise ValueError( + "Didn't recognize extension for file '{}'. Supported extensions are: {}".format( + out_fn, list(SUPPORTED_EXTENSIONS.keys()) + ) + ) + + return out + + +def _convert( + fn, + out_ext, + out_folder, + force=False, + zstd_compress_level=None, + zstd_compress_threads=None, + **kw, +): + # allow package to work in degraded mode when zstandard is not available + import conda_package_streaming.transmute + import zstandard + + basename = get_default_extracted_folder(fn, abspath=False) + from .validate import validate_converted_files_match_streaming + + if not basename: + return ( + fn, + "", + "Input file %s doesn't have a supported extension (%s), skipping it" + % (fn, SUPPORTED_EXTENSIONS), + ) + out_fn = str(_os.path.join(out_folder, basename + out_ext)) + errors = "" + if not _os.path.lexists(out_fn) or force: + if force and _os.path.lexists(out_fn): + _os.unlink(out_fn) + + if out_ext == ".conda": + # ZSTD_COMPRESS_* constants are only defined if we have zstandard + if zstd_compress_level is None: + zstd_compress_level = ZSTD_COMPRESS_LEVEL + if zstd_compress_threads is None: + zstd_compress_threads = ZSTD_COMPRESS_THREADS + + def compressor(): + return zstandard.ZstdCompressor( + level=zstd_compress_level, threads=zstd_compress_threads + ) + + def is_info(filename): + return filter_info_files([filename], prefix=".") == [] + + transmute = _functools.partial( + conda_package_streaming.transmute.transmute, + fn, + out_folder, + compressor=compressor, + is_info=is_info, + ) + + else: + transmute = _functools.partial( + conda_package_streaming.transmute.transmute_tar_bz2, fn, out_folder + ) + + try: + transmute() + result = validate_converted_files_match_streaming(out_fn, fn) + _, missing_files, mismatching_sizes = result + if missing_files or mismatching_sizes: + errors = str(ConversionError(missing_files, mismatching_sizes)) + except BaseException as e: + # don't leave partial package around + if _os.path.isfile(out_fn): + _rm_rf(out_fn) + if not isinstance(e, Exception): + raise + errors = str(e) + + return fn, out_fn, errors + + +def transmute(in_file, out_ext, out_folder=None, processes=1, **kw): + if not out_folder: + out_folder = _os.path.dirname(in_file) or _os.getcwd() + + flist = set(_glob(in_file)) + for in_ext in SUPPORTED_EXTENSIONS: + if in_file.endswith(in_ext): + replacement = in_file[: -len(in_ext)] + out_ext + flist = flist - set(_glob(replacement)) + break + + failed_files = {} + with _get_executor(processes) as executor: + convert_f = _functools.partial(_convert, out_ext=out_ext, out_folder=out_folder, **kw) + for fn, out_fn, errors in executor.map(convert_f, flist): + if errors: + failed_files[fn] = errors + _rm_rf(out_fn) + return failed_files + + +def get_pkg_details(in_file): + """For the new pkg format, we return the size and hashes of the inner pkg part of the file""" + for format in SUPPORTED_EXTENSIONS.values(): + if format.supported(in_file): + return format.get_pkg_details(in_file) + raise ValueError(f"Don't know what to do with file {in_file}") + + +def list_contents(in_file, verbose=False, components=None): + components = ensure_list(components or ("info", "pkg")) + for format in SUPPORTED_EXTENSIONS.values(): + if format.supported(in_file): + return format.list_contents(in_file, verbose=verbose, components=components) + raise ValueError(f"Don't know what to do with file {in_file}") diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/cli.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/cli.py new file mode 100644 index 0000000000000000000000000000000000000000..b1ed3733c53fb2b2ab9d163378a4bdc7b0d1d4f5 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/cli.py @@ -0,0 +1,165 @@ +import argparse +import os +import sys +from pprint import pprint + +from . import __version__, api + + +def parse_args(parse_this=None): + parser = build_parser() + return parser.parse_args(parse_this) + + +def build_parser(): + parser = argparse.ArgumentParser() + parser.add_argument( + "-V", + "--version", + action="version", + help="Show the conda-package-handling version number and exit.", + version=f"conda-package-handling {__version__}", + ) + sp = parser.add_subparsers(title="subcommands", dest="subcommand", required=True) + + extract_parser = sp.add_parser("extract", help="extract package contents", aliases=["x"]) + extract_parser.add_argument("archive_path", help="path to archive to extract") + extract_parser.add_argument( + "--dest", + help="destination folder to extract to. If not set, defaults to" + " package filename minus extension in the same folder as the input archive." + " May be relative path used in tandem with the --prefix flag.", + ) + extract_parser.add_argument( + "--prefix", + help="base directory to extract to. Use this to set the base" + " directory, while allowing the folder name to be automatically determined " + "by the input filename. An abspath --prefix with an unset --dest will " + "achieve this.", + ) + extract_parser.add_argument( + "--info", + help="If the archive supports separate metadata, this" + " flag extracts only the metadata in the info folder from the " + "package. If the archive does not support separate metadata, this " + "flag has no effect and all files are extracted.", + action="store_true", + ) + + create_parser = sp.add_parser("create", help="bundle files into a package", aliases=["c"]) + create_parser.add_argument( + "prefix", + help="folder of files to bundle. Not strictly required to" + " have conda package metadata, but if conda package metadata isn't " + "present, you'll see a warning and your file will not work as a " + "conda package", + ) + create_parser.add_argument( + "out_fn", + help="Filename of archive to be created. Extension determines package type.", + ) + create_parser.add_argument( + "--file-list", + help="Path to file containing one relative path per" + " line that should be included in the archive. If not provided, " + "lists all files in the prefix.", + ) + create_parser.add_argument("--out-folder", help="Folder to dump final archive to") + + convert_parser = sp.add_parser( + "transmute", help="convert from one package type to another", aliases=["t"] + ) + convert_parser.add_argument( + "in_file", help="existing file to convert from. Glob patterns accepted." + ) + convert_parser.add_argument( + "out_ext", + help="extension of file to convert to. Examples: .tar.bz2, .conda", + ) + convert_parser.add_argument("--out-folder", help="Folder to dump final archive to") + convert_parser.add_argument( + "--force", action="store_true", help="Force overwrite existing package" + ) + convert_parser.add_argument( + "--processes", + type=int, + help="Max number of processes to use. If not set, defaults to 1.", + ) + convert_parser.add_argument( + "--zstd-compression-level", + help=( + "When building v2 packages, set the compression level used by " + "conda-package-handling. Defaults to 19." + ), + type=int, + choices=range(1, 23), + default=19, + ) + convert_parser.add_argument( + "--zstd-compression-threads", + help=( + "When building v2 packages, set the compression threads used by " + "conda-package-handling. Defaults to 1. -1=automatic." + ), + type=int, + default=1, + ) + list_parser = sp.add_parser( + "list", + aliases=["l"], + help="List package contents like `python -m tarfile --list ...` would do.", + ) + list_parser.add_argument("archive_path", help="path or URL to archive to inspect") + list_parser.add_argument( + "-v", + "--verbose", + action="store_true", + help="Report more details, similar to 'ls -l'. Otherwise, only the filenames are printed.", + ) + list_parser.add_argument( + "--components", + dest="components", + default="info,pkg", + help="Comma-separated list of components to read (.conda artifacts only; " + "ignored for .tar.bz2). Allowed values: info, pkg.", + ) + + return parser + + +def main(args=None): + args = parse_args(args) + if hasattr(args, "out_folder") and args.out_folder: + args.out_folder = ( + os.path.abspath(os.path.normpath(os.path.expanduser(args.out_folder))) + os.sep + ) + if args.subcommand in ("extract", "x"): + if args.info: + api.extract(args.archive_path, args.dest, components="info", prefix=args.prefix) + else: + api.extract(args.archive_path, args.dest, prefix=args.prefix) + elif args.subcommand in ("create", "c"): + api.create(args.prefix, args.file_list, args.out_fn, args.out_folder) + elif args.subcommand in ("transmute", "t"): + failed_files = api.transmute( + args.in_file, + args.out_ext, + args.out_folder, + args.processes or 1, + force=args.force, + zstd_compress_level=args.zstd_compression_level, + zstd_compress_threads=args.zstd_compression_threads, + ) + if failed_files: + print("failed files:") + pprint(failed_files) + sys.exit(1) + elif args.subcommand in ("list", "l"): + components = [ + component.strip() for component in (args.components or "info,pkg").split(",") + ] + api.list_contents(args.archive_path, verbose=args.verbose, components=components) + + +if __name__ == "__main__": # pragma: no cover + main(args=None) diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/conda_fmt.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/conda_fmt.py new file mode 100644 index 0000000000000000000000000000000000000000..c6c45cd37234c682db53e511ecd94bc8c909b089 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/conda_fmt.py @@ -0,0 +1,198 @@ +""" +The 'new' conda format, introduced in late 2018/early 2019. + +https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/packages.html +""" + +from __future__ import annotations + +import json +import os +import stat +import tarfile +import time +from contextlib import closing +from typing import Callable +from zipfile import ZIP_STORED, ZipFile + +import zstandard +from conda_package_streaming.package_streaming import stream_conda_component +from conda_package_streaming.url import conda_reader_for_url + +from . import utils +from .interface import AbstractBaseFormat +from .streaming import _extract, _list + +CONDA_PACKAGE_FORMAT_VERSION = 2 +DEFAULT_COMPRESSION_TUPLE = (".tar.zst", "zstd", "zstd:compression-level=19") + +# increase to reduce speed and increase compression (22 = conda's default) +ZSTD_COMPRESS_LEVEL = 19 +# increase to reduce compression (slightly) and increase speed +ZSTD_COMPRESS_THREADS = 1 + + +class CondaFormat_v2(AbstractBaseFormat): + """If there's another conda format or breaking changes, please create a new class and keep this + one, so that handling of v2 stays working.""" + + @staticmethod + def supported(fn): + return fn.endswith(".conda") + + @staticmethod + def extract(fn, dest_dir, **kw): + components = utils.ensure_list(kw.get("components")) or ("info", "pkg") + if not os.path.isabs(fn): + fn = os.path.normpath(os.path.join(os.getcwd(), fn)) + if not os.path.isdir(dest_dir): + os.makedirs(dest_dir) + + _extract(str(fn), str(dest_dir), components=components) + + @staticmethod + def extract_info(fn, dest_dir=None): + return CondaFormat_v2.extract(fn, dest_dir, components=["info"]) + + @staticmethod + def create( + prefix, + file_list, + out_fn, + out_folder=None, + compressor: Callable[[], zstandard.ZstdCompressor] | None = None, + compression_tuple=(None, None, None), + ): + if out_folder is None: + out_folder = os.getcwd() + if os.path.isabs(out_fn): + out_folder = os.path.dirname(out_fn) + out_fn = os.path.basename(out_fn) + conda_pkg_fn = os.path.join(out_folder, out_fn) + file_id = out_fn[: -len(".conda")] + pkg_files = utils.filter_info_files(file_list, prefix) + # preserve order + pkg_files_set = set(pkg_files) + info_files = list(f for f in file_list if f not in pkg_files_set) + + if compressor and (compression_tuple != (None, None, None)): + raise ValueError("Supply one of compressor= or (deprecated) compression_tuple=") + + if compressor is None: + compressor = lambda: zstandard.ZstdCompressor( + level=ZSTD_COMPRESS_LEVEL, + threads=ZSTD_COMPRESS_THREADS, + ) + + # legacy libarchive-ish compatibility + ext, comp_filter, filter_opts = compression_tuple + if filter_opts and filter_opts.startswith("zstd:compression-level="): + compressor = lambda: zstandard.ZstdCompressor( + level=int(filter_opts.split("=", 1)[-1]), + threads=ZSTD_COMPRESS_THREADS, + ) + + class NullWriter: + """ + zstd uses less memory on extract if size is known. + """ + + def __init__(self): + self.size = 0 + + def write(self, bytes): + self.size += len(bytes) + return len(bytes) + + def tell(self): + return self.size + + with ZipFile(conda_pkg_fn, "w", compression=ZIP_STORED) as conda_file, utils.tmp_chdir( + prefix + ): + pkg_metadata = {"conda_pkg_format_version": CONDA_PACKAGE_FORMAT_VERSION} + conda_file.writestr("metadata.json", json.dumps(pkg_metadata)) + + components_files = ( + (f"pkg-{file_id}.tar.zst", pkg_files), + ( + f"info-{file_id}.tar.zst", + info_files, + ), + ) + + # put the info last, for parity with updated transmute. + compress = compressor() + for component, files in components_files: + # If size is known, the decompressor may be able to allocate less memory. + # The compressor will error if size is not correct. + with tarfile.TarFile(fileobj=NullWriter(), mode="w") as sizer: # type: ignore + for file in files: + sizer.add(file, filter=utils.anonymize_tarinfo) + size = sizer.fileobj.size # type: ignore + + with conda_file.open(component, "w", force_zip64=True) as component_file: + # only one stream_writer() per compressor() must be in use at a time + component_stream = compress.stream_writer( + component_file, size=size, closefd=False + ) + component_tar = tarfile.TarFile(fileobj=component_stream, mode="w") + + for file in files: + component_tar.add(file, filter=utils.anonymize_tarinfo) + + component_tar.close() + component_stream.close() + + return conda_pkg_fn + + @staticmethod + def get_pkg_details(in_file): + stat_result = os.stat(in_file) + size = stat_result.st_size + md5, sha256 = utils.checksums(in_file, ("md5", "sha256")) + return {"size": size, "md5": md5, "sha256": sha256} + + @classmethod + def list_contents(cls, fn, verbose=False, **kw): + components = utils.ensure_list(kw.get("components")) or ("info", "pkg") + if "://" in fn: + return cls._list_remote_contents(fn, components=components, verbose=verbose) + # local resource + if not os.path.isabs(fn): + fn = os.path.abspath(fn) + _list(fn, components=components, verbose=verbose) + + @staticmethod + def _list_remote_contents(url, verbose=False, components=("info", "pkg")): + """ + List contents of a remote .conda artifact (by URL). It only fetches the 'info' component + and uses the metadata to infer details of the 'pkg' component. Some fields like + modification time or permissions will be missing in verbose mode. + """ + components = utils.ensure_list(components or ("info", "pkg")) + lines = {} + filename, conda = conda_reader_for_url(url) + with closing(conda): + for tar, member in stream_conda_component(filename, conda, component="info"): + path = member.name + ("/" if member.isdir() else "") + if "info" in components: + line = "" + if verbose: + line = ( + f"{stat.filemode(member.mode)} " + f"{member.uname or member.uid}/{member.gname or member.gid} " + f"{member.size:10d} " + ) + line += "%d-%02d-%02d %02d:%02d:%02d " % time.localtime(member.mtime)[:6] + lines[path] = line + path + if "pkg" in components and member.name == "info/paths.json": + data = json.loads(tar.extractfile(member).read().decode()) + assert data.get("paths_version", 1) == 1, data + for path in data.get("paths", ()): + line = "" + if verbose: + size = path["size_in_bytes"] + line = f"?????????? ?/? {size:10d} ????-??-?? ??:??:?? " + lines[path["_path"]] = line + path["_path"] + print(*[line for _, line in sorted(lines.items())], sep="\n") diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/exceptions.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..00e820c63b072448b432e258a34a1d8f73c80126 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/exceptions.py @@ -0,0 +1,53 @@ +from errno import ENOENT + + +class InvalidArchiveError(Exception): + """Raised when libarchive can't open a file""" + + def __init__(self, fn, msg, *args, **kw): + msg = ( + "Error with archive %s. You probably need to delete and re-download " + "or re-create this file. Message was:\n\n%s" % (fn, msg) + ) + self.errno = ENOENT + super().__init__(msg) + + +class ArchiveCreationError(Exception): + """Raised when an archive fails during creation""" + + pass + + +class CaseInsensitiveFileSystemError(InvalidArchiveError): + def __init__(self, package_location, extract_location, **kwargs): + message = """ + Cannot extract package to a case-insensitive file system. Your install + destination does not differentiate between upper and lowercase + characters, and this breaks things. Try installing to a location that + is case-sensitive. Windows drives are usually the culprit here - can + you install to a native Unix drive, or turn on case sensitivity for + this (Windows) location? + + package location: %(package_location)s + extract location: %(extract_location)s + """ + self.package_location = package_location + self.extract_location = extract_location + super().__init__(package_location, message, **kwargs) + + +class ConversionError(Exception): + def __init__(self, missing_files, mismatching_sizes, *args, **kw): + self.missing_files = missing_files + self.mismatching_sizes = mismatching_sizes + errors = "" + if self.missing_files: + errors = "Missing files in converted package: %s\n" % self.missing_files + errors = ( + errors + + "Mismatching sizes (corruption) in converted package: %s" # noqa + % self.mismatching_sizes + ) + + super().__init__(errors, *args, **kw) diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/interface.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/interface.py new file mode 100644 index 0000000000000000000000000000000000000000..390cffdc77ed4fc668f0ebd070f641855f4f1447 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/interface.py @@ -0,0 +1,30 @@ +from __future__ import annotations + +import abc + + +class AbstractBaseFormat(metaclass=abc.ABCMeta): + @staticmethod + @abc.abstractmethod + def supported(fn): # pragma: no cover + return False + + @staticmethod + @abc.abstractmethod + def extract(fn, dest_dir, **kw): # pragma: no cover + raise NotImplementedError + + @staticmethod + @abc.abstractmethod + def create(prefix, file_list, out_fn, out_folder: str | None = None, **kw): # pragma: no cover + raise NotImplementedError + + @staticmethod + @abc.abstractmethod + def get_pkg_details(in_file): # pragma: no cover + raise NotImplementedError + + @staticmethod + @abc.abstractmethod + def list_contents(in_file, verbose=False, **kw): # pragma: no cover + raise NotImplementedError diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/streaming.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/streaming.py new file mode 100644 index 0000000000000000000000000000000000000000..f05f981ae70e215ea89fdba9c1366b575284756c --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/streaming.py @@ -0,0 +1,82 @@ +""" +Exception-compatible adapter from conda_package_streaming. +""" + +from __future__ import annotations + +import io +import tarfile +from contextlib import redirect_stdout +from tarfile import TarError +from typing import Generator +from zipfile import BadZipFile + +from conda_package_streaming.extract import exceptions as cps_exceptions +from conda_package_streaming.extract import extract_stream, package_streaming + +from . import exceptions + + +def _stream_components( + filename: str, + components: list[str], + dest_dir: str = "", +) -> Generator[Generator[tuple[tarfile.TarFile, tarfile.TarInfo]]]: + if str(filename).endswith(".tar.bz2"): + assert components == ["pkg"] + + try: + with open(filename, "rb") as fileobj: + for component in components: + # will parse zipfile twice + yield package_streaming.stream_conda_component( + filename, fileobj, component=component + ) + except cps_exceptions.CaseInsensitiveFileSystemError as e: + raise exceptions.CaseInsensitiveFileSystemError(filename, dest_dir) from e + except (OSError, TarError, BadZipFile) as e: + raise exceptions.InvalidArchiveError(filename, f"failed with error: {str(e)}") from e + + +def _extract(filename: str, dest_dir: str, components: list[str]): + """ + Extract .conda or .tar.bz2 package to dest_dir. + + If it's a conda package, components may be ["pkg", "info"] + + If it's a .tar.bz2 package, components must equal ["pkg"] + + Internal. Skip directly to conda-package-streaming if you don't need + exception compatibility. + """ + for stream in _stream_components(filename, components, dest_dir=dest_dir): + try: + extract_stream(stream, dest_dir) + except cps_exceptions.CaseInsensitiveFileSystemError as e: + raise exceptions.CaseInsensitiveFileSystemError(filename, dest_dir) from e + except (OSError, TarError, BadZipFile) as e: + raise exceptions.InvalidArchiveError(filename, f"failed with error: {str(e)}") from e + + +def _list(filename: str, components: list[str], verbose=True): + memfile = io.StringIO() + for component in _stream_components(filename, components): + for tar, _ in component: + with redirect_stdout(memfile): + tar.list(verbose=verbose) + # next iteraton of for loop raises GeneratorExit in stream + # see comments in conda_package_streaming.extract:extract_stream + # and docstring in conda_package_streaming.package_streaming:stream_conda_info + component.close() + memfile.seek(0) + if verbose: + lines = sorted( + memfile.readlines(), + # verbose Tarfile.list() produces lines like: + # ?rw-r--r-- 502/20 2342 2018-10-04 14:02:00 info/about.json + # We only want the last part but we need to be mindful of paths containing spaces + key=lambda line: line.split(None, 5)[-1], + ) + else: + lines = sorted(memfile.readlines()) + print("".join(lines), end="") diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/tarball.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/tarball.py new file mode 100644 index 0000000000000000000000000000000000000000..506a3e0ba5c0f8ea99b1210d11b5dd6e255bc222 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/tarball.py @@ -0,0 +1,101 @@ +import logging +import os +import re +import tarfile + +from . import streaming, utils +from .interface import AbstractBaseFormat + +LOG = logging.getLogger(__name__) + + +def _sort_file_order(prefix, files): + """Sort by filesize, to optimize compression?""" + info_slash = "info" + os.path.sep + + def order(f): + # we don't care about empty files so send them back via 100000 + fsize = os.lstat(os.path.join(prefix, f)).st_size or 100000 + # info/* records will be False == 0, others will be 1. + info_order = int(not f.startswith(info_slash)) + if info_order: + _, ext = os.path.splitext(f) + # Strip any .dylib.* and .so.* and rename .dylib to .so + ext = re.sub(r"(\.dylib|\.so).*$", r".so", ext) + if not ext: + # Files without extensions should be sorted by dirname + info_order = 1 + hash(os.path.dirname(f)) % (10**8) + else: + info_order = 1 + abs(hash(ext)) % (10**8) + return info_order, fsize + + files_list = list(sorted(files, key=order)) + + return files_list + + +def _create_no_libarchive(fullpath, files): + with tarfile.open(fullpath, "w:bz2") as t: + for f in files: + t.add(f, filter=utils.anonymize_tarinfo) + + +def create_compressed_tarball( + prefix, files, tmpdir, basename, ext, compression_filter, filter_opts="" +): + tmp_path = os.path.join(tmpdir, basename) + files = _sort_file_order(prefix, files) + + # add files in order of a) in info directory, b) increasing size so + # we can access small manifest or json files without decompressing + # possible large binary or data files + fullpath = tmp_path + ext + with utils.tmp_chdir(prefix): + _create_no_libarchive(fullpath, files) + return fullpath + + +class CondaTarBZ2(AbstractBaseFormat): + @staticmethod + def supported(fn): + return fn.endswith(".tar.bz2") + + @staticmethod + def extract(fn, dest_dir, **kw): + if not os.path.isdir(dest_dir): + os.makedirs(dest_dir) + if not os.path.isabs(fn): + fn = os.path.normpath(os.path.join(os.getcwd(), fn)) + + streaming._extract(str(fn), str(dest_dir), components=["pkg"]) + + @staticmethod + def create(prefix, file_list, out_fn, out_folder=None, **kw): + if out_folder is None: + out_folder = os.getcwd() + if os.path.isabs(out_fn): + out_folder = os.path.dirname(out_fn) + out_file = create_compressed_tarball( + prefix, + file_list, + out_folder, + os.path.basename(out_fn).replace(".tar.bz2", ""), + ".tar.bz2", + "bzip2", + ) + return out_file + + @staticmethod + def get_pkg_details(in_file): + stat_result = os.stat(in_file) + size = stat_result.st_size + md5, sha256 = utils.checksums(in_file, ("md5", "sha256")) + return {"size": size, "md5": md5, "sha256": sha256} + + @staticmethod + def list_contents(fn, verbose=False, **kw): + if "://" in fn: + raise ValueError("Remote .tar.bz2 artifact listing is not supported.") + if not os.path.isabs(fn): + fn = os.path.abspath(fn) + streaming._list(str(fn), components=["pkg"], verbose=verbose) diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/utils.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/utils.py new file mode 100644 index 0000000000000000000000000000000000000000..699a2dbe4d31c495a04205c200376a22714be26c --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/utils.py @@ -0,0 +1,493 @@ +import contextlib +import fnmatch +import hashlib +import logging +import os +import re +import shutil +import sys +import warnings as _warnings +from concurrent.futures import Executor, ProcessPoolExecutor, ThreadPoolExecutor +from errno import EACCES, ENOENT, EPERM, EROFS +from itertools import chain +from os.path import ( + abspath, + basename, + dirname, + isdir, + isfile, + islink, + join, + lexists, + normpath, + split, +) +from stat import S_IEXEC, S_IMODE, S_ISDIR, S_ISREG, S_IWRITE +from subprocess import STDOUT, CalledProcessError, check_output, list2cmdline +from tempfile import NamedTemporaryFile, mkdtemp + +on_win = sys.platform == "win32" +log = logging.getLogger(__name__) +CONDA_TEMP_EXTENSION = ".c~" + + +def which(executable): + from distutils.spawn import find_executable + + return find_executable(executable) + + +def make_writable(path): + try: + mode = os.lstat(path).st_mode + if S_ISDIR(mode): + os.chmod(path, S_IMODE(mode) | S_IWRITE | S_IEXEC) + elif S_ISREG(mode) or islink(path): + os.chmod(path, S_IMODE(mode) | S_IWRITE) + else: + log.debug("path cannot be made writable: %s", path) + return True + except Exception as e: + eno = getattr(e, "errno", None) + if eno in (ENOENT,): + log.debug("tried to make writable, but didn't exist: %s", path) + raise + elif eno in (EACCES, EPERM, EROFS): + log.debug("tried make writable but failed: %s\n%r", path, e) + return False + else: + log.warn("Error making path writable: %s\n%r", path, e) + raise + + +class DummyExecutor(Executor): + def map(self, func, *iterables): + for iterable in iterables: + for thing in iterable: + yield func(thing) + + +def get_executor(processes): + return DummyExecutor() if processes == 1 else ProcessPoolExecutor(max_workers=processes) + + +def recursive_make_writable(path): + # The need for this function was pointed out at + # https://github.com/conda/conda/issues/3266#issuecomment-239241915 + # Especially on windows, file removal will often fail because it is marked read-only + if isdir(path): + for root, dirs, files in os.walk(path): + for path in chain.from_iterable((files, dirs)): + try: + make_writable(join(root, path)) + except: + pass + else: + try: + make_writable(path) + except: + pass + + +def quote_for_shell(arguments, shell=None): + if not shell: + shell = "cmd.exe" if on_win else "bash" + if shell == "cmd.exe": + return list2cmdline(arguments) + else: + # If any multiline argument gets mixed with any other argument (which is true if we've + # arrived in this function) then we just quote it. This assumes something like: + # ['python', '-c', 'a\nmultiline\nprogram\n'] + # It may make sense to allow specifying a replacement character for '\n' too? e.g. ';' + quoted = [] + # This could all be replaced with some regex wizardry but that is less readable and + # for code like this, readability is very important. + for arg in arguments: + if '"' in arg: + quote = "'" + elif "'" in arg: + quote = '"' + elif not any(_ in arg for _ in (" ", "\n")): + quote = "" + else: + quote = '"' + quoted.append(quote + arg + quote) + return " ".join(quoted) + + +def rmtree(path, *args, **kwargs): + # subprocessing to delete large folders can be quite a bit faster + path = normpath(path) + if on_win: + try: + # the fastest way seems to be using DEL to recursively delete files + # https://www.ghacks.net/2017/07/18/how-to-delete-large-folders-in-windows-super-fast/ + # However, this is not entirely safe, as it can end up following symlinks to folders + # https://superuser.com/a/306618/184799 + # so, we stick with the slower, but hopefully safer way. Maybe if we figured out how + # to scan for any possible symlinks, we could do the faster way. + # out = check_output('DEL /F/Q/S *.* > NUL 2> NUL'.format(path), shell=True, + # stderr=STDOUT, cwd=path) + + out = check_output(f'RD /S /Q "{path}" > NUL 2> NUL', shell=True, stderr=STDOUT) + except: + try: + # Try to delete in Unicode + name = None + + with NamedTemporaryFile(suffix=".bat", delete=False) as batch_file: + batch_file.write(f"RD /S {quote_for_shell([path])}\n") + batch_file.write("chcp 65001\n") + batch_file.write(f"RD /S {quote_for_shell([path])}\n") + batch_file.write("EXIT 0\n") + name = batch_file.name + # If the above is bugged we can end up deleting hard-drives, so we check + # that 'path' appears in it. This is not bulletproof but it could save you (me). + with open(name) as contents: + content = contents.read() + assert path in content + comspec = os.environ["COMSPEC"] + CREATE_NO_WINDOW = 0x08000000 + # It is essential that we `pass stdout=None, stderr=None, stdin=None` here because + # if we do not, then the standard console handles get attached and chcp affects the + # parent process (and any which share those console handles!) + out = check_output( + [comspec, "/d", "/c", name], + shell=False, + stdout=None, + stderr=None, + stdin=None, + creationflags=CREATE_NO_WINDOW, + ) + + except CalledProcessError as e: + if e.returncode != 5: + log.error(f"Removing folder {path} the fast way failed. Output was: {out}") + raise + else: + log.debug(f"removing dir contents the fast way failed. Output was: {out}") + else: + try: + os.makedirs(".empty") + except: + pass + # yes, this looks strange. See + # https://unix.stackexchange.com/a/79656/34459 + # https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html # NOQA + rsync = which("rsync") + if rsync and isdir(".empty"): + try: + out = check_output( + [ + rsync, + "-a", + "--force", + "--delete", + join(os.getcwd(), ".empty") + "/", + path + "/", + ], + stderr=STDOUT, + ) + except CalledProcessError: + log.debug(f"removing dir contents the fast way failed. Output was: {out}") + shutil.rmtree(".empty") + shutil.rmtree(path) + + +def unlink_or_rename_to_trash(path): + """If files are in use, especially on windows, we can't remove them. + The fallback path is to rename them (but keep their folder the same), + which maintains the file handle validity. See comments at: + https://serverfault.com/a/503769 + """ + try: + make_writable(path) + os.unlink(path) + except OSError: + try: + os.rename(path, path + ".conda_trash") + except OSError: + if on_win: + # on windows, it is important to use the rename program, as just using python's + # rename leads to permission errors when files are in use. + with NamedTemporaryFile(suffix=".bat") as trash_script: + with open(trash_script, "w") as f: + f.write('@pushd "%1"\n') + f.write("@REM Rename src to dest") + f.write('@ren "%2" "%3" > NUL 2> NUL")') + + _dirname, _fn = split(path) + dest_fn = path + ".conda_trash" + counter = 1 + while isfile(dest_fn): + dest_fn = dest_fn.splitext[0] + f".conda_trash_{counter}" + counter += 1 + out = "< empty >" + try: + out = check_output( + [ + "cmd.exe", + "/C", + trash_script, + _dirname, + _fn, + basename(dest_fn), + ], + stderr=STDOUT, + ) + except CalledProcessError: + log.warn( + "renaming file path {} to trash failed. Output was: {}".format( + path, out + ) + ) + + log.warn( + "Could not remove or rename {}. Please remove this file manually (you " + "may need to reboot to free file handles)".format(path) + ) + + +def remove_empty_parent_paths(path): + # recurse to clean up empty folders that were created to have a nested hierarchy + parent_path = dirname(path) + while isdir(parent_path) and not os.listdir(parent_path): + rmdir(parent_path) + parent_path = dirname(parent_path) + + +def rm_rf(path, clean_empty_parents=False, *args, **kw): + """ + Completely delete path + max_retries is the number of times to retry on failure. The default is 5. This only applies + to deleting a directory. + If removing path fails and trash is True, files will be moved to the trash directory. + """ + recursive_make_writable(path) + try: + path = abspath(path) + if isdir(path) and not islink(path): + rmdir(path) + elif lexists(path): + unlink_or_rename_to_trash(path) + else: + log.debug("rm_rf failed. Not a link, file, or directory: %s", path) + finally: + if lexists(path): + log.info("rm_rf failed for %s", path) + return False + if isdir(path): + delete_trash(path) + if clean_empty_parents: + remove_empty_parent_paths(path) + return True + + +# aliases that all do the same thing (legacy compat) +try_rmdir_all_empty = move_to_trash = move_path_to_trash = rm_rf + + +def delete_trash(prefix): + if not prefix: + prefix = sys.prefix + exclude = {"envs"} + for root, dirs, files in os.walk(prefix, topdown=True): + dirs[:] = [d for d in dirs if d not in exclude] + for fn in files: + if fnmatch.fnmatch(fn, "*.conda_trash*") or fnmatch.fnmatch( + fn, "*" + CONDA_TEMP_EXTENSION + ): + filename = join(root, fn) + try: + os.unlink(filename) + remove_empty_parent_paths(filename) + except OSError as e: + log.debug("%r errno %d\nCannot unlink %s.", e, e.errno, filename) + + +def rmdir(dirpath): + if not isdir(dirpath): + return + try: + rmtree(dirpath) + # we don't really care about errors that much. We'll catch remaining files + # with slower python logic. + except: + pass + + for root, dirs, files in os.walk(dirpath, topdown=False): + for f in files: + unlink_or_rename_to_trash(join(root, f)) + + +# we have our own TemporaryDirectory class because it's faster and handles disk issues better. +class TemporaryDirectory: + """Create and return a temporary directory. This has the same + behavior as mkdtemp but can be used as a context manager. For + example: + + with TemporaryDirectory() as tmpdir: + ... + + Upon exiting the context, the directory and everything contained + in it are removed. + """ + + # Handle mkdtemp raising an exception + name = None + _closed = False + + def __init__(self, suffix="", prefix=".cph_tmp", dir=os.getcwd()): + self.name = mkdtemp(suffix, prefix, dir) + + def __repr__(self): + return f"<{self.__class__.__name__} {self.name!r}>" + + def __enter__(self): + return self.name + + def cleanup(self, _warn=False, _warnings=_warnings): + if self.name and not self._closed: + try: + rm_rf(self.name) + except: + _warnings.warn( + 'Conda-package-handling says: "I tried to clean up, ' + "but I could not. There is a mess in %s that you might " + 'want to clean up yourself. Sorry..."' % self.name + ) + self._closed = True + if _warn and _warnings.warn: + _warnings.warn( + f"Implicitly cleaning up {self!r}", + _warnings.ResourceWarning, + ) + + def __exit__(self, exc, value, tb): + self.cleanup() + + def __del__(self): + # Issue a ResourceWarning if implicit cleanup needed + self.cleanup(_warn=True) + + +@contextlib.contextmanager +def tmp_chdir(dest): + curdir = os.getcwd() + try: + os.chdir(dest) + yield + finally: + os.chdir(curdir) + + +def ensure_list(arg): + if isinstance(arg, str) or not hasattr(arg, "__iter__"): + if arg is not None: + arg = [arg] + else: + arg = [] + return arg + + +def filter_files( + files_list, + prefix, + filter_patterns=( + r"(.*[\\\\/])?\.git[\\\\/].*", + r"(.*[\\\\/])?\.git$", + r"(.*)?\.DS_Store.*", + r".*\.la$", + r"conda-meta.*", + ), +): + """Remove things like the .git directory from the list of files to be copied""" + for pattern in filter_patterns: + r = re.compile(pattern) + files_list = set(files_list) - set(filter(r.match, files_list)) + return [ + f + for f in files_list + if + # `islink` prevents symlinks to directories from being removed + os.path.islink(os.path.join(prefix, f)) or not os.path.isdir(os.path.join(prefix, f)) + ] + + +def filter_info_files(files_list, prefix): + return filter_files( + files_list, + prefix, + filter_patterns=( + "info[\\\\/]index\\.json", + "info[\\\\/]files", + "info[\\\\/]paths\\.json", + "info[\\\\/]about\\.json", + "info[\\\\/]has_prefix", + "info[\\\\/]hash_input_files", # legacy, not used anymore + "info[\\\\/]hash_input\\.json", + "info[\\\\/]run_exports\\.yaml", # legacy + "info[\\\\/]run_exports\\.json", # current + "info[\\\\/]git", + "info[\\\\/]recipe[\\\\/].*", + "info[\\\\/]recipe_log.json", + "info[\\\\/]recipe.tar", + "info[\\\\/]test[\\\\/].*", + "info[\\\\/]LICENSE.*", + "info[\\\\/]requires", + "info[\\\\/]meta", + "info[\\\\/]platform", + "info[\\\\/]no_link", + "info[\\\\/]link\\.json", + "info[\\\\/]icon\\.png", + ), + ) + + +def _checksum(fd, algorithm, buffersize=65536): + hash_impl = getattr(hashlib, algorithm) + if not hash_impl: + raise ValueError(f"Unrecognized hash algorithm: {algorithm}") + else: + hash_impl = hash_impl() + for block in iter(lambda: fd.read(buffersize), b""): + hash_impl.update(block) + return hash_impl.hexdigest() + + +def sha256_checksum(fd): + return _checksum(fd, "sha256") + + +def md5_checksum(fd): + return _checksum(fd, "md5") + + +def checksum(fn, algorithm, buffersize=1 << 18): + """ + Calculate a checksum for a filename (not an open file). + """ + with open(fn, "rb") as fd: + return _checksum(fd, algorithm, buffersize) + + +def checksums(fn, algorithms, buffersize=1 << 18): + """ + Calculate multiple checksums for a filename in parallel. + """ + with ThreadPoolExecutor(max_workers=len(algorithms)) as e: + # take care not to share hash_impl between threads + results = [e.submit(checksum, fn, algorithm, buffersize) for algorithm in algorithms] + return [result.result() for result in results] + + +def anonymize_tarinfo(tarinfo): + """ + Remove user id, name from tarinfo. + """ + # also remove timestamps? + tarinfo.uid = 0 + tarinfo.uname = "" + tarinfo.gid = 0 + tarinfo.gname = "" + return tarinfo diff --git a/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/validate.py b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/validate.py new file mode 100644 index 0000000000000000000000000000000000000000..024d71af293153b500a273fe2f45ba641eb48945 --- /dev/null +++ b/miniconda3/pkgs/conda-package-handling-2.4.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_handling/validate.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +import hashlib +import os +from itertools import chain +from pathlib import Path + +from conda_package_streaming import package_streaming + +from .utils import TemporaryDirectory + + +def validate_converted_files_match( + src_file_or_folder, subject, reference_ext="" +): # pragma: nocover + # No longer used by conda-package-handling + from .api import extract + + with TemporaryDirectory() as tmpdir: + assert tmpdir is not None + if os.path.isdir(src_file_or_folder): + src_folder = src_file_or_folder + else: + extract(src_file_or_folder + reference_ext, dest_dir=os.path.join(tmpdir, "src")) + src_folder = os.path.join(tmpdir, "src") + + converted_folder = os.path.join(tmpdir, "converted") + extract(subject, dest_dir=converted_folder) + + missing_files = set() + mismatch_size = set() + for root, dirs, files in os.walk(src_folder): + for f in files: + absfile = os.path.join(root, f) + rp = os.path.relpath(absfile, src_folder) + destpath = os.path.join(converted_folder, rp) + if not os.path.islink(destpath): + if not os.path.isfile(destpath): + missing_files.add(rp) + elif os.stat(absfile).st_size != os.stat(destpath).st_size: + mismatch_size.add(rp) + return src_file_or_folder, missing_files, mismatch_size + + +def hash_fn(): + return hashlib.blake2b() + + +IGNORE_FIELDS = { + "uid", + "gid", + "mtime", + "uname", + "gname", + "chksum", +} #: ignore if not strict + + +def validate_converted_files_match_streaming( + src: str | Path, reference: str | Path, *, strict=True +): + """ + Check that two .tar.bz2 or .conda files (either of src_file and + reference_file can be either format) match exactly, down to the timestamps + etc. + + Does not check outside of the info- and pkg- components of a .conda. + (conda's metadata.json, which gives the version "2" of the format) + + If strict = True, also check for matching uid, gid, mtime, uname, gname. + """ + source_set = {} + reference_set = {} + ignore_fields = {"chksum"} if strict else IGNORE_FIELDS + + def get_fileset(filename: str | Path): + fileset = {} + components = ["info", "pkg"] if os.fspath(filename).endswith(".conda") else ["pkg"] + with open(filename, "rb") as conda_file: + for component in components: + for tar, member in package_streaming.stream_conda_component( + filename, conda_file, component + ): + info = {k: v for k, v in member.get_info().items() if k not in ignore_fields} + + if member.isfile(): + hasher = hash_fn() + fd = tar.extractfile(member) + assert fd is not None + for block in iter(lambda: fd.read(1 << 18), b""): # type: ignore + hasher.update(block) + + info["digest"] = hasher.hexdigest() + + fileset[info["name"]] = info + + return fileset + + source_set = get_fileset(src) + reference_set = get_fileset(reference) + + missing = [] + mismatched = [] + + if source_set != reference_set: + for file in chain(source_set, reference_set): + if not (file in source_set and file in reference_set): + missing.append(file) + elif source_set[file] != reference_set[file]: + mismatched.append(file) + + return src, missing, mismatched diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/about.json b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..83490d6bcedf6604253f6c90731314d8995a1e3e --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/about.json @@ -0,0 +1,160 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main", + "https://repo.anaconda.com/pkgs/r", + "https://repo.anaconda.com/pkgs/r" + ], + "conda_build_version": "25.1.2", + "conda_version": "25.1.1", + "description": "An efficient library to read from new and old format .conda and .tar.bz2 conda packages.\n", + "dev_url": "https://github.com/conda/conda-package-streaming", + "doc_url": "https://conda.github.io/conda-package-streaming/", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true, + "recipe-maintainers": [ + "dholth" + ] + }, + "home": "https://github.com/conda/conda-package-streaming", + "identifiers": [], + "keywords": [], + "license": "BSD-3-Clause", + "license_family": "BSD", + "license_file": "LICENSE", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "ca-certificates 2025.9.9 h06a4308_0", + "ld_impl_linux-64 2.40 h12ee557_0", + "libstdcxx-ng 11.2.0 h1234567_1", + "nlohmann_json 3.11.2 h6a678d5_0", + "pybind11-abi 5 hd3eb1b0_0", + "tzdata 2025a h04d1e81_0", + "libgomp 11.2.0 h1234567_1", + "_openmp_mutex 5.1 1_gnu", + "libgcc-ng 11.2.0 h1234567_1", + "bzip2 1.0.8 h5eee18b_6", + "c-ares 1.19.1 h5eee18b_0", + "cpp-expected 1.1.0 hdb19cb5_0", + "expat 2.6.4 h6a678d5_0", + "fmt 9.1.0 hdb19cb5_1", + "icu 73.1 h6a678d5_0", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_1", + "libuuid 1.41.5 h5eee18b_0", + "lz4-c 1.9.4 h6a678d5_1", + "ncurses 6.4 h6a678d5_0", + "liblief 0.12.3 h6a678d5_0", + "reproc 14.2.4 h6a678d5_2", + "simdjson 3.10.1 hdb19cb5_0", + "xz 5.4.6 h5eee18b_1", + "yaml-cpp 0.8.0 h6a678d5_1", + "zlib 1.2.13 h5eee18b_1", + "libedit 3.1.20230828 h5eee18b_0", + "libnghttp2 1.57.0 h2d74bed_0", + "libssh2 1.11.1 h251f7ec_0", + "libxml2 2.13.5 hfdd30dd_0", + "pcre2 10.42 hebb0a14_1", + "readline 8.2 h5eee18b_0", + "reproc-cpp 14.2.4 h6a678d5_2", + "spdlog 1.11.0 hdb19cb5_0", + "tk 8.6.14 h39e8969_0", + "zstd 1.5.6 hc292b87_0", + "krb5 1.20.1 h143b758_1", + "libarchive 3.7.7 hfab0078_0", + "libsolv 0.7.30 he621ea3_1", + "sqlite 3.45.3 h5eee18b_0", + "libcurl 8.11.1 hc9e6f67_0", + "python 3.12.9 h5148396_0", + "libmamba 2.0.5 haf1ee3a_1", + "menuinst 2.2.0 py312h06a4308_1", + "anaconda-anon-usage 0.5.0 py312hfc0e8ea_100", + "annotated-types 0.6.0 py312h06a4308_0", + "archspec 0.2.3 pyhd3eb1b0_0", + "boltons 24.1.0 py312h06a4308_0", + "brotli-python 1.0.9 py312h6a678d5_9", + "charset-normalizer 3.3.2 pyhd3eb1b0_0", + "distro 1.9.0 py312h06a4308_0", + "frozendict 2.4.2 py312h06a4308_0", + "idna 3.7 py312h06a4308_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "libmambapy 2.0.5 py312hdb19cb5_1", + "mdurl 0.1.0 py312h06a4308_0", + "packaging 24.2 py312h06a4308_0", + "platformdirs 3.10.0 py312h06a4308_0", + "pluggy 1.5.0 py312h06a4308_0", + "pycosat 0.6.6 py312h5eee18b_2", + "pycparser 2.21 pyhd3eb1b0_0", + "pygments 2.15.1 py312h06a4308_1", + "pysocks 1.7.1 py312h06a4308_0", + "ruamel.yaml.clib 0.2.8 py312h5eee18b_0", + "setuptools 75.8.0 py312h06a4308_0", + "tqdm 4.67.1 py312he106c6f_0", + "truststore 0.10.0 py312h06a4308_0", + "typing_extensions 4.12.2 py312h06a4308_0", + "wheel 0.45.1 py312h06a4308_0", + "cffi 1.17.1 py312h1fdaa30_1", + "jsonpatch 1.33 py312h06a4308_1", + "markdown-it-py 2.2.0 py312h06a4308_1", + "pip 25.0 py312h06a4308_0", + "ruamel.yaml 0.18.6 py312h5eee18b_0", + "typing-extensions 4.12.2 py312h06a4308_0", + "urllib3 2.3.0 py312h06a4308_0", + "cryptography 43.0.3 py312h7825ff9_1", + "pydantic-core 2.27.1 py312h4aa5aa6_0", + "requests 2.32.3 py312h06a4308_1", + "rich 13.9.4 py312h06a4308_0", + "zstandard 0.23.0 py312h2c38b39_1", + "conda-content-trust 0.2.0 py312h06a4308_1", + "conda-package-streaming 0.11.0 py312h06a4308_0", + "pydantic 2.10.3 py312h06a4308_0", + "conda-package-handling 2.4.0 py312h06a4308_0", + "conda 25.1.1 py312h06a4308_0", + "conda-anaconda-tos 0.1.2 py312h06a4308_0", + "conda-libmamba-solver 25.1.1 pyhd3eb1b0_0", + "libsodium 1.0.20 heac8642_0", + "openssl 3.0.18 hd6dcaed_0", + "patch 2.8 hb25bd0a_0", + "patchelf 0.17.2 h6a678d5_0", + "yaml 0.2.5 h7b6447c_0", + "argcomplete 3.6.2 py312h06a4308_0", + "attrs 24.3.0 py312h06a4308_0", + "certifi 2025.8.3 py312h06a4308_0", + "chardet 5.2.0 py312h06a4308_0", + "click 8.2.1 py312h06a4308_0", + "filelock 3.17.0 py312h06a4308_0", + "jmespath 1.0.1 py312h06a4308_0", + "markupsafe 3.0.2 py312h5eee18b_0", + "more-itertools 10.3.0 py312h06a4308_0", + "pkginfo 1.12.0 py312h06a4308_0", + "psutil 7.0.0 py312hee96239_0", + "py-lief 0.12.3 py312h6a678d5_0", + "python-libarchive-c 5.1 pyhd3eb1b0_0", + "pytz 2025.2 py312h06a4308_0", + "pyyaml 6.0.2 py312h5eee18b_0", + "rpds-py 0.22.3 py312h4aa5aa6_0", + "six 1.17.0 py312h06a4308_0", + "soupsieve 2.5 py312h06a4308_0", + "tomlkit 0.13.2 py312h06a4308_0", + "xmltodict 0.14.2 py312h06a4308_0", + "jinja2 3.1.6 py312h06a4308_0", + "python-dateutil 2.9.0post0 py312h06a4308_2", + "referencing 0.30.2 py312h06a4308_0", + "yq 3.4.3 py312h06a4308_0", + "beautifulsoup4 4.13.5 py312h06a4308_0", + "botocore 1.37.10 py312h06a4308_0", + "jsonschema-specifications 2023.7.1 py312h06a4308_0", + "pynacl 1.5.0 py312h2630517_2", + "jsonschema 4.25.0 py312h06a4308_0", + "s3transfer 0.11.2 py312h06a4308_0", + "boto3 1.37.10 py312h06a4308_0", + "conda-anaconda-telemetry 0.3.0 pyhd3eb1b0_1", + "conda-index 0.5.0 py312h06a4308_0", + "conda-build 25.1.2 py312h06a4308_0" + ], + "summary": "An efficient library to read from new and old format .conda and .tar.bz2 conda packages.", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/files b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/files new file mode 100644 index 0000000000000000000000000000000000000000..3f6d2eecfb4b86515f47a3dc0f92310f11d603a3 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/files @@ -0,0 +1,25 @@ +lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/INSTALLER +lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/METADATA +lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/RECORD +lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/REQUESTED +lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/WHEEL +lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/direct_url.json +lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/licenses/LICENSE +lib/python3.13/site-packages/conda_package_streaming/__init__.py +lib/python3.13/site-packages/conda_package_streaming/__pycache__/__init__.cpython-313.pyc +lib/python3.13/site-packages/conda_package_streaming/__pycache__/create.cpython-313.pyc +lib/python3.13/site-packages/conda_package_streaming/__pycache__/exceptions.cpython-313.pyc +lib/python3.13/site-packages/conda_package_streaming/__pycache__/extract.cpython-313.pyc +lib/python3.13/site-packages/conda_package_streaming/__pycache__/lazy_wheel.cpython-313.pyc +lib/python3.13/site-packages/conda_package_streaming/__pycache__/package_streaming.cpython-313.pyc +lib/python3.13/site-packages/conda_package_streaming/__pycache__/s3.cpython-313.pyc +lib/python3.13/site-packages/conda_package_streaming/__pycache__/transmute.cpython-313.pyc +lib/python3.13/site-packages/conda_package_streaming/__pycache__/url.cpython-313.pyc +lib/python3.13/site-packages/conda_package_streaming/create.py +lib/python3.13/site-packages/conda_package_streaming/exceptions.py +lib/python3.13/site-packages/conda_package_streaming/extract.py +lib/python3.13/site-packages/conda_package_streaming/lazy_wheel.py +lib/python3.13/site-packages/conda_package_streaming/package_streaming.py +lib/python3.13/site-packages/conda_package_streaming/s3.py +lib/python3.13/site-packages/conda_package_streaming/transmute.py +lib/python3.13/site-packages/conda_package_streaming/url.py diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/git b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/hash_input.json b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..54f8fb2da41bdb4962a008606b017773d2fef48e --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/hash_input.json @@ -0,0 +1,4 @@ +{ + "target_platform": "linux-64", + "channel_targets": "defaults" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/index.json b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..56b7356a162ae03e5c3f54fd0bf56b6a79399ff0 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/index.json @@ -0,0 +1,18 @@ +{ + "arch": "x86_64", + "build": "py313h06a4308_1", + "build_number": 1, + "depends": [ + "python >=3.13,<3.14.0a0", + "python_abi 3.13.* *_cp313", + "requests", + "zstandard >=0.15" + ], + "license": "BSD-3-Clause", + "license_family": "BSD", + "name": "conda-package-streaming", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1762361653472, + "version": "0.12.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/licenses/LICENSE b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..da262492a2f75f300ad89a447d7f39bc20b24f77 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/licenses/LICENSE @@ -0,0 +1,53 @@ +BSD 3-Clause License + +Copyright (c) 2022, Anaconda, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +lazy_wheel.py: + +Copyright (c) 2008-present The pip developers (see +https://github.com/pypa/pip/blob/main/AUTHORS.txt file) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/paths.json b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..a8ba16e637d126fa671f8b21bbe3d790bb46d613 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/paths.json @@ -0,0 +1,155 @@ +{ + "paths": [ + { + "_path": "lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/INSTALLER", + "path_type": "hardlink", + "sha256": "d0edee15f91b406f3f99726e44eb990be6e34fd0345b52b910c568e0eef6a2a8", + "size_in_bytes": 5 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/METADATA", + "path_type": "hardlink", + "sha256": "942c832bfcdd5bbb2fc61ae96f8861dfe674bb98d650b0dbdc88a8f3c49697e3", + "size_in_bytes": 4557 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/RECORD", + "path_type": "hardlink", + "sha256": "371bfbe3c4d5a7ba9df2b29c621074dc3d99ff5672f5650237161c0e2270c222", + "size_in_bytes": 2109 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/REQUESTED", + "path_type": "hardlink", + "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "size_in_bytes": 0 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/WHEEL", + "path_type": "hardlink", + "sha256": "1b68144734c4b66791f27add5d425f3620775585718a03d0f9b110ba3a4d88db", + "size_in_bytes": 82 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/direct_url.json", + "path_type": "hardlink", + "sha256": "623b659cb18fbf0a09c2d5a802d5dc494ea0f14ead6cf6952d6f505fd6defbe5", + "size_in_bytes": 113 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/licenses/LICENSE", + "path_type": "hardlink", + "sha256": "58f39270ef88f5aa09817a24fc379b35937e3d986d075df18b55aa5348aaad66", + "size_in_bytes": 2670 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/__init__.py", + "path_type": "hardlink", + "sha256": "7878edf433ec31ba6d69b4b6c86c7d6216f2ceae611525075dbef373c43ff3ea", + "size_in_bytes": 23 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/__pycache__/__init__.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "0f17a3b0918fc66d781b200bfd4be800fe0578ccb93e05f0281bd99e0ecd471a", + "size_in_bytes": 188 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/__pycache__/create.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "c5f3626ea69e701839a97ecf0e6e5e67ed70044bdb8141d00580dd627b1732b1", + "size_in_bytes": 7574 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/__pycache__/exceptions.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "67fc26ab11e9473e8ec6a134d1c5ea818efe5b62952c5ee8dd6828ed5d92a53a", + "size_in_bytes": 1536 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/__pycache__/extract.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "56a086c91455bf891a7d86c475ba96837c071878cc7c93a377f33a1e477d6665", + "size_in_bytes": 3902 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/__pycache__/lazy_wheel.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "9b05ec69819325303421c51ed518116c3a9a8848a3548b24edc6cc4866a7732a", + "size_in_bytes": 14551 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/__pycache__/package_streaming.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "b82da8d9a15a2cb2eafc1d36902a7e0c1b9025db7c8db897d88a99d77e15b25c", + "size_in_bytes": 7026 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/__pycache__/s3.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "5ac0fa5d2750c1c89d958f4034359bf05aeaef4a149d5ddcad93ff0df1829b07", + "size_in_bytes": 4124 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/__pycache__/transmute.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "306d2116ca6572212ea7818d0a91d5cde71c7a8fcd1225854ba645e70631c133", + "size_in_bytes": 6920 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/__pycache__/url.cpython-313.pyc", + "path_type": "hardlink", + "sha256": "63ca0d03b55446b8cd6cad185d6a3fc9adc34c9be48212f6a9fbc16ec331223d", + "size_in_bytes": 4314 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/create.py", + "path_type": "hardlink", + "sha256": "ed3bc29741ef2419c7e5b3b446650a69be1abc021883ec44a776dbfa3e3cffc0", + "size_in_bytes": 6142 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/exceptions.py", + "path_type": "hardlink", + "sha256": "edf1b808db6e9244915801a1f598360c2364870fb0368f8e8b7e5cda37f456c4", + "size_in_bytes": 677 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/extract.py", + "path_type": "hardlink", + "sha256": "1a80aaf425ae933c9c087820172853f9055e4b0e7a620e0a7c38082ad67b0378", + "size_in_bytes": 2935 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/lazy_wheel.py", + "path_type": "hardlink", + "sha256": "742cfbf81a44542c957e9b1036d71eb11a73d1df5d66c335001c315c627e6475", + "size_in_bytes": 12172 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/package_streaming.py", + "path_type": "hardlink", + "sha256": "0c3ecfbebbf5687f7996600c1da7017c280495e7eae0e8ede38de79694735cc5", + "size_in_bytes": 5107 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/s3.py", + "path_type": "hardlink", + "sha256": "ca09b9f7048fa62c6fc243b842a4a0bda94d523024d45cc45d6d09363e397202", + "size_in_bytes": 2286 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/transmute.py", + "path_type": "hardlink", + "sha256": "614ae3b2e265d3034afd19421bc6bcd16c7317ae68f733da54e5cc24c2c283e3", + "size_in_bytes": 5540 + }, + { + "_path": "lib/python3.13/site-packages/conda_package_streaming/url.py", + "path_type": "hardlink", + "sha256": "6d9fdf3bf04b59bcfef92735423018e2047132d19cf01106a9cf320460163e71", + "size_in_bytes": 3219 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/recipe/conda_build_config.yaml b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/recipe/conda_build_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..c104ceffae0ee6616062b011c9a871dbcbec85ec --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/recipe/conda_build_config.yaml @@ -0,0 +1,28 @@ +c_compiler: gcc +channel_targets: defaults +cpu_optimization_target: nocona +cran_mirror: https://cran.r-project.org +cxx_compiler: gxx +extend_keys: +- extend_keys +- pin_run_as_build +- ignore_version +- ignore_build_only_deps +fortran_compiler: gfortran +ignore_build_only_deps: +- python +- numpy +lua: '5' +numpy: '1.26' +perl: 5.26.2 +pin_run_as_build: + python: + max_pin: x.x + min_pin: x.x + r-base: + max_pin: x.x + min_pin: x.x +platform: linux-64 +python: '3.13' +r_base: '3.5' +target_platform: linux-64 diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/recipe/meta.yaml b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/recipe/meta.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8770d0f048bc75cf7c8736e529f0dcc2597d202e --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/recipe/meta.yaml @@ -0,0 +1,82 @@ +# This file created by conda-build 25.1.2 +# meta.yaml template originally from: +# /home/task_176236152622180/conda-package-streaming-feedstock/recipe, last modified Wed Nov 5 16:53:41 2025 +# ------------------------------------------------ + +package: + name: conda-package-streaming + version: 0.12.0 +source: + sha256: 2cd261d3bc3bd4c51e2bb84a8397b6cc1b591f837838439d4befc12fc3d77314 + url: https://github.com/conda/conda-package-streaming/archive/refs/tags/v0.12.0.tar.gz +build: + number: '1' + script: /home/task_176236152622180/conda-bld/conda-package-streaming_1762361633858/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla/bin/python + -m pip install --no-deps --no-build-isolation . -vv + string: py313h06a4308_1 +requirements: + host: + - _libgcc_mutex 0.1 main + - _openmp_mutex 5.1 1_gnu + - bzip2 1.0.8 h5eee18b_6 + - ca-certificates 2025.11.4 h06a4308_0 + - expat 2.7.3 h3385a95_0 + - flit-core 3.12.0 py313hee27c6d_0 + - ld_impl_linux-64 2.44 h153f514_2 + - libffi 3.4.4 h6a678d5_1 + - libgcc-ng 11.2.0 h1234567_1 + - libgomp 11.2.0 h1234567_1 + - libmpdec 4.0.0 h5eee18b_0 + - libstdcxx-ng 11.2.0 h1234567_1 + - libuuid 1.41.5 h5eee18b_0 + - libxcb 1.17.0 h9b100fa_0 + - libzlib 1.3.1 hb25bd0a_0 + - ncurses 6.5 h7934f7d_0 + - openssl 3.0.18 hd6dcaed_0 + - pip 25.2 pyhc872135_1 + - pthread-stubs 0.3 h0ce48e5_1 + - python 3.13.9 h7e8bc2b_100_cp313 + - python_abi 3.13 1_cp313 + - readline 8.3 hc2a1206_0 + - setuptools 80.9.0 py313h06a4308_0 + - sqlite 3.50.2 hb25bd0a_1 + - tk 8.6.15 h54e0aa7_0 + - tzdata 2025b h04d1e81_0 + - wheel 0.45.1 py313h06a4308_0 + - xorg-libx11 1.8.12 h9b100fa_1 + - xorg-libxau 1.0.12 h9b100fa_0 + - xorg-libxdmcp 1.1.5 h9b100fa_0 + - xorg-xorgproto 2024.1 h5eee18b_1 + - xz 5.6.4 h5eee18b_1 + - zlib 1.3.1 hb25bd0a_0 + run: + - python >=3.13,<3.14.0a0 + - python_abi 3.13.* *_cp313 + - requests + - zstandard >=0.15 +test: + commands: + - pip check + imports: + - conda_package_streaming + - conda_package_streaming.url + requires: + - pip +about: + description: 'An efficient library to read from new and old format .conda and .tar.bz2 + conda packages. + + ' + dev_url: https://github.com/conda/conda-package-streaming + doc_url: https://conda.github.io/conda-package-streaming/ + home: https://github.com/conda/conda-package-streaming + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + summary: An efficient library to read from new and old format .conda and .tar.bz2 + conda packages. +extra: + copy_test_source_files: true + final: true + recipe-maintainers: + - dholth diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/recipe/meta.yaml.template b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/recipe/meta.yaml.template new file mode 100644 index 0000000000000000000000000000000000000000..122b37b2b629733cdae8548b2632477585ca3cc3 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/recipe/meta.yaml.template @@ -0,0 +1,49 @@ +{% set name = "conda-package-streaming" %} +{% set version = "0.12.0" %} + +package: + name: {{ name|lower }} + version: {{ version }} + +source: + url: https://github.com/conda/{{ name }}/archive/refs/tags/v{{ version }}.tar.gz + sha256: 2cd261d3bc3bd4c51e2bb84a8397b6cc1b591f837838439d4befc12fc3d77314 + +build: + number: 1 + skip: true # [py<39] + script: {{ PYTHON }} -m pip install --no-deps --no-build-isolation . -vv + +requirements: + host: + - flit-core + - python + - pip + run: + - python + - zstandard >=0.15 + - requests + +test: + imports: + - conda_package_streaming + - conda_package_streaming.url + requires: + - pip + commands: + - pip check + +about: + home: https://github.com/conda/conda-package-streaming + summary: An efficient library to read from new and old format .conda and .tar.bz2 conda packages. + description: | + An efficient library to read from new and old format .conda and .tar.bz2 conda packages. + license: BSD-3-Clause + license_family: BSD + license_file: LICENSE + doc_url: https://conda.github.io/conda-package-streaming/ + dev_url: https://github.com/conda/conda-package-streaming + +extra: + recipe-maintainers: + - dholth diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/repodata_record.json b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/repodata_record.json new file mode 100644 index 0000000000000000000000000000000000000000..cd62946ecd576037e341cef77042afd4b2984f92 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/repodata_record.json @@ -0,0 +1,25 @@ +{ + "arch": "x86_64", + "build": "py313h06a4308_1", + "build_number": 1, + "channel": "https://repo.anaconda.com/pkgs/main/linux-64/", + "constrains": [], + "depends": [ + "python >=3.13,<3.14.0a0", + "python_abi 3.13.* *_cp313", + "requests", + "zstandard >=0.15" + ], + "fn": "conda-package-streaming-0.12.0-py313h06a4308_1.conda", + "license": "BSD-3-Clause", + "license_family": "BSD", + "md5": "56c2a9c6a706a12193c0b98ef951b4b6", + "name": "conda-package-streaming", + "platform": "linux", + "sha256": "8d1ff42b4560986c9d46ef2114cd77ae791ec4400a5ba4eb9a4b22ad540466c1", + "size": 38518, + "subdir": "linux-64", + "timestamp": 1762361653000, + "url": "https://repo.anaconda.com/pkgs/main/linux-64/conda-package-streaming-0.12.0-py313h06a4308_1.conda", + "version": "0.12.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/test/run_test.py b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/test/run_test.py new file mode 100644 index 0000000000000000000000000000000000000000..e47493e099d1d0d097e2751b1b860b23a2a1eb81 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/test/run_test.py @@ -0,0 +1,6 @@ +print("import: 'conda_package_streaming'") +import conda_package_streaming + +print("import: 'conda_package_streaming.url'") +import conda_package_streaming.url + diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/test/run_test.sh b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/test/run_test.sh new file mode 100644 index 0000000000000000000000000000000000000000..1afc6b862fab8658b14cb4cc0345a4ee1f02ad0e --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/test/run_test.sh @@ -0,0 +1,8 @@ + + +set -ex + + + +pip check +exit 0 diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/test/test_time_dependencies.json b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/test/test_time_dependencies.json new file mode 100644 index 0000000000000000000000000000000000000000..215362c1832b66eb448cdeeadbb1db3470d5adb4 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/info/test/test_time_dependencies.json @@ -0,0 +1 @@ +["pip"] \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/INSTALLER b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/INSTALLER new file mode 100644 index 0000000000000000000000000000000000000000..f79e4cb9aaf0b2d9e8ba78861e2071317b2384b3 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/INSTALLER @@ -0,0 +1 @@ +conda \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/METADATA b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/METADATA new file mode 100644 index 0000000000000000000000000000000000000000..d1b0ee7869f6fadc3400c478ea1e0f327c8d187e --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/METADATA @@ -0,0 +1,125 @@ +Metadata-Version: 2.4 +Name: conda_package_streaming +Version: 0.12.0 +Summary: An efficient library to read from new and old format .conda and .tar.bz2 conda packages. +Author-email: "Anaconda, Inc. & Contributors" +Requires-Python: >=3.9 +Description-Content-Type: text/markdown +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +License-File: LICENSE +Requires-Dist: requests +Requires-Dist: zstandard >=0.15 +Requires-Dist: furo ; extra == "docs" +Requires-Dist: sphinx ; extra == "docs" +Requires-Dist: myst-parser ; extra == "docs" +Requires-Dist: mdit-py-plugins>=0.3.0 ; extra == "docs" +Requires-Dist: pytest >=7 ; extra == "test" +Requires-Dist: pytest-cov ; extra == "test" +Requires-Dist: pytest-mock ; extra == "test" +Requires-Dist: boto3 ; extra == "test" +Requires-Dist: boto3-stubs[essential] ; extra == "test" +Requires-Dist: bottle ; extra == "test" +Requires-Dist: conda ; extra == "test" +Requires-Dist: conda-package-handling >=2 ; extra == "test" +Requires-Dist: responses ; extra == "test" +Project-URL: Documentation, https://conda.github.io/conda-package-streaming/ +Project-URL: Home, https://github.com/conda/conda-package-streaming +Provides-Extra: docs +Provides-Extra: test + +# conda-package-streaming + +[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/conda/conda-package-streaming/main.svg)](https://results.pre-commit.ci/latest/github/conda/conda-package-streaming/main) + +An efficient library to read from new and old format .conda and .tar.bz2 conda +packages. + +Download conda metadata from packages without transferring entire file. Get +metadata from local `.tar.bz2` packages without reading entire files. + +Uses enhanced pip `lazy_wheel` to fetch a file out of `.conda` with no more than +3 range requests, but usually 2. + +Uses `tar = tarfile.open(fileobj=...)` to stream remote `.tar.bz2`. Closes the +HTTP request once desired files have been seen. + +# Quickstart + +The basic API yields (tarfile, member) tuples from conda files as tarfile is +needed to extract member. Note the `.tar.bz2` format yields all members, not +just `info/`, from `stream_conda_info` / `stream_conda_component`, while the +`.conda` format yields members from the requested inner archive — allowing the +caller to decide when to stop reading. + +From a url, +```python +from conda_package_streaming.url import stream_conda_info +# url = (ends with .conda or .tar.bz2) +for tar, member in stream_conda_info(url): + if member.name == "info/index.json": + index_json = json.load(tar.extractfile(member)) + break +``` + +From s3, +```python +client = boto3.client("s3") +from conda_package_streaming.s3 import stream_conda_info +# key = (ends with .conda or .tar.bz2) +for tar, member in stream_conda_info(client, bucket, key): + if member.name == "info/index.json": + index_json = json.load(tar.extractfile(member)) + break +``` + +From a filename, +```python +from conda_package_streaming import package_streaming +# filename = (ends with .conda or .tar.bz2) +for tar, member in package_streaming.stream_conda_info(filename): + if member.name == "info/index.json": + index_json = json.load(tar.extractfile(member)) + break +``` + +From a file-like object, +```python +from contextlib import closing + +from conda_package_streaming.url import conda_reader_for_url +from conda_package_streaming.package_streaming import stream_conda_component +filename, conda = conda_reader_for_url(url) + +# file object must be seekable for `.conda` format, but merely readable for `.tar.bz2` +with closing(conda): + for tar, member in stream_conda_component(filename, conda, component="info"): + if member.name == "info/index.json": + index_json = json.load(tar.extractfile(member)) + break +``` + +If you need the entire package, download it first and use the file-based APIs. +The URL-based APIs are more efficient if you only need to access package +metadata. + +# Package goals + +* Extract conda packages (both formats) +* Easy to install from pypi or conda +* Do the least amount of I/O possible (no temporary files, transfer partial packages) +* Open files from the network / standard HTTP / s3 + +* Continue using conda-package-handling to create .conda packages + +# Generating documentation + +Uses markdown, furo theme. Requires newer mdit-py-plugins. + +`pip install conda-package-streaming[docs]` + +One time: +`sphinx-apidoc -o docs .` + diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/RECORD b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/RECORD new file mode 100644 index 0000000000000000000000000000000000000000..ac4418cef85507bdabf965901f3e3c5c429f3f23 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/RECORD @@ -0,0 +1,25 @@ +conda_package_streaming-0.12.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +conda_package_streaming-0.12.0.dist-info/METADATA,sha256=lCyDK_zdW7svxhrpb4hh3-Z0u5jWULDb3Iio88SWl-M,4557 +conda_package_streaming-0.12.0.dist-info/RECORD,, +conda_package_streaming-0.12.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +conda_package_streaming-0.12.0.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82 +conda_package_streaming-0.12.0.dist-info/direct_url.json,sha256=YjtlnLGPvwoJwtWoAtXcSU6g8U6tbPaVLW9QX9be--U,113 +conda_package_streaming-0.12.0.dist-info/licenses/LICENSE,sha256=WPOScO-I9aoJgXok_DebNZN-PZhtB13xi1WqU0iqrWY,2670 +conda_package_streaming/__init__.py,sha256=eHjt9DPsMbptabS2yGx9Yhbyzq5hFSUHXb7zc8Q_8-o,23 +conda_package_streaming/__pycache__/__init__.cpython-313.pyc,, +conda_package_streaming/__pycache__/create.cpython-313.pyc,, +conda_package_streaming/__pycache__/exceptions.cpython-313.pyc,, +conda_package_streaming/__pycache__/extract.cpython-313.pyc,, +conda_package_streaming/__pycache__/lazy_wheel.cpython-313.pyc,, +conda_package_streaming/__pycache__/package_streaming.cpython-313.pyc,, +conda_package_streaming/__pycache__/s3.cpython-313.pyc,, +conda_package_streaming/__pycache__/transmute.cpython-313.pyc,, +conda_package_streaming/__pycache__/url.cpython-313.pyc,, +conda_package_streaming/create.py,sha256=7TvCl0HvJBnH5bO0RmUKab4avAIYg-xEp3bb-j48_8A,6142 +conda_package_streaming/exceptions.py,sha256=7fG4CNtukkSRWAGh9Zg2DCNkhw-wNo-Oi35c2jf0VsQ,677 +conda_package_streaming/extract.py,sha256=GoCq9CWukzycCHggFyhT-QVeSw56Yg4KfDgIKtZ7A3g,2935 +conda_package_streaming/lazy_wheel.py,sha256=dCz7-BpEVCyVfpsQNtcesRpz0d9dZsM1ABwxXGJ-ZHU,12172 +conda_package_streaming/package_streaming.py,sha256=DD7Pvrv1aH95lmAMHacBfCgElefq4Ojt443nlpRzXMU,5107 +conda_package_streaming/s3.py,sha256=ygm59wSPpixvwkO4QqSgvalNUjAk1FzEXW0JNj45cgI,2286 +conda_package_streaming/transmute.py,sha256=YUrjsuJl0wNK_RlCG8a80WxzF65o9zPaVOXMJMLCg-M,5540 +conda_package_streaming/url.py,sha256=bZ_fO_BLWbz--Sc1QjAY4gRxMtGc8BEGqc8yBGAWPnE,3219 diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/REQUESTED b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/REQUESTED new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/WHEEL b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/WHEEL new file mode 100644 index 0000000000000000000000000000000000000000..d8b9936dad9ab2513fa6979f411560d3b6b57e37 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/WHEEL @@ -0,0 +1,4 @@ +Wheel-Version: 1.0 +Generator: flit 3.12.0 +Root-Is-Purelib: true +Tag: py3-none-any diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/direct_url.json b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/direct_url.json new file mode 100644 index 0000000000000000000000000000000000000000..2ac3aa423f7c95927050f1786b2dcb71643f4976 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/direct_url.json @@ -0,0 +1 @@ +{"dir_info": {}, "url": "file:///home/task_176236152622180/conda-bld/conda-package-streaming_1762361633858/work"} \ No newline at end of file diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/licenses/LICENSE b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/licenses/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..da262492a2f75f300ad89a447d7f39bc20b24f77 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming-0.12.0.dist-info/licenses/LICENSE @@ -0,0 +1,53 @@ +BSD 3-Clause License + +Copyright (c) 2022, Anaconda, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +lazy_wheel.py: + +Copyright (c) 2008-present The pip developers (see +https://github.com/pypa/pip/blob/main/AUTHORS.txt file) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/__init__.py b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ea370a8e55e9af5fcda45d1f12372a47d86f1a69 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/__init__.py @@ -0,0 +1 @@ +__version__ = "0.12.0" diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/create.py b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/create.py new file mode 100644 index 0000000000000000000000000000000000000000..732474d1f8afa95fcb485e1bc7fc5d0efa561788 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/create.py @@ -0,0 +1,191 @@ +""" +Tools for creating ``.conda``-format archives. + +Uses ``tempfile.SpooledTemporaryFile`` to buffer ``pkg-*.tar`` and +``info-*.tar``, then compress directly into an open `ZipFile` at the end. +`SpooledTemporaryFile` buffers the first 10MB of the package and its metadata in +memory, but writes out to disk for larger packages. + +Uses more disk space than ``conda-package-handling`` (temporary uncompressed +tarballs of the package contents) but accepts streams instead of just +files-on-the-filesystem. +""" + +from __future__ import annotations + +import json +import shutil +import tarfile +import tempfile +import zipfile +from collections.abc import Iterator +from contextlib import contextmanager +from pathlib import Path +from typing import Callable + +import zstandard + +# increase to reduce speed and increase compression (levels above 19 use much +# more memory) +ZSTD_COMPRESS_LEVEL = 19 +# increase to reduce compression and increase speed +ZSTD_COMPRESS_THREADS = 1 + +CONDA_PACKAGE_FORMAT_VERSION = 2 + +# Account for growth from "2 GB of /dev/urandom" to not exceed ZIP64_LIMIT after +# compression +CONDA_ZIP64_LIMIT = zipfile.ZIP64_LIMIT - (1 << 18) - 1 + + +def anonymize(tarinfo: tarfile.TarInfo): + """ + Pass to ``tarfile.add(..., filter=anonymize)`` to anonymize uid/gid. + + Does not anonymize mtime or any other field. + """ + tarinfo.uid = tarinfo.gid = 0 + tarinfo.uname = tarinfo.gname = "" + return tarinfo + + +class CondaTarFile(tarfile.TarFile): + """ + Subclass of :external+python:py:class:`tarfile.TarFile` that adds members to + a second ``info`` tar if they match ``is_info(name)``. + + Create this with ``conda_builder(...)`` which sets up the component + archives, then wraps them into a ``.conda`` on exit. + + Only useful for creating, not extracting ``.conda``. + """ + + info_tar: tarfile.TarFile + is_info: Callable + + def __init__( + self, + *args, + info_tar: tarfile.TarFile, + is_info=lambda name: name.startswith("info/"), + **kwargs, + ): + super().__init__(*args, **kwargs) + self.info_tar = info_tar + self.is_info = is_info + + def addfile(self, tarinfo, fileobj=None): + """ + Add the TarInfo object ``tarinfo`` to the archive. If ``fileobj`` is + given, it should be a binary file, and tarinfo.size bytes are read from + it and added to the archive. You can create TarInfo objects directly, or + by using ``gettarinfo()``. + + If ``self.is_info(tarinfo.name)`` returns ``True``, add ``tarinfo`` to + ``self.info_tar`` instead. + """ + if self.is_info(tarinfo.name): + return self.info_tar.addfile(tarinfo, fileobj=fileobj) + else: + return super().addfile(tarinfo, fileobj) + + +@contextmanager +def conda_builder( + stem, + path, + *, + compressor: Callable[ + [], zstandard.ZstdCompressor + ] = lambda: zstandard.ZstdCompressor( + level=ZSTD_COMPRESS_LEVEL, threads=ZSTD_COMPRESS_THREADS + ), + is_info: Callable[[str], bool] = lambda filename: filename.startswith("info/"), + encoding="utf-8", +) -> Iterator[CondaTarFile]: + """ + Produce a ``TarFile`` subclass used to build a ``.conda`` package. The + subclass delegates ``addfile()`` to the ``info-`` component when ``is_info`` + returns True. + + When the context manager exits, ``{path}/{stem}.conda`` is written with + the component tar archives. + + Args: + stem: output filename without extension + + path: destination path for transmuted .conda package compressor: A + function that creates instances of ``zstandard.ZstdCompressor()``. + + encoding: passed to TarFile constructor. Keep default "utf-8" for valid + .conda. + + Yields: + ``CondaTarFile`` + """ + output_path = Path(path, f"{stem}.conda") + with ( + tempfile.SpooledTemporaryFile() as info_file, + tempfile.SpooledTemporaryFile() as pkg_file, + ): + with ( + tarfile.TarFile(fileobj=info_file, mode="w", encoding=encoding) as info_tar, + CondaTarFile( + fileobj=pkg_file, + mode="w", + info_tar=info_tar, + is_info=is_info, + encoding=encoding, + ) as pkg_tar, + ): + # If we wanted to compress these at a low setting to save temporary + # space, we could insert a file object that counts bytes written in + # front of a zstd (level between 1..3) compressor. + yield pkg_tar + + info_tar.close() + pkg_tar.close() + + info_size = info_file.tell() + pkg_size = pkg_file.tell() + + info_file.seek(0) + pkg_file.seek(0) + + with zipfile.ZipFile( + output_path, + "x", # x to not append to existing + compresslevel=zipfile.ZIP_STORED, + ) as conda_file: + # Use a maximum of one Zstd compressor, stream_writer at a time to save + # # memory. + data_compress = compressor() + + pkg_metadata = {"conda_pkg_format_version": CONDA_PACKAGE_FORMAT_VERSION} + conda_file.writestr("metadata.json", json.dumps(pkg_metadata)) + + with ( + conda_file.open( + f"pkg-{stem}.tar.zst", + "w", + force_zip64=(pkg_size > CONDA_ZIP64_LIMIT), + ) as pkg_file_zip, + data_compress.stream_writer( + pkg_file_zip, size=pkg_size, closefd=False + ) as pkg_stream, + ): + shutil.copyfileobj(pkg_file._file, pkg_stream) + + with ( + conda_file.open( + f"info-{stem}.tar.zst", + "w", + force_zip64=(info_size > CONDA_ZIP64_LIMIT), + ) as info_file_zip, + data_compress.stream_writer( + info_file_zip, + size=info_size, + closefd=False, + ) as info_stream, + ): + shutil.copyfileobj(info_file._file, info_stream) diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/exceptions.py b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/exceptions.py new file mode 100644 index 0000000000000000000000000000000000000000..269c387f1fb9019dc103e74d50d65f9a297943ba --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/exceptions.py @@ -0,0 +1,19 @@ +import tarfile + + +class SafetyError(tarfile.TarError): + def __init__(self, msg, *args, **kw): + msg = f"Error with archive. {msg}" + super().__init__(msg) + + +class CaseInsensitiveFileSystemError(OSError): + def __init__(self): + message = """\ +Cannot extract package to a case-insensitive file system. Your install +destination does not differentiate between upper and lowercase characters, and +this breaks things. Try installing to a location that is case-sensitive. Windows +drives are usually the culprit here - can you install to a native Unix drive, or +turn on case sensitivity for this (Windows) location? + """ + super().__init__(message) diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/extract.py b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/extract.py new file mode 100644 index 0000000000000000000000000000000000000000..6398a2d57247fa0177f465de6e1fec3184d00eb6 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/extract.py @@ -0,0 +1,93 @@ +""" +Extract package to directory, with checks against tar members extracting outside +the target directory. +""" + +from __future__ import annotations + +import os +import tarfile +from collections.abc import Generator +from errno import ELOOP +from pathlib import Path + +from . import exceptions, package_streaming + +__all__ = ["extract_stream", "extract"] +HAS_TAR_FILTER = hasattr(tarfile, "tar_filter") + + +def extract_stream( + stream: Generator[tuple[tarfile.TarFile, tarfile.TarInfo]], + dest_dir: Path | str, + tar_filter: str | None = None, +): + """ + Pipe ``stream_conda_component`` output here to extract every member into + dest_dir. + + For ``.conda`` will need to be called twice (for info and pkg components); + for ``.tar.bz2`` every member is extracted. + """ + dest_dir = os.path.realpath(dest_dir) + + def is_within_dest_dir(name): + abs_target = os.path.realpath(os.path.join(dest_dir, name)) + prefix = os.path.commonpath((dest_dir, abs_target)) + return prefix == dest_dir + + for tar_file, _ in stream: + # careful not to seek backwards + def checked_members(): + # from conda_package_handling + for member in tar_file: + if not is_within_dest_dir(member.name): + raise exceptions.SafetyError(f"contains unsafe path: {member.name}") + yield member + + try: + # Drop checked_members() when HAS_TAR_FILTER once we are 100% + # certain the stdlib filter maintains same permissions as + # checked_members(). + tar_args = {"path": dest_dir, "members": checked_members()} + if HAS_TAR_FILTER: + tar_args["filter"] = tar_filter or "fully_trusted" + tar_file.extractall(**tar_args) + except OSError as e: + if e.errno == ELOOP: + raise exceptions.CaseInsensitiveFileSystemError() from e + raise + + # next iteraton of for loop raises GeneratorExit in stream + stream.close() + + +def extract(filename, dest_dir=None, fileobj=None): + """ + Extract all components of conda package to dest_dir. + + fileobj: must be seekable if provided, if a ``.conda`` package. + """ + assert dest_dir, "dest_dir is required" + if str(filename).endswith(".conda"): + components = [ + package_streaming.CondaComponent.pkg, + package_streaming.CondaComponent.info, + ] + else: # .tar.bz2 doesn't filter by component + components = [package_streaming.CondaComponent.pkg] + + closefd = False + if not fileobj: + fileobj = open(filename, "rb") + closefd = True + + try: + for component in components: + stream = package_streaming.stream_conda_component( + filename, fileobj, component=component + ) + extract_stream(stream, dest_dir) + finally: + if closefd: + fileobj.close() diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/lazy_wheel.py b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/lazy_wheel.py new file mode 100644 index 0000000000000000000000000000000000000000..39a9bc9f42efb70be7e9281aa17989943e97debf --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/lazy_wheel.py @@ -0,0 +1,331 @@ +"""Lazy ZIP over HTTP""" + +from __future__ import annotations + +import logging +import zipfile +from bisect import bisect_left, bisect_right +from collections.abc import Iterator +from contextlib import contextmanager +from tempfile import NamedTemporaryFile +from typing import Any +from zipfile import BadZipfile, ZipFile + +from requests import HTTPError, Session +from requests.models import CONTENT_CHUNK_SIZE, Response + +# from pip 22.0.3 with fixes & remove imports from pip + + +log = logging.getLogger(__name__) + +# If-Match (etag) to detect file changed during fetch would also be nice +HEADERS = {"Accept-Encoding": "identity"} + + +class HTTPRangeRequestUnsupported(Exception): + pass + + +class LazyZipOverHTTP: + """File-like object mapped to a ZIP file over HTTP. + + This uses HTTP range requests to lazily fetch the file's content, + which is supposed to be fed to ZipFile. If such requests are not + supported by the server, raise HTTPRangeRequestUnsupported + during initialization. + """ + + def __init__( + self, + url: str, + session: Session, + chunk_size: int = CONTENT_CHUNK_SIZE, + fall_back_to_full_download: bool = False, + ) -> None: + """ + Initialize a LazyZipOverHTTP object. + + :param session: The session to use for web requests. + :param chunk_size: The chunk size to use for downloading. + :param fall_back_to_full_download: If true, we fall back to downloading + the whole file if the server incorrectly responds with 416 + (Range Not Satisfiable) to an HTTP range request. + """ + # if CONTENT_CHUNK_SIZE is bigger than the file: + # In [8]: response.headers["Content-Range"] + # Out[8]: 'bytes 0-3133374/3133375' + + self._request_count = 0 + + self._session, self._url, self._chunk_size = session, url, chunk_size + + self._fall_back_to_full_download: bool = fall_back_to_full_download + self._has_streaming_support: bool = True + + # If the server returns 416 (Range Not Satisfiable) and the fallback is + # enabled, we request the whole file and set this to False. Some package + # servers incorrectly respond with 416 (Range Not Satisfiable) if the + # file is smaller than the range requested. + + # initial range request for the end of the file + # if the server does not support range requests, this sets + # _has_streaming_support to False + tail = self._stream_response(start="", end=CONTENT_CHUNK_SIZE) + # e.g. {'accept-ranges': 'bytes', 'content-length': '10240', + # 'content-range': 'bytes 12824-23063/23064', 'last-modified': 'Sat, 16 + # Apr 2022 13:03:02 GMT', 'date': 'Thu, 21 Apr 2022 11:34:04 GMT'} + + if self._has_streaming_support and tail.status_code != 206: + raise HTTPRangeRequestUnsupported("range request is not supported") + + if self._has_streaming_support: + # lowercase content-range to support s3 + self._length = int(tail.headers["content-range"].partition("/")[-1]) + else: + # the file is already downloaded + self._length = len(tail.content) + + self._file = NamedTemporaryFile() + self.truncate(self._length) + + # length is also in Content-Length and Content-Range header + with self._stay(): + if self._has_streaming_support: + content_length = int(tail.headers["content-length"]) + if hasattr(tail, "content"): + assert content_length == len(tail.content) + else: + content_length = len(tail.content) + self.seek(self._length - content_length) + for chunk in tail.iter_content(self._chunk_size): + self._file.write(chunk) + self._left: list[int] = [self._length - content_length] + self._right: list[int] = [self._length - 1] + + @property + def mode(self) -> str: + """Opening mode, which is always rb.""" + return "rb" + + @property + def name(self) -> str: + """Path to the underlying file.""" + return self._file.name + + def seekable(self) -> bool: + """Return whether random access is supported, which is True.""" + return True + + def close(self) -> None: + """Close the file.""" + self._file.close() + + @property + def closed(self) -> bool: + """Whether the file is closed.""" + return self._file.closed + + def read(self, size: int = -1) -> bytes: + """Read up to size bytes from the object and return them. + + As a convenience, if size is unspecified or -1, + all bytes until EOF are returned. Fewer than + size bytes may be returned if EOF is reached. + """ + # BUG does not download correctly if size is unspecified + download_size = size + start, length = self.tell(), self._length + stop = length if size < 0 else min(start + download_size, length) + start = max(0, stop - download_size) + self._download(start, stop - 1) + return self._file.read(size) + + def readable(self) -> bool: + """Return whether the file is readable, which is True.""" + return True + + def seek(self, offset: int, whence: int = 0) -> int: + """Change stream position and return the new absolute position. + + Seek to offset relative position indicated by whence: + * 0: Start of stream (the default). pos should be >= 0; + * 1: Current position - pos may be negative; + * 2: End of stream - pos usually negative. + """ + return self._file.seek(offset, whence) + + def tell(self) -> int: + """Return the current position.""" + return self._file.tell() + + def truncate(self, size: int | None = None) -> int: + """Resize the stream to the given size in bytes. + + If size is unspecified resize to the current position. + The current stream position isn't changed. + + Return the new file size. + """ + return self._file.truncate(size) + + def writable(self) -> bool: + """Return False.""" + return False + + def __enter__(self) -> LazyZipOverHTTP: + self._file.__enter__() + return self + + def __exit__(self, *exc: Any) -> bool | None: + return self._file.__exit__(*exc) + + @contextmanager + def _stay(self) -> Iterator[None]: + """Return a context manager keeping the position. + + At the end of the block, seek back to original position. + """ + pos = self.tell() + try: + yield + finally: + self.seek(pos) + + def _check_zip(self) -> None: + """Check and download until the file is a valid ZIP.""" + end = self._length - 1 + for start in reversed(range(0, end, self._chunk_size)): + self._download(start, end) + with self._stay(): + try: + # For read-only ZIP files, ZipFile only needs + # methods read, seek, seekable and tell. + ZipFile(self) # type: ignore + except BadZipfile: + pass + else: + break + + def _stream_response( + self, start: int | str, end: int, base_headers: dict[str, str] = HEADERS + ) -> Response: + """ + Return HTTP response to a range request from start to end. + If the does not support range requests, the whole file is requested. + + :param start: if "", request `end` bytes from end of file. + """ + headers = base_headers.copy() + headers["Range"] = f"bytes={start}-{end}" + log.debug("%s", headers["Range"]) + # TODO: Get range requests to be correctly cached + headers["Cache-Control"] = "no-cache" + self._request_count += 1 + + if self._has_streaming_support: + response = self._session.get(self._url, headers=headers, stream=True) + + if response.status_code == 416 and self._fall_back_to_full_download: + # Range Not Satisfiable -> enable fallback + self._has_streaming_support = False + elif response.status_code == 416: + # fallback disabled, print helpful error message + raise HTTPError( + "The server returned 416 (Range Not Satisfiable). " + "This can occur on a buggy server if the file is smaller " + "than the range requested. Set the fall_back_to_full_download flag " + "to work around this issue.", + response=response, + ) + else: + response.raise_for_status() + return response + + # no streaming support, try to get the whole file + del headers["Range"] + response = self._session.get(self._url, headers=headers, stream=True) + + response.raise_for_status() + return response + + def _merge( + self, start: int, end: int, left: int, right: int + ) -> Iterator[tuple[int, int]]: + """Return an iterator of intervals to be fetched. + + Args: + start (int): Start of needed interval + end (int): End of needed interval + left (int): Index of first overlapping downloaded data + right (int): Index after last overlapping downloaded data + """ + lslice, rslice = self._left[left:right], self._right[left:right] + i = start = min([start] + lslice[:1]) + end = max([end] + rslice[-1:]) + for j, k in zip(lslice, rslice): + if j > i: + yield i, j - 1 + i = k + 1 + if i <= end: + yield i, end + self._left[left:right], self._right[left:right] = [start], [end] + + def _download(self, start: int, end: int) -> None: + """ + Download bytes from start to end inclusively. If the server does not support + streaming for this file, this does nothing as the entire file is already + downloaded. + """ + # these assertions should hold, but read() violates them + # assert 0 <= start <= end + # assert end < self._length + + with self._stay(): + left = bisect_left(self._right, start) + right = bisect_right(self._left, end) + for start, end in self._merge(start, end, left, right): + response = self._stream_response(start, end) + self.seek(start) + for chunk in response.iter_content(self._chunk_size): + self._file.write(chunk) + + +class LazyConda(LazyZipOverHTTP): + def prefetch(self, conda_file_id): + """ + Conda fork specific. Prefetch the `.info` range from the remote archive. + Reduces number of Range requests to 2 or 3 (1 or 2 for the directory, 1 + for the file). + + conda_file_id: name of .conda without path or `.conda` extension + """ + target_file = f"info-{conda_file_id}.tar.zst" + with self._stay(): # not strictly necessary + # try to read entire conda info in one request + zf = zipfile.ZipFile(self) + infolist = zf.infolist() + for i, info in enumerate(infolist): + if info.filename == target_file: + # could be incorrect if zipfile was concatenated to another + # file (not likely for .conda) + start = info.header_offset + try: + end = infolist[i + 1].header_offset + # or info.header_offset + # + len(info.filename) + # + len(info.extra) + # + info.compress_size + # (unless Zip64) + except IndexError: + end = zf.start_dir + self.seek(start) + self.read(end - start) + log.debug( + "prefetch %s-%s", + info.header_offset, + end, + ) + break + else: + log.debug("no zip prefetch") diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/package_streaming.py b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/package_streaming.py new file mode 100644 index 0000000000000000000000000000000000000000..ff9ffcf2d2bbfb9508f5c36705dc06c15614e224 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/package_streaming.py @@ -0,0 +1,154 @@ +""" +Unpack conda packages without using a temporary file. +""" + +from __future__ import annotations + +import bz2 +import os +import os.path +import tarfile +import zipfile +from collections.abc import Generator +from enum import Enum + +# acquire umask taking advantage of import system lock, instead of possibly in +# multiple threads at once. +UMASK = os.umask(0) +os.umask(UMASK) + +try: + import zstandard +except ImportError: + import warnings + + warnings.warn("zstandard could not be imported. Running without .conda support.") + + zstandard = None + + +class CondaComponent(Enum): + pkg = "pkg" + info = "info" + + def __str__(self): + return self.value + + +class TarfileNoSameOwner(tarfile.TarFile): + def __init__(self, *args, umask: int | None = None, **kwargs): + """Open an (uncompressed) tar archive `name'. `mode' is either 'r' to + read from an existing archive, 'a' to append data to an existing + file or 'w' to create a new file overwriting an existing one. `mode' + defaults to 'r'. + If `fileobj' is given, it is used for reading or writing data. If it + can be determined, `mode' is overridden by `fileobj's mode. + `fileobj' is not closed, when TarFile is closed. + """ + super().__init__(*args, **kwargs) + self.umask = umask if umask is not None else UMASK + + def chown(self, tarinfo, targetpath, numeric_owner): + """ + Override chown to be a no-op, since we don't want to preserve ownership + here. (tarfile.TarFile only lets us toggle all of (chown, chmod, mtime)) + """ + return + + def chmod(self, tarinfo, targetpath): + """ + Set file permissions of targetpath according to tarinfo, respecting + umask. + """ + if tarinfo.mode is None: + return + + try: + os.chmod(targetpath, tarinfo.mode & (-1 & (~self.umask))) + except OSError as e: + raise tarfile.ExtractError("could not change mode") from e + + +def tar_generator( + fileobj, tarfile_open=TarfileNoSameOwner.open, closefd=False, *, encoding="utf-8" +) -> Generator[tuple[tarfile.TarFile, tarfile.TarInfo]]: + """ + Yield (tar, member) from fileobj. + + Args: + fileobj: file-like object + + encoding: "utf-8" passed to TarFile.open(); can be changed for testing. + """ + # tarfile will not close fileobj because _extfileobj is True + # caller should take care to close files all the way back to the http request... + try: + with tarfile_open(fileobj=fileobj, mode="r|", encoding=encoding) as tar: + for member in tar: + yield tar, member + finally: + if closefd: + fileobj.close() + + +def stream_conda_info( + filename, fileobj=None +) -> Generator[tuple[tarfile.TarFile, tarfile.TarInfo]]: + """ + Yield members from conda's embedded info/ tarball. + + For .tar.bz2 packages, yield all members. + + Yields (tar, member) tuples. You must only use the current member to + prevent tar seeks and scans. + + To extract to disk, it's possible to call ``tar.extractall(path)`` on the + first result and then ignore the rest of this generator. ``extractall`` takes + care of some directory permissions/mtime issues, compared to ``extract`` or + writing out the file objects yourself. + """ + component = "info" + return stream_conda_component(filename, fileobj, component) + + +def stream_conda_component( + filename, + fileobj=None, + component: CondaComponent | str = CondaComponent.pkg, + *, + encoding="utf-8", +) -> Generator[tuple[tarfile.TarFile, tarfile.TarInfo]]: + """ + Yield members from .conda's embedded {component}- tarball. "info" or "pkg". + + For .tar.bz2 packages, yield all members. + + Yields (tar, member) tuples. You must only use the current member to + prevent tar seeks and scans. + + To extract to disk, it's possible to call ``tar.extractall(path)`` on the + first result and then ignore the rest of this generator. ``extractall`` takes + care of some directory permissions/mtime issues, compared to ``extract`` or + writing out the file objects yourself. + """ + if str(filename).endswith(".conda"): + if zstandard is None: + raise RuntimeError("Cannot unpack `.conda` without zstandard") + + zf = zipfile.ZipFile(fileobj or filename) + stem, _, _ = os.path.basename(filename).rpartition(".") + component_name = f"{component}-{stem}" + component_filename = [ + info for info in zf.infolist() if info.filename.startswith(component_name) + ] + if not component_filename: + raise LookupError(f"didn't find {component_name} component in {filename}") + assert len(component_filename) == 1 + reader = zstandard.ZstdDecompressor().stream_reader( + zf.open(component_filename[0]) + ) + elif str(filename).endswith(".tar.bz2"): + reader = bz2.open(fileobj or filename, mode="rb") + else: + raise ValueError("unsupported file extension") + return tar_generator(reader, closefd=fileobj is None, encoding=encoding) diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/s3.py b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/s3.py new file mode 100644 index 0000000000000000000000000000000000000000..8aceb0ab80c226483dfee033cca6333eb98ed57a --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/s3.py @@ -0,0 +1,83 @@ +""" +Adapt s3 to package_streaming +""" + +from __future__ import annotations + +import typing +from contextlib import closing +from typing import Any + +from . import package_streaming + +if typing.TYPE_CHECKING: # pragma: no cover + from mypy_boto3_s3 import Client + from mypy_boto3_s3.type_defs import GetObjectOutputTypeDef +else: + Client = GetObjectOutputTypeDef = None + +from .url import conda_reader_for_url + +__all__ = ["stream_conda_info", "conda_reader_for_s3"] + + +class ResponseFacade: + def __init__(self, response: GetObjectOutputTypeDef): + self.response = response + self.raw: Any = response["Body"] + + def raise_for_status(self): + # s3 get_object raises automatically? + pass + + @property + def status_code(self): + return self.response["ResponseMetadata"]["HTTPStatusCode"] + + @property + def headers(self): + # a case-sensitive dict; keys may be lowercased always? + return self.response["ResponseMetadata"]["HTTPHeaders"] + + def iter_content(self, n: int): + return iter(lambda: self.raw.read(n), b"") + + +class SessionFacade: + """ + Make s3 client look just enough like a requests.session for LazyZipOverHTTP + """ + + def __init__(self, client: Client, bucket: str, key: str): + self.client = client + self.bucket = bucket + self.key = key + + def get(self, url, *, headers: dict | None = None, stream=True): + if headers and "Range" in headers: + response = self.client.get_object( + Bucket=self.bucket, Key=self.key, Range=headers["Range"] + ) + else: + response = self.client.get_object(Bucket=self.bucket, Key=self.key) + return ResponseFacade(response) + + +def stream_conda_info(client, bucket, key): + """ + Yield (tar, member) for conda package. + + Just "info/" for .conda, all members for tar. + """ + filename, conda = conda_reader_for_s3(client, bucket, key) + + with closing(conda): + yield from package_streaming.stream_conda_info(filename, conda) + + +def conda_reader_for_s3(client: Client, bucket: str, key: str): + """ + Return (name, file_like) suitable for package_streaming APIs + """ + session: Any = SessionFacade(client, bucket, key) + return conda_reader_for_url(key, session) diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/transmute.py b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/transmute.py new file mode 100644 index 0000000000000000000000000000000000000000..c959b9f3d08a95027c2864bf21f6a702e726eea6 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/transmute.py @@ -0,0 +1,162 @@ +""" +Convert .tar.bz2 to .conda + +Uses ``tempfile.SpooledTemporaryFile`` to buffer ``pkg-*.tar`` and +``info-*.tar``, then compress directly into an open `ZipFile` at the end. +`SpooledTemporaryFile` buffers the first 10MB of the package and its metadata in +memory, but writes out to disk for larger packages. +""" + +from __future__ import annotations + +import os +import tarfile +from collections.abc import Iterator +from pathlib import Path +from typing import Callable + +import zstandard + +from .create import ZSTD_COMPRESS_LEVEL, ZSTD_COMPRESS_THREADS, conda_builder + +# streams everything in .tar.bz2 mode +from .package_streaming import CondaComponent, stream_conda_component + + +def transmute( + package, + path, + *, + compressor: Callable[ + [], zstandard.ZstdCompressor + ] = lambda: zstandard.ZstdCompressor( + level=ZSTD_COMPRESS_LEVEL, threads=ZSTD_COMPRESS_THREADS + ), + is_info: Callable[[str], bool] = lambda filename: filename.startswith("info/"), +) -> Path: + """ + Convert .tar.bz2 conda package to .conda-format under path. + + :param package: path to .tar.bz2 conda package + :param path: destination path for transmuted .conda package + :param compressor: A function that creates instances of + ``zstandard.ZstdCompressor()`` to override defaults. + :param is_info: A function that returns True if a file belongs in the + ``info`` component of a `.conda` package. ``conda-package-handling`` + (not this package ``conda-package-streaming``) uses a set of regular + expressions to keep expected items in the info- component, while other + items starting with ``info/`` wind up in the pkg- component. + + :return: Path to transmuted package. + """ + assert package.endswith(".tar.bz2"), "can only convert .tar.bz2 to .conda" + assert os.path.isdir(path) + stem = os.path.basename(package)[: -len(".tar.bz2")] + package_stream = stream_conda_component(package) + + return transmute_stream( + stem, + path, + compressor=compressor, + is_info=is_info, + package_stream=package_stream, + ) + + +def transmute_stream( + stem, + path, + *, + compressor: Callable[ + [], zstandard.ZstdCompressor + ] = lambda: zstandard.ZstdCompressor( + level=ZSTD_COMPRESS_LEVEL, threads=ZSTD_COMPRESS_THREADS + ), + is_info: Callable[[str], bool] = lambda filename: filename.startswith("info/"), + package_stream: Iterator[tuple[tarfile.TarFile, tarfile.TarInfo]], +): + """ + Convert (TarFile, TarInfo) iterator like those produced by + ``stream_conda_component`` to .conda-format under path. Allows for more + creative data sources. + + e.g. recompress ``.conda``: + + .. code-block:: python + + transmute_stream(..., package_stream=itertools.chain( + stream_conda_component("package.conda", + component=CondaComponent.pkg), + stream_conda_component("package.conda", + component=CondaComponent.info), + )) + + This example could move files between the ``pkg-`` and ``info-`` components + depending on the ``is_info`` function. + + :param stem: output filename without extension + :param path: destination path for transmuted .conda package + :param compressor: A function that creates instances of + ``zstandard.ZstdCompressor()`` to override defaults. + :param is_info: A function that returns True if a file belongs in the + ``info`` component of a `.conda` package. ``conda-package-handling`` + (not this package ``conda-package-streaming``) uses a set of regular + expressions to keep expected items in the info- component, while other + items starting with ``info/`` wind up in the pkg- component. + :param package_stream: Iterator of (Tarfile, TarInfo) tuples. + + :return: Path to transmuted package. + """ + output_path = Path(path, f"{stem}.conda") + with conda_builder(stem, path, compressor=compressor, is_info=is_info) as conda_tar: + for tar, member in package_stream: + if member.isfile(): + conda_tar.addfile(member, tar.extractfile(member)) + else: + conda_tar.addfile(member) + + return output_path + + +def transmute_tar_bz2( + package: str, + path, +) -> Path: + """ + Convert .conda package to .tar.bz2 format under path. + + Can recompress .tar.bz2 packages. + + Args: + package: path to .conda or .tar.bz2 package. + path: destination path for transmuted package. + + Returns: + Path to transmuted package. + """ + assert package.endswith((".tar.bz2", ".conda")), "Unknown extension" + assert os.path.isdir(path) + + incoming_format = ".conda" if package.endswith(".conda") else ".tar.bz2" + + file_id = os.path.basename(package)[: -len(incoming_format)] + + if incoming_format == ".conda": + # .tar.bz2 MUST place info/ first. + components = [CondaComponent.info, CondaComponent.pkg] + else: + # .tar.bz2 doesn't filter by component + components = [CondaComponent.pkg] + + output_path = Path(path, f"{file_id}.tar.bz2") + + with open(package, "rb") as fileobj, tarfile.open(output_path, "x:bz2") as pkg_tar: + for component in components: + stream = iter(stream_conda_component(package, fileobj, component=component)) + for tar, member in stream: + if member.isfile(): + pkg_tar.addfile(member, tar.extractfile(member)) + else: + pkg_tar.addfile(member) + + return output_path diff --git a/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/url.py b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/url.py new file mode 100644 index 0000000000000000000000000000000000000000..2941318abc85f94931447d10cde8d63651739133 --- /dev/null +++ b/miniconda3/pkgs/conda-package-streaming-0.12.0-py313h06a4308_1/lib/python3.13/site-packages/conda_package_streaming/url.py @@ -0,0 +1,100 @@ +""" +Fetch metadata from remote .conda or .tar.bz2 package. + +Try to fetch less than the whole file if possible. + +This module should only be used to make *partial* reads against a remote +package, typically just the ``info`` portion. If a full ``.conda`` format +package is needed, it is more efficient to download locally first and then use +the file-based API. +""" + +import logging +import sys +import urllib.parse +from pathlib import Path + +import requests + +from . import package_streaming + +# Excellent HTTP Range request file-like object +from .lazy_wheel import LazyConda + +log = logging.getLogger(__name__) + +session = requests.Session() +session.headers["User-Agent"] = "conda-package-streaming/0.1.0" + + +METADATA_CHECKLIST = frozenset({"info/index.json", "info/recipe/meta.yaml"}) + + +def extract_conda_info(url, destdir, checklist=METADATA_CHECKLIST, session=session): + """ + Extract info/index.json and info/recipe/meta.yaml from url to destdir; close + url as soon as those files are found. + """ + checklist = set(checklist) + stream = stream_conda_info(url, session=session) + for tar, member in stream: + if member.name in checklist: + tar.extract(member, destdir) + checklist.remove(member.name) + if not checklist: + stream.close() + # next iteraton of for loop raises GeneratorExit in stream + + +def stream_conda_info(url, session=session): + """ + Yield (tar, member) for conda package at url + + Just "info/" for .conda, all members for tar. + """ + filename, conda = conda_reader_for_url(url, session=session) + + try: + yield from package_streaming.stream_conda_info(filename, conda) + finally: + if hasattr(conda, "release_conn"): + # For .tar.bz2. Take extra care to drop connections after we are + # done reading a partial response. + conda.release_conn() + conda.close() + + +def conda_reader_for_url( + url, session: requests.Session = session, fall_back_to_full_download: bool = False +): + """ + Return (name, file_like) suitable for package_streaming APIs + + :param url: URL to conda package + :param session: The session to use for web requests. + :param fall_back_to_full_download: If true, fall back to downloading the entire + package instead of streaming it in the case of a specific issue where the server + incorrectly responds with 416 (Range Not Satisfiable). See LazyZipOverHTTP for + more details. + """ + parsed_url = urllib.parse.urlparse(url) + *_, filename = parsed_url.path.rsplit("/", 1) + if filename.endswith(".conda"): + file_id = filename[: -len(".conda")] + conda = LazyConda( + url, session, fall_back_to_full_download=fall_back_to_full_download + ) + conda.prefetch(file_id) + elif filename.endswith(".tar.bz2"): + response = session.get(url, stream=True, headers={"Connection": "close"}) + conda = response.raw + else: + raise ValueError("Unsupported extension %s", url) + return filename, conda + + +if __name__ == "__main__": # pragma: no cover + import logging + + logging.basicConfig(level=logging.DEBUG) + extract_conda_info(sys.argv[1], Path(sys.argv[2]).absolute()) diff --git a/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/include/tl/expected.hpp b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/include/tl/expected.hpp new file mode 100644 index 0000000000000000000000000000000000000000..afee404d43ee50f772fc962befbfeac0794b2aea --- /dev/null +++ b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/include/tl/expected.hpp @@ -0,0 +1,2444 @@ +/// +// expected - An implementation of std::expected with extensions +// Written in 2017 by Sy Brand (tartanllama@gmail.com, @TartanLlama) +// +// Documentation available at http://tl.tartanllama.xyz/ +// +// To the extent possible under law, the author(s) have dedicated all +// copyright and related and neighboring rights to this software to the +// public domain worldwide. This software is distributed without any warranty. +// +// You should have received a copy of the CC0 Public Domain Dedication +// along with this software. If not, see +// . +/// + +#ifndef TL_EXPECTED_HPP +#define TL_EXPECTED_HPP + +#define TL_EXPECTED_VERSION_MAJOR 1 +#define TL_EXPECTED_VERSION_MINOR 1 +#define TL_EXPECTED_VERSION_PATCH 0 + +#include +#include +#include +#include + +#if defined(__EXCEPTIONS) || defined(_CPPUNWIND) +#define TL_EXPECTED_EXCEPTIONS_ENABLED +#endif + +#if (defined(_MSC_VER) && _MSC_VER == 1900) +#define TL_EXPECTED_MSVC2015 +#define TL_EXPECTED_MSVC2015_CONSTEXPR +#else +#define TL_EXPECTED_MSVC2015_CONSTEXPR constexpr +#endif + +#if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \ + !defined(__clang__)) +#define TL_EXPECTED_GCC49 +#endif + +#if (defined(__GNUC__) && __GNUC__ == 5 && __GNUC_MINOR__ <= 4 && \ + !defined(__clang__)) +#define TL_EXPECTED_GCC54 +#endif + +#if (defined(__GNUC__) && __GNUC__ == 5 && __GNUC_MINOR__ <= 5 && \ + !defined(__clang__)) +#define TL_EXPECTED_GCC55 +#endif + +#if !defined(TL_ASSERT) +//can't have assert in constexpr in C++11 and GCC 4.9 has a compiler bug +#if (__cplusplus > 201103L) && !defined(TL_EXPECTED_GCC49) +#include +#define TL_ASSERT(x) assert(x) +#else +#define TL_ASSERT(x) +#endif +#endif + +#if (defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 9 && \ + !defined(__clang__)) +// GCC < 5 doesn't support overloading on const&& for member functions + +#define TL_EXPECTED_NO_CONSTRR +// GCC < 5 doesn't support some standard C++11 type traits +#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ + std::has_trivial_copy_constructor +#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \ + std::has_trivial_copy_assign + +// This one will be different for GCC 5.7 if it's ever supported +#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \ + std::is_trivially_destructible + +// GCC 5 < v < 8 has a bug in is_trivially_copy_constructible which breaks +// std::vector for non-copyable types +#elif (defined(__GNUC__) && __GNUC__ < 8 && !defined(__clang__)) +#ifndef TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX +#define TL_GCC_LESS_8_TRIVIALLY_COPY_CONSTRUCTIBLE_MUTEX +namespace tl { +namespace detail { +template +struct is_trivially_copy_constructible + : std::is_trivially_copy_constructible {}; +#ifdef _GLIBCXX_VECTOR +template +struct is_trivially_copy_constructible> : std::false_type {}; +#endif +} // namespace detail +} // namespace tl +#endif + +#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ + tl::detail::is_trivially_copy_constructible +#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \ + std::is_trivially_copy_assignable +#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \ + std::is_trivially_destructible +#else +#define TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T) \ + std::is_trivially_copy_constructible +#define TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T) \ + std::is_trivially_copy_assignable +#define TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T) \ + std::is_trivially_destructible +#endif + +#if __cplusplus > 201103L +#define TL_EXPECTED_CXX14 +#endif + +#ifdef TL_EXPECTED_GCC49 +#define TL_EXPECTED_GCC49_CONSTEXPR +#else +#define TL_EXPECTED_GCC49_CONSTEXPR constexpr +#endif + +#if (__cplusplus == 201103L || defined(TL_EXPECTED_MSVC2015) || \ + defined(TL_EXPECTED_GCC49)) +#define TL_EXPECTED_11_CONSTEXPR +#else +#define TL_EXPECTED_11_CONSTEXPR constexpr +#endif + +namespace tl { +template class expected; + +#ifndef TL_MONOSTATE_INPLACE_MUTEX +#define TL_MONOSTATE_INPLACE_MUTEX +class monostate {}; + +struct in_place_t { + explicit in_place_t() = default; +}; +static constexpr in_place_t in_place{}; +#endif + +template class unexpected { +public: + static_assert(!std::is_same::value, "E must not be void"); + + unexpected() = delete; + constexpr explicit unexpected(const E &e) : m_val(e) {} + + constexpr explicit unexpected(E &&e) : m_val(std::move(e)) {} + + template ::value>::type * = nullptr> + constexpr explicit unexpected(Args &&...args) + : m_val(std::forward(args)...) {} + template < + class U, class... Args, + typename std::enable_if &, Args &&...>::value>::type * = nullptr> + constexpr explicit unexpected(std::initializer_list l, Args &&...args) + : m_val(l, std::forward(args)...) {} + + constexpr const E &value() const & { return m_val; } + TL_EXPECTED_11_CONSTEXPR E &value() & { return m_val; } + TL_EXPECTED_11_CONSTEXPR E &&value() && { return std::move(m_val); } + constexpr const E &&value() const && { return std::move(m_val); } + +private: + E m_val; +}; + +#ifdef __cpp_deduction_guides +template unexpected(E) -> unexpected; +#endif + +template +constexpr bool operator==(const unexpected &lhs, const unexpected &rhs) { + return lhs.value() == rhs.value(); +} +template +constexpr bool operator!=(const unexpected &lhs, const unexpected &rhs) { + return lhs.value() != rhs.value(); +} +template +constexpr bool operator<(const unexpected &lhs, const unexpected &rhs) { + return lhs.value() < rhs.value(); +} +template +constexpr bool operator<=(const unexpected &lhs, const unexpected &rhs) { + return lhs.value() <= rhs.value(); +} +template +constexpr bool operator>(const unexpected &lhs, const unexpected &rhs) { + return lhs.value() > rhs.value(); +} +template +constexpr bool operator>=(const unexpected &lhs, const unexpected &rhs) { + return lhs.value() >= rhs.value(); +} + +template +unexpected::type> make_unexpected(E &&e) { + return unexpected::type>(std::forward(e)); +} + +struct unexpect_t { + unexpect_t() = default; +}; +static constexpr unexpect_t unexpect{}; + +namespace detail { +template +[[noreturn]] TL_EXPECTED_11_CONSTEXPR void throw_exception(E &&e) { +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + throw std::forward(e); +#else + (void)e; +#ifdef _MSC_VER + __assume(0); +#else + __builtin_unreachable(); +#endif +#endif +} + +#ifndef TL_TRAITS_MUTEX +#define TL_TRAITS_MUTEX +// C++14-style aliases for brevity +template using remove_const_t = typename std::remove_const::type; +template +using remove_reference_t = typename std::remove_reference::type; +template using decay_t = typename std::decay::type; +template +using enable_if_t = typename std::enable_if::type; +template +using conditional_t = typename std::conditional::type; + +// std::conjunction from C++17 +template struct conjunction : std::true_type {}; +template struct conjunction : B {}; +template +struct conjunction + : std::conditional, B>::type {}; + +#if defined(_LIBCPP_VERSION) && __cplusplus == 201103L +#define TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND +#endif + +// In C++11 mode, there's an issue in libc++'s std::mem_fn +// which results in a hard-error when using it in a noexcept expression +// in some cases. This is a check to workaround the common failing case. +#ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND +template +struct is_pointer_to_non_const_member_func : std::false_type {}; +template +struct is_pointer_to_non_const_member_func + : std::true_type {}; +template +struct is_pointer_to_non_const_member_func + : std::true_type {}; +template +struct is_pointer_to_non_const_member_func + : std::true_type {}; +template +struct is_pointer_to_non_const_member_func + : std::true_type {}; +template +struct is_pointer_to_non_const_member_func + : std::true_type {}; +template +struct is_pointer_to_non_const_member_func + : std::true_type {}; + +template struct is_const_or_const_ref : std::false_type {}; +template struct is_const_or_const_ref : std::true_type {}; +template struct is_const_or_const_ref : std::true_type {}; +#endif + +// std::invoke from C++17 +// https://stackoverflow.com/questions/38288042/c11-14-invoke-workaround +template < + typename Fn, typename... Args, +#ifdef TL_TRAITS_LIBCXX_MEM_FN_WORKAROUND + typename = enable_if_t::value && + is_const_or_const_ref::value)>, +#endif + typename = enable_if_t>::value>, int = 0> +constexpr auto invoke(Fn &&f, Args &&...args) noexcept( + noexcept(std::mem_fn(f)(std::forward(args)...))) + -> decltype(std::mem_fn(f)(std::forward(args)...)) { + return std::mem_fn(f)(std::forward(args)...); +} + +template >::value>> +constexpr auto invoke(Fn &&f, Args &&...args) noexcept( + noexcept(std::forward(f)(std::forward(args)...))) + -> decltype(std::forward(f)(std::forward(args)...)) { + return std::forward(f)(std::forward(args)...); +} + +// std::invoke_result from C++17 +template struct invoke_result_impl; + +template +struct invoke_result_impl< + F, + decltype(detail::invoke(std::declval(), std::declval()...), void()), + Us...> { + using type = + decltype(detail::invoke(std::declval(), std::declval()...)); +}; + +template +using invoke_result = invoke_result_impl; + +template +using invoke_result_t = typename invoke_result::type; + +#if defined(_MSC_VER) && _MSC_VER <= 1900 +// TODO make a version which works with MSVC 2015 +template struct is_swappable : std::true_type {}; + +template struct is_nothrow_swappable : std::true_type {}; +#else +// https://stackoverflow.com/questions/26744589/what-is-a-proper-way-to-implement-is-swappable-to-test-for-the-swappable-concept +namespace swap_adl_tests { +// if swap ADL finds this then it would call std::swap otherwise (same +// signature) +struct tag {}; + +template tag swap(T &, T &); +template tag swap(T (&a)[N], T (&b)[N]); + +// helper functions to test if an unqualified swap is possible, and if it +// becomes std::swap +template std::false_type can_swap(...) noexcept(false); +template (), std::declval()))> +std::true_type can_swap(int) noexcept(noexcept(swap(std::declval(), + std::declval()))); + +template std::false_type uses_std(...); +template +std::is_same(), std::declval())), tag> +uses_std(int); + +template +struct is_std_swap_noexcept + : std::integral_constant::value && + std::is_nothrow_move_assignable::value> {}; + +template +struct is_std_swap_noexcept : is_std_swap_noexcept {}; + +template +struct is_adl_swap_noexcept + : std::integral_constant(0))> {}; +} // namespace swap_adl_tests + +template +struct is_swappable + : std::integral_constant< + bool, + decltype(detail::swap_adl_tests::can_swap(0))::value && + (!decltype(detail::swap_adl_tests::uses_std(0))::value || + (std::is_move_assignable::value && + std::is_move_constructible::value))> {}; + +template +struct is_swappable + : std::integral_constant< + bool, + decltype(detail::swap_adl_tests::can_swap(0))::value && + (!decltype(detail::swap_adl_tests::uses_std( + 0))::value || + is_swappable::value)> {}; + +template +struct is_nothrow_swappable + : std::integral_constant< + bool, + is_swappable::value && + ((decltype(detail::swap_adl_tests::uses_std(0))::value && + detail::swap_adl_tests::is_std_swap_noexcept::value) || + (!decltype(detail::swap_adl_tests::uses_std(0))::value && + detail::swap_adl_tests::is_adl_swap_noexcept::value))> {}; +#endif +#endif + +// Trait for checking if a type is a tl::expected +template struct is_expected_impl : std::false_type {}; +template +struct is_expected_impl> : std::true_type {}; +template using is_expected = is_expected_impl>; + +template +using expected_enable_forward_value = detail::enable_if_t< + std::is_constructible::value && + !std::is_same, in_place_t>::value && + !std::is_same, detail::decay_t>::value && + !std::is_same, detail::decay_t>::value>; + +template +using expected_enable_from_other = detail::enable_if_t< + std::is_constructible::value && + std::is_constructible::value && + !std::is_constructible &>::value && + !std::is_constructible &&>::value && + !std::is_constructible &>::value && + !std::is_constructible &&>::value && + !std::is_convertible &, T>::value && + !std::is_convertible &&, T>::value && + !std::is_convertible &, T>::value && + !std::is_convertible &&, T>::value>; + +template +using is_void_or = conditional_t::value, std::true_type, U>; + +template +using is_copy_constructible_or_void = + is_void_or>; + +template +using is_move_constructible_or_void = + is_void_or>; + +template +using is_copy_assignable_or_void = is_void_or>; + +template +using is_move_assignable_or_void = is_void_or>; + +} // namespace detail + +namespace detail { +struct no_init_t {}; +static constexpr no_init_t no_init{}; + +// Implements the storage of the values, and ensures that the destructor is +// trivial if it can be. +// +// This specialization is for where neither `T` or `E` is trivially +// destructible, so the destructors must be called on destruction of the +// `expected` +template ::value, + bool = std::is_trivially_destructible::value> +struct expected_storage_base { + constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {} + constexpr expected_storage_base(no_init_t) : m_no_init(), m_has_val(false) {} + + template ::value> * = + nullptr> + constexpr expected_storage_base(in_place_t, Args &&...args) + : m_val(std::forward(args)...), m_has_val(true) {} + + template &, Args &&...>::value> * = nullptr> + constexpr expected_storage_base(in_place_t, std::initializer_list il, + Args &&...args) + : m_val(il, std::forward(args)...), m_has_val(true) {} + template ::value> * = + nullptr> + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) + : m_unexpect(std::forward(args)...), m_has_val(false) {} + + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected_storage_base(unexpect_t, + std::initializer_list il, + Args &&...args) + : m_unexpect(il, std::forward(args)...), m_has_val(false) {} + + ~expected_storage_base() { + if (m_has_val) { + m_val.~T(); + } else { + m_unexpect.~unexpected(); + } + } + union { + T m_val; + unexpected m_unexpect; + char m_no_init; + }; + bool m_has_val; +}; + +// This specialization is for when both `T` and `E` are trivially-destructible, +// so the destructor of the `expected` can be trivial. +template struct expected_storage_base { + constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {} + constexpr expected_storage_base(no_init_t) : m_no_init(), m_has_val(false) {} + + template ::value> * = + nullptr> + constexpr expected_storage_base(in_place_t, Args &&...args) + : m_val(std::forward(args)...), m_has_val(true) {} + + template &, Args &&...>::value> * = nullptr> + constexpr expected_storage_base(in_place_t, std::initializer_list il, + Args &&...args) + : m_val(il, std::forward(args)...), m_has_val(true) {} + template ::value> * = + nullptr> + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) + : m_unexpect(std::forward(args)...), m_has_val(false) {} + + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected_storage_base(unexpect_t, + std::initializer_list il, + Args &&...args) + : m_unexpect(il, std::forward(args)...), m_has_val(false) {} + + ~expected_storage_base() = default; + union { + T m_val; + unexpected m_unexpect; + char m_no_init; + }; + bool m_has_val; +}; + +// T is trivial, E is not. +template struct expected_storage_base { + constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {} + TL_EXPECTED_MSVC2015_CONSTEXPR expected_storage_base(no_init_t) + : m_no_init(), m_has_val(false) {} + + template ::value> * = + nullptr> + constexpr expected_storage_base(in_place_t, Args &&...args) + : m_val(std::forward(args)...), m_has_val(true) {} + + template &, Args &&...>::value> * = nullptr> + constexpr expected_storage_base(in_place_t, std::initializer_list il, + Args &&...args) + : m_val(il, std::forward(args)...), m_has_val(true) {} + template ::value> * = + nullptr> + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) + : m_unexpect(std::forward(args)...), m_has_val(false) {} + + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected_storage_base(unexpect_t, + std::initializer_list il, + Args &&...args) + : m_unexpect(il, std::forward(args)...), m_has_val(false) {} + + ~expected_storage_base() { + if (!m_has_val) { + m_unexpect.~unexpected(); + } + } + + union { + T m_val; + unexpected m_unexpect; + char m_no_init; + }; + bool m_has_val; +}; + +// E is trivial, T is not. +template struct expected_storage_base { + constexpr expected_storage_base() : m_val(T{}), m_has_val(true) {} + constexpr expected_storage_base(no_init_t) : m_no_init(), m_has_val(false) {} + + template ::value> * = + nullptr> + constexpr expected_storage_base(in_place_t, Args &&...args) + : m_val(std::forward(args)...), m_has_val(true) {} + + template &, Args &&...>::value> * = nullptr> + constexpr expected_storage_base(in_place_t, std::initializer_list il, + Args &&...args) + : m_val(il, std::forward(args)...), m_has_val(true) {} + template ::value> * = + nullptr> + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) + : m_unexpect(std::forward(args)...), m_has_val(false) {} + + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected_storage_base(unexpect_t, + std::initializer_list il, + Args &&...args) + : m_unexpect(il, std::forward(args)...), m_has_val(false) {} + + ~expected_storage_base() { + if (m_has_val) { + m_val.~T(); + } + } + union { + T m_val; + unexpected m_unexpect; + char m_no_init; + }; + bool m_has_val; +}; + +// `T` is `void`, `E` is trivially-destructible +template struct expected_storage_base { + #if __GNUC__ <= 5 + //no constexpr for GCC 4/5 bug + #else + TL_EXPECTED_MSVC2015_CONSTEXPR + #endif + expected_storage_base() : m_has_val(true) {} + + constexpr expected_storage_base(no_init_t) : m_val(), m_has_val(false) {} + + constexpr expected_storage_base(in_place_t) : m_has_val(true) {} + + template ::value> * = + nullptr> + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) + : m_unexpect(std::forward(args)...), m_has_val(false) {} + + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected_storage_base(unexpect_t, + std::initializer_list il, + Args &&...args) + : m_unexpect(il, std::forward(args)...), m_has_val(false) {} + + ~expected_storage_base() = default; + struct dummy {}; + union { + unexpected m_unexpect; + dummy m_val; + }; + bool m_has_val; +}; + +// `T` is `void`, `E` is not trivially-destructible +template struct expected_storage_base { + constexpr expected_storage_base() : m_dummy(), m_has_val(true) {} + constexpr expected_storage_base(no_init_t) : m_dummy(), m_has_val(false) {} + + constexpr expected_storage_base(in_place_t) : m_dummy(), m_has_val(true) {} + + template ::value> * = + nullptr> + constexpr explicit expected_storage_base(unexpect_t, Args &&...args) + : m_unexpect(std::forward(args)...), m_has_val(false) {} + + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected_storage_base(unexpect_t, + std::initializer_list il, + Args &&...args) + : m_unexpect(il, std::forward(args)...), m_has_val(false) {} + + ~expected_storage_base() { + if (!m_has_val) { + m_unexpect.~unexpected(); + } + } + + union { + unexpected m_unexpect; + char m_dummy; + }; + bool m_has_val; +}; + +// This base class provides some handy member functions which can be used in +// further derived classes +template +struct expected_operations_base : expected_storage_base { + using expected_storage_base::expected_storage_base; + + template void construct(Args &&...args) noexcept { + new (std::addressof(this->m_val)) T(std::forward(args)...); + this->m_has_val = true; + } + + template void construct_with(Rhs &&rhs) noexcept { + new (std::addressof(this->m_val)) T(std::forward(rhs).get()); + this->m_has_val = true; + } + + template void construct_error(Args &&...args) noexcept { + new (std::addressof(this->m_unexpect)) + unexpected(std::forward(args)...); + this->m_has_val = false; + } + +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + + // These assign overloads ensure that the most efficient assignment + // implementation is used while maintaining the strong exception guarantee. + // The problematic case is where rhs has a value, but *this does not. + // + // This overload handles the case where we can just copy-construct `T` + // directly into place without throwing. + template ::value> + * = nullptr> + void assign(const expected_operations_base &rhs) noexcept { + if (!this->m_has_val && rhs.m_has_val) { + geterr().~unexpected(); + construct(rhs.get()); + } else { + assign_common(rhs); + } + } + + // This overload handles the case where we can attempt to create a copy of + // `T`, then no-throw move it into place if the copy was successful. + template ::value && + std::is_nothrow_move_constructible::value> + * = nullptr> + void assign(const expected_operations_base &rhs) noexcept { + if (!this->m_has_val && rhs.m_has_val) { + T tmp = rhs.get(); + geterr().~unexpected(); + construct(std::move(tmp)); + } else { + assign_common(rhs); + } + } + + // This overload is the worst-case, where we have to move-construct the + // unexpected value into temporary storage, then try to copy the T into place. + // If the construction succeeds, then everything is fine, but if it throws, + // then we move the old unexpected value back into place before rethrowing the + // exception. + template ::value && + !std::is_nothrow_move_constructible::value> + * = nullptr> + void assign(const expected_operations_base &rhs) { + if (!this->m_has_val && rhs.m_has_val) { + auto tmp = std::move(geterr()); + geterr().~unexpected(); + +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + construct(rhs.get()); + } catch (...) { + geterr() = std::move(tmp); + throw; + } +#else + construct(rhs.get()); +#endif + } else { + assign_common(rhs); + } + } + + // These overloads do the same as above, but for rvalues + template ::value> + * = nullptr> + void assign(expected_operations_base &&rhs) noexcept { + if (!this->m_has_val && rhs.m_has_val) { + geterr().~unexpected(); + construct(std::move(rhs).get()); + } else { + assign_common(std::move(rhs)); + } + } + + template ::value> + * = nullptr> + void assign(expected_operations_base &&rhs) { + if (!this->m_has_val && rhs.m_has_val) { + auto tmp = std::move(geterr()); + geterr().~unexpected(); +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + construct(std::move(rhs).get()); + } catch (...) { + geterr() = std::move(tmp); + throw; + } +#else + construct(std::move(rhs).get()); +#endif + } else { + assign_common(std::move(rhs)); + } + } + +#else + + // If exceptions are disabled then we can just copy-construct + void assign(const expected_operations_base &rhs) noexcept { + if (!this->m_has_val && rhs.m_has_val) { + geterr().~unexpected(); + construct(rhs.get()); + } else { + assign_common(rhs); + } + } + + void assign(expected_operations_base &&rhs) noexcept { + if (!this->m_has_val && rhs.m_has_val) { + geterr().~unexpected(); + construct(std::move(rhs).get()); + } else { + assign_common(std::move(rhs)); + } + } + +#endif + + // The common part of move/copy assigning + template void assign_common(Rhs &&rhs) { + if (this->m_has_val) { + if (rhs.m_has_val) { + get() = std::forward(rhs).get(); + } else { + destroy_val(); + construct_error(std::forward(rhs).geterr()); + } + } else { + if (!rhs.m_has_val) { + geterr() = std::forward(rhs).geterr(); + } + } + } + + bool has_value() const { return this->m_has_val; } + + TL_EXPECTED_11_CONSTEXPR T &get() & { return this->m_val; } + constexpr const T &get() const & { return this->m_val; } + TL_EXPECTED_11_CONSTEXPR T &&get() && { return std::move(this->m_val); } +#ifndef TL_EXPECTED_NO_CONSTRR + constexpr const T &&get() const && { return std::move(this->m_val); } +#endif + + TL_EXPECTED_11_CONSTEXPR unexpected &geterr() & { + return this->m_unexpect; + } + constexpr const unexpected &geterr() const & { return this->m_unexpect; } + TL_EXPECTED_11_CONSTEXPR unexpected &&geterr() && { + return std::move(this->m_unexpect); + } +#ifndef TL_EXPECTED_NO_CONSTRR + constexpr const unexpected &&geterr() const && { + return std::move(this->m_unexpect); + } +#endif + + TL_EXPECTED_11_CONSTEXPR void destroy_val() { get().~T(); } +}; + +// This base class provides some handy member functions which can be used in +// further derived classes +template +struct expected_operations_base : expected_storage_base { + using expected_storage_base::expected_storage_base; + + template void construct() noexcept { this->m_has_val = true; } + + // This function doesn't use its argument, but needs it so that code in + // levels above this can work independently of whether T is void + template void construct_with(Rhs &&) noexcept { + this->m_has_val = true; + } + + template void construct_error(Args &&...args) noexcept { + new (std::addressof(this->m_unexpect)) + unexpected(std::forward(args)...); + this->m_has_val = false; + } + + template void assign(Rhs &&rhs) noexcept { + if (!this->m_has_val) { + if (rhs.m_has_val) { + geterr().~unexpected(); + construct(); + } else { + geterr() = std::forward(rhs).geterr(); + } + } else { + if (!rhs.m_has_val) { + construct_error(std::forward(rhs).geterr()); + } + } + } + + bool has_value() const { return this->m_has_val; } + + TL_EXPECTED_11_CONSTEXPR unexpected &geterr() & { + return this->m_unexpect; + } + constexpr const unexpected &geterr() const & { return this->m_unexpect; } + TL_EXPECTED_11_CONSTEXPR unexpected &&geterr() && { + return std::move(this->m_unexpect); + } +#ifndef TL_EXPECTED_NO_CONSTRR + constexpr const unexpected &&geterr() const && { + return std::move(this->m_unexpect); + } +#endif + + TL_EXPECTED_11_CONSTEXPR void destroy_val() { + // no-op + } +}; + +// This class manages conditionally having a trivial copy constructor +// This specialization is for when T and E are trivially copy constructible +template :: + value &&TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value> +struct expected_copy_base : expected_operations_base { + using expected_operations_base::expected_operations_base; +}; + +// This specialization is for when T or E are not trivially copy constructible +template +struct expected_copy_base : expected_operations_base { + using expected_operations_base::expected_operations_base; + + expected_copy_base() = default; + expected_copy_base(const expected_copy_base &rhs) + : expected_operations_base(no_init) { + if (rhs.has_value()) { + this->construct_with(rhs); + } else { + this->construct_error(rhs.geterr()); + } + } + + expected_copy_base(expected_copy_base &&rhs) = default; + expected_copy_base &operator=(const expected_copy_base &rhs) = default; + expected_copy_base &operator=(expected_copy_base &&rhs) = default; +}; + +// This class manages conditionally having a trivial move constructor +// Unfortunately there's no way to achieve this in GCC < 5 AFAIK, since it +// doesn't implement an analogue to std::is_trivially_move_constructible. We +// have to make do with a non-trivial move constructor even if T is trivially +// move constructible +#ifndef TL_EXPECTED_GCC49 +template >::value + &&std::is_trivially_move_constructible::value> +struct expected_move_base : expected_copy_base { + using expected_copy_base::expected_copy_base; +}; +#else +template struct expected_move_base; +#endif +template +struct expected_move_base : expected_copy_base { + using expected_copy_base::expected_copy_base; + + expected_move_base() = default; + expected_move_base(const expected_move_base &rhs) = default; + + expected_move_base(expected_move_base &&rhs) noexcept( + std::is_nothrow_move_constructible::value) + : expected_copy_base(no_init) { + if (rhs.has_value()) { + this->construct_with(std::move(rhs)); + } else { + this->construct_error(std::move(rhs.geterr())); + } + } + expected_move_base &operator=(const expected_move_base &rhs) = default; + expected_move_base &operator=(expected_move_base &&rhs) = default; +}; + +// This class manages conditionally having a trivial copy assignment operator +template >::value + &&TL_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(E)::value + &&TL_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(E)::value + &&TL_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(E)::value> +struct expected_copy_assign_base : expected_move_base { + using expected_move_base::expected_move_base; +}; + +template +struct expected_copy_assign_base : expected_move_base { + using expected_move_base::expected_move_base; + + expected_copy_assign_base() = default; + expected_copy_assign_base(const expected_copy_assign_base &rhs) = default; + + expected_copy_assign_base(expected_copy_assign_base &&rhs) = default; + expected_copy_assign_base &operator=(const expected_copy_assign_base &rhs) { + this->assign(rhs); + return *this; + } + expected_copy_assign_base & + operator=(expected_copy_assign_base &&rhs) = default; +}; + +// This class manages conditionally having a trivial move assignment operator +// Unfortunately there's no way to achieve this in GCC < 5 AFAIK, since it +// doesn't implement an analogue to std::is_trivially_move_assignable. We have +// to make do with a non-trivial move assignment operator even if T is trivially +// move assignable +#ifndef TL_EXPECTED_GCC49 +template , + std::is_trivially_move_constructible, + std::is_trivially_move_assignable>>:: + value &&std::is_trivially_destructible::value + &&std::is_trivially_move_constructible::value + &&std::is_trivially_move_assignable::value> +struct expected_move_assign_base : expected_copy_assign_base { + using expected_copy_assign_base::expected_copy_assign_base; +}; +#else +template struct expected_move_assign_base; +#endif + +template +struct expected_move_assign_base + : expected_copy_assign_base { + using expected_copy_assign_base::expected_copy_assign_base; + + expected_move_assign_base() = default; + expected_move_assign_base(const expected_move_assign_base &rhs) = default; + + expected_move_assign_base(expected_move_assign_base &&rhs) = default; + + expected_move_assign_base & + operator=(const expected_move_assign_base &rhs) = default; + + expected_move_assign_base & + operator=(expected_move_assign_base &&rhs) noexcept( + std::is_nothrow_move_constructible::value + &&std::is_nothrow_move_assignable::value) { + this->assign(std::move(rhs)); + return *this; + } +}; + +// expected_delete_ctor_base will conditionally delete copy and move +// constructors depending on whether T is copy/move constructible +template ::value && + std::is_copy_constructible::value), + bool EnableMove = (is_move_constructible_or_void::value && + std::is_move_constructible::value)> +struct expected_delete_ctor_base { + expected_delete_ctor_base() = default; + expected_delete_ctor_base(const expected_delete_ctor_base &) = default; + expected_delete_ctor_base(expected_delete_ctor_base &&) noexcept = default; + expected_delete_ctor_base & + operator=(const expected_delete_ctor_base &) = default; + expected_delete_ctor_base & + operator=(expected_delete_ctor_base &&) noexcept = default; +}; + +template +struct expected_delete_ctor_base { + expected_delete_ctor_base() = default; + expected_delete_ctor_base(const expected_delete_ctor_base &) = default; + expected_delete_ctor_base(expected_delete_ctor_base &&) noexcept = delete; + expected_delete_ctor_base & + operator=(const expected_delete_ctor_base &) = default; + expected_delete_ctor_base & + operator=(expected_delete_ctor_base &&) noexcept = default; +}; + +template +struct expected_delete_ctor_base { + expected_delete_ctor_base() = default; + expected_delete_ctor_base(const expected_delete_ctor_base &) = delete; + expected_delete_ctor_base(expected_delete_ctor_base &&) noexcept = default; + expected_delete_ctor_base & + operator=(const expected_delete_ctor_base &) = default; + expected_delete_ctor_base & + operator=(expected_delete_ctor_base &&) noexcept = default; +}; + +template +struct expected_delete_ctor_base { + expected_delete_ctor_base() = default; + expected_delete_ctor_base(const expected_delete_ctor_base &) = delete; + expected_delete_ctor_base(expected_delete_ctor_base &&) noexcept = delete; + expected_delete_ctor_base & + operator=(const expected_delete_ctor_base &) = default; + expected_delete_ctor_base & + operator=(expected_delete_ctor_base &&) noexcept = default; +}; + +// expected_delete_assign_base will conditionally delete copy and move +// constructors depending on whether T and E are copy/move constructible + +// assignable +template ::value && + std::is_copy_constructible::value && + is_copy_assignable_or_void::value && + std::is_copy_assignable::value), + bool EnableMove = (is_move_constructible_or_void::value && + std::is_move_constructible::value && + is_move_assignable_or_void::value && + std::is_move_assignable::value)> +struct expected_delete_assign_base { + expected_delete_assign_base() = default; + expected_delete_assign_base(const expected_delete_assign_base &) = default; + expected_delete_assign_base(expected_delete_assign_base &&) noexcept = + default; + expected_delete_assign_base & + operator=(const expected_delete_assign_base &) = default; + expected_delete_assign_base & + operator=(expected_delete_assign_base &&) noexcept = default; +}; + +template +struct expected_delete_assign_base { + expected_delete_assign_base() = default; + expected_delete_assign_base(const expected_delete_assign_base &) = default; + expected_delete_assign_base(expected_delete_assign_base &&) noexcept = + default; + expected_delete_assign_base & + operator=(const expected_delete_assign_base &) = default; + expected_delete_assign_base & + operator=(expected_delete_assign_base &&) noexcept = delete; +}; + +template +struct expected_delete_assign_base { + expected_delete_assign_base() = default; + expected_delete_assign_base(const expected_delete_assign_base &) = default; + expected_delete_assign_base(expected_delete_assign_base &&) noexcept = + default; + expected_delete_assign_base & + operator=(const expected_delete_assign_base &) = delete; + expected_delete_assign_base & + operator=(expected_delete_assign_base &&) noexcept = default; +}; + +template +struct expected_delete_assign_base { + expected_delete_assign_base() = default; + expected_delete_assign_base(const expected_delete_assign_base &) = default; + expected_delete_assign_base(expected_delete_assign_base &&) noexcept = + default; + expected_delete_assign_base & + operator=(const expected_delete_assign_base &) = delete; + expected_delete_assign_base & + operator=(expected_delete_assign_base &&) noexcept = delete; +}; + +// This is needed to be able to construct the expected_default_ctor_base which +// follows, while still conditionally deleting the default constructor. +struct default_constructor_tag { + explicit constexpr default_constructor_tag() = default; +}; + +// expected_default_ctor_base will ensure that expected has a deleted default +// consturctor if T is not default constructible. +// This specialization is for when T is default constructible +template ::value || std::is_void::value> +struct expected_default_ctor_base { + constexpr expected_default_ctor_base() noexcept = default; + constexpr expected_default_ctor_base( + expected_default_ctor_base const &) noexcept = default; + constexpr expected_default_ctor_base(expected_default_ctor_base &&) noexcept = + default; + expected_default_ctor_base & + operator=(expected_default_ctor_base const &) noexcept = default; + expected_default_ctor_base & + operator=(expected_default_ctor_base &&) noexcept = default; + + constexpr explicit expected_default_ctor_base(default_constructor_tag) {} +}; + +// This specialization is for when T is not default constructible +template struct expected_default_ctor_base { + constexpr expected_default_ctor_base() noexcept = delete; + constexpr expected_default_ctor_base( + expected_default_ctor_base const &) noexcept = default; + constexpr expected_default_ctor_base(expected_default_ctor_base &&) noexcept = + default; + expected_default_ctor_base & + operator=(expected_default_ctor_base const &) noexcept = default; + expected_default_ctor_base & + operator=(expected_default_ctor_base &&) noexcept = default; + + constexpr explicit expected_default_ctor_base(default_constructor_tag) {} +}; +} // namespace detail + +template class bad_expected_access : public std::exception { +public: + explicit bad_expected_access(E e) : m_val(std::move(e)) {} + + virtual const char *what() const noexcept override { + return "Bad expected access"; + } + + const E &error() const & { return m_val; } + E &error() & { return m_val; } + const E &&error() const && { return std::move(m_val); } + E &&error() && { return std::move(m_val); } + +private: + E m_val; +}; + +/// An `expected` object is an object that contains the storage for +/// another object and manages the lifetime of this contained object `T`. +/// Alternatively it could contain the storage for another unexpected object +/// `E`. The contained object may not be initialized after the expected object +/// has been initialized, and may not be destroyed before the expected object +/// has been destroyed. The initialization state of the contained object is +/// tracked by the expected object. +template +class expected : private detail::expected_move_assign_base, + private detail::expected_delete_ctor_base, + private detail::expected_delete_assign_base, + private detail::expected_default_ctor_base { + static_assert(!std::is_reference::value, "T must not be a reference"); + static_assert(!std::is_same::type>::value, + "T must not be in_place_t"); + static_assert(!std::is_same::type>::value, + "T must not be unexpect_t"); + static_assert( + !std::is_same>::type>::value, + "T must not be unexpected"); + static_assert(!std::is_reference::value, "E must not be a reference"); + + T *valptr() { return std::addressof(this->m_val); } + const T *valptr() const { return std::addressof(this->m_val); } + unexpected *errptr() { return std::addressof(this->m_unexpect); } + const unexpected *errptr() const { + return std::addressof(this->m_unexpect); + } + + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR U &val() { + return this->m_val; + } + TL_EXPECTED_11_CONSTEXPR unexpected &err() { return this->m_unexpect; } + + template ::value> * = nullptr> + constexpr const U &val() const { + return this->m_val; + } + constexpr const unexpected &err() const { return this->m_unexpect; } + + using impl_base = detail::expected_move_assign_base; + using ctor_base = detail::expected_default_ctor_base; + +public: + typedef T value_type; + typedef E error_type; + typedef unexpected unexpected_type; + +#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ + !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) + template TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) & { + return and_then_impl(*this, std::forward(f)); + } + template TL_EXPECTED_11_CONSTEXPR auto and_then(F &&f) && { + return and_then_impl(std::move(*this), std::forward(f)); + } + template constexpr auto and_then(F &&f) const & { + return and_then_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template constexpr auto and_then(F &&f) const && { + return and_then_impl(std::move(*this), std::forward(f)); + } +#endif + +#else + template + TL_EXPECTED_11_CONSTEXPR auto + and_then(F &&f) & -> decltype(and_then_impl(std::declval(), + std::forward(f))) { + return and_then_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR auto + and_then(F &&f) && -> decltype(and_then_impl(std::declval(), + std::forward(f))) { + return and_then_impl(std::move(*this), std::forward(f)); + } + template + constexpr auto and_then(F &&f) const & -> decltype(and_then_impl( + std::declval(), std::forward(f))) { + return and_then_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template + constexpr auto and_then(F &&f) const && -> decltype(and_then_impl( + std::declval(), std::forward(f))) { + return and_then_impl(std::move(*this), std::forward(f)); + } +#endif +#endif + +#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ + !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) + template TL_EXPECTED_11_CONSTEXPR auto map(F &&f) & { + return expected_map_impl(*this, std::forward(f)); + } + template TL_EXPECTED_11_CONSTEXPR auto map(F &&f) && { + return expected_map_impl(std::move(*this), std::forward(f)); + } + template constexpr auto map(F &&f) const & { + return expected_map_impl(*this, std::forward(f)); + } + template constexpr auto map(F &&f) const && { + return expected_map_impl(std::move(*this), std::forward(f)); + } +#else + template + TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl( + std::declval(), std::declval())) + map(F &&f) & { + return expected_map_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval(), + std::declval())) + map(F &&f) && { + return expected_map_impl(std::move(*this), std::forward(f)); + } + template + constexpr decltype(expected_map_impl(std::declval(), + std::declval())) + map(F &&f) const & { + return expected_map_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template + constexpr decltype(expected_map_impl(std::declval(), + std::declval())) + map(F &&f) const && { + return expected_map_impl(std::move(*this), std::forward(f)); + } +#endif +#endif + +#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ + !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) + template TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) & { + return expected_map_impl(*this, std::forward(f)); + } + template TL_EXPECTED_11_CONSTEXPR auto transform(F &&f) && { + return expected_map_impl(std::move(*this), std::forward(f)); + } + template constexpr auto transform(F &&f) const & { + return expected_map_impl(*this, std::forward(f)); + } + template constexpr auto transform(F &&f) const && { + return expected_map_impl(std::move(*this), std::forward(f)); + } +#else + template + TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl( + std::declval(), std::declval())) + transform(F &&f) & { + return expected_map_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR decltype(expected_map_impl(std::declval(), + std::declval())) + transform(F &&f) && { + return expected_map_impl(std::move(*this), std::forward(f)); + } + template + constexpr decltype(expected_map_impl(std::declval(), + std::declval())) + transform(F &&f) const & { + return expected_map_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template + constexpr decltype(expected_map_impl(std::declval(), + std::declval())) + transform(F &&f) const && { + return expected_map_impl(std::move(*this), std::forward(f)); + } +#endif +#endif + +#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ + !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) + template TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) & { + return map_error_impl(*this, std::forward(f)); + } + template TL_EXPECTED_11_CONSTEXPR auto map_error(F &&f) && { + return map_error_impl(std::move(*this), std::forward(f)); + } + template constexpr auto map_error(F &&f) const & { + return map_error_impl(*this, std::forward(f)); + } + template constexpr auto map_error(F &&f) const && { + return map_error_impl(std::move(*this), std::forward(f)); + } +#else + template + TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval(), + std::declval())) + map_error(F &&f) & { + return map_error_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval(), + std::declval())) + map_error(F &&f) && { + return map_error_impl(std::move(*this), std::forward(f)); + } + template + constexpr decltype(map_error_impl(std::declval(), + std::declval())) + map_error(F &&f) const & { + return map_error_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template + constexpr decltype(map_error_impl(std::declval(), + std::declval())) + map_error(F &&f) const && { + return map_error_impl(std::move(*this), std::forward(f)); + } +#endif +#endif +#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ + !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) + template TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) & { + return map_error_impl(*this, std::forward(f)); + } + template TL_EXPECTED_11_CONSTEXPR auto transform_error(F &&f) && { + return map_error_impl(std::move(*this), std::forward(f)); + } + template constexpr auto transform_error(F &&f) const & { + return map_error_impl(*this, std::forward(f)); + } + template constexpr auto transform_error(F &&f) const && { + return map_error_impl(std::move(*this), std::forward(f)); + } +#else + template + TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval(), + std::declval())) + transform_error(F &&f) & { + return map_error_impl(*this, std::forward(f)); + } + template + TL_EXPECTED_11_CONSTEXPR decltype(map_error_impl(std::declval(), + std::declval())) + transform_error(F &&f) && { + return map_error_impl(std::move(*this), std::forward(f)); + } + template + constexpr decltype(map_error_impl(std::declval(), + std::declval())) + transform_error(F &&f) const & { + return map_error_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template + constexpr decltype(map_error_impl(std::declval(), + std::declval())) + transform_error(F &&f) const && { + return map_error_impl(std::move(*this), std::forward(f)); + } +#endif +#endif + template expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) & { + return or_else_impl(*this, std::forward(f)); + } + + template expected TL_EXPECTED_11_CONSTEXPR or_else(F &&f) && { + return or_else_impl(std::move(*this), std::forward(f)); + } + + template expected constexpr or_else(F &&f) const & { + return or_else_impl(*this, std::forward(f)); + } + +#ifndef TL_EXPECTED_NO_CONSTRR + template expected constexpr or_else(F &&f) const && { + return or_else_impl(std::move(*this), std::forward(f)); + } +#endif + constexpr expected() = default; + constexpr expected(const expected &rhs) = default; + constexpr expected(expected &&rhs) = default; + expected &operator=(const expected &rhs) = default; + expected &operator=(expected &&rhs) = default; + + template ::value> * = + nullptr> + constexpr expected(in_place_t, Args &&...args) + : impl_base(in_place, std::forward(args)...), + ctor_base(detail::default_constructor_tag{}) {} + + template &, Args &&...>::value> * = nullptr> + constexpr expected(in_place_t, std::initializer_list il, Args &&...args) + : impl_base(in_place, il, std::forward(args)...), + ctor_base(detail::default_constructor_tag{}) {} + + template ::value> * = + nullptr, + detail::enable_if_t::value> * = + nullptr> + explicit constexpr expected(const unexpected &e) + : impl_base(unexpect, e.value()), + ctor_base(detail::default_constructor_tag{}) {} + + template < + class G = E, + detail::enable_if_t::value> * = + nullptr, + detail::enable_if_t::value> * = nullptr> + constexpr expected(unexpected const &e) + : impl_base(unexpect, e.value()), + ctor_base(detail::default_constructor_tag{}) {} + + template < + class G = E, + detail::enable_if_t::value> * = nullptr, + detail::enable_if_t::value> * = nullptr> + explicit constexpr expected(unexpected &&e) noexcept( + std::is_nothrow_constructible::value) + : impl_base(unexpect, std::move(e.value())), + ctor_base(detail::default_constructor_tag{}) {} + + template < + class G = E, + detail::enable_if_t::value> * = nullptr, + detail::enable_if_t::value> * = nullptr> + constexpr expected(unexpected &&e) noexcept( + std::is_nothrow_constructible::value) + : impl_base(unexpect, std::move(e.value())), + ctor_base(detail::default_constructor_tag{}) {} + + template ::value> * = + nullptr> + constexpr explicit expected(unexpect_t, Args &&...args) + : impl_base(unexpect, std::forward(args)...), + ctor_base(detail::default_constructor_tag{}) {} + + template &, Args &&...>::value> * = nullptr> + constexpr explicit expected(unexpect_t, std::initializer_list il, + Args &&...args) + : impl_base(unexpect, il, std::forward(args)...), + ctor_base(detail::default_constructor_tag{}) {} + + template ::value && + std::is_convertible::value)> * = + nullptr, + detail::expected_enable_from_other + * = nullptr> + explicit TL_EXPECTED_11_CONSTEXPR expected(const expected &rhs) + : ctor_base(detail::default_constructor_tag{}) { + if (rhs.has_value()) { + this->construct(*rhs); + } else { + this->construct_error(rhs.error()); + } + } + + template ::value && + std::is_convertible::value)> * = + nullptr, + detail::expected_enable_from_other + * = nullptr> + TL_EXPECTED_11_CONSTEXPR expected(const expected &rhs) + : ctor_base(detail::default_constructor_tag{}) { + if (rhs.has_value()) { + this->construct(*rhs); + } else { + this->construct_error(rhs.error()); + } + } + + template < + class U, class G, + detail::enable_if_t::value && + std::is_convertible::value)> * = nullptr, + detail::expected_enable_from_other * = nullptr> + explicit TL_EXPECTED_11_CONSTEXPR expected(expected &&rhs) + : ctor_base(detail::default_constructor_tag{}) { + if (rhs.has_value()) { + this->construct(std::move(*rhs)); + } else { + this->construct_error(std::move(rhs.error())); + } + } + + template < + class U, class G, + detail::enable_if_t<(std::is_convertible::value && + std::is_convertible::value)> * = nullptr, + detail::expected_enable_from_other * = nullptr> + TL_EXPECTED_11_CONSTEXPR expected(expected &&rhs) + : ctor_base(detail::default_constructor_tag{}) { + if (rhs.has_value()) { + this->construct(std::move(*rhs)); + } else { + this->construct_error(std::move(rhs.error())); + } + } + + template < + class U = T, + detail::enable_if_t::value> * = nullptr, + detail::expected_enable_forward_value * = nullptr> + explicit TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v) + : expected(in_place, std::forward(v)) {} + + template < + class U = T, + detail::enable_if_t::value> * = nullptr, + detail::expected_enable_forward_value * = nullptr> + TL_EXPECTED_MSVC2015_CONSTEXPR expected(U &&v) + : expected(in_place, std::forward(v)) {} + + template < + class U = T, class G = T, + detail::enable_if_t::value> * = + nullptr, + detail::enable_if_t::value> * = nullptr, + detail::enable_if_t< + (!std::is_same, detail::decay_t>::value && + !detail::conjunction, + std::is_same>>::value && + std::is_constructible::value && + std::is_assignable::value && + std::is_nothrow_move_constructible::value)> * = nullptr> + expected &operator=(U &&v) { + if (has_value()) { + val() = std::forward(v); + } else { + err().~unexpected(); + ::new (valptr()) T(std::forward(v)); + this->m_has_val = true; + } + + return *this; + } + + template < + class U = T, class G = T, + detail::enable_if_t::value> * = + nullptr, + detail::enable_if_t::value> * = nullptr, + detail::enable_if_t< + (!std::is_same, detail::decay_t>::value && + !detail::conjunction, + std::is_same>>::value && + std::is_constructible::value && + std::is_assignable::value && + std::is_nothrow_move_constructible::value)> * = nullptr> + expected &operator=(U &&v) { + if (has_value()) { + val() = std::forward(v); + } else { + auto tmp = std::move(err()); + err().~unexpected(); + +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + ::new (valptr()) T(std::forward(v)); + this->m_has_val = true; + } catch (...) { + err() = std::move(tmp); + throw; + } +#else + ::new (valptr()) T(std::forward(v)); + this->m_has_val = true; +#endif + } + + return *this; + } + + template ::value && + std::is_assignable::value> * = nullptr> + expected &operator=(const unexpected &rhs) { + if (!has_value()) { + err() = rhs; + } else { + this->destroy_val(); + ::new (errptr()) unexpected(rhs); + this->m_has_val = false; + } + + return *this; + } + + template ::value && + std::is_move_assignable::value> * = nullptr> + expected &operator=(unexpected &&rhs) noexcept { + if (!has_value()) { + err() = std::move(rhs); + } else { + this->destroy_val(); + ::new (errptr()) unexpected(std::move(rhs)); + this->m_has_val = false; + } + + return *this; + } + + template ::value> * = nullptr> + void emplace(Args &&...args) { + if (has_value()) { + val().~T(); + } else { + err().~unexpected(); + this->m_has_val = true; + } + ::new (valptr()) T(std::forward(args)...); + } + + template ::value> * = nullptr> + void emplace(Args &&...args) { + if (has_value()) { + val().~T(); + ::new (valptr()) T(std::forward(args)...); + } else { + auto tmp = std::move(err()); + err().~unexpected(); + +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + ::new (valptr()) T(std::forward(args)...); + this->m_has_val = true; + } catch (...) { + err() = std::move(tmp); + throw; + } +#else + ::new (valptr()) T(std::forward(args)...); + this->m_has_val = true; +#endif + } + } + + template &, Args &&...>::value> * = nullptr> + void emplace(std::initializer_list il, Args &&...args) { + if (has_value()) { + T t(il, std::forward(args)...); + val() = std::move(t); + } else { + err().~unexpected(); + ::new (valptr()) T(il, std::forward(args)...); + this->m_has_val = true; + } + } + + template &, Args &&...>::value> * = nullptr> + void emplace(std::initializer_list il, Args &&...args) { + if (has_value()) { + T t(il, std::forward(args)...); + val() = std::move(t); + } else { + auto tmp = std::move(err()); + err().~unexpected(); + +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + ::new (valptr()) T(il, std::forward(args)...); + this->m_has_val = true; + } catch (...) { + err() = std::move(tmp); + throw; + } +#else + ::new (valptr()) T(il, std::forward(args)...); + this->m_has_val = true; +#endif + } + } + +private: + using t_is_void = std::true_type; + using t_is_not_void = std::false_type; + using t_is_nothrow_move_constructible = std::true_type; + using move_constructing_t_can_throw = std::false_type; + using e_is_nothrow_move_constructible = std::true_type; + using move_constructing_e_can_throw = std::false_type; + + void swap_where_both_have_value(expected & /*rhs*/, t_is_void) noexcept { + // swapping void is a no-op + } + + void swap_where_both_have_value(expected &rhs, t_is_not_void) { + using std::swap; + swap(val(), rhs.val()); + } + + void swap_where_only_one_has_value(expected &rhs, t_is_void) noexcept( + std::is_nothrow_move_constructible::value) { + ::new (errptr()) unexpected_type(std::move(rhs.err())); + rhs.err().~unexpected_type(); + std::swap(this->m_has_val, rhs.m_has_val); + } + + void swap_where_only_one_has_value(expected &rhs, t_is_not_void) { + swap_where_only_one_has_value_and_t_is_not_void( + rhs, typename std::is_nothrow_move_constructible::type{}, + typename std::is_nothrow_move_constructible::type{}); + } + + void swap_where_only_one_has_value_and_t_is_not_void( + expected &rhs, t_is_nothrow_move_constructible, + e_is_nothrow_move_constructible) noexcept { + auto temp = std::move(val()); + val().~T(); + ::new (errptr()) unexpected_type(std::move(rhs.err())); + rhs.err().~unexpected_type(); + ::new (rhs.valptr()) T(std::move(temp)); + std::swap(this->m_has_val, rhs.m_has_val); + } + + void swap_where_only_one_has_value_and_t_is_not_void( + expected &rhs, t_is_nothrow_move_constructible, + move_constructing_e_can_throw) { + auto temp = std::move(val()); + val().~T(); +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + ::new (errptr()) unexpected_type(std::move(rhs.err())); + rhs.err().~unexpected_type(); + ::new (rhs.valptr()) T(std::move(temp)); + std::swap(this->m_has_val, rhs.m_has_val); + } catch (...) { + val() = std::move(temp); + throw; + } +#else + ::new (errptr()) unexpected_type(std::move(rhs.err())); + rhs.err().~unexpected_type(); + ::new (rhs.valptr()) T(std::move(temp)); + std::swap(this->m_has_val, rhs.m_has_val); +#endif + } + + void swap_where_only_one_has_value_and_t_is_not_void( + expected &rhs, move_constructing_t_can_throw, + e_is_nothrow_move_constructible) { + auto temp = std::move(rhs.err()); + rhs.err().~unexpected_type(); +#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED + try { + ::new (rhs.valptr()) T(std::move(val())); + val().~T(); + ::new (errptr()) unexpected_type(std::move(temp)); + std::swap(this->m_has_val, rhs.m_has_val); + } catch (...) { + rhs.err() = std::move(temp); + throw; + } +#else + ::new (rhs.valptr()) T(std::move(val())); + val().~T(); + ::new (errptr()) unexpected_type(std::move(temp)); + std::swap(this->m_has_val, rhs.m_has_val); +#endif + } + +public: + template + detail::enable_if_t::value && + detail::is_swappable::value && + (std::is_nothrow_move_constructible::value || + std::is_nothrow_move_constructible::value)> + swap(expected &rhs) noexcept( + std::is_nothrow_move_constructible::value + &&detail::is_nothrow_swappable::value + &&std::is_nothrow_move_constructible::value + &&detail::is_nothrow_swappable::value) { + if (has_value() && rhs.has_value()) { + swap_where_both_have_value(rhs, typename std::is_void::type{}); + } else if (!has_value() && rhs.has_value()) { + rhs.swap(*this); + } else if (has_value()) { + swap_where_only_one_has_value(rhs, typename std::is_void::type{}); + } else { + using std::swap; + swap(err(), rhs.err()); + } + } + + constexpr const T *operator->() const { + TL_ASSERT(has_value()); + return valptr(); + } + TL_EXPECTED_11_CONSTEXPR T *operator->() { + TL_ASSERT(has_value()); + return valptr(); + } + + template ::value> * = nullptr> + constexpr const U &operator*() const & { + TL_ASSERT(has_value()); + return val(); + } + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR U &operator*() & { + TL_ASSERT(has_value()); + return val(); + } + template ::value> * = nullptr> + constexpr const U &&operator*() const && { + TL_ASSERT(has_value()); + return std::move(val()); + } + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR U &&operator*() && { + TL_ASSERT(has_value()); + return std::move(val()); + } + + constexpr bool has_value() const noexcept { return this->m_has_val; } + constexpr explicit operator bool() const noexcept { return this->m_has_val; } + + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR const U &value() const & { + if (!has_value()) + detail::throw_exception(bad_expected_access(err().value())); + return val(); + } + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR U &value() & { + if (!has_value()) + detail::throw_exception(bad_expected_access(err().value())); + return val(); + } + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR const U &&value() const && { + if (!has_value()) + detail::throw_exception(bad_expected_access(std::move(err()).value())); + return std::move(val()); + } + template ::value> * = nullptr> + TL_EXPECTED_11_CONSTEXPR U &&value() && { + if (!has_value()) + detail::throw_exception(bad_expected_access(std::move(err()).value())); + return std::move(val()); + } + + constexpr const E &error() const & { + TL_ASSERT(!has_value()); + return err().value(); + } + TL_EXPECTED_11_CONSTEXPR E &error() & { + TL_ASSERT(!has_value()); + return err().value(); + } + constexpr const E &&error() const && { + TL_ASSERT(!has_value()); + return std::move(err().value()); + } + TL_EXPECTED_11_CONSTEXPR E &&error() && { + TL_ASSERT(!has_value()); + return std::move(err().value()); + } + + template constexpr T value_or(U &&v) const & { + static_assert(std::is_copy_constructible::value && + std::is_convertible::value, + "T must be copy-constructible and convertible to from U&&"); + return bool(*this) ? **this : static_cast(std::forward(v)); + } + template TL_EXPECTED_11_CONSTEXPR T value_or(U &&v) && { + static_assert(std::is_move_constructible::value && + std::is_convertible::value, + "T must be move-constructible and convertible to from U&&"); + return bool(*this) ? std::move(**this) : static_cast(std::forward(v)); + } +}; + +namespace detail { +template using exp_t = typename detail::decay_t::value_type; +template using err_t = typename detail::decay_t::error_type; +template using ret_t = expected>; + +#ifdef TL_EXPECTED_CXX14 +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + *std::declval()))> +constexpr auto and_then_impl(Exp &&exp, F &&f) { + static_assert(detail::is_expected::value, "F must return an expected"); + + return exp.has_value() + ? detail::invoke(std::forward(f), *std::forward(exp)) + : Ret(unexpect, std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval()))> +constexpr auto and_then_impl(Exp &&exp, F &&f) { + static_assert(detail::is_expected::value, "F must return an expected"); + + return exp.has_value() ? detail::invoke(std::forward(f)) + : Ret(unexpect, std::forward(exp).error()); +} +#else +template struct TC; +template (), + *std::declval())), + detail::enable_if_t>::value> * = nullptr> +auto and_then_impl(Exp &&exp, F &&f) -> Ret { + static_assert(detail::is_expected::value, "F must return an expected"); + + return exp.has_value() + ? detail::invoke(std::forward(f), *std::forward(exp)) + : Ret(unexpect, std::forward(exp).error()); +} + +template ())), + detail::enable_if_t>::value> * = nullptr> +constexpr auto and_then_impl(Exp &&exp, F &&f) -> Ret { + static_assert(detail::is_expected::value, "F must return an expected"); + + return exp.has_value() ? detail::invoke(std::forward(f)) + : Ret(unexpect, std::forward(exp).error()); +} +#endif + +#ifdef TL_EXPECTED_CXX14 +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + *std::declval())), + detail::enable_if_t::value> * = nullptr> +constexpr auto expected_map_impl(Exp &&exp, F &&f) { + using result = ret_t>; + return exp.has_value() ? result(detail::invoke(std::forward(f), + *std::forward(exp))) + : result(unexpect, std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + *std::declval())), + detail::enable_if_t::value> * = nullptr> +auto expected_map_impl(Exp &&exp, F &&f) { + using result = expected>; + if (exp.has_value()) { + detail::invoke(std::forward(f), *std::forward(exp)); + return result(); + } + + return result(unexpect, std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval())), + detail::enable_if_t::value> * = nullptr> +constexpr auto expected_map_impl(Exp &&exp, F &&f) { + using result = ret_t>; + return exp.has_value() ? result(detail::invoke(std::forward(f))) + : result(unexpect, std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval())), + detail::enable_if_t::value> * = nullptr> +auto expected_map_impl(Exp &&exp, F &&f) { + using result = expected>; + if (exp.has_value()) { + detail::invoke(std::forward(f)); + return result(); + } + + return result(unexpect, std::forward(exp).error()); +} +#else +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + *std::declval())), + detail::enable_if_t::value> * = nullptr> + +constexpr auto expected_map_impl(Exp &&exp, F &&f) + -> ret_t> { + using result = ret_t>; + + return exp.has_value() ? result(detail::invoke(std::forward(f), + *std::forward(exp))) + : result(unexpect, std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + *std::declval())), + detail::enable_if_t::value> * = nullptr> + +auto expected_map_impl(Exp &&exp, F &&f) -> expected> { + if (exp.has_value()) { + detail::invoke(std::forward(f), *std::forward(exp)); + return {}; + } + + return unexpected>(std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval())), + detail::enable_if_t::value> * = nullptr> + +constexpr auto expected_map_impl(Exp &&exp, F &&f) + -> ret_t> { + using result = ret_t>; + + return exp.has_value() ? result(detail::invoke(std::forward(f))) + : result(unexpect, std::forward(exp).error()); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval())), + detail::enable_if_t::value> * = nullptr> + +auto expected_map_impl(Exp &&exp, F &&f) -> expected> { + if (exp.has_value()) { + detail::invoke(std::forward(f)); + return {}; + } + + return unexpected>(std::forward(exp).error()); +} +#endif + +#if defined(TL_EXPECTED_CXX14) && !defined(TL_EXPECTED_GCC49) && \ + !defined(TL_EXPECTED_GCC54) && !defined(TL_EXPECTED_GCC55) +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +constexpr auto map_error_impl(Exp &&exp, F &&f) { + using result = expected, detail::decay_t>; + return exp.has_value() + ? result(*std::forward(exp)) + : result(unexpect, detail::invoke(std::forward(f), + std::forward(exp).error())); +} +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +auto map_error_impl(Exp &&exp, F &&f) { + using result = expected, monostate>; + if (exp.has_value()) { + return result(*std::forward(exp)); + } + + detail::invoke(std::forward(f), std::forward(exp).error()); + return result(unexpect, monostate{}); +} +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +constexpr auto map_error_impl(Exp &&exp, F &&f) { + using result = expected, detail::decay_t>; + return exp.has_value() + ? result() + : result(unexpect, detail::invoke(std::forward(f), + std::forward(exp).error())); +} +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +auto map_error_impl(Exp &&exp, F &&f) { + using result = expected, monostate>; + if (exp.has_value()) { + return result(); + } + + detail::invoke(std::forward(f), std::forward(exp).error()); + return result(unexpect, monostate{}); +} +#else +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +constexpr auto map_error_impl(Exp &&exp, F &&f) + -> expected, detail::decay_t> { + using result = expected, detail::decay_t>; + + return exp.has_value() + ? result(*std::forward(exp)) + : result(unexpect, detail::invoke(std::forward(f), + std::forward(exp).error())); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +auto map_error_impl(Exp &&exp, F &&f) -> expected, monostate> { + using result = expected, monostate>; + if (exp.has_value()) { + return result(*std::forward(exp)); + } + + detail::invoke(std::forward(f), std::forward(exp).error()); + return result(unexpect, monostate{}); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +constexpr auto map_error_impl(Exp &&exp, F &&f) + -> expected, detail::decay_t> { + using result = expected, detail::decay_t>; + + return exp.has_value() + ? result() + : result(unexpect, detail::invoke(std::forward(f), + std::forward(exp).error())); +} + +template >::value> * = nullptr, + class Ret = decltype(detail::invoke(std::declval(), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +auto map_error_impl(Exp &&exp, F &&f) -> expected, monostate> { + using result = expected, monostate>; + if (exp.has_value()) { + return result(); + } + + detail::invoke(std::forward(f), std::forward(exp).error()); + return result(unexpect, monostate{}); +} +#endif + +#ifdef TL_EXPECTED_CXX14 +template (), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +constexpr auto or_else_impl(Exp &&exp, F &&f) { + static_assert(detail::is_expected::value, "F must return an expected"); + return exp.has_value() ? std::forward(exp) + : detail::invoke(std::forward(f), + std::forward(exp).error()); +} + +template (), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +detail::decay_t or_else_impl(Exp &&exp, F &&f) { + return exp.has_value() ? std::forward(exp) + : (detail::invoke(std::forward(f), + std::forward(exp).error()), + std::forward(exp)); +} +#else +template (), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +auto or_else_impl(Exp &&exp, F &&f) -> Ret { + static_assert(detail::is_expected::value, "F must return an expected"); + return exp.has_value() ? std::forward(exp) + : detail::invoke(std::forward(f), + std::forward(exp).error()); +} + +template (), + std::declval().error())), + detail::enable_if_t::value> * = nullptr> +detail::decay_t or_else_impl(Exp &&exp, F &&f) { + return exp.has_value() ? std::forward(exp) + : (detail::invoke(std::forward(f), + std::forward(exp).error()), + std::forward(exp)); +} +#endif +} // namespace detail + +template +constexpr bool operator==(const expected &lhs, + const expected &rhs) { + return (lhs.has_value() != rhs.has_value()) + ? false + : (!lhs.has_value() ? lhs.error() == rhs.error() : *lhs == *rhs); +} +template +constexpr bool operator!=(const expected &lhs, + const expected &rhs) { + return (lhs.has_value() != rhs.has_value()) + ? true + : (!lhs.has_value() ? lhs.error() != rhs.error() : *lhs != *rhs); +} +template +constexpr bool operator==(const expected &lhs, + const expected &rhs) { + return (lhs.has_value() != rhs.has_value()) + ? false + : (!lhs.has_value() ? lhs.error() == rhs.error() : true); +} +template +constexpr bool operator!=(const expected &lhs, + const expected &rhs) { + return (lhs.has_value() != rhs.has_value()) + ? true + : (!lhs.has_value() ? lhs.error() == rhs.error() : false); +} + +template +constexpr bool operator==(const expected &x, const U &v) { + return x.has_value() ? *x == v : false; +} +template +constexpr bool operator==(const U &v, const expected &x) { + return x.has_value() ? *x == v : false; +} +template +constexpr bool operator!=(const expected &x, const U &v) { + return x.has_value() ? *x != v : true; +} +template +constexpr bool operator!=(const U &v, const expected &x) { + return x.has_value() ? *x != v : true; +} + +template +constexpr bool operator==(const expected &x, const unexpected &e) { + return x.has_value() ? false : x.error() == e.value(); +} +template +constexpr bool operator==(const unexpected &e, const expected &x) { + return x.has_value() ? false : x.error() == e.value(); +} +template +constexpr bool operator!=(const expected &x, const unexpected &e) { + return x.has_value() ? true : x.error() != e.value(); +} +template +constexpr bool operator!=(const unexpected &e, const expected &x) { + return x.has_value() ? true : x.error() != e.value(); +} + +template ::value || + std::is_move_constructible::value) && + detail::is_swappable::value && + std::is_move_constructible::value && + detail::is_swappable::value> * = nullptr> +void swap(expected &lhs, + expected &rhs) noexcept(noexcept(lhs.swap(rhs))) { + lhs.swap(rhs); +} +} // namespace tl + +#endif diff --git a/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/about.json b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/about.json new file mode 100644 index 0000000000000000000000000000000000000000..5ca922f42daca6d618beb5d7c7cbb514047f80be --- /dev/null +++ b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/about.json @@ -0,0 +1,132 @@ +{ + "channels": [ + "https://repo.anaconda.com/pkgs/main" + ], + "conda_build_version": "24.1.2", + "conda_version": "24.1.2", + "description": "C++11/14/17 std::expected with functional-style extensions", + "dev_url": "https://github.com/TartanLlama/expected", + "doc_url": "https://github.com/TartanLlama/expected#readme", + "env_vars": { + "CIO_TEST": "" + }, + "extra": { + "copy_test_source_files": true, + "final": true, + "flow_run_id": "71069434-1bcc-413e-83cf-bdfe3163604b", + "recipe-maintainers": [ + "JohanMabille", + "wolfv" + ], + "remote_url": "git@github.com:AnacondaRecipes/cpp-expected-feedstock.git", + "sha": "4457a27f5d09d4666580e8050590e37591484e2c" + }, + "home": "https://github.com/TartanLlama/expected", + "identifiers": [], + "keywords": [], + "license": "CC0-1.0", + "license_family": "CC", + "license_file": "COPYING", + "root_pkgs": [ + "_libgcc_mutex 0.1 main", + "_openmp_mutex 5.1 1_gnu", + "archspec 0.2.1 pyhd3eb1b0_0", + "boltons 23.0.0 py39h06a4308_0", + "brotli-python 1.0.9 py39h6a678d5_7", + "bzip2 1.0.8 h7b6447c_0", + "c-ares 1.19.1 h5eee18b_0", + "charset-normalizer 2.0.4 pyhd3eb1b0_0", + "conda-content-trust 0.2.0 py39h06a4308_0", + "conda-package-handling 2.2.0 py39h06a4308_0", + "conda-package-streaming 0.9.0 py39h06a4308_0", + "fmt 9.1.0 hdb19cb5_0", + "icu 73.1 h6a678d5_0", + "idna 3.4 py39h06a4308_0", + "jsonpatch 1.32 pyhd3eb1b0_0", + "jsonpointer 2.1 pyhd3eb1b0_0", + "krb5 1.20.1 h143b758_1", + "ld_impl_linux-64 2.38 h1181459_1", + "libarchive 3.6.2 h6ac8c49_2", + "libev 4.33 h7f8727e_1", + "libffi 3.4.4 h6a678d5_0", + "libgcc-ng 11.2.0 h1234567_1", + "libgomp 11.2.0 h1234567_1", + "libnghttp2 1.57.0 h2d74bed_0", + "libsolv 0.7.24 he621ea3_0", + "libssh2 1.10.0 hdbd6064_2", + "libstdcxx-ng 11.2.0 h1234567_1", + "libxml2 2.10.4 hf1b16e4_1", + "lz4-c 1.9.4 h6a678d5_0", + "ncurses 6.4 h6a678d5_0", + "packaging 23.1 py39h06a4308_0", + "pcre2 10.42 hebb0a14_0", + "pluggy 1.0.0 py39h06a4308_1", + "pybind11-abi 4 hd3eb1b0_1", + "pycosat 0.6.6 py39h5eee18b_0", + "pycparser 2.21 pyhd3eb1b0_0", + "pysocks 1.7.1 py39h06a4308_0", + "python 3.9.18 h955ad1f_0", + "readline 8.2 h5eee18b_0", + "reproc 14.2.4 h295c915_1", + "reproc-cpp 14.2.4 h295c915_1", + "ruamel.yaml 0.17.21 py39h5eee18b_0", + "ruamel.yaml.clib 0.2.6 py39h5eee18b_1", + "sqlite 3.41.2 h5eee18b_0", + "tk 8.6.12 h1ccaba5_0", + "tqdm 4.65.0 py39hb070fc8_0", + "wheel 0.41.2 py39h06a4308_0", + "yaml-cpp 0.8.0 h6a678d5_0", + "zlib 1.2.13 h5eee18b_0", + "zstandard 0.19.0 py39h5eee18b_0", + "zstd 1.5.5 hc292b87_0", + "attrs 23.1.0 py39h06a4308_0", + "beautifulsoup4 4.12.2 py39h06a4308_0", + "ca-certificates 2023.12.12 h06a4308_0", + "certifi 2024.2.2 py39h06a4308_0", + "cffi 1.16.0 py39h5eee18b_0", + "chardet 4.0.0 py39h06a4308_1003", + "click 8.1.7 py39h06a4308_0", + "conda 24.1.2 py39h06a4308_0", + "conda-build 24.1.2 py39h06a4308_0", + "conda-index 0.4.0 pyhd3eb1b0_0", + "conda-libmamba-solver 24.1.0 pyhd3eb1b0_0", + "cryptography 42.0.2 py39hdda0065_0", + "distro 1.8.0 py39h06a4308_0", + "filelock 3.13.1 py39h06a4308_0", + "jinja2 3.1.3 py39h06a4308_0", + "jsonschema 4.19.2 py39h06a4308_0", + "jsonschema-specifications 2023.7.1 py39h06a4308_0", + "libcurl 8.5.0 h251f7ec_0", + "libedit 3.1.20230828 h5eee18b_0", + "liblief 0.12.3 h6a678d5_0", + "libmamba 1.5.6 haf1ee3a_0", + "libmambapy 1.5.6 py39h2dafd23_0", + "markupsafe 2.1.3 py39h5eee18b_0", + "menuinst 2.0.2 py39h06a4308_0", + "more-itertools 10.1.0 py39h06a4308_0", + "openssl 3.0.13 h7f8727e_0", + "patch 2.7.6 h7b6447c_1001", + "patchelf 0.17.2 h6a678d5_0", + "pip 23.3.1 py39h06a4308_0", + "pkginfo 1.9.6 py39h06a4308_0", + "platformdirs 3.10.0 py39h06a4308_0", + "psutil 5.9.0 py39h5eee18b_0", + "py-lief 0.12.3 py39h6a678d5_0", + "pyopenssl 24.0.0 py39h06a4308_0", + "python-libarchive-c 2.9 pyhd3eb1b0_1", + "pytz 2023.3.post1 py39h06a4308_0", + "pyyaml 6.0.1 py39h5eee18b_0", + "referencing 0.30.2 py39h06a4308_0", + "requests 2.31.0 py39h06a4308_1", + "rpds-py 0.10.6 py39hb02cf49_0", + "setuptools 68.2.2 py39h06a4308_0", + "soupsieve 2.5 py39h06a4308_0", + "tomli 2.0.1 py39h06a4308_0", + "tzdata 2023d h04d1e81_0", + "urllib3 2.1.0 py39h06a4308_1", + "xz 5.4.5 h5eee18b_0", + "yaml 0.2.5 h7b6447c_0" + ], + "summary": "C++11/14/17 std::expected with functional-style extensions", + "tags": [] +} \ No newline at end of file diff --git a/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/files b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/files new file mode 100644 index 0000000000000000000000000000000000000000..d4b9eacc2d20a87c5973311ebe1cc8e872fa8648 --- /dev/null +++ b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/files @@ -0,0 +1,4 @@ +include/tl/expected.hpp +share/cmake/tl-expected/tl-expected-config-version.cmake +share/cmake/tl-expected/tl-expected-config.cmake +share/cmake/tl-expected/tl-expected-targets.cmake diff --git a/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/git b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/git new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/hash_input.json b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/hash_input.json new file mode 100644 index 0000000000000000000000000000000000000000..7a33b6b638d9e60b28369fd2a4b57c3e1a2f21d0 --- /dev/null +++ b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/hash_input.json @@ -0,0 +1,6 @@ +{ + "target_platform": "linux-64", + "cxx_compiler_version": "11.2.0", + "cxx_compiler": "gxx", + "channel_targets": "defaults" +} \ No newline at end of file diff --git a/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/index.json b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/index.json new file mode 100644 index 0000000000000000000000000000000000000000..1c30d951bcaeaf12c807c48a864efc81bd6d5bff --- /dev/null +++ b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/index.json @@ -0,0 +1,16 @@ +{ + "arch": "x86_64", + "build": "hdb19cb5_0", + "build_number": 0, + "depends": [ + "libgcc-ng >=11.2.0", + "libstdcxx-ng >=11.2.0" + ], + "license": "CC0-1.0", + "license_family": "CC", + "name": "cpp-expected", + "platform": "linux", + "subdir": "linux-64", + "timestamp": 1734039334436, + "version": "1.1.0" +} \ No newline at end of file diff --git a/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/licenses/COPYING b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/licenses/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..0e259d42c996742e9e3cba14c677129b2c1b6311 --- /dev/null +++ b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/licenses/COPYING @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/paths.json b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/paths.json new file mode 100644 index 0000000000000000000000000000000000000000..61a99e1b497d963a6e6e6aed2e13a1fa976a545b --- /dev/null +++ b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/paths.json @@ -0,0 +1,29 @@ +{ + "paths": [ + { + "_path": "include/tl/expected.hpp", + "path_type": "hardlink", + "sha256": "5a6a46da2e46ee3360bd8fbd759affefc46b8bfd6295043262ec867acac1fa14", + "size_in_bytes": 92778 + }, + { + "_path": "share/cmake/tl-expected/tl-expected-config-version.cmake", + "path_type": "hardlink", + "sha256": "8b952c9ac0e5f4fff1f17904d1d19aaa6e798a409a31d07295bc531bd3b65286", + "size_in_bytes": 2303 + }, + { + "_path": "share/cmake/tl-expected/tl-expected-config.cmake", + "path_type": "hardlink", + "sha256": "e81d5d1be789466fbf2bebff6818ac0879ccf13ef5f4e4566f91f1cfd47e0f08", + "size_in_bytes": 949 + }, + { + "_path": "share/cmake/tl-expected/tl-expected-targets.cmake", + "path_type": "hardlink", + "sha256": "12df027652c6538628992b5be395af1a7d144199ac103d66e88ca0939d474721", + "size_in_bytes": 4054 + } + ], + "paths_version": 1 +} \ No newline at end of file diff --git a/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/recipe/LICENSE b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/recipe/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..0e259d42c996742e9e3cba14c677129b2c1b6311 --- /dev/null +++ b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/recipe/LICENSE @@ -0,0 +1,121 @@ +Creative Commons Legal Code + +CC0 1.0 Universal + + CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE + LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN + ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS + INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES + REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS + PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM + THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED + HEREUNDER. + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator +and subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for +the purpose of contributing to a commons of creative, cultural and +scientific works ("Commons") that the public can reliably and without fear +of later claims of infringement build upon, modify, incorporate in other +works, reuse and redistribute as freely as possible in any form whatsoever +and for any purposes, including without limitation commercial purposes. +These owners may contribute to the Commons to promote the ideal of a free +culture and the further production of creative, cultural and scientific +works, or to gain reputation or greater distribution for their Work in +part through the use and efforts of others. + +For these and/or other purposes and motivations, and without any +expectation of additional consideration or compensation, the person +associating CC0 with a Work (the "Affirmer"), to the extent that he or she +is an owner of Copyright and Related Rights in the Work, voluntarily +elects to apply CC0 to the Work and publicly distribute the Work under its +terms, with knowledge of his or her Copyright and Related Rights in the +Work and the meaning and intended legal effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not +limited to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, + communicate, and translate a Work; + ii. moral rights retained by the original author(s) and/or performer(s); +iii. publicity and privacy rights pertaining to a person's image or + likeness depicted in a Work; + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + v. rights protecting the extraction, dissemination, use and reuse of data + in a Work; + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation + thereof, including any amended or successor version of such + directive); and +vii. other similar, equivalent or corresponding rights throughout the + world based on applicable law or treaty, and any national + implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention +of, applicable law, Affirmer hereby overtly, fully, permanently, +irrevocably and unconditionally waives, abandons, and surrenders all of +Affirmer's Copyright and Related Rights and associated claims and causes +of action, whether now known or unknown (including existing as well as +future claims and causes of action), in the Work (i) in all territories +worldwide, (ii) for the maximum duration provided by applicable law or +treaty (including future time extensions), (iii) in any current or future +medium and for any number of copies, and (iv) for any purpose whatsoever, +including without limitation commercial, advertising or promotional +purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each +member of the public at large and to the detriment of Affirmer's heirs and +successors, fully intending that such Waiver shall not be subject to +revocation, rescission, cancellation, termination, or any other legal or +equitable action to disrupt the quiet enjoyment of the Work by the public +as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason +be judged legally invalid or ineffective under applicable law, then the +Waiver shall be preserved to the maximum extent permitted taking into +account Affirmer's express Statement of Purpose. In addition, to the +extent the Waiver is so judged Affirmer hereby grants to each affected +person a royalty-free, non transferable, non sublicensable, non exclusive, +irrevocable and unconditional license to exercise Affirmer's Copyright and +Related Rights in the Work (i) in all territories worldwide, (ii) for the +maximum duration provided by applicable law or treaty (including future +time extensions), (iii) in any current or future medium and for any number +of copies, and (iv) for any purpose whatsoever, including without +limitation commercial, advertising or promotional purposes (the +"License"). The License shall be deemed effective as of the date CC0 was +applied by Affirmer to the Work. Should any part of the License for any +reason be judged legally invalid or ineffective under applicable law, such +partial invalidity or ineffectiveness shall not invalidate the remainder +of the License, and in such case Affirmer hereby affirms that he or she +will not (i) exercise any of his or her remaining Copyright and Related +Rights in the Work or (ii) assert any associated claims and causes of +action with respect to the Work, in either case contrary to Affirmer's +express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + b. Affirmer offers the Work as-is and makes no representations or + warranties of any kind concerning the Work, express, implied, + statutory or otherwise, including without limitation warranties of + title, merchantability, fitness for a particular purpose, non + infringement, or the absence of latent or other defects, accuracy, or + the present or absence of errors, whether or not discoverable, all to + the greatest extent permissible under applicable law. + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without + limitation any person's Copyright and Related Rights in the Work. + Further, Affirmer disclaims responsibility for obtaining any necessary + consents, permissions or other rights required for any use of the + Work. + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to + this CC0 or use of the Work. diff --git a/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/recipe/bld.bat b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/recipe/bld.bat new file mode 100644 index 0000000000000000000000000000000000000000..97950f114a736c12412e67042e314f458ca469c1 --- /dev/null +++ b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/recipe/bld.bat @@ -0,0 +1,24 @@ +:: cmd + +:: Isolate the build. +mkdir Build +cd Build +if errorlevel 1 exit 1 + +:: Generate the build files. +cmake .. -G"Ninja" %CMAKE_ARGS% ^ + -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^ + -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ + -DCMAKE_BUILD_TYPE=Release + +:: Build. +ninja +if errorlevel 1 exit 1 + +:: Run tests. +.\tl-expected-tests +if errorlevel 1 exit 1 + +:: Install. +ninja install +if errorlevel 1 exit 1 diff --git a/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/recipe/build.sh b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/recipe/build.sh new file mode 100644 index 0000000000000000000000000000000000000000..d052b61462c8e604a23886ea369beadffa261835 --- /dev/null +++ b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/recipe/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Isolate the build. +mkdir -p Build +cd Build || exit 1 + +# Generate the build files. +cmake .. -G"Ninja" ${CMAKE_ARGS} \ + -DCMAKE_PREFIX_PATH=$PREFIX \ + -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_BUILD_TYPE=Release + +# Build. +ninja || exit 1 + +# Run tests. +./tl-expected-tests || exit 1 + +# Build and install. +ninja install || exit 1 diff --git a/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/recipe/catch.hpp b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/recipe/catch.hpp new file mode 100644 index 0000000000000000000000000000000000000000..07efa655e8748a3c30a546a3213914340a95e8d4 --- /dev/null +++ b/miniconda3/pkgs/cpp-expected-1.1.0-hdb19cb5_0/info/recipe/catch.hpp @@ -0,0 +1,17969 @@ +/* + * Catch v2.13.9 + * Generated: 2022-04-12 22:37:23.260201 + * ---------------------------------------------------------- + * This file has been merged from multiple headers. Please don't edit it directly + * Copyright (c) 2022 Two Blue Cubes Ltd. All rights reserved. + * + * Distributed under the Boost Software License, Version 1.0. (See accompanying + * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED +#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED +// start catch.hpp + + +#define CATCH_VERSION_MAJOR 2 +#define CATCH_VERSION_MINOR 13 +#define CATCH_VERSION_PATCH 9 + +#ifdef __clang__ +# pragma clang system_header +#elif defined __GNUC__ +# pragma GCC system_header +#endif + +// start catch_suppress_warnings.h + +#ifdef __clang__ +# ifdef __ICC // icpc defines the __clang__ macro +# pragma warning(push) +# pragma warning(disable: 161 1682) +# else // __ICC +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wpadded" +# pragma clang diagnostic ignored "-Wswitch-enum" +# pragma clang diagnostic ignored "-Wcovered-switch-default" +# endif +#elif defined __GNUC__ + // Because REQUIREs trigger GCC's -Wparentheses, and because still + // supported version of g++ have only buggy support for _Pragmas, + // Wparentheses have to be suppressed globally. +# pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details + +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wunused-variable" +# pragma GCC diagnostic ignored "-Wpadded" +#endif +// end catch_suppress_warnings.h +#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER) +# define CATCH_IMPL +# define CATCH_CONFIG_ALL_PARTS +#endif + +// In the impl file, we want to have access to all parts of the headers +// Can also be used to sanely support PCHs +#if defined(CATCH_CONFIG_ALL_PARTS) +# define CATCH_CONFIG_EXTERNAL_INTERFACES +# if defined(CATCH_CONFIG_DISABLE_MATCHERS) +# undef CATCH_CONFIG_DISABLE_MATCHERS +# endif +# if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER) +# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER +# endif +#endif + +#if !defined(CATCH_CONFIG_IMPL_ONLY) +// start catch_platform.h + +// See e.g.: +// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html +#ifdef __APPLE__ +# include +# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \ + (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1) +# define CATCH_PLATFORM_MAC +# elif (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1) +# define CATCH_PLATFORM_IPHONE +# endif + +#elif defined(linux) || defined(__linux) || defined(__linux__) +# define CATCH_PLATFORM_LINUX + +#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__) +# define CATCH_PLATFORM_WINDOWS +#endif + +// end catch_platform.h + +#ifdef CATCH_IMPL +# ifndef CLARA_CONFIG_MAIN +# define CLARA_CONFIG_MAIN_NOT_DEFINED +# define CLARA_CONFIG_MAIN +# endif +#endif + +// start catch_user_interfaces.h + +namespace Catch { + unsigned int rngSeed(); +} + +// end catch_user_interfaces.h +// start catch_tag_alias_autoregistrar.h + +// start catch_common.h + +// start catch_compiler_capabilities.h + +// Detect a number of compiler features - by compiler +// The following features are defined: +// +// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported? +// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported? +// CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported? +// CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled? +// **************** +// Note to maintainers: if new toggles are added please document them +// in configuration.md, too +// **************** + +// In general each macro has a _NO_ form +// (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature. +// Many features, at point of detection, define an _INTERNAL_ macro, so they +// can be combined, en-mass, with the _NO_ forms later. + +#ifdef __cplusplus + +# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) +# define CATCH_CPP14_OR_GREATER +# endif + +# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) +# define CATCH_CPP17_OR_GREATER +# endif + +#endif + +// Only GCC compiler should be used in this block, so other compilers trying to +// mask themselves as GCC should be ignored. +#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) && !defined(__LCC__) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" ) + +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) + +#endif + +#if defined(__clang__) + +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" ) + +// As of this writing, IBM XL's implementation of __builtin_constant_p has a bug +// which results in calls to destructors being emitted for each temporary, +// without a matching initialization. In practice, this can result in something +// like `std::string::~string` being called on an uninitialized value. +// +// For example, this code will likely segfault under IBM XL: +// ``` +// REQUIRE(std::string("12") + "34" == "1234") +// ``` +// +// Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented. +# if !defined(__ibmxl__) && !defined(__CUDACC__) +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */ +# endif + +# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \ + _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"") + +# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wparentheses\"" ) + +# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" ) + +# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" ) + +# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \ + _Pragma( "clang diagnostic ignored \"-Wunused-template\"" ) + +#endif // __clang__ + +//////////////////////////////////////////////////////////////////////////////// +// Assume that non-Windows platforms support posix signals by default +#if !defined(CATCH_PLATFORM_WINDOWS) + #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS +#endif + +//////////////////////////////////////////////////////////////////////////////// +// We know some environments not to support full POSIX signals +#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__) + #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +#endif + +#ifdef __OS400__ +# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS +# define CATCH_CONFIG_COLOUR_NONE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Android somehow still does not support std::to_string +#if defined(__ANDROID__) +# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING +# define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Not all Windows environments support SEH properly +#if defined(__MINGW32__) +# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH +#endif + +//////////////////////////////////////////////////////////////////////////////// +// PS4 +#if defined(__ORBIS__) +# define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE +#endif + +//////////////////////////////////////////////////////////////////////////////// +// Cygwin +#ifdef __CYGWIN__ + +// Required for some versions of Cygwin to declare gettimeofday +// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin +# define _BSD_SOURCE +// some versions of cygwin (most) do not support std::to_string. Use the libstd check. +// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813 +# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \ + && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF)) + +# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING + +# endif +#endif // __CYGWIN__ + +//////////////////////////////////////////////////////////////////////////////// +// Visual C++ +#if defined(_MSC_VER) + +// Universal Windows platform does not support SEH +// Or console colours (or console at all...) +# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) +# define CATCH_CONFIG_COLOUR_NONE +# else +# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH +# endif + +# if !defined(__clang__) // Handle Clang masquerading for msvc + +// MSVC traditional preprocessor needs some workaround for __VA_ARGS__ +// _MSVC_TRADITIONAL == 0 means new conformant preprocessor +// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor +# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL) +# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +# endif // MSVC_TRADITIONAL + +// Only do this if we're not using clang on Windows, which uses `diagnostic push` & `diagnostic pop` +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) ) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) ) +# endif // __clang__ + +#endif // _MSC_VER + +#if defined(_REENTRANT) || defined(_MSC_VER) +// Enable async processing, as -pthread is specified or no additional linking is required +# define CATCH_INTERNAL_CONFIG_USE_ASYNC +#endif // _MSC_VER + +//////////////////////////////////////////////////////////////////////////////// +// Check if we are compiled with -fno-exceptions or equivalent +#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND) +# define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED +#endif + +//////////////////////////////////////////////////////////////////////////////// +// DJGPP +#ifdef __DJGPP__ +# define CATCH_INTERNAL_CONFIG_NO_WCHAR +#endif // __DJGPP__ + +//////////////////////////////////////////////////////////////////////////////// +// Embarcadero C++Build +#if defined(__BORLANDC__) + #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN +#endif + +//////////////////////////////////////////////////////////////////////////////// + +// Use of __COUNTER__ is suppressed during code analysis in +// CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly +// handled by it. +// Otherwise all supported compilers support COUNTER macro, +// but user still might want to turn it off +#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L ) + #define CATCH_INTERNAL_CONFIG_COUNTER +#endif + +//////////////////////////////////////////////////////////////////////////////// + +// RTX is a special version of Windows that is real time. +// This means that it is detected as Windows, but does not provide +// the same set of capabilities as real Windows does. +#if defined(UNDER_RTSS) || defined(RTX64_BUILD) + #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH + #define CATCH_INTERNAL_CONFIG_NO_ASYNC + #define CATCH_CONFIG_COLOUR_NONE +#endif + +#if !defined(_GLIBCXX_USE_C99_MATH_TR1) +#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER +#endif + +// Various stdlib support checks that require __has_include +#if defined(__has_include) + // Check if string_view is available and usable + #if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW + #endif + + // Check if optional is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) + + // Check if byte is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # include + # if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0) + # define CATCH_INTERNAL_CONFIG_CPP17_BYTE + # endif + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) + + // Check if variant is available and usable + # if __has_include() && defined(CATCH_CPP17_OR_GREATER) + # if defined(__clang__) && (__clang_major__ < 8) + // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852 + // fix should be in clang 8, workaround in libstdc++ 8.2 + # include + # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) + # define CATCH_CONFIG_NO_CPP17_VARIANT + # else + # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT + # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9) + # else + # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT + # endif // defined(__clang__) && (__clang_major__ < 8) + # endif // __has_include() && defined(CATCH_CPP17_OR_GREATER) +#endif // defined(__has_include) + +#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER) +# define CATCH_CONFIG_COUNTER +#endif +#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH) +# define CATCH_CONFIG_WINDOWS_SEH +#endif +// This is set by default, because we assume that unix compilers are posix-signal-compatible by default. +#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS) +# define CATCH_CONFIG_POSIX_SIGNALS +#endif +// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions. +#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR) +# define CATCH_CONFIG_WCHAR +#endif + +#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING) +# define CATCH_CONFIG_CPP11_TO_STRING +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL) +# define CATCH_CONFIG_CPP17_OPTIONAL +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW) +# define CATCH_CONFIG_CPP17_STRING_VIEW +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT) +# define CATCH_CONFIG_CPP17_VARIANT +#endif + +#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE) +# define CATCH_CONFIG_CPP17_BYTE +#endif + +#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT) +# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE +#endif + +#if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE) +# define CATCH_CONFIG_NEW_CAPTURE +#endif + +#if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) +# define CATCH_CONFIG_DISABLE_EXCEPTIONS +#endif + +#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN) +# define CATCH_CONFIG_POLYFILL_ISNAN +#endif + +#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC) +# define CATCH_CONFIG_USE_ASYNC +#endif + +#if defined(CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_NO_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_ANDROID_LOGWRITE) +# define CATCH_CONFIG_ANDROID_LOGWRITE +#endif + +#if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER) +# define CATCH_CONFIG_GLOBAL_NEXTAFTER +#endif + +// Even if we do not think the compiler has that warning, we still have +// to provide a macro that can be used by the code. +#if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION) +# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION +#endif +#if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION) +# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS +#endif +#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS +#endif + +// The goal of this macro is to avoid evaluation of the arguments, but +// still have the compiler warn on problems inside... +#if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN) +# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) +#endif + +#if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10) +# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#elif defined(__clang__) && (__clang_major__ < 5) +# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#endif + +#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS) +# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS +#endif + +#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) +#define CATCH_TRY if ((true)) +#define CATCH_CATCH_ALL if ((false)) +#define CATCH_CATCH_ANON(type) if ((false)) +#else +#define CATCH_TRY try +#define CATCH_CATCH_ALL catch (...) +#define CATCH_CATCH_ANON(type) catch (type) +#endif + +#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) +#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#endif + +// end catch_compiler_capabilities.h +#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line +#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) +#ifdef CATCH_CONFIG_COUNTER +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ ) +#else +# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ ) +#endif + +#include +#include +#include + +// We need a dummy global operator<< so we can bring it into Catch namespace later +struct Catch_global_namespace_dummy {}; +std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy); + +namespace Catch { + + struct CaseSensitive { enum Choice { + Yes, + No + }; }; + + class NonCopyable { + NonCopyable( NonCopyable const& ) = delete; + NonCopyable( NonCopyable && ) = delete; + NonCopyable& operator = ( NonCopyable const& ) = delete; + NonCopyable& operator = ( NonCopyable && ) = delete; + + protected: + NonCopyable(); + virtual ~NonCopyable(); + }; + + struct SourceLineInfo { + + SourceLineInfo() = delete; + SourceLineInfo( char const* _file, std::size_t _line ) noexcept + : file( _file ), + line( _line ) + {} + + SourceLineInfo( SourceLineInfo const& other ) = default; + SourceLineInfo& operator = ( SourceLineInfo const& ) = default; + SourceLineInfo( SourceLineInfo&& ) noexcept = default; + SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default; + + bool empty() const noexcept { return file[0] == '\0'; } + bool operator == ( SourceLineInfo const& other ) const noexcept; + bool operator < ( SourceLineInfo const& other ) const noexcept; + + char const* file; + std::size_t line; + }; + + std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ); + + // Bring in operator<< from global namespace into Catch namespace + // This is necessary because the overload of operator<< above makes + // lookup stop at namespace Catch + using ::operator<<; + + // Use this in variadic streaming macros to allow + // >> +StreamEndStop + // as well as + // >> stuff +StreamEndStop + struct StreamEndStop { + std::string operator+() const; + }; + template + T const& operator + ( T const& value, StreamEndStop ) { + return value; + } +} + +#define CATCH_INTERNAL_LINEINFO \ + ::Catch::SourceLineInfo( __FILE__, static_cast( __LINE__ ) ) + +// end catch_common.h +namespace Catch { + + struct RegistrarForTagAliases { + RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ); + }; + +} // end namespace Catch + +#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \ + CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \ + CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ + namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \ + CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION + +// end catch_tag_alias_autoregistrar.h +// start catch_test_registry.h + +// start catch_interfaces_testcase.h + +#include + +namespace Catch { + + class TestSpec; + + struct ITestInvoker { + virtual void invoke () const = 0; + virtual ~ITestInvoker(); + }; + + class TestCase; + struct IConfig; + + struct ITestCaseRegistry { + virtual ~ITestCaseRegistry(); + virtual std::vector const& getAllTests() const = 0; + virtual std::vector const& getAllTestsSorted( IConfig const& config ) const = 0; + }; + + bool isThrowSafe( TestCase const& testCase, IConfig const& config ); + bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ); + std::vector filterTests( std::vector const& testCases, TestSpec const& testSpec, IConfig const& config ); + std::vector const& getAllTestCasesSorted( IConfig const& config ); + +} + +// end catch_interfaces_testcase.h +// start catch_stringref.h + +#include +#include +#include +#include + +namespace Catch { + + /// A non-owning string class (similar to the forthcoming std::string_view) + /// Note that, because a StringRef may be a substring of another string, + /// it may not be null terminated. + class StringRef { + public: + using size_type = std::size_t; + using const_iterator = const char*; + + private: + static constexpr char const* const s_empty = ""; + + char const* m_start = s_empty; + size_type m_size = 0; + + public: // construction + constexpr StringRef() noexcept = default; + + StringRef( char const* rawChars ) noexcept; + + constexpr StringRef( char const* rawChars, size_type size ) noexcept + : m_start( rawChars ), + m_size( size ) + {} + + StringRef( std::string const& stdString ) noexcept + : m_start( stdString.c_str() ), + m_size( stdString.size() ) + {} + + explicit operator std::string() const { + return std::string(m_start, m_size); + } + + public: // operators + auto operator == ( StringRef const& other ) const noexcept -> bool; + auto operator != (StringRef const& other) const noexcept -> bool { + return !(*this == other); + } + + auto operator[] ( size_type index ) const noexcept -> char { + assert(index < m_size); + return m_start[index]; + } + + public: // named queries + constexpr auto empty() const noexcept -> bool { + return m_size == 0; + } + constexpr auto size() const noexcept -> size_type { + return m_size; + } + + // Returns the current start pointer. If the StringRef is not + // null-terminated, throws std::domain_exception + auto c_str() const -> char const*; + + public: // substrings and searches + // Returns a substring of [start, start + length). + // If start + length > size(), then the substring is [start, size()). + // If start > size(), then the substring is empty. + auto substr( size_type start, size_type length ) const noexcept -> StringRef; + + // Returns the current start pointer. May not be null-terminated. + auto data() const noexcept -> char const*; + + constexpr auto isNullTerminated() const noexcept -> bool { + return m_start[m_size] == '\0'; + } + + public: // iterators + constexpr const_iterator begin() const { return m_start; } + constexpr const_iterator end() const { return m_start + m_size; } + }; + + auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&; + auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&; + + constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef { + return StringRef( rawChars, size ); + } +} // namespace Catch + +constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef { + return Catch::StringRef( rawChars, size ); +} + +// end catch_stringref.h +// start catch_preprocessor.hpp + + +#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__ +#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__))) +#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__))) + +#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__ +// MSVC needs more evaluations +#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__))) +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__)) +#else +#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__) +#endif + +#define CATCH_REC_END(...) +#define CATCH_REC_OUT + +#define CATCH_EMPTY() +#define CATCH_DEFER(id) id CATCH_EMPTY() + +#define CATCH_REC_GET_END2() 0, CATCH_REC_END +#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2 +#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1 +#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT +#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0) +#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next) + +#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ ) + +#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ ) +#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ ) + +// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results, +// and passes userdata as the first parameter to each invocation, +// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c) +#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) + +#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) +#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ +#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ +#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__) +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) +#else +// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF +#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__) +#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__ +#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1) +#endif + +#define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__ +#define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name) + +#define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) + +#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR +#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper()) +#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) +#else +#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper())) +#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))) +#endif + +#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\ + CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__) + +#define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0) +#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1) +#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2) +#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3) +#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4) +#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5) +#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _3, _4, _5, _6) +#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7) +#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8) +#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9) +#define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10) + +#define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N + +#define INTERNAL_CATCH_TYPE_GEN\ + template struct TypeList {};\ + template\ + constexpr auto get_wrapper() noexcept -> TypeList { return {}; }\ + template class...> struct TemplateTypeList{};\ + template class...Cs>\ + constexpr auto get_wrapper() noexcept -> TemplateTypeList { return {}; }\ + template\ + struct append;\ + template\ + struct rewrap;\ + template class, typename...>\ + struct create;\ + template class, typename>\ + struct convert;\ + \ + template \ + struct append { using type = T; };\ + template< template class L1, typename...E1, template class L2, typename...E2, typename...Rest>\ + struct append, L2, Rest...> { using type = typename append, Rest...>::type; };\ + template< template class L1, typename...E1, typename...Rest>\ + struct append, TypeList, Rest...> { using type = L1; };\ + \ + template< template class Container, template class List, typename...elems>\ + struct rewrap, List> { using type = TypeList>; };\ + template< template class Container, template class List, class...Elems, typename...Elements>\ + struct rewrap, List, Elements...> { using type = typename append>, typename rewrap, Elements...>::type>::type; };\ + \ + template