Question

with a python package that has a file myparser (no .py) is it possible to use that file as both a script in setup.py and as library? e.g. to do:

mypackage
  mypackage/__init__.py
  mypackage/internals.py
  mypackage/myparser

and then in setup.py use myparser as a script (so that it gets installed in bin/) and use it from within the library, e.g. in internals.py as:

import myparser as mp
Was it helpful?

Solution

Make it a normal .py module so it can be imported, and define an entry point. Automatic script creation will take care of creating a script in bin that will call the entry point method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top