Package: pyrun
You can access the most commonly useful features ofpyrun, without installing
the project, by running thepyrun.pyfile directly.For example, the following:wget http://svn.wiretooth.com/svn/open/pyrun/trunk/pyrun.py
python pyrun.py  my/python/libs my/python/scripts/go.pyIs all you need in order to run thego.pymodule with a sys.path
automatically discovered from directories undermy/python/libs. You can
list an arbitrary number of directories and paths to actual python files. The
order you list them controls the order in which the path extension entries are
built. The resulting path will not contain any duplicates. Each entry in the
path extension will be a legitimate import path.Note:A setup.py file is provided - with suitable egg entry point declarations
- if you prefer this.For each argument which identifies a python filepyrunwill locate the root
package directory and add that to the path. Theabsolutedotted module name
of the first python file you identify in this way is the module that will, by
default, be executed as __main__. You can explicitly override this choice by
using pyrun’s-moption.Note:root package is the parent directory of the “top most package” seedistutils python termsanddistutils distutils termsThe delimiter between thepyrunarguments and options and the options for the
target module is the first non option argument encountered after the discovery
paths. If that option is apyrunoption (seepyrun--helpfor the list)
thenpyruntakes it and passes all remaining arguments to the target module
in a suitably massagedsys.argv.If the target module takes arguments but does not naturally accept an option
as its first argument (python setup.py install is the classic example) then
you can artificially terminate thepyrunoptions with--.For example it is possible to run the setup script of thepyrunproject in
the following waysIf you have setup tools installed:python setup.py bdist_eggIf your python distribution hasnotremoved distutls from the python
standard library:python setup.py sdistIf you have a copy of the setuptools egg in../python/eggs:python pyrun.py ../python/eggs -m setup bdist_egg
python pyrun.py ../python/eggs setup.py -- bdist_eggIf you have a directory which contains a docutils source tree or installation
then adding that to the discovery path will let the setup.py script buildthisdocumentation.If none of the non option arguments identify a python module fileandyou
dont explicitly select one using-mthenpyrunwill simply print the path
it has discovered and exit. You can forcejust print the pathusing-por-Ppyrunis reasonably smart in respect of python egg distributions. When
multiple egg distributions of the same project are found on the discovery path
only thebestversion found is included in the path extension. Eggs which are
not compatible with the current python interpreter are ignored. The measure ofbest egg for a projectuses the same algorithm as used by the
pkg_resources.py module distributed by the setuptools project.Note:The current version does not filter out incompatibleplatformsfor eggs
that contain c extensions - seepyrun.filter_best_eggsif you have time on
your hands, its not to much work to add this check.The issue tracker for this package can be found at:http://trac.wiretooth.com/public/wiki/pyrunWhen opening a ticket please assign it to thepyruncomponent or, at least,
mentionpyrunin your ticket summary.