I am trying to be a good Pythonista and following PEP 338 for my package I plan on deploying.
I am also trying to generate my executable scripts upon python setuptools install
using setuptools entry_points{'console_scripts': ... }
options.
How can I use entry_points to generate a binary that calls python -m mypackage
(and passes *args, **kwargs) ?
Here are a few attempts I have made with no success:
setuptools(
...
(1)
entry_points=
{'console_scripts': ['mypkg=mypkg.__main__'],},
(2)
entry_points=
{'console_scripts': ['mypkg=mypkg.main'],},
(3)
entry_points=
{'console_scripts': ['mypkg=python -m mypkg'],},
Primary resources I have been using:
myscript
, my main() function is called twice. My main function only contains aprint("Success!")
statement, and I get the output twice. – Invert