:py:mod:`specs` =============== .. py:module:: conda.env.specs .. toctree:: :hidden: :titlesonly: :maxdepth: 3 binstar/index.rst requirements/index.rst yaml_file/index.rst Classes ------- .. autoapisummary:: conda.env.specs.BinstarSpec conda.env.specs.RequirementsSpec conda.env.specs.YamlFileSpec Functions --------- .. autoapisummary:: conda.env.specs.get_spec_class_from_file conda.env.specs.detect Attributes ---------- .. autoapisummary:: conda.env.specs.CONDA_SESSION_SCHEMES conda.env.specs.FileSpecTypes conda.env.specs.SpecTypes .. py:exception:: EnvironmentFileExtensionNotValid(filename, *args, **kwargs) Bases: :py:obj:`CondaEnvException` Common base class for all non-exit exceptions. .. py:exception:: EnvironmentFileNotFound(filename, *args, **kwargs) Bases: :py:obj:`CondaEnvException` Common base class for all non-exit exceptions. .. py:exception:: SpecNotFound(msg, *args, **kwargs) Bases: :py:obj:`conda.CondaError` Common base class for all non-exit exceptions. .. py:data:: CONDA_SESSION_SCHEMES .. py:class:: BinstarSpec(name=None) spec = BinstarSpec('darth/deathstar') spec.can_handle() # => True / False spec.environment # => YAML string spec.msg # => Error messages :raises: EnvironmentFileNotDownloaded .. py:attribute:: msg .. py:method:: can_handle() -> bool Validates loader can process environment definition. :return: True or False .. py:method:: valid_name() -> bool Validates name :return: True or False .. py:method:: valid_package() -> bool Returns True if package has an environment file :return: True or False .. py:method:: binstar() -> types.ModuleType .. py:method:: file_data() -> list[dict[str, str]] .. py:method:: environment() -> conda.env.env.Environment .. py:method:: package() .. py:method:: username() -> str .. py:method:: packagename() -> str .. py:class:: RequirementsSpec(filename=None, name=None, **kwargs) Reads dependencies from a requirements.txt file and returns an Environment object from it. .. py:property:: environment .. py:attribute:: msg .. py:attribute:: extensions .. py:method:: _valid_file() .. py:method:: _valid_name() .. py:method:: can_handle() .. py:class:: YamlFileSpec(filename=None, **kwargs) .. py:property:: environment .. py:attribute:: _environment .. py:attribute:: extensions .. py:method:: can_handle() .. py:data:: FileSpecTypes .. py:function:: get_spec_class_from_file(filename: str) -> FileSpecTypes Determine spec class to use from the provided ``filename`` :raises EnvironmentFileExtensionNotValid | EnvironmentFileNotFound: .. py:data:: SpecTypes .. py:function:: detect(name: str = None, filename: str = None, directory: str = None, remote_definition: str = None) -> SpecTypes Return the appropriate spec type to use. :raises SpecNotFound: Raised if no suitable spec class could be found given the input :raises EnvironmentFileExtensionNotValid | EnvironmentFileNotFound: