Console script for pyproject2conda (cli
)#
Classes:
|
Provide aliasing for commands |
|
Options for --overwrite |
Functions:
|
Versioning call back. |
|
Extract conda environment.yaml and pip requirement.txt files from pyproject.toml |
|
Decorator factory to add logger and set logger level based on verbosity argument value. |
|
List available extras. |
|
Create yaml file from dependencies and optional-dependencies. |
|
Create requirements.txt for pip dependencies. |
|
Create multiple environment files from pyproject.toml specification. |
|
Create requirement files for conda and pip. |
|
Create json representation. |
- class pyproject2conda.cli.AliasedGroup(*, name=None, commands=None, rich_markup_mode=None, rich_help_panel=None, **attrs)[source]#
Bases:
TyperGroup
Provide aliasing for commands
Methods:
get_command
(ctx, cmd_name)Given a context and a command name, this returns a
Command
object if it exists or returns None.list_commands
(ctx)Returns a list of subcommand names in the order they should appear.
- pyproject2conda.cli.main(version=<typer.models.OptionInfo object>)[source]#
Extract conda environment.yaml and pip requirement.txt files from pyproject.toml
Note 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 ...
- pyproject2conda.cli.add_verbose_logger(logger, verbose_arg='verbose')[source]#
Decorator factory to add logger and set logger level based on verbosity argument value.
- pyproject2conda.cli.create_list(filename=PosixPath('pyproject.toml'), verbose=None)[source]#
List available extras.
- pyproject2conda.cli.yaml(filename=PosixPath('pyproject.toml'), extras=None, channels=None, output=None, name=None, python_include=None, python_version=None, python=None, base=True, sort=True, header=None, overwrite=Overwrite.check, verbose=None, deps=None, reqs=None, allow_empty=False, remove_whitespace=True)[source]#
Create yaml file from dependencies and optional-dependencies.
- pyproject2conda.cli.requirements(filename=PosixPath('pyproject.toml'), extras=None, output=None, base=True, sort=True, header=None, overwrite=Overwrite.check, verbose=None, reqs=None, allow_empty=False, remove_whitespace=True)[source]#
Create requirements.txt for pip dependencies.
- pyproject2conda.cli.project(filename=PosixPath('pyproject.toml'), envs=None, template=None, template_python=None, sort=True, header=None, overwrite=Overwrite.check, verbose=None, dry=False, user_config='infer', allow_empty=None, remove_whitespace=None)[source]#
Create multiple environment files from pyproject.toml specification.
- pyproject2conda.cli.conda_requirements(path_conda=None, path_pip=None, extras=None, python_include=None, python_version=None, python=None, channels=None, filename=PosixPath('pyproject.toml'), base=True, prefix=None, prepend_channel=False, sort=True, header=None, deps=None, reqs=None, verbose=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(extras=None, python_include=None, python_version=None, python=None, channels=None, filename=PosixPath('pyproject.toml'), sort=True, output=None, base=True, deps=None, reqs=None, verbose=None)[source]#
Create json representation.
Keys are: “dependencies”: conda dependencies. “pip”: pip dependencies. “channels”: conda channels.