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

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

Closed
3 tasks done
jouve opened this issue Aug 30, 2021 · 1 comment · Fixed by #4456
Closed
3 tasks done

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

jouve opened this issue Aug 30, 2021 · 1 comment · Fixed by #4456
Labels
kind/bug Something isn't working as expected

Comments

@jouve
Copy link
Contributor

jouve commented Aug 30, 2021

  • 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 :)

@jouve jouve added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Aug 30, 2021
@abn abn closed this as completed in #4456 Oct 8, 2021
@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants