sitetools - WesternX’s Python Setup¶
Tools for setting up WesternX’s Python execution environment at runtime. Generally useful for extending one Python prefix (or virtualenv) with another.
When sitetools._startup
is imported (by sitecustomize
in our environment),
this will take a few automatic actions:
- The standard library logging will be setup.
- All directories and virtualenvs listed within
KS_SITES
will be added tosys.path
, in a similar manner as site-packages (viasitetools.sites.add_site_dir()
), but extended to support multi-platform builts and self-describing tools. - Variables previously frozen via
sitetools.environ.freeze()
will be restored. - Monkey-patch
os.chflags()
to not error on our NFS (by ignoring the error) for Python2.6.
Warning
Be extremely careful while modifying this package and test it very thoroughly, since being able to locate any other packages is dependent on it running successfully.
Additionally, there are a set of scripts to assist in local development.