Contributing
Warning
This section of the documentation in under construction.
py-clesperanto is a Python API layer for the CLIc library.
Several operation and functionality are directly inherited from the CLIc library, compiled and imported in the package as _clesperanto
.
Arround this C++ core, the package as several Python code to ensure proper integration with the Python ecosystem (numpy, etc.).
Therefore, it is possible to contribute to the development of py-clesperanto either on the C++ side or on the Python side depending on what you are trying to achieve.
Environment setup
Like for any other python development we encourage you to use a virtual environment to develop py-clesperanto. Here we will describe how to setup a development environment for py-clesperanto with conda/mamba.
Create a new environment with conda/mamba:
mamba create -n pycle-dev python=3.9 -c conda-forge
conda activate pycle-dev
Install the dependencies:
mamba install -c conda-forge numpy pytest jupyter scikit-image black flake8 pre-commit
Setup pre-commit:
pre-commit install
Install py-clesperanto in development mode:
pip install . -v
Run the tests:
pytest
All tests should pass.
The pip install
command will compile and install the package in the environment.
You will now be able to modify the pyclesperanto
package and see the changes directly in the environment.
The pre-commit
tool will ensure that the code is properly formatted and linted before any commit.
Warning
-e
flag of the pip install
command is not available for the moment.
Versioning
pyClesperanto version folows the CLIc versioning. Although they are not necessarily made to be identically, the versioning is kept in sync as much as possible.
In order to update the version of pyClesperanto, you will need to follow the following steps:
Update the CLIc version tag used in the
CMakeLists.txt
file at the root of the project.Update the version in the pyproject.toml file.
Update the version in the pyclesperanto/_version.py file. Both
VERSION
andCLIC_VERSION
should be updated accordingly.
Note
The version tag in the pyproject.toml
file should be made automatic in the near future.