Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Short --clean option for build subcommand is malformed #9993

Closed
tari opened this issue Jan 8, 2025 · 1 comment · Fixed by #9994
Closed

Short --clean option for build subcommand is malformed #9993

tari opened this issue Jan 8, 2025 · 1 comment · Fixed by #9994
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@tari
Copy link

tari commented Jan 8, 2025

Description

Help output for poetry build shows unexpected formatting for --clean:

$ poetry build --help

Description:
  Builds a package, as a tarball and a wheel by default.

...
  -C, --directory=DIRECTORY                          The working directory for the Poetry command (defaults to the current working directory). All command-line arguments will be resolved relative to the given directory.
  -Clean output directory before building., --clean

poetry.console.commands.build:

        option(
            "clean",
            "Clean output directory before building.",
            flag=True,
        ),

The second positional parameter to option is the short option, so either the help text needs to be a keyword argument (description="...") or an explicit None should be inserted for the second (short_name) parameter.

Workarounds

Use --clean rather than attempting to use a short form of the option.

Poetry Installation Method

pipx

Operating System

Arch Linux

Poetry Version

2.0.0

Poetry Configuration

cache-dir = "/home/tari/.cache/pypoetry"
installer.max-workers = null
installer.no-binary = null
installer.only-binary = null
installer.parallel = true
installer.re-resolve = true
keyring.enabled = true
requests.max-retries = 0
solver.lazy-wheel = true
system-git-client = false
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /home/tari/.cache/pypoetry/virtualenvs
virtualenvs.prompt = "{project_name}-py{python_version}"
virtualenvs.use-poetry-python = false

Python Sysconfig

No response

Example pyproject.toml

No response

Poetry Runtime Logs

Description:
  Builds a package, as a tarball and a wheel by default.

Usage:
  build [options]

Options:
  -f, --format=FORMAT                                Limit the format to either sdist or wheel.
  -l, --local-version=LOCAL-VERSION                  Add or replace a local version label to the build.
  -o, --output=OUTPUT                                Set output directory for build artifacts. Default is `dist`. [default: "dist"]
  -h, --help                                         Display help for the given command. When no command is given display help for the list command.
  -q, --quiet                                        Do not output any message.
  -V, --version                                      Display this application version.
      --ansi                                         Force ANSI output.
      --no-ansi                                      Disable ANSI output.
  -n, --no-interaction                               Do not ask any interactive question.
      --no-plugins                                   Disables plugins.
      --no-cache                                     Disables Poetry source caches.
  -P, --project=PROJECT                              Specify another path as the project root. All command-line arguments will be resolved relative to the current working directory.
  -C, --directory=DIRECTORY                          The working directory for the Poetry command (defaults to the current working directory). All command-line arguments will be resolved relative to the given directory.
  -Clean output directory before building., --clean
  -v|vv|vvv, --verbose                               Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug.
@tari tari added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jan 8, 2025
@Secrus
Copy link
Member

Secrus commented Jan 8, 2025

Good catch, #9993

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants