diff --git a/docs/cli.md b/docs/cli.md index 8a0745cad66..7918fac9f6a 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -305,6 +305,25 @@ Without `--` this command will fail if `${GITLAB_JOB_TOKEN}` starts with a hyphe * `--local`: Set/Get settings that are specific to a project (in the local configuration file `poetry.toml`). * `--migrate`: Migrate outdated configuration settings. +## debug + +The `debug` command groups subcommands that are useful for, as the name suggests, debugging issues you might have +when using Poetry with your projects. + +### debug info + +The `debug info` command shows debug information about Poetry and your project's virtual environment. + +### debug resolve + +The `debug resolve` command helps when debugging dependency resolution issues. The command attempts to resolve your +dependencies and list the chosen packages and versions. + +### debug tags + +The `debug tags` command is useful when you want to see the supported packaging tags for your project's active +virtual environment. This is useful when Poetry cannot install any known binary distributions for a dependency. + ## env The `env` command groups subcommands to interact with the virtualenvs diff --git a/src/poetry/console/application.py b/src/poetry/console/application.py index e4c3c3f06f2..cc300cf2ae5 100644 --- a/src/poetry/console/application.py +++ b/src/poetry/console/application.py @@ -75,6 +75,7 @@ def _load() -> Command: # Debug commands "debug info", "debug resolve", + "debug tags", # Env commands "env activate", "env info", diff --git a/src/poetry/console/commands/debug/tags.py b/src/poetry/console/commands/debug/tags.py new file mode 100644 index 00000000000..0d1fe23eb52 --- /dev/null +++ b/src/poetry/console/commands/debug/tags.py @@ -0,0 +1,17 @@ +from __future__ import annotations + +from poetry.console.commands.env_command import EnvCommand + + +class DebugTagsCommand(EnvCommand): + name = "debug tags" + description = "Shows compatible tags for your project's current active environment." + + def handle(self) -> int: + for tag in self.env.get_supported_tags(): + self.io.write_line( + f"{tag.interpreter}" + f"-{tag.abi}" + f"-{tag.platform}" + ) + return 0