How do I run the CI tests locally in a fork of the repo?

How can I run the CI tests locally before pushing so I can catch things like stylistic mistakes?

Hi @jeremy9959

There is a “getting started” chapter tin the Dev Guide that explains how to get all the necessary dependencies installed:[1]

https://docs.bokeh.org/en/latest/docs/dev_guide/setup.html#devguide-setup

Note that those docs published from the last release are slightly out of date. We just got rid of pytest marks, and expect to run top-level test categories by directory, instead of via -m <mark>. In particular, to run the codebase checks, execute

py.test tests/codebase

from the top level. That will run flake8, mypy, isort etc.

EDIT: one more recent update: you will also need to manually pip install channels or else isort will get confused (there is not a conda package for it yet AFAIK)


  1. If you are not using conda, you can install the test deps manually I suppose, they are listed in conda.receipe/meta.yaml ↩︎

BTW if you are interested in other issues to contribute to, there was a recent issue to further streamline the dev setup process:

Basically, to generate dev_requirements.txt and an environment.yml that are more “standard” than the experience now with our deps.py script.

Thanks, I had set everything up but I couldn’t find the py.test tests/codebase.

Actually I have one other question on this general topic. When I wanted to test my proposed new code I needed to use version 1.4 of bokeh. The bokeh repo master branch comes in at the cutting edge. I checked out v1.4.0 so that was ok but I’m not sure if that’s the correct approach for contributing in other ways. I wonder if there’s a place where I can read about the right git protocol for contributing to a big complicated project like this one?

Well, I thought your comment was on the issue so I actually answered there :slight_smile:

1 Like