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

[bug] script entry point import path #3214

Merged
merged 1 commit into from
Oct 16, 2020
Merged

[bug] script entry point import path #3214

merged 1 commit into from
Oct 16, 2020

Conversation

akeeman
Copy link
Contributor

@akeeman akeeman commented Oct 15, 2020

[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
Copy link
Contributor Author

akeeman commented Oct 15, 2020

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

@akeeman
Copy link
Contributor Author

akeeman commented Oct 16, 2020

@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
Copy link

github-actions bot commented Mar 1, 2024

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