dls.environment Python Module
This module contains a python object representation of a site enviroment. All other dls python modules use this to get their install instructions, and modules like the dependency_tree use it to find default locations of the production and development areas, etc. It also contains an example application template.
The standard install requires that you have setuptools
This module is generally only used in installation, and in a few special cases like dls.dependency_tree. However, most users will have to modify and build this in order to build other dls python modules. These are the things that a user will generally have to modify:
- setuptools.mk: modify variables to suit local install of python.
PYTHON: python executable
SCRIPT_DIR: location to install any generated python scripts
TEST_INSTALL_DIR: location to put eggs if you do a
TEST_SCRIPT_DIR: location to put generated python scripts if you do a
- src.env.environment: change some functions:
It is assumed that the site environment is of a similar structure to dls:
- development of a module is done in a local area or in <devArea>
- modules in devArea have the path <devArea>/<module_name>
- modules are installed in <prodArea>
- modules in prodArea have the path <prodArea>/<module_name>/<module_release>
To make this, or any other dls python module using the dls.environment makefile:
make to build the python egg
install to install the egg to the python site-packages directory and install scripts to
test to install the egg to
TEST_INSTALL_DIR and install scripts to
clean to clean the module
If you have done a
, you need to do one of the following:
from pkg_resources import require
require("dls.environment") # latest installed version
require("dls.environment==1.0") # this exact version number
require("dls.environment>=1.0") # this version or higher
If you have done a
, then you need to set your
to pick up the right egg: export PYTHONPATH=TEST_INSTALL_DIR Where
is the location you entered in setuptools.mk
. You then need to do the require as above
The installation process will install the egg into site-packages, and the following scripts to SCRIPT_DIR:
- dls-setuptools-makefile.py: Gives the location of the setuptools.mk so that other dls modules follow the same build
- dls-python-make-new-app.py: Makes a new python app in the diamond template (much like makeBaseApp.pl) Run the script with the
-h option for more details.
The doxygen documentation is a good starting point, but the Pydoc html pages
are included for reference
'dls.environment' is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
'dls.environment' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with 'dls.environment'. If not, see http://www.gnu.org/licenses/.