Hacker News new | ask | show | jobs
by hackandtrip 1181 days ago
Another possibility is using the `scripts` in the `pyproject.toml`, as described here: https://python-poetry.org/docs/pyproject/#scripts
2 comments

that’s generally not correct. entry points are how your package, once installed, is called from the command line; i wouldn’t wire up a docker image build step or twine publish that way.
Those two examples are the exact use-case that defining scripts in pyproject.toml are meant for. Users of my installed package would never need to run `twine publish` or build the project's docker image. That's only really needed by developers who would be working from the full project source including pyproject.toml.
entry points are installed to the interpreter site when you `pip install`: everyone gets them including your users.
That's specifically for the Poetry package manager, not Python in general.
Neither is make. You’re using an external tool either way. The one purpose built for the task, and doesn’t have a bunch of archaic footguns [1], will probably give a better experience.

1. https://stackoverflow.com/questions/17965806/how-do-i-handle....

pyproject.toml is for python in general. https://peps.python.org/pep-0621/ setup.py is legacy.
The GP comment was referring to the `tools.poetry.scripts` namespace in pyproject.toml.