Skip to content

Console scripts dependant on extras is officially discouraged #8902

@couling

Description

@couling
  • I have searched the issues of this repo and believe that this is not a duplicate.

Issue

Context

Console scripts dependent on extras is officially discouraged and may not work in the wider eco python system:

Using extras for an entry point is no longer recommended. Consumers should support parsing them from existing distributions, but may then ignore them. New publishing tools need not support specifying extras. The functionality of handling extras was tied to setuptools’ model of managing ‘egg’ packages, but newer tools such as pip and virtualenv use a different model.

Poetry has a documented feature to support scripts dependent on extras:

To specify a script that depends on an extra, you may provide an entry as an inline table:

[tool.poetry.scripts]
devtest = { reference = "mypackage:test.run_tests", extras = ["test"], type = "console" }

When people have raised issues around this feature, it's been flagged that using the feature may be inadvisable (examples: here and here). It seems odd to warn people that a documented feature is discouraged only when they raise an issue that the feature is broken in some way.

Problem & Suggestion

Poetry documentation is suggesting something that is discouraged in the wider Python eco-system. It would make sense to either:

  • Add a documentation warning with external documentation link to highlight that the feature is discouraged
  • Remove the documentation on the feature entirely. Perhaps this would require a decision to deprecate and remove the feature too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/docsDocumentation issues/improvements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions