Skip to content

[bug] script entry point import path - #3214

Merged
abn merged 1 commit into
python-poetry:1.1from
akeeman:patch-1
Oct 16, 2020
Merged

abn merged 1 commit into
python-poetry:1.1from
akeeman:patch-1

Conversation

@akeeman

@akeeman akeeman commented Oct 15, 2020 •

Copy link
Copy Markdown
Contributor
[tool.poetry.scripts]
baz = "bar:baz.boom.bim"

currently translates to

from bar import baz.boom

if __name__ == '__main__':
    baz.boom.bim()

but should be

from bar import baz  # <- notice the difference

if __name__ == '__main__':
    baz.boom.bim()

This is the case when, for instance, this is an entry point

# file __init__.py in module bar
class baz:
    class boom:
        @classmethod
        def bim():
            #  ...

Also extended the tests to test sub-module import

@akeeman akeeman changed the title compatible script entry point [bug] script entry point import path Oct 15, 2020
@akeeman

akeeman commented Oct 15, 2020 •

Copy link
Copy Markdown
Contributor Author

The test failure is due to a 'Connection reset by peer' error while installing tox...

@akeeman

akeeman commented Oct 16, 2020

Copy link
Copy Markdown
Contributor Author

@stephsamson @finswimmer

@abn
abn merged commit 66d29f6 into python-poetry:1.1 Oct 16, 2020
@akeeman
akeeman deleted the patch-1 branch October 19, 2020 15:31
@abn abn mentioned this pull request Oct 23, 2020
@github-actions

github-actions Bot commented Mar 1, 2024

Copy link
Copy Markdown

This pull request 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 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants