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:
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:
``` bash
``` bash
...
@@ -23,16 +23,18 @@ from vipscore_common.data_utils import *
...
@@ -23,16 +23,18 @@ from vipscore_common.data_utils import *
Read more about [implementing a VIPS Model using Python](/docs/VIPSModel.md)
Read more about [implementing a VIPS Model using Python](/docs/VIPSModel.md)
## Developer guide
## Developer guide
Developing and testing this package requires that you set up a virtualenv:
### Unit tests
The tests are located in the `tests` folder, and we're using [Pytest](https://docs.pytest.org/)
Prerequisite: To test, use a venv, install this package in it by running:
``` bash
``` bash
$ python3 -m venv venv
$ source venv/bin/activate
(venv)$ python -m pip install-e .
(venv)$ python -m pip install-e .
```
```
To run the unit tests, move to the root folder of the project, and execute:
### Unit tests
The tests are located in the `tests` folder, and we're using [Pytest](https://docs.pytest.org/)
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:
``` bash
``` bash
pytest -v
pytest -v
...
@@ -55,43 +57,3 @@ bumpver update --major
...
@@ -55,43 +57,3 @@ bumpver update --major
### References
### References
We used this excellent guide for packaging: https://realpython.com/pypi-publish-python-package/
We used this excellent guide for packaging: https://realpython.com/pypi-publish-python-package/
### Deployment
Whenever changes are pushed to the repository, the pipeline defined in `.gitlab-ci.yml` is triggered. Here, there are three jobs: build, test and deploy.
The final job will only be performed for the `main` branch. Please note that publishing a package to the package repository will fail (= red deploy job)
if the version of the package has not been bumped since the previous deploy.
Follow these steps for running build, test + deploy on your laptop:
1. Create [Personal access token](https://gitlab.nibio.no/-/profile/personal_access_tokens) with name=`gitlab-pypi` and scope=`Api`.
2. Create file `~/.pypirc` with the following content: