
VIPSCore-Python-Common
User guide
This is the source code for the module that contains the common data models and utilities for the Python implementation(s) of VIPS. It can be installed with pip like this:
# From local path, if you've cloned the Git repo
pip3 install /home/foo/vipscore-python-common/
# From GitLab
pip3 install git+https://gitlab.nibio.no/VIPS/vipscore-python-common.git@0.2.4
...where the version is specified after the @
. You can omit everything from @
if you want the latest version
If you're implementing a VIPS model, typical imports would be
from vipscore_common.vips_model import VIPSModel
from vipscore_common.entities import Result, ModelConfiguration, WeatherObservation
from vipscore_common.data_utils import *
Read more about implementing a VIPS Model using Python
Developer guide
Developing and testing this package requires that you set up a virtualenv:
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ python -m pip install -e .
Unit tests
The tests are located in the tests
folder, and we're using Pytest
To run the unit tests, make sure you've activated this project's virtualen (see "Developer guide") move to the root folder of the project, and execute:
pytest -v
Using bumpver
For developers: When you want to publish a new version, use
# Increment the PATCH version when you make backwards compatible bug fixes.
bumpver update --patch
# Increment the MINOR version when you add functionality in a backwards compatible manner.
bumpver update --minor
# Increment the MAJOR version when you make incompatible API changes.
bumpver update --major
References
We used this excellent guide for packaging: https://realpython.com/pypi-publish-python-package/