<+xrl> Random thought: if we want to properly support python -m sopel start we should have a __main__.py file.
Currently, users who want to invoke Sopel without using the installed entrypoint have to spell that as python3 -m sopel.cli.run which is a bit verbose. There's no other obvious reading of python3 -m sopel, so we may as well define a __main__.py that has the same effect as the sopel entrypoint. It probably can even call exactly the same functionality in sopel.cli.run, although maybe it's worth considering having subcommands for run, config, plugins, i.e. spelling it as python3 -m sopel run instead.
Problems Solved
It is often more reliable to invoke programs with the python3 -m … spelling, as there is a single executable whose resolution needs to be worried over. It's possible (if not a bit uncommon) for python3 and entrypoints (pip is a notorious one) to become "out of sync", i.e. for python3 to refer to a different interpreter than the shebang in a given entrypoint on one's PATH.
Alternatives
No response
Notes
Somewhat related to #2515, the proposed invocation will probably have the same issue with reloading, but that is not a blocker for this issue.
Requested Feature
Currently, users who want to invoke Sopel without using the installed entrypoint have to spell that as
python3 -m sopel.cli.run
which is a bit verbose. There's no other obvious reading ofpython3 -m sopel
, so we may as well define a__main__.py
that has the same effect as thesopel
entrypoint. It probably can even call exactly the same functionality insopel.cli.run
, although maybe it's worth considering having subcommands forrun, config, plugins
, i.e. spelling it aspython3 -m sopel run
instead.Problems Solved
It is often more reliable to invoke programs with the
python3 -m …
spelling, as there is a single executable whose resolution needs to be worried over. It's possible (if not a bit uncommon) forpython3
and entrypoints (pip
is a notorious one) to become "out of sync", i.e. forpython3
to refer to a different interpreter than the shebang in a given entrypoint on one'sPATH
.Alternatives
No response
Notes
Somewhat related to #2515, the proposed invocation will probably have the same issue with reloading, but that is not a blocker for this issue.