Skip to content

Latest commit

 

History

History
126 lines (82 loc) · 3.73 KB

CONTRIBUTING.rst

File metadata and controls

126 lines (82 loc) · 3.73 KB

Contributing

This document briefly describes how to contribute to ms2rescore.

Before you begin

If you have an idea for a feature, use case to add or an approach for a bugfix, you are welcome to communicate it with the community by opening a thread in GitHub Discussions or in GitHub Issues.

Welcome contributions include:

  • New features, such as the addition of new feature generators
  • Improvements of existing functionality
  • Bugfixes

Development setup

Local install

  1. Setup Python 3, and preferably create a virtual environment.
  2. Clone the ms2rescore repository.
  3. Use pip in editable mode to setup the development environment:
pip install --editable .[dev,docs]

Pre-commit hooks

Pre-commit hooks ensure that certain checks are performed before making a new commit. For instance, the black pre-commit hook is used to format all Python code, and jsonschema2md is used to automatically generate Markdown documentation for the configuration file. Setup the pre-commit hooks with:

pre-commit install

Unit tests

Run tests with pytest:

pytest ./tests

Documentation

To work on the documentation and get a live preview, install the requirements and run sphinx-autobuild:

pip install .[docs]
sphinx-autobuild  --watch ./ms2rescore ./docs/source/ ./docs/_build/html/

Then browse to http://localhost:8000 to watch the live preview.

How to contribute

  • Fork ms2rescore on GitHub to make your changes.

  • Commit and push your changes to your fork.

  • Ensure that the tests and documentation (both Python docstrings and files in /docs/source/) have been updated according to your changes. Python docstrings are formatted in the numpydoc style.

  • Open a pull request with these changes. You pull request message ideally should include:

    • A description of why the changes should be made.
    • A description of the implementation of the changes.
    • A description of how to test the changes.
  • The pull request should pass all the continuous integration tests which are automatically run by GitHub Actions.

Release workflow

  • When a new version is ready to be published:

    1. Change the __version__ in ms2rescore/__init__.py following semantic versioning.
    2. Update the changelog (if not already done) in CHANGELOG.md according to Keep a Changelog.
    3. Merge all final changes with the main branch.
    4. On GitHub, draft a new release with the new version number and the changes that are listed in CHANGELOG.md.
  • When a new release is published on GitHub, the following GitHub Actions are triggered:

    1. The Python package is build and published to PyPI.
    2. The Windows installer is build with pyInstaller and InnoSetup and published to the GitHub release.
  • A webhook triggers a new build of the documentation on Read the Docs.

  • The Bioconda recipe is automatically updated by the Bioconda bot, and subsequently both the Conda Python package and the Docker image are build.