Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
You can contribute in many ways:
Report bugs at https://github.com/MeridianInnovation/colormap-tool/issues
If you are reporting a bug, please include:
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement a fix for it.
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
colormap-tool could always use more documentation, whether as part of the official docs, in docstrings, or even on the web in blog posts, articles, and such.
The best way to send feedback is to file an issue at https://github.com/MeridianInnovation/colormap-tool/issues.
If you are proposing a new feature:
- Explain in detail how it would work.
- Keep the scope as narrow as possible, to make it easier to implement.
Ready to contribute? Here's how to set up colormap-tool for local development.
Please note this documentation assumes you already have uv and Git installed and ready to go.
-
Fork the
colormap-toolrepo on GitHub. -
Clone your fork locally:
In a standard setup, you generally have an origin and an upstream remote. Latter is the upstream repo you forked from.
cd <directory_in_which_repo_should_be_created>
git clone git@github.com:YOUR_NAME/colormap-tool.git
# Add the upstream remote
git remote add upstream git@github.com:MeridianInnovation/colormap-tool.gitVerify that the remote is added correctly:
git remote -v
origin git@github.com:YOUR_NAME/colormap-tool.git (fetch)
origin git@github.com:YOUR_NAME/colormap-tool.git (push)
upstream git@github.com:MeridianInnovation/colormap-tool.git (fetch)
upstream git@github.com:MeridianInnovation/colormap-tool.git (push)
- Now we need to install the environment. Navigate into the directory
cd colormap-toolThen, install and activate the environment with:
uv venv --seed
uv syncWe recommend using uv to manage the development environment because it provides a consistent and reproducible environment for all developers and is easy to setup.
- Install pre-commit to run linters/formatters at commit time:
uv run pre-commit install --install-hooksWe also provide a Makefile to help you with these tasks.
You can use the make (or ./make on windows) command to print the available commands.
For Step 3 and 4, you can use below commands as well:
# On macOS and Linux
make install
# On Windows
./make install- Once the environment is set up, you can start working on your feature or bugfix.
We follow the GitFlow branching model.
All the features and bugfixes should be branched from develop instead of main.
First, remember to sync with the upstream repo every time you start working on a new feature or bugfix.
# Switch to the develop branch
git checkout develop
# Fetch the latest changes from the upstream repo
git fetch upstream
# Merge the latest changes from the upstream repo
git pull --rebase upstream develop
# (Optional) Push the updated develop branch to your fork
git push origin developOr use Makefile to sync with upstream repo:
make sync- Create a new branch for your feature or bugfix.
You can use the git flow extension to simplify this process.
The git flow extension is already included in Git for Windows version 2.5.3 and later.
# Using git-flow
git flow feature start feature/your-feature-name
# Using standard git
git checkout develop
git checkout -b feature/your-feature-nameNow you can make your changes locally.
Don't forget to add test cases for your added functionality to the tests directory.
- When you're done making changes, check that your changes pass the formatting tests.
# Use Makefile
# On macOS and Linux
make check
make test
# On Windows
./make check
./make test
# Or Standard Command
# check
uv lock --locked
uv run pre-commit run -a
uv run mypy
uv run deptry src
# test
uv run python -m pytest --doctest-modules
- (Optional) Before raising a pull request you should also run tox. This will run the tests across different versions of Python:
toxThis requires you to have multiple versions of python installed. This step is also triggered in the CI/CD pipeline, so you could also choose to skip this step locally.
- Commit your changes.
# Add all changes
git add .
# Commit with a conventional commit message
# Please see #Commit Message Guidelines for details
git commit -m "feat: add your feature"- After you have finished your feature, you should publish it to your fork.
# Using git-flow
git flow feature publish feature/your-feature-name
# Using standard git
git push origin feature/your-feature-name- Now you can submit a pull request on GitHub.
You need to send a pull request that merges your feature branch into the develop branch of the original repository.
If you don't know how to do this, you can follow the instructions on the GitHub documentation.
Once the PR review is passed, the PR will be merged into the develop branch.
If for some reason, you are asked to make changes to your PR, you need to:
- Make the changes in your local branch.
- Commit the changes with a new commit message.
- You can use the
git commit --fixup <commit_hash>command to create a fixup commit. - Or you can use the
git commit --amendand thengit push --force(be careful!) to update the existing commit.
- You can use the
- Push the changes to your fork.
- Add a comment in the PR to notify the reviewer that you have made changes.
- Wait for the reviewer to review the changes.
Before you submit a pull request, check that it meets these guidelines:
-
The pull request should include tests.
-
If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring, and add the feature to the list in
README.md.
We follow a simplified Git Flow + GitHub Flow model:
| Branch | Purpose |
|---|---|
main |
Production-ready code only |
develop |
Integration branch for development |
feature/* |
New features (feature/login-api) |
bugfix/* |
Non-urgent bug fixes |
hotfix/* |
Urgent fixes for production |
release/* |
Pre-release preparations |
developis the default working branch.- All features and fixes are branched from
develop. - When a feature or bugfix is complete, it is merged into
develop. - When
develophas accumulated enough features for a release, a release branch is created. - When the release is ready, the release branch is merged into
main.
All commit messages should follow the Conventional Commits specification.
feat:- New featurefix:- Bug fixrefactor:- Code refactoringchore:- Build tasks or maintenancedocs:- Documentation only changestest:- Adding or updating tests
feat: add user authentication
fix: correct typo in login controller
- Fork the repository.
- Clone your fork locally.
- Create a branch for local development.
- Write clean, tested code and follow the commit message guidelines.
- Run pre-commit hooks locally.
- Push to your fork/branch.
- Open a pull request.