Re:Automate your Python project with Makefile (2021)
by hackandtrip on Monday March 27, 2023 @01:55PM
(#35329954)
Another possibility is using the `scripts` in the `pyproject.toml`, as described here: https://python-poetry.org/docs/pyproject/#scripts
[ Parent
| on HN ]
Re:Automate your Python project with Makefile (2021)
by hprotagonist on Monday March 27, 2023 @01:57PM
(#35329971)
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.
Re:Automate your Python project with Makefile (2021)
by zer0w1re on Monday March 27, 2023 @02:11PM
(#35330137)
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.
Re:Automate your Python project with Makefile (2021)
by hprotagonist on Monday March 27, 2023 @02:25PM
(#35330335)
entry points are installed to the interpreter site when you `pip install`: everyone gets them including your users.
Re:Automate your Python project with Makefile (2021)
by leblancfg on Monday March 27, 2023 @02:08PM
(#35330101)
That's specifically for the Poetry package manager, not Python in general.
Re:Automate your Python project with Makefile (2021)
by nomel on Monday March 27, 2023 @04:06PM
(#35331699)
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....
Re:Automate your Python project with Makefile (2021)
by paiute on Monday March 27, 2023 @04:09PM
(#35331741)
pyproject.toml is for python in general. https://peps.python.org/pep-0621/ setup.py is legacy.