Contributing to napari
We welcome your contributions! Please see the provided steps below and never hesitate to contact us.
If you are a new user, we recommend checking out the detailed Github Guides.
Setting up a development installation
If you are not familiar with
git, we recommend reading up on this guide.
Clone the forked repository to your local machine and change directories:
$ git clone https://github.com/your-username/napari.git $ cd napari
upstream remote to the base
$ git remote add upstream https://github.com/napari/napari.git
Install the required dependencies:
$ pip install -r requirements.txt
Make the development version available globally:
$ pip install -e .
$ pre-commit install
Upon committing, your code will be formatted according to our
which includes the settings
skip-string-normalization = true and
max-line-length = 79.
To learn more, see
Code will also be linted to enforce the stylistic and logistical rules specified in our
flake8 configuration, which currently ignores E203, E501, W503 and C901. For information on any specific flake8 error code, see the Flake8 Rules. You may also wish to refer to the PEP 8 style guide.
If you wish to tell the linter to ignore a specific line use the
# noqa comment along with the specific error code (e.g.
import sys # noqa: E402) but please do not ignore errors lightly.
Building the icons
Our icon build process starts with a base set of
svg formatted icons stored in
napari/resources/icons/svg. If you want to add a new icon to the app, make the icon in whatever program you like, add it to that folder, and make sure it is listed in both
Then run the following command
python -m napari.resources.build_icons
This creates separate folders in
napari/resources/icons with full colored icon sets for each of our themes.
Make sure that the file
napari/resources/icons/res.qrc has a list of all the icons with the correct prefix for each of our themes, e.g.
Finally, compile all the icons for use in the app by calling either
# for PySide2 users pyside2-rcc -o napari/resources/qt.py napari/resources/res.qrc
# for PyQt5 users pyrcc5 -o napari/resources/qt.py napari/resources/res.qrc
depending on if you are using
PyQt5 respectively. Those two commands are automatically installed when
pip installing the respective packages.
Finally inside the autogenerated
napari/resources/qt.py replace either
qtpy to ensure compatibility with both packages.
If you want to change one of the existing icons, modify the version in
napari/resources/icons/svg and run the commands above.
Create a new feature branch:
$ git checkout master -b your-branch-name
git will automatically detect changes to a repository.
You can view them with:
$ git status
Add and commit your changed files:
$ git add my-file-or-directory $ git commit -m "my message"
Help us make sure it's you
To set it, use
git config --global user.email email@example.com.
Keeping your branches up-to-date
Switch to the
$ git checkout master
Fetch changes and update
$ git pull upstream master --tags
This is shorthand for:
$ git fetch upstream master --tags $ git merge upstream/master
Update your other branches:
$ git checkout your-branch-name $ git merge master
Sharing your changes
Update your remote branch:
$ git push -u origin your-branch-name
You can then make a pull-request to
Building the docs
From the project root:
$ make docs
The docs will be built at
Most web browsers will allow you to preview HTML pages.
file:///absolute/path/to/napari/docs/build/html/index.html in your address bar.
Code of conduct
napari has a Code of Conduct that should be honored by everyone who participates in the
Questions, comments, and feedback
If you have questions, comments, suggestions for improvement, or any other inquiries regarding the project, feel free to open an issue.