Poetry: Add support for Entry Points

Created on 2 Mar 2019  路  6Comments  路  Source: python-poetry/poetry

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] I have searched the documentation and believe that my question is not covered.

Feature Request

I do not see a way to specify arbitrary entry points. Eg, SaltStack uses the salt.loader entry point.

Please add this?

Most helpful comment

I had the same misconception as @astronouth7303 and ended up at this issue searching the Poetry docs and then repo for standard setuptools terms like console_scripts. It does not appear to be mentioned anywhere in them today.

[I did quite a bit of wondering about how to generate my setup.py with Poetry until discovering it was being done automatically. I feel like this may be worth calling out explicitly for users coming from other packaging tools where we are used to explicitly writing or explicitly generating the setup.py etc.]

It may also be helpful to add a mention of console_scripts to the scripts section of the pyproject.toml page in the docs. The current example on the page is confusing because it refers to Poetry itself rather than e.g., the package one is developing.

In my opinion it would be a lot clearer if this example:

[tool.poetry.scripts]
poetry = 'poetry:console.run'

Was changed to one with more familiar, relatable vocabulary such as:

[tool.poetry.scripts]
my-cli = 'my_package.my_module:my_function'

Or at least if explanation could be added to discuss how this is used behind the scenes.

All 6 comments

@astronouth7303 Perhaps you mean this?

Scripts get converted to console_scripts entry points, plugins would allow for arbitrary entry points.

@astronouth7303 - here's something that might help you:
https://github.com/sdispater/poetry/issues/658
If it does, would you mind closing this issue and tracking it there?

Oh! Sorry, it wasn't super clear that "plugins" were package declarations and not hooks for poetry.

No worries, it's definitely not clear, but when that linked issues gets resolved, we'll have better docs :-)

I had the same misconception as @astronouth7303 and ended up at this issue searching the Poetry docs and then repo for standard setuptools terms like console_scripts. It does not appear to be mentioned anywhere in them today.

[I did quite a bit of wondering about how to generate my setup.py with Poetry until discovering it was being done automatically. I feel like this may be worth calling out explicitly for users coming from other packaging tools where we are used to explicitly writing or explicitly generating the setup.py etc.]

It may also be helpful to add a mention of console_scripts to the scripts section of the pyproject.toml page in the docs. The current example on the page is confusing because it refers to Poetry itself rather than e.g., the package one is developing.

In my opinion it would be a lot clearer if this example:

[tool.poetry.scripts]
poetry = 'poetry:console.run'

Was changed to one with more familiar, relatable vocabulary such as:

[tool.poetry.scripts]
my-cli = 'my_package.my_module:my_function'

Or at least if explanation could be added to discuss how this is used behind the scenes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jbarlow83 picture jbarlow83  路  3Comments

thejohnfreeman picture thejohnfreeman  路  3Comments

EdgyEdgemond picture EdgyEdgemond  路  3Comments

ulope picture ulope  路  3Comments

mozartilize picture mozartilize  路  3Comments