Read/use config/pyproject.toml file (config)#

Classes:

Config(data[, default_pythons, all_pythons])

Class to parse toml file with [tool.pyproject2conda] section

class pyproject2conda.config.Config(data, default_pythons=None, all_pythons=None)[source]#

Bases: object

Class to parse toml file with [tool.pyproject2conda] section

Methods:

get_in(*keys[, default])

Utility to extract from nested dict.

channels([env_name, inherit])

Channels getter

python([env_name, inherit, default])

Python getter

extras(env_name[, inherit])

Extras getter

groups(env_name[, inherit])

Groups getter.

extras_or_groups(env_name[, inherit])

Extras_or_Groups getter.

output([env_name])

Output getter

sort([env_name, inherit, default])

Sort getter

skip_package(env_name[, default])

skip_package getter.

name(env_name)

Name option.

header(env_name)

Header getter

style([env_name, default])

Style getter.

python_include([env_name])

Flag python_include

python_version([env_name])

Flag python_version

overwrite([env_name, default])

Flag overwrite

verbose([env_name, default])

Flag verbose

template(env_name[, default])

Flag for template

template_python(env_name[, default])

Flag for template_python.

reqs_ext(env_name[, default])

Requirements extension

yaml_ext(env_name[, default])

Conda yaml extension

deps(env_name[, default])

Conda dependencies option.

reqs(env_name[, default])

Pip dependencies option.

user_config([env_name])

Flag user_config

allow_empty([env_name, default])

Allow empty option.

remove_whitespace([env_name, default])

Remove whitespace option.

assign_user_config(user)

Assign user_config to self.

iter_envs([envs])

Iterate over configs

from_toml_dict(data_toml[, user_config])

Create from toml dictionaries.

from_string(s[, user_config])

Create from string representation of toml file.

from_file(path[, user_config])

Create from toml file(s).

Attributes:

overrides

All overrides sections from [[tool.pyproject2conda.overrides]]

envs

All environments

get_in(*keys, default=None)[source]#

Utility to extract from nested dict.

property overrides#

All overrides sections from [[tool.pyproject2conda.overrides]]

property envs#

All environments

channels(env_name=None, inherit=True)[source]#

Channels getter

python(env_name=None, inherit=True, default=<class 'list'>)[source]#

Python getter

extras(env_name, inherit=True)[source]#

Extras getter

  • If value is True (default), then return [env_name]

  • If value is False, return []

  • else return list of extras

groups(env_name, inherit=True)[source]#

Groups getter.

Same style as self.extras

extras_or_groups(env_name, inherit=True)[source]#

Extras_or_Groups getter.

These will need to be resolved after the fact.

output(env_name=None)[source]#

Output getter

sort(env_name=None, inherit=True, default=True)[source]#

Sort getter

skip_package(env_name, default=False)[source]#

skip_package getter.

name(env_name)[source]#

Name option.

header(env_name)[source]#

Header getter

style(env_name=None, default='yaml')[source]#

Style getter. One of yaml, requirements

python_include(env_name=None)[source]#

Flag python_include

python_version(env_name=None)[source]#

Flag python_version

overwrite(env_name=None, default='check')[source]#

Flag overwrite

verbose(env_name=None, default=None)[source]#

Flag verbose

template(env_name, default='{env}')[source]#

Flag for template

template_python(env_name, default='py{py}-{env}')[source]#

Flag for template_python.

reqs_ext(env_name, default='.txt')[source]#

Requirements extension

yaml_ext(env_name, default='.yaml')[source]#

Conda yaml extension

deps(env_name, default=None)[source]#

Conda dependencies option.

reqs(env_name, default=None)[source]#

Pip dependencies option.

user_config(env_name=None)[source]#

Flag user_config

allow_empty(env_name=None, default=False)[source]#

Allow empty option.

remove_whitespace(env_name=None, default=True)[source]#

Remove whitespace option.

assign_user_config(user)[source]#

Assign user_config to self.

iter_envs(envs=None, **defaults)[source]#

Iterate over configs

classmethod from_toml_dict(data_toml, user_config=None)[source]#

Create from toml dictionaries.

classmethod from_string(s, user_config=None)[source]#

Create from string representation of toml file.

classmethod from_file(path, user_config='infer')[source]#

Create from toml file(s).