Skip to content

poetry install exit code 0 (success) even if readme file does not exist and fails to install the package #8637

@roy-ht

Description

@roy-ht
  • Poetry version: Poetry (version 1.7.0)
  • Python version: Python: 3.10.9
  • OS version and name: Ubuntu 22.04
  • pyproject.toml:
[tool.poetry]
name = "test"
version = "1.0.0"
readme = "README_does_not_exist"
authors = ["xxx <xxx@example.com>"]
description = ""

[tool.poetry.dependencies]
python = ">=3.10,<3.11"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

with Poetry 1.6.1, poetry install command fails with exit code != 0:

❯ poetry161 install
Installing dependencies from lock file

[Errno 2] No such file or directory: '/home/jovyan/repo/sarasvati/temp/README_does_not_exist'

but Poetry 1.7.0 do not fail:

❯ poetry install   
Installing dependencies from lock file

Installing the current project: test (1.0.0)
The current project could not be installed: [Errno 2] No such file or directory: '/home/jovyan/repo/sarasvati/temp/README_does_not_exist'
If you do not want to install the current project use --no-root

I guess this behavior was introduced by #8369 .

In daily development, it's ok, one can see the warning messages.

But in my usecase, poetry install in Dockerfile,
docker build doesn't fail if i forget to copy README like COPY README.md.

This result is very confusing, and I expect to return failure exit code if attempting to install package was failed.

Thanks! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions