Console script for pyproject2conda (cli)#
Functions:
|
Extract conda |
|
List available extras. |
|
Create yaml file from dependencies and optional-dependencies. |
|
Create requirements.txt for pip dependencies. |
|
Create multiple environment files from |
|
Create requirement files for conda and pip. |
|
Create json representation. |
- pyproject2conda.cli.main(version: Annotated[bool, <typer.models.OptionInfo object at 0x7fec20273c50>]=False, columns: Annotated[int | None, <typer.models.OptionInfo object at 0x7fec20273b10>]=None) None[source]#
Extract conda
environment.yamland piprequirement.txtfiles frompyproject.tomlNote that all subcommands can be called with shortest possible match. Also, you can call with any of
pyproject2conda,p2c,python -m pyproject2conda. For example,# these are equivalent $ pyproject2conda yaml ... $ p2c y ... $ python -m pyproject2conda yaml ...
- pyproject2conda.cli.create_list(pyproject_filename: ~typing.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7fec23cbca50>], verbose: ~typing.Annotated[int | None, <typer.models.OptionInfo object at 0x7fec23cbd450>] = None) None[source]#
List available extras.
- pyproject2conda.cli.yaml(pyproject_filename: ~typing.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7fec23cbca50>], extras: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbcb90>] = None, groups: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbccd0>] = None, extras_or_groups: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbce10>] = None, channels: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbcf50>] = None, output: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7fec23cbd1d0>] = None, name: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbd090>] = None, python_include: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbd810>] = None, python_version: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbd950>] = None, python: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbda90>] = None, skip_package: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fec23cbd590>] = False, pip_only: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fec23cbd6d0>] = False, header: ~typing.Annotated[bool | None, <typer.models.OptionInfo object at 0x7fec23cbdbd0>] = None, custom_command: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbdd10>] = None, overwrite: ~typing.Annotated[~pyproject2conda._schema.Overwrite, <typer.models.OptionInfo object at 0x7fec23cbd310>] = Overwrite.force, verbose: ~typing.Annotated[int | None, <typer.models.OptionInfo object at 0x7fec23cbd450>] = None, conda_deps: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbde50>] = None, pip_deps: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbdf90>] = None, allow_empty: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fec23cbead0>] = False) None[source]#
Create yaml file from dependencies and optional-dependencies.
- pyproject2conda.cli.requirements(pyproject_filename: ~typing.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7fec23cbca50>], extras: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbcb90>] = None, groups: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbccd0>] = None, extras_or_groups: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbce10>] = None, output: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7fec23cbd1d0>] = None, skip_package: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fec23cbd590>] = False, header: ~typing.Annotated[bool | None, <typer.models.OptionInfo object at 0x7fec23cbdbd0>] = None, custom_command: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbdd10>] = None, overwrite: ~typing.Annotated[~pyproject2conda._schema.Overwrite, <typer.models.OptionInfo object at 0x7fec23cbd310>] = Overwrite.force, verbose: ~typing.Annotated[int | None, <typer.models.OptionInfo object at 0x7fec23cbd450>] = None, pip_deps: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbdf90>] = None, allow_empty: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fec23cbead0>] = False) None[source]#
Create requirements.txt for pip dependencies. Note that all requirements are normalized using
packaging.requirements.Requirement
- pyproject2conda.cli.project(pyproject_filename: ~typing.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7fec23cbca50>], envs: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbe0d0>] = None, template: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbe210>] = None, template_python: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbe350>] = None, pip_deps: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbdf90>] = None, conda_deps: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbde50>] = None, reqs_ext: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbe490>] = '.txt', yaml_ext: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbe5d0>] = '.yaml', header: ~typing.Annotated[bool | None, <typer.models.OptionInfo object at 0x7fec23cbdbd0>] = None, custom_command: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbdd10>] = None, overwrite: ~typing.Annotated[~pyproject2conda._schema.Overwrite, <typer.models.OptionInfo object at 0x7fec23cbd310>] = Overwrite.force, verbose: ~typing.Annotated[int | None, <typer.models.OptionInfo object at 0x7fec23cbd450>] = None, dry: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fec23cbe710>] = False, pip_only: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fec23cbd6d0>] = False, allow_empty: ~typing.Annotated[bool | None, <typer.models.OptionInfo object at 0x7fec23cbead0>] = None) None[source]#
Create multiple environment files from
pyproject.tomlspecification.Note that if you specify options in
pyproject.toml, the name is usually the same as the command line option. For cases where the option can take multiple values, the config file option will be plural. For example, the command line option--groupbecomes the config file optiongroups = .... Boolean options like--header/--no-headerbecomeheader = true/falsein the config file.
- pyproject2conda.cli.conda_requirements(pyproject_filename: ~typing.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7fec23cbca50>], path_conda: ~typing.Annotated[~pathlib.Path | None, <typer.models.ArgumentInfo object at 0x7fec202716d0>] = None, path_pip: ~typing.Annotated[~pathlib.Path | None, <typer.models.ArgumentInfo object at 0x7fec20271590>] = None, extras: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbcb90>] = None, groups: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbccd0>] = None, extras_or_groups: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbce10>] = None, python_include: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbd810>] = None, python_version: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbd950>] = None, python: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbda90>] = None, channels: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbcf50>] = None, skip_package: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fec23cbd590>] = False, prefix: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7fec23cbe850>] = None, prepend_channel: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fec23cbe990>] = False, header: ~typing.Annotated[bool | None, <typer.models.OptionInfo object at 0x7fec23cbdbd0>] = None, custom_command: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbdd10>] = None, conda_deps: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbde50>] = None, pip_deps: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbdf90>] = None, verbose: ~typing.Annotated[int | None, <typer.models.OptionInfo object at 0x7fec23cbd450>] = None) None[source]#
Create requirement files for conda and pip.
These can be install with, for example,
conda install –file {path_conda} pip install -r {path_pip}
- pyproject2conda.cli.to_json(pyproject_filename: ~typing.Annotated[~pathlib.Path, <typer.models.OptionInfo object at 0x7fec23cbca50>], extras: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbcb90>] = None, groups: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbccd0>] = None, extras_or_groups: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbce10>] = None, python_include: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbd810>] = None, python_version: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbd950>] = None, python: ~typing.Annotated[str | None, <typer.models.OptionInfo object at 0x7fec23cbda90>] = None, channels: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbcf50>] = None, output: ~typing.Annotated[~pathlib.Path | None, <typer.models.OptionInfo object at 0x7fec23cbd1d0>] = None, skip_package: ~typing.Annotated[bool, <typer.models.OptionInfo object at 0x7fec23cbd590>] = False, conda_deps: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbde50>] = None, pip_deps: ~typing.Annotated[list[str] | None, <typer.models.OptionInfo object at 0x7fec23cbdf90>] = None, verbose: ~typing.Annotated[int | None, <typer.models.OptionInfo object at 0x7fec23cbd450>] = None, overwrite: ~typing.Annotated[~pyproject2conda._schema.Overwrite, <typer.models.OptionInfo object at 0x7fec23cbd310>] = Overwrite.force) None[source]#
Create json representation.
Keys are: “dependencies”: conda dependencies. “pip”: pip dependencies. “channels”: conda channels.