repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
conda | conda/auxlib/collection.py | .py | """Common collection classes."""
from functools import reduce
from collections.abc import Mapping, Set
from frozendict import frozendict
from ..deprecations import deprecated
from ..common.compat import isiterable
# http://stackoverflow.com/a/14620633/2127762
class AttrDict(dict):
"""Sub-classes dict, and furth... | 63 | 1,941 |
conda | conda/auxlib/decorators.py | .py | from collections.abc import Hashable
from types import GeneratorType
from functools import wraps
# TODO: spend time filling out functionality and make these more robust
def memoizemethod(method):
"""
Decorator to cause a method to cache it's results in self for each
combination of inputs and return the... | 217 | 6,388 |
conda | conda/auxlib/compat.py | .py | from collections import OrderedDict as odict # noqa: F401
import os
from shlex import split
from ..deprecations import deprecated
@deprecated("26.3", "26.9", addendum="Use `conda.common.compat.isiterable` instead.")
def isiterable(obj):
# and not a string
from collections.abc import Iterable
return not ... | 44 | 1,352 |
conda | conda/auxlib/ish.py | .py | from logging import getLogger
from textwrap import dedent
log = getLogger(__name__)
def dals(string):
"""dedent and left-strip"""
return dedent(string).lstrip()
def _get_attr(obj, attr_name, aliases=()):
try:
return getattr(obj, attr_name)
except AttributeError:
for alias in aliases... | 66 | 1,964 |
conda | conda/auxlib/type_coercion.py | .py | """Collection of functions to coerce conversion of types with an intelligent guess."""
from __future__ import annotations
from collections.abc import Mapping
from enum import Enum
from itertools import chain
from re import IGNORECASE, compile
from typing import TYPE_CHECKING
from ..deprecations import deprecated
fro... | 273 | 8,936 |
conda | conda/auxlib/entity.py | .py | """
This module provides serializable, validatable, type-enforcing domain objects and data
transfer objects. It has many of the same motivations as the python
`Marshmallow <http://marshmallow.readthedocs.org/en/latest/why.html>`_ package. It is most
similar to `Schematics <http://schematics.readthedocs.io/>`_.
=======... | 983 | 33,626 |
conda | conda/models/match_spec.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Implements the query language for conda packages (a.k.a, MatchSpec).
The MatchSpec is the conda package specification (e.g. `conda==23.3`, `python<3.7`,
`cryptography * *_0`) and is used to communicate the desired packages to install.
"""
f... | 1,688 | 62,430 |
conda | conda/models/channel.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Defines Channel and MultiChannel objects and other channel-related functions.
Object inheritance:
.. autoapi-inheritance-diagram:: Channel MultiChannel
:top-classes: conda.models.channel.Channel
:parts: 1
"""
from __future__ import a... | 754 | 24,874 |
conda | conda/models/package_info.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""(Legacy) Low-level implementation of a PackageRecord."""
from logging import getLogger
from ..auxlib.entity import (
ComposableField,
Entity,
EnumField,
ImmutableEntity,
IntegerField,
ListField,
StringField,
)
fr... | 81 | 2,257 |
conda | conda/models/environment.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""EXPERIMENTAL Conda environment data model"""
from __future__ import annotations
from dataclasses import dataclass, field, fields, replace
from functools import reduce
from itertools import chain
from logging import getLogger
from typing imp... | 682 | 25,160 |
conda | conda/models/records.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Implements the data model for conda packages.
A PackageRecord is the record of a package present in a channel. A PackageCache is the record of a
downloaded and cached package. A PrefixRecord is the record of a package installed into a conda
... | 751 | 25,624 |
conda | conda/models/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Models are data transfer objects or "light-weight" domain objects with no appreciable logic
other than their own validation. Models are used to pass data between layers of the stack. In
many ways they are similar to ORM objects. Unlike ORM ... | 17 | 685 |
conda | conda/models/dist.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""(Legacy) Low-level implementation of a Channel."""
import re
from logging import getLogger
from typing import NamedTuple
from .. import CondaError
from ..auxlib.entity import Entity, EntityType, IntegerField, StringField
from ..base.constan... | 376 | 12,093 |
conda | conda/models/version.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Implements the version spec with parsing and comparison logic.
Object inheritance:
.. autoapi-inheritance-diagram:: BaseSpec VersionSpec BuildNumberMatch
:top-classes: conda.models.version.BaseSpec
:parts: 1
"""
from __future__ impor... | 716 | 26,234 |
conda | conda/models/enums.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Collection of enums used throughout conda."""
import sys
import sysconfig
from enum import Enum
from platform import machine
from ..auxlib.decorators import classproperty
from ..auxlib.ish import dals
from ..auxlib.type_coercion import Type... | 197 | 5,380 |
conda | conda/models/prefix_graph.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Implements directed graphs to sort and manipulate packages within a prefix.
Object inheritance:
.. autoapi-inheritance-diagram:: PrefixGraph GeneralGraph
:top-classes: conda.models.prefix_graph.PrefixGraph
:parts: 1
"""
from __future... | 467 | 17,510 |
conda | conda/env/pip_util.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Functions related to core conda functionality that relates to pip
NOTE: This modules used to in conda, as conda/pip.py
"""
import os
import re
import sys
from logging import getLogger
from ..base.context import context
from ..common.compa... | 70 | 2,092 |
conda | conda/env/env.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Environment object describing the conda environment.yaml file."""
from __future__ import annotations
import os
import re
from itertools import chain
from typing import TYPE_CHECKING
from ..base.context import context
from ..cli import comm... | 478 | 14,892 |
conda | conda/env/specs/requirements.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Define requirements.txt spec."""
from __future__ import annotations
import os
from ...base.context import context
from ...common.url import is_url
from ...exceptions import CondaValueError, InvalidMatchSpec, PluginError
from ...gateways.di... | 95 | 3,119 |
conda | conda/env/specs/explicit.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Define explicit spec."""
from __future__ import annotations
from ...base.constants import EXPLICIT_MARKER
from ...base.context import context
from ...exceptions import CondaValueError, PluginError
from ...gateways.disk.read import yield_lin... | 76 | 2,463 |
conda | conda/env/specs/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
from ...base.context import context
from ...exceptions import (
EnvironmentSpecPluginNotDetected,
SpecNotFound,
)
if TYPE_CHECKING:
from .requirements import Requ... | 36 | 960 |
conda | conda/env/specs/yaml_file.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Define YAML spec."""
from __future__ import annotations
from logging import getLogger
from typing import TYPE_CHECKING
from ...common.serialize import yaml
from ...deprecations import deprecated
from ...exceptions import CondaValueError, P... | 75 | 2,364 |
conda | conda/env/specs/cep_24.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Define cep-0024 compliant YAML spec."""
from __future__ import annotations
from logging import getLogger
from typing import TYPE_CHECKING
from ...common.io import dashlist
from ...common.serialize import yaml
from ...exceptions import Cond... | 59 | 1,643 |
conda | conda/env/installers/conda.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Conda-flavored installer."""
from __future__ import annotations
import tempfile
from os.path import basename
from typing import TYPE_CHECKING
from ...base.constants import UpdateModifier
from ...base.context import context
from ...common.c... | 141 | 5,076 |
conda | conda/env/installers/base.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Dynamic installer loading."""
import importlib
from ...exceptions import InvalidInstaller
def get_installer(name, *, file=None):
"""Load the environment installer module for the given name.
Args:
name: Installer name (e.g... | 24 | 677 |
conda | conda/env/installers/pip.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Pip-flavored installer."""
import os
import os.path as op
from logging import getLogger
from ...auxlib.compat import Utf8NamedTemporaryFile
from ...env.pip_util import get_pip_installed_packages, get_pip_workdir, pip_subprocess
from ...repo... | 74 | 2,678 |
conda | conda/plugins/types.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Definition of specific return types for use when defining a conda plugin hook.
Each type corresponds to the plugin hook for which it is used.
"""
from __future__ import annotations
import enum
import os
from abc import ABC, abstractmetho... | 990 | 33,752 |
conda | conda/plugins/manager.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
This module contains a subclass implementation of pluggy's
`PluginManager <https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluginManager>`_.
Additionally, it contains a function we use to construct the ``PluginManager`` ob... | 1,396 | 50,935 |
conda | conda/plugins/solvers.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Register the classic conda solver."""
from ..base.constants import CLASSIC_SOLVER
from . import hookimpl
from .types import CondaSolver
@hookimpl(tryfirst=True) # make sure the classic solver can't be overwritten
def conda_solvers():
... | 19 | 496 |
conda | conda/plugins/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
In this module, you will find everything relevant to conda's plugin system.
It contains all of the code that plugin authors will use to write plugins,
as well as conda's internal implementations of plugins.
**Modules relevant for plugin aut... | 73 | 2,240 |
conda | conda/plugins/config.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Handles plugin configuration functionality including:
- Managing plugin-specific settings
- Processing configuration data from various sources
- Dynamically adding and removing plugin settings
- Providing a standardized interface for... | 133 | 4,392 |
conda | conda/plugins/previews.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Built-in plugin hooks for opt-in preview features."""
from __future__ import annotations
from typing import TYPE_CHECKING
from ..base.context import context
from . import hookimpl
if TYPE_CHECKING:
from .types import CondaSubcommand
... | 37 | 1,095 |
conda | conda/plugins/hookspec.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Pluggy hook specifications ("hookspecs") to register conda plugins.
Each hookspec defined in :class:`~conda.plugins.hookspec.CondaSpecs` contains
an example of how to use it.
"""
from __future__ import annotations
from typing import TYPE... | 935 | 30,223 |
conda | conda/plugins/environment_exporters/explicit.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Built-in conda explicit environment exporter plugin.
This module implements the explicit format defined in CEP 23:
Files with @EXPLICIT marker and package URLs for reproducible installs.
"""
from __future__ import annotations
from typing i... | 97 | 3,727 |
conda | conda/plugins/environment_exporters/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Built-in conda environment exporter plugins."""
from . import environment_yml, explicit, requirements_txt
plugins = [environment_yml, explicit, requirements_txt]
"""The list of environment exporter plugins for easier registration with plugg... | 9 | 326 |
conda | conda/plugins/environment_exporters/environment_yml.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Built-in conda standard environment exporter plugins (YAML and JSON)."""
from __future__ import annotations
from typing import TYPE_CHECKING, Literal
from ...common.serialize import json, yaml
from ...exceptions import CondaValueError
from... | 119 | 3,878 |
conda | conda/plugins/environment_exporters/requirements_txt.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Built-in conda requirements environment exporter plugin.
This module implements the requirements format defined in CEP 23:
Files with MatchSpec strings (no @EXPLICIT marker) for flexible package specifications.
"""
from __future__ import an... | 65 | 2,267 |
conda | conda/plugins/environment_specifiers/explicit.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
**EXPERIMENTAL**
Register the conda env spec for explicit files.
"""
from .. import hookimpl
from ..types import CondaEnvironmentSpecifier, EnvironmentFormat
@hookimpl
def conda_environment_specifiers():
from ...env.specs.explicit imp... | 23 | 626 |
conda | conda/plugins/environment_specifiers/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Register the built-in environment specifier hook implementations."""
from . import cep_24, environment_yml, explicit, requirements_txt
plugins = [cep_24, requirements_txt, environment_yml, explicit]
"""The list of environment specifier plug... | 9 | 364 |
conda | conda/plugins/environment_specifiers/environment_yml.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
**EXPERIMENTAL**
Register the conda env spec for environment.yml files.
"""
from .. import hookimpl
from ..types import CondaEnvironmentSpecifier
@hookimpl(tryfirst=True)
def conda_environment_specifiers():
from ...env.specs.yaml_file... | 22 | 604 |
conda | conda/plugins/environment_specifiers/requirements_txt.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
**EXPERIMENTAL**
Register the conda env spec for requirements.txt files.
"""
from .. import hookimpl
from ..types import CondaEnvironmentSpecifier
@hookimpl
def conda_environment_specifiers():
from ...env.specs.requirements import Req... | 23 | 624 |
conda | conda/plugins/environment_specifiers/cep_24.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
**EXPERIMENTAL**
Register the conda env spec for environment.yml files.
"""
from .. import hookimpl
from ..types import CondaEnvironmentSpecifier
@hookimpl(tryfirst=True)
def conda_environment_specifiers():
from ...env.specs.cep_24 im... | 23 | 641 |
conda | conda/plugins/post_solves/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Register the built-in post_solves hook implementations."""
plugins = []
"""The list of post-solve plugins for easier registration with pluggy."""
| 7 | 225 |
conda | conda/plugins/virtual_packages/freebsd.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Detect whether this is FeeBSD."""
from __future__ import annotations
from typing import TYPE_CHECKING
from ...base.context import context
from .. import hookimpl
from ..types import CondaVirtualPackage
if TYPE_CHECKING:
from collectio... | 29 | 708 |
conda | conda/plugins/virtual_packages/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from . import archspec, conda, cuda, freebsd, linux, osx, windows
plugins = [archspec, conda, cuda, freebsd, linux, osx, windows]
"""The list of virtual package plugins for easier registration with pluggy."""... | 9 | 321 |
conda | conda/plugins/virtual_packages/archspec.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Detect archspec name."""
from __future__ import annotations
from typing import TYPE_CHECKING
from ...auxlib import NULL
from .. import hookimpl
from ..types import CondaVirtualPackage
if TYPE_CHECKING:
from collections.abc import Iter... | 34 | 782 |
conda | conda/plugins/virtual_packages/conda.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Expose conda version."""
from __future__ import annotations
from typing import TYPE_CHECKING
from .. import hookimpl
from ..types import CondaVirtualPackage
if TYPE_CHECKING:
from collections.abc import Iterable
@hookimpl
def conda_... | 27 | 615 |
conda | conda/plugins/virtual_packages/osx.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Detect whether this is macOS."""
from __future__ import annotations
from typing import TYPE_CHECKING
from ...base.context import context
from .. import hookimpl
from ..types import CondaVirtualPackage
if TYPE_CHECKING:
from collection... | 47 | 1,263 |
conda | conda/plugins/virtual_packages/windows.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Detect whether this is Windows."""
from __future__ import annotations
from typing import TYPE_CHECKING
from ...base.context import context
from .. import hookimpl
from ..types import CondaVirtualPackage
if TYPE_CHECKING:
from collecti... | 39 | 1,048 |
conda | conda/plugins/virtual_packages/cuda.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Detect CUDA version."""
from __future__ import annotations
import ctypes
import functools
import itertools
import multiprocessing
import os
import platform
import warnings
from contextlib import suppress
from typing import TYPE_CHECKING
fr... | 183 | 5,820 |
conda | conda/plugins/virtual_packages/linux.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Detect whether this is Linux."""
from __future__ import annotations
import re
from typing import TYPE_CHECKING
from ...base.context import context
from ...common._os.linux import linux_get_libc_version
from .. import hookimpl
from ..types ... | 77 | 2,534 |
conda | conda/plugins/package_extractors/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Package extractor plugins."""
from . import conda
plugins = [conda]
| 8 | 148 |
conda | conda/plugins/package_extractors/conda.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Package extractor plugin for .conda and .tar.bz2 formats."""
from __future__ import annotations
import os
from logging import getLogger
from os.path import join
from typing import TYPE_CHECKING
from ..._private.extract import extract_cond... | 81 | 2,720 |
conda | conda/plugins/subcommands/doctor/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Implementation for `conda doctor` subcommand.
Adds various environment and package checks to detect issues or possible environment
corruption.
"""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING
from ....... | 143 | 4,584 |
conda | conda/plugins/subcommands/doctor/health_checks/requests_ca_bundle.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Health check: REQUESTS_CA_BUNDLE environment variable."""
from __future__ import annotations
import os
from pathlib import Path
from typing import TYPE_CHECKING
from requests.exceptions import RequestException # noqa: TID253
from .....ba... | 56 | 1,909 |
conda | conda/plugins/subcommands/doctor/health_checks/file_locking.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Health check: File locking support."""
from __future__ import annotations
from typing import TYPE_CHECKING
from .....base.constants import OK_MARK, X_MARK
from .....base.context import context
from .....gateways.disk.lock import locking_su... | 40 | 1,202 |
conda | conda/plugins/subcommands/doctor/health_checks/consistency.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Health check: Environment consistency (dependencies)."""
from __future__ import annotations
from typing import TYPE_CHECKING
from .....base.constants import OK_MARK, X_MARK
from .....base.context import context
from .....cli.install import... | 136 | 4,652 |
conda | conda/plugins/subcommands/doctor/health_checks/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Health checks for `conda doctor`.
This package contains individual health check modules that are registered
via the conda_health_checks plugin hook.
"""
from __future__ import annotations
from . import (
altered_files,
consistency,... | 33 | 656 |
conda | conda/plugins/subcommands/doctor/health_checks/missing_files.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Health check: Missing files in packages."""
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
from .....base.constants import OK_MARK, X_MARK
from .....cli.install import reinstall_packages
from .... | 87 | 3,031 |
conda | conda/plugins/subcommands/doctor/health_checks/environment_txt.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Health check: Environment listed in environments.txt."""
from __future__ import annotations
from logging import getLogger
from pathlib import Path
from typing import TYPE_CHECKING
from .....base.constants import OK_MARK, X_MARK
from .....c... | 87 | 2,769 |
conda | conda/plugins/subcommands/doctor/health_checks/altered_files.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Health check: Altered files in packages."""
from __future__ import annotations
from logging import getLogger
from pathlib import Path
from typing import TYPE_CHECKING
from .....base.constants import OK_MARK, X_MARK
from .....cli.install im... | 126 | 3,907 |
conda | conda/plugins/subcommands/doctor/health_checks/pinned.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Health check: Pinned file format."""
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
from .....base.constants import OK_MARK, PREFIX_PINNED_FILE, X_MARK
from .....common.io import dashlist
from ... | 132 | 4,080 |
conda | conda/plugins/subcommands/plugins/list.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Implementation for `conda plugins list` subcommand."""
from __future__ import annotations
from typing import TYPE_CHECKING
from ....base.context import context
from ....cli.helpers import add_parser_json
from ....common.serialize import js... | 59 | 1,518 |
conda | conda/plugins/subcommands/plugins/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Implementation for `conda plugins` subcommand."""
from __future__ import annotations
from functools import partial
from typing import TYPE_CHECKING
from ... import hookimpl
from ...types import CondaSubcommand
from . import list
if TYPE_C... | 43 | 969 |
conda | conda/plugins/reporter_backends/json.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Defines a JSON reporter backend
This reporter backend is used to provide JSON strings for output rendering. It is
essentially just a wrapper around ``conda.common.serialize.json.dumps``.
"""
from __future__ import annotations
import sys
f... | 136 | 3,552 |
conda | conda/plugins/reporter_backends/console.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Defines a "console" reporter backend.
This reporter backend provides the default output for conda.
"""
from __future__ import annotations
import sys
from errno import EPIPE, ESHUTDOWN
from itertools import cycle
from threading import Even... | 318 | 9,310 |
conda | conda/plugins/prefix_data_loaders/pypi/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Reads PyPI packages in a conda prefix that have been installed with non-conda tools."""
from __future__ import annotations
import sys
import traceback
from logging import getLogger
from pathlib import Path
from typing import TYPE_CHECKING
... | 151 | 6,029 |
conda | conda/plugins/prefix_data_loaders/pypi/pkg_format.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Common Python package format utilities."""
from __future__ import annotations
import platform
import re
import sys
import warnings
from base64 import urlsafe_b64decode
from collections import namedtuple
from configparser import ConfigParser... | 1,304 | 48,840 |
conda | conda/_preview/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Private namespace for conda preview features.
This package contains opt-in preview features that are not yet part of the
stable conda API. Code here may change or be removed across any release without
deprecation notices.
Conventions
------... | 26 | 1,117 |
conda | conda/_preview/env_setup/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Preview feature: env-setup.
Scaffolding for the upcoming Rich CLI and runner facade for create/install/update/remove.
Currently non-operational — all CLI entry points raise ``OperationNotAllowed``.
"""
PREVIEW_LABEL = "env-setup"
| 10 | 312 |
conda | conda/_preview/env_setup/cli/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""CLI modules for the env-setup preview feature."""
| 4 | 128 |
conda | conda/_preview/env_setup/cli/main_install.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""CLI implementation for `conda install` — env-setup preview stub.
This module is part of the ``env-setup`` preview feature. It intercepts
``conda install`` when the preview is enabled and raises ``OperationNotAllowed``
until a functional impl... | 35 | 1,053 |
conda | conda/_preview/env_setup/cli/main_create.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""CLI implementation for `conda create` — env-setup preview stub.
This module is part of the ``env-setup`` preview feature. It intercepts
``conda create`` when the preview is enabled and raises ``OperationNotAllowed``
until a functional implem... | 35 | 1,040 |
conda | docs/source/conf.py | .py | #!/usr/bin/env python3
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import os.path
import sys
from pathlib import Path
# expose custom extensions
sys.path.insert(0, os.path.abspath("_extensions"))
# expose source code for import
sys.path.insert(0, os.path.abspath("../.."))
import conda
... | 252 | 8,732 |
conda | docs/source/_extensions/conda_umls.py | .py | #!/usr/bin/env python
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import fileinput
import os
import sys
from pylint.pyreverse.main import Run
here = os.path.dirname(__file__)
# files and folders to ignore during generating the UML files
ignore = [
"_vendor.py",
"compat.py",
... | 111 | 3,174 |
conda | tests/test_api.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
try:
from inspect import getfullargspec as getargspec
except ImportError:
from inspect import getargspec
import pytest
from conda.api import (
DepsModifier,
PackageCacheData,
PrefixData,
Solver,
SubdirData,
Upda... | 287 | 9,169 |
conda | tests/test_history.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
from conda.history import History
if TYPE_CHECKING:
from pytest_mock import MockerFixture
@pytest.fixture
def tmp_history(tmp_pa... | 296 | 9,745 |
conda | tests/test_exceptions.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import getpass
import json
import sys
from contextlib import nullcontext
from datetime import timedelta
from unittest.mock import patch
import pytest
import requests
from pytest import CaptureFixture, MonkeyPatch
from pytest_mock import MockerF... | 1,724 | 51,940 |
conda | tests/test_activate.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import json
import os
from logging import getLogger
from os.path import join
from pathlib import Path
from typing import TYPE_CHECKING
from uuid import uuid4
import pytest
from conda import CondaError, plugi... | 2,289 | 75,127 |
conda | tests/test_misc.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import re
from contextlib import nullcontext
from typing import TYPE_CHECKING
import pytest
from conda import misc
from conda.common.compat import on_mac, on_win
from conda.core.subdir_data import cache_fn_u... | 250 | 8,112 |
conda | tests/fixtures_package_server.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""
Flask-based conda repository server for testing.
Provides pytest fixtures for running a local HTTP server that serves
conda repository data for testing purposes.
Change contents to simulate an updating repository.
Must be imported by conf... | 156 | 4,149 |
conda | tests/test_resolve.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.common.compat import on_win
from conda.exceptions import UnsatisfiableError
from conda.models.match_spec import MatchSpec
from conda.resolve import ... | 75 | 2,349 |
conda | tests/test_exports.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from contextlib import nullcontext
import pytest
from conda import exports
@pytest.mark.parametrize(
"function,raises",
[
("EntityEncoder", None),
("input", OSError),
("Stri... | 42 | 1,280 |
conda | tests/__init__.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
# This is just here so that tests is a package, so that dotted relative
# imports work.
import sys
from conda.gateways.logging import initialize_logging
initialize_logging()
from conda.testing import conda_move_to_front_of_PATH
conda_move_t... | 37 | 1,100 |
conda | tests/test_features.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.testing.integration import package_is_installed
if TYPE_CHECKING:
from pathlib import Path
from conda.testing.fixtures import CondaCLIFixtu... | 104 | 3,752 |
conda | tests/test_fetch.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import hashlib
import os
import re
from contextlib import nullcontext
from os.path import exists, isfile
from pathlib import Path
from tempfile import mktemp
from typing import TYPE_CHECKING
from unittest.mock... | 494 | 15,575 |
conda | tests/test_deprecations.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import sys
import warnings
from argparse import ArgumentParser, _StoreAction, _StoreTrueAction
from contextlib import nullcontext
from types import ModuleType
from typing import TYPE_CHECKING
import pytest
f... | 343 | 10,317 |
conda | tests/test_deferred_exceptions_imports.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Verify that importing conda.exceptions does not eagerly load heavy deps.
These imports are only needed when formatting specific error messages,
not when defining exception classes.
"""
from __future__ import annotations
import subprocess
i... | 45 | 1,179 |
conda | tests/test_instructions.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
import os
import pytest
with pytest.deprecated_call():
from conda import instructions
from conda.exceptions import CondaFileIOError
def test_expected_operation_order():
"""Ensure expected order of operations"""
expected = (
... | 40 | 1,060 |
conda | tests/test_create.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import os
import platform
import re
import sys
from datetime import datetime
from importlib.metadata import version
from itertools import zip_longest
from json import loads as json_loads
from logging import ge... | 3,265 | 112,259 |
conda | tests/test_solvers.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from conda.core.solve import Solver
from conda.testing.solver_helpers import SolverTests
class TestClassicSolver(SolverTests):
@property
def solver_class(self) -> type[Solver]:
return Solver
... | 41 | 1,203 |
conda | tests/test_codesigned.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import os
from functools import cache
from pathlib import Path
from shutil import which
from subprocess import CalledProcessError, check_output, run
import pytest
from conda import CONDA_PACKAGE_ROOT
from co... | 94 | 3,268 |
conda | tests/test_deferred_deprecations.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Cold-path tests for canonicalized deprecation shims in
``conda.auxlib.logz`` and ``conda.common.serialize``.
Each case asserts that importing a module does NOT transitively import the
heavy dependency that its deprecated symbols reference. R... | 87 | 2,699 |
conda | tests/test_install.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import os
import random
import subprocess
import sys
import tempfile
from os import makedirs
from os.path import exists, join, relpath
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
... | 267 | 9,113 |
conda | tests/test_priority.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from conda.testing.integration import package_is_installed
if TYPE_CHECKING:
from pathlib import Path
from pytest import MonkeyPatch
from conda.t... | 81 | 2,745 |
conda | tests/test_reporters.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from contextlib import nullcontext
from io import StringIO
from typing import TYPE_CHECKING
import pytest
from conda.base.context import context, reset_context
from conda.exceptions import CondaSystemExit, D... | 120 | 3,372 |
conda | tests/test_utils.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import sys
from logging import getLogger
from os import environ, pathsep
from os.path import dirname, join
from shutil import which
from typing import TYPE_CHECKING
import pytest
from conda import CondaError... | 204 | 7,288 |
conda | tests/test_link_order.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
from pathlib import Path
from conda.testing.fixtures import TmpEnvFixture
@pytest.mark.integration
def test_link_order_post_link_ac... | 29 | 600 |
conda | tests/conftest.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import logging
import shutil
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
import conda
from conda import plugins
from conda.base.constants import APP_NAME
from conda.base.context ... | 336 | 10,160 |
conda | tests/testing/test_http_test_server.py | .py | # Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
"""Tests for HTTP test server fixtures."""
from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
import requests
if TYPE_CHECKING:
from conda.testing.fixtures import HttpTestServerFixt... | 144 | 5,504 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.