Skip to content

Commit 1146366

Browse files
committed
feat(cli): add debug tags command
1 parent 08754fe commit 1146366

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

docs/cli.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,25 @@ Without `--` this command will fail if `${GITLAB_JOB_TOKEN}` starts with a hyphe
305305
* `--local`: Set/Get settings that are specific to a project (in the local configuration file `poetry.toml`).
306306
* `--migrate`: Migrate outdated configuration settings.
307307

308+
## debug
309+
310+
The `debug` command groups subcommands that are useful for, as the name suggests, debugging issues you might have
311+
when using Poetry with your projects.
312+
313+
### debug info
314+
315+
The `debug info` command shows debug information about Poetry and your project's virtual environment.
316+
317+
### debug resolve
318+
319+
The `debug resolve` command helps when debugging dependency resolution issues. The command attempts to resolve your
320+
dependencies and list the chosen packages and versions.
321+
322+
### debug tags
323+
324+
The `debug tags` command is useful when you want to see the supported packaging tags for your project's active
325+
virtual environment. This is useful when Poetry cannot install any known binary distributions for a dependency.
326+
308327
## env
309328

310329
The `env` command groups subcommands to interact with the virtualenvs

src/poetry/console/application.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def _load() -> Command:
7575
# Debug commands
7676
"debug info",
7777
"debug resolve",
78+
"debug tags",
7879
# Env commands
7980
"env activate",
8081
"env info",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from __future__ import annotations
2+
3+
from poetry.console.commands.env_command import EnvCommand
4+
5+
6+
class DebugTagsCommand(EnvCommand):
7+
name = "debug tags"
8+
description = "Shows compatible tags for your project's current active environment."
9+
10+
def handle(self) -> int:
11+
for tag in self.env.get_supported_tags():
12+
self.io.write_line(
13+
f"<c1>{tag.interpreter}</>"
14+
f"-<c2>{tag.abi}</>"
15+
f"-<fg=yellow;options=bold>{tag.platform}</>"
16+
)
17+
return 0

0 commit comments

Comments
 (0)