Skip to content

inconsistent entry_point/script behaviour between pip install and poetry install #4453

@jouve

Description

@jouve
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: cygwin
  • Poetry version: Poetry version 1.1.8
  • Link of a Gist with the contents of your pyproject.toml file:
[tool.poetry]
name = "xxx"
version = "0.2"
description = ""
authors = ["xxx"]

[tool.poetry.scripts]
xxx-yyy = "xxx:yyy"
xxx-zzz = "xxx:zzz"

Issue

when running poetry install in the repo, the script produced is :

#!/.../bin/python
from xxx import yyy

if __name__ == '__main__':
    yyy()

(from

SCRIPT_TEMPLATE = """\
)

but when running pip install ., the script produced is :

#!/.../python
# -*- coding: utf-8 -*-
import re
import sys
from xxx import yyy
if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
    sys.exit(yyy())

(from https://github.com/pypa/pip/blob/1c4753f299c00c74882e80211f91daf80c870041/src/pip/_vendor/distlib/scripts.py#L41 )

I believe pip is the correct behaviour with the sys.exit :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions