Skip to content

Commit 74fd5c3

Browse files
committed
update CONTRIBUTING to add import_tests notebook validation step
1 parent 024c91c commit 74fd5c3

File tree

1 file changed

+36
-17
lines changed

1 file changed

+36
-17
lines changed

CONTRIBUTING.md

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
11
# Contributing to Notebooks
22

3-
## Notebook Naming
3+
# Notebooks
44

5-
Notebooks cannot have spaces in the paths. Use underscores instead. This is
5+
## Names
6+
7+
Notebook filenames cannot have spaces. Use underscores instead. This is
68
because pytest does not like spaces in command line arguments.
79

8-
## Docker Image Validation
10+
## Dependencies
11+
12+
When a new notebook has a dependency that is not yet supported by the Docker image,
13+
a new Docker image must be built. Additionally, add the new dependency to the
14+
[imports_test notebook](development-notebooks/imports_test.ipynb).
15+
16+
## Skipping Validation
17+
18+
To enable validation of the Docker image, every notebook should run successfully
19+
when run from the command line. For notebooks where that just is not possible,
20+
the notebooks can be excluded from automated running by adding its path to
21+
[tests/skip_notebooks](tests/skip_notebooks). Excluding a notebook from automated running
22+
means that it is excluded from Docker Image validation. **If a notebook is
23+
skipped, it will not be guaranteed to be supported by the Docker image.**
24+
25+
# Docker Image
26+
27+
## Validation
28+
29+
**Every time** the Docker image is changed, at the very least ensure that the
30+
python packages still import without error by running the
31+
[imports_test notebook](development-notebooks/imports_test.ipynb).
932

10-
The docker image must be able to run all notebooks. Whenever a change is made to
11-
the docker image, it must be validated. This can be accomplished by automatically
12-
running all of the notebooks using the supplied test script. This is accomplished
13-
by running the notebook in interactive mode, achieved by adding `/bin/bash` to
33+
It is also strongly recommended that you ensure the Docker image can run all
34+
of the notebooks in the repository. This can be accomplished by automatically
35+
running all of the notebooks using the supplied test script. To run the test script,
36+
run the notebook in interactive mode, achieved by adding `/bin/bash` to
1437
the container run command, e.g.
1538
```bash
1639
docker run -it --rm -p 8888:8888 -v $PWD:/home/jovyan/work -e PL_API_KEY='[YOUR-API-KEY]' planet-notebooks /bin/bash
@@ -35,14 +58,10 @@ From the root directory within the docker container, run one of the following:
3558
$> pytest tests/test_notebooks.py --notebooks "$(grep -rl import <package> jupyter-notebooks/)"
3659
```
3760

38-
## Automated Running and Skipping
39-
40-
To enable validation of the Docker image, every notebook should run successfully
41-
when run from the command line. For notebooks where that just is not possible,
42-
the notebooks can be excluded from automated running by adding its path to
43-
`tests/skip_notebooks`. Excluding a notebook from automated running
44-
means that it is excluded from Docker Image validation. **If a notebook is
45-
skipped, it will not be guaranteed to be supported by the Docker image.**
61+
## Skipping Notebooks
4662

47-
Skipping of notebooks within `skip_notebooks` can be achieved with by adding the
48-
`--no-skip` option to the pytest command.
63+
Some notebooks are purposefully skipped in the validation process because they
64+
do not run successfully from the command line. These notebooks are specified in
65+
[tests/skip_notebooks](tests/skip_notebooks). Skipping of notebooks within
66+
`skip_notebooks` can be disabled by adding the `--no-skip` option to the pytest
67+
command.

0 commit comments

Comments
 (0)