Contributing

To contribute to Musify, follow these steps:

Setup your development environment

  1. Ensure you have Python3.12 or greater installed on your system.

  2. Go to the GitHub repository and fork the project by clicking Fork in the top left:

    _images/musify_fork.png
  3. Go to the page of your GitHub account’s fork of Musify and clone the repository:

    _images/musify_clone.png
  4. In a terminal, navigate to the directory of the cloned project and create a virtual environment for Musify:

    python -m venv .venv
    
  5. Install the dependencies with pip for the changes you wish to make as follows:

    pip install -e '.[test]'  # installs just the core package + the required dependencies for testing
    pip install -e '.[dev]'  # installs the `test` dependencies + dependencies for linting and other development uses
    pip install -e '.[docs]'  # installs just the core package + the required dependencies for building documentation
    
  6. Optionally, to ensure inhreitance diagrams in the documentation render correctly, install graphviz. See here for platform-specific info on how to install graphviz.

Making changes and testing

Create a new branch in your local git project and commit changes to this branch as you develop.

All tests are located within ./tests. If you make any changes to the functionality of the package, you must either modify or add new tests for these changes. To run tests, you must have installed either the test or dev optional dependencies and run pytest i.e.:

pytest
# OR
pytest path/to/test/file.py

As part of code validation, your code will be required to pass certain linting checks. This project uses flake8 to help give an indication as to the quality of your code. For the current checks that your code will be expected to pass, please check the .flake8 config file in the root of the project.

To run these checks locally, simply run the following command in a terminal:

flake8

Submitting your changes for review

  1. Ensure all tests pass locally first.

  2. Add any changes you made to the Release History.

  3. Go to your forked repository and open a pull request for your branch.

    _images/musify_pr_new.png _images/musify_pr_create1.png
  4. Add a title, a motivation for your changes, and the changes you have made. This can just be a copy-paste from your release history notes.

    _images/musify_pr_create2.png
  5. Wait for a review and make any necessary changes.

  6. Have your changes committed 🎉