This module provides basic functionality that's often reinvented across many of Zaber's scripts. It provides a unified configuration interface to allow a single YAML file to hold information that can be used across multiple applications as well as generic tools to handle basic services such as logging, email and templates.
Other modules such as izaber-cron will allow additional services such as scheduled event and SQL support.
API documentation, usage and examples can be found in the "docs" directory.
This library is uploaded to PyPi. Installation for usage can be done with:
pip install python-izaber
For hacking on the code, this requires the following:
git
python3
- poetry
git clone [email protected]:zabertech/python-izaber.git
cd python-izaber
poetry install
poetry shell
And now it's possible to make changes to the code
As we test on multiple versions of python, getting setup for tests is a bit annoying.
Running on Ubuntu, the setup process is to install the appropriate python versions as well as required support binaries and libraries.
sudo add-apt-repository ppa:deadsnakes/ppa
sudo add-apt-repository ppa:pypy/ppa
sudo apt install pypy3 python3.6 python3.7 python3.8 python3.9 libxml2-dev libxslt1-dev build-essential pypy3-dev python3.6-dev python3.7-dev python3.8-dev python3.9-dev libssl-dev
Then running the tests becomes:
poetry run nox
It's not always desireable to pollute the environment with multiple versions of python so a Dockerfile is provided for testing.
docker build -t tests-izaber .
docker run tests-izaber
To use the local copy of the library files, can do the following instead:
docker run --rm -v `pwd`:/src tests-izaber
- Ensure that the
pyproject.toml
has the newest version. - Update the
VERSIONS.md
with the changes made into the library - Then, assuming access to the pypi account. Poetry can publish to PyPI
poetry build poetry publish