-
Currently, console scripts that are defined as a call to a single file, produce an error when executed. entry_points={
'console_scripts': [
'sqlite2png=sqlalchemy_schemadisplay',
],
}, ✗ sqlite2png
Traceback (most recent call last):
File "/home/anatoli/.local/share/virtualenvs/sqlite2png-67cYiUtQ/bin/sqlite2png", line 33, in <module>
sys.exit(load_entry_point('sqlalchemy-schemadisplay', 'console_scripts', 'sqlite2png')())
TypeError: 'module' object is not callable I can wrap my entry_points={
'console_scripts': [
'sqlite2png=sqlalchemy_schemadisplay:main',
],
}, But why not just make the whole module executable as a script? |
Beta Was this translation helpful? Give feedback.
Answered by
webknjaz
May 30, 2021
Replies: 1 comment
-
I don't see much use for this. Honestly, I'd prefer a runpy-style invocation (as in Besides, not having the "if main" thing is really an antipattern — import-time logic is evil. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
webknjaz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't see much use for this. Honestly, I'd prefer a runpy-style invocation (as in
python -m importable.thing
)Besides, not having the "if main" thing is really an antipattern — import-time logic is evil.