Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

Allow invocation through runpy #111

Closed
jaraco opened this issue Dec 15, 2019 · 1 comment · Fixed by #112
Closed

Allow invocation through runpy #111

jaraco opened this issue Dec 15, 2019 · 1 comment · Fixed by #112

Comments

@jaraco
Copy link
Contributor

jaraco commented Dec 15, 2019

Currently, it's only possible to invoke termtosvg through its script, meaning the package must be installed somewhere with a PATH-exposed bin/Scripts directory. It would be nice to be able to invoke it also through runpy (python -m termtosvg). Currently, if one invokes that command, the following error occurs:

/usr/local/bin/python: No module named termtosvg.__main__; 'termtosvg' is a package and cannot be directly executed

Instead, I'd expect that command to invoke termtosvg directly from the indicated Python interpreter. This method of invocation would allow for a couple of use cases currently not supported, including:

  • Invocation via pip-run
  • Selective invocation from different Python interpreters (e.g. python3.6 -m termtosvg)

I notice there's already a __main__ in the root directory of the project, but it's not distributed with the package. I wonder if that file intended to serve this same purpose.

@nbedos
Copy link
Owner

nbedos commented Dec 15, 2019

Good idea, thanks. I removed __main__.py from the root directory since this file seemed useless.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants