requirements#

Define requirements.txt spec.

Classes#

RequirementsSpec

Reads dependencies from a requirements.txt file

class RequirementsSpec(filename=None, **kwargs)#

Bases: conda.plugins.types.EnvironmentSpecBase

Reads dependencies from a requirements.txt file and returns an Environment object from it.

property name#
property environment#

Express the provided environment file as a conda environment object.

Returns Environment:

the conda environment represented by the file.

msg#
extensions#
_valid_file()#
_valid_name()#
can_handle() bool#

Validates loader can process environment definition. This can handle if:

  • the provided file ends in the supported file extensions (.txt)

  • the file exists

Returns:

True if the file can be parsed and handled, False otherwise