Say I wrote module foo.py
.
I want the installation process to copy foo.py
to prefix/lib/pythonX.Y/site-packages
so that it can be imported by other modules, but also to create a symbolic link named foo
(not foo.py
) in prefix/bin/
that points to foo.py
.
How does one tell distutils
to do that?
You can do this if you use setuptools
entry_points
. Here's an example:foo.py
setup.py
Example usage, once the module has been installed using a tool like
pip
: