[Distutils] easy_install ./mymodule.py

Phillip J. Eby pje at telecommunity.com
Sun Mar 12 23:00:26 CET 2006

At 11:11 PM 3/12/2006 +0200, Ville Vainio wrote:
>I can't remember whether this has been discussed previously, but I'd
>like to see the ability to quickly install simple python modules
>globally, with the usage of
>easy_install ./mymodule.py
>or even
>easy_install http://somesite.com/mymodule.py

If you do this:

     easy_install "http://somesite.com/mymodule.py#egg=MyProject-0.1"

EasyInstall will treat the .py file as being an egg named MyProject, with a 
version number of 0.1.

This should also work with file: URLs, and can also be used as links in a 
download page or --find-links option.

EasyInstall automatically generates a setup.py to go with the .py file, and 
runs it to create the egg which it then installs.

>Additionally, it would be groovy to be able to specify the entry
>points in .py files, a'la
># setuptools_entrypoint = myscript:main
>def main():
>   """ will be called by 'myscript' script."""

That won't work, but it's possible I could have it look for an assignment 
like this:

     __setuptools_entry_points__ = """
     foo = mymodule:main

On the other hand, this seems like a path to diminishing returns.  You 
might as well start using a setup.py if you need entry points.

More information about the Distutils-SIG mailing list