| description | Development notes regarding Metacity package |
|---|
After uploading any code to the Metacity GitHub repo, the actions specified in ci.yaml are executed. Generally, it involves
- Building the C++ parts of the code
- Running tests with
pytest- see Testing
Metacity is written in Python and C++ using pybind11. If you want to edit the package code yourself, we recommend following these steps first:
Clone the repository:
git clone git@github.com:MetacitySuite/Metacity.git(Optional but strongly recommended) Initialize local Python virtual environment
cd Metacity
python -m venv env
. ./env/bin/activateAny time you make a change to the C++ or Python code, you can build it with:
pip install .{% hint style="info" %}
Up to version 0.5.3 there was a bug in the setup, which caused pollution of the python environment folder with files unrelated to the installation. This has been fixed.
{% endhint %}
If you encounter any problems, ensure you:
- have
CMakeinstalled - have a C++ compiler supporting C++14 installed
Metacity comes with a few testing datasets and uses pytest. To run the tests locally, with coverage analysis, run:
python -m pytest tests/* --cov=metacity --cov-report term-missingIf you need to see the output of the tested code, run the command above with an extra flag -s
The tests are located inside the tests directory:
tests/conftest.pycontains fixtures providing the testing data.tests/test_module.pycontains individual tests, themoduleplaceholder in the filename is usually replaced with the name of the tested Python module (not required)
Always test your code!
Everything merged into the branch release gets released. Before you publish a new version:
- make sure the version number in your code is set up correctly
| Branch | Status | Description |
|---|---|---|
| release | for production | |
| dev | merged PRs auto tested, for development |