Local python functions and classes that are available for general python use.
- Prerequisites
- Installation
- Pip Installation
- Testing
- Unit
- Integration
- List of Linux packages that need to be installed on the server.
- git
- python-pip
- From here on out, any reference to {Python_Project} or PYTHON_PROJECT replace with the baseline path of the python lib project and any reference to {Other_Python_Project} with the baseline path of another python program.
Create requirements-python-lib.txt file. This will require access to a clone of the python-lib project.
cp {Python_Project}/python-lib/requirements-python-lib.txt {Other_Python_Project}/requirements-python-lib.txt
Modify the other program's README.md file to add the pip commands under the "Install supporting classes and libraries" section.
Modify the {Other_Python_Project}/README.md file:
pip install -r requirements-python-lib.txt --target lib --system
Add the general python-lib requirements to the other program's requirements.txt file. Remove any duplicates.
Add/modify the following lines to the {Other_Python_Project}/requirements.txt file:
simplejson==2.0.9
Install the project using git.
cd {Python_Project}
git clone git@github.com:deepcoder42/python-lib.git
Install/upgrade system modules.
cd python-lib
sudo bash
umask 022
pip install -r requirements.txt --upgrade --system
exit
cd {Python_Project}/python-lib
test/unit/gen_libs/unit_test_run.sh
test/unit/arg_parser/unit_test_run.sh
test/unit/gen_class/unit_test_run.sh
test/unit/cmds_gen/unit_test_run.sh
test/unit/errors/unit_test_run.sh
test/unit/machine/unit_test_run.sh
cd {Python_Project}/python-lib
test/unit/gen_libs/code_coverage.sh
test/unit/arg_parser/code_coverage.sh
test/unit/gen_class/code_coverage.sh
test/unit/cmds_gen/code_coverage.sh
test/unit/errors/code_coverage.sh
test/unit/machine/code_coverage.sh
Install the project using the procedures in the Installation section under Unit Testing.
cd {Python_Project}/python-lib
test/unit/arg_parser/integration_test_run.sh
test/unit/gen_libs/integration_test_run.sh