Python libraries to assist with writing Linux Ops scripts.
This library currently requires compatibility with:
- 2.6
- 2.7
- 3.4
However, additional versions are tested automatically.
Each module is versioned so that they can undergo significant changes without impacting the function and stability of the scripts that use them.
For example:
from opscripts.config import v6 as ops_config from opscripts.logging import v2 as ops_logging from opscripts.utils import v8 as ops_utils
For a more in-depth examples, see the:
opscripts.config
opscripts.yaml
- ordereddict (only required by Python 2.6)
- PyYAML
- Unit Tests
- mock (only required by Python < 3.3)
- pytest
- pytest-catchlog
- pytest-colordots
- pytest-flakes
- pytest-localserver
- pytest-pep8
- pytest-pep257
- pytest-pythonpath
- pytest-remove-stale-bytecode
- pytest-warnings
Change directory into repository (into same directory as where this README resides).
Install virtual environment:
mkvirtualenv -a . -r tests/requirements.txt opscripts_test
If installing requirements errors, update pip:
pip install --upgrade pip
Install requirements:
pip install -r tests/requirements.txt
Run pytest:
py.test
To test against alternate Python versions, it may be useful to create virtual
environments with an interpreter other than the one with which virtualenv
was installed, e.g. for non-default python3:
mkvirtualenv -a . -p $(which python3) -r tests/requirements.txt \ opscripts_test3