-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
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
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 = falsePython Sysconfig
sysconfig.log
Paste the output of 'python -m sysconfig', over this line.
Example pyproject.toml
Poetry Runtime Logs
poetry-runtime.log
Paste the output of 'poetry -vvv <command>', over this line.