ITADN

poetry publish --no-interaction still prompts when build artifacts exist in dist/, blocking CI pipelines

#10760Openmuhammed-mizaj 创建于 2026-03-06
kind/bugarea/cliarea/publishing
M
muhammed-mizajcommented
### Description When running poetry publish in a CI environment with the --no-interaction flag, Poetry still prompts for confirmation if build artifacts already exist in the dist/ directory. Example prompt: There are 2 files ready for publishing. Build anyway? (yes/no) [no] This works fine when running locally, but in CI/CD environments (for example Bitbucket Pipelines or GitHub Actions) there is no interactive input available. As a result, the pipeline stops waiting for input and eventually fails. My expectation was that --no-interaction would behave the same as answering yes to the prompt and continue execution. Since CI environments cannot respond to prompts, this makes poetry publish difficult to use reliably unless additional cleanup steps are added. ### Workarounds A common workaround is to manually clear the dist/ directory before running the publish command to avoid triggering the prompt: clear the dist directory poetry publish --build Alternatively, ensure that the dist/ directory is empty in your CI environment before the publish step. ### Poetry Installation Method pip ### Operating System MacOS Tahoe ### Poetry Version 2.2.1 ### Poetry Configuration ```bash session cache-dir = "/Users/{USER}/Library/Caches/pypoetry" data-dir = "/Users/{USER}/Library/Application Support/pypoetry" installer.max-workers = null installer.no-binary = null installer.only-binary = null installer.parallel = true installer.re-resolve = true keyring.enabled = true python.installation-dir = "{data-dir}/python" # /Users/{USER}/Library/Application Support/pypoetry/python requests.max-retries = 0 solver.lazy-wheel = true system-git-client = false virtualenvs.create = true virtualenvs.in-project = true virtualenvs.options.always-copy = false virtualenvs.options.no-pip = false virtualenvs.options.system-site-packages = false virtualenvs.path = "{cache-dir}/virtualenvs" # /Users/{USER}/Library/Caches/pypoetry/virtualenvs virtualenvs.prompt = "{project_name}-py{python_version}" virtualenvs.use-poetry-python = false ``` ### Python Sysconfig <details> <summary>sysconfig.log</summary> <!-- Please leave one blank line below for enabling the code block rendering. --> ``` Paste the output of 'python -m sysconfig', over this line. ``` </details> ### Example pyproject.toml ```TOML ``` ### Poetry Runtime Logs <details> <summary>poetry-runtime.log</summary> <!-- Please leave one blank line below for enabling the code block rendering. --> ``` Paste the output of 'poetry -vvv <command>', over this line. ``` </details>
2 条评论