Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbunnyru committed Nov 21, 2023
1 parent d53e397 commit 0a75e3d
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ repos:
hooks:
- id: blacken-docs
# --skip-errors is added to allow us to have python syntax highlighting even if
# the python code blocks includes jupyter specific additions such as % or !
# the python code blocks include jupyter-specific additions such as % or !
# See https://github.com/adamchainz/blacken-docs/issues/127 for an upstream
# feature request about this.
args: [--target-version=py39, --skip-errors]
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ for information about how to contribute
[features](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/features.html),
[recipes](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/recipes.html),
[tests](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/tests.html),
[community-maintained stacks](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/stacks.html).
and [community-maintained stacks](https://jupyter-docker-stacks.readthedocs.io/en/latest/contributing/stacks.html).

<!-- markdownlint-disable-file MD041 -->
8 changes: 4 additions & 4 deletions docs/using/selecting.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ It contains:
[Dockerfile commit history](https://github.com/jupyter/docker-stacks/commits/main/images/base-notebook/Dockerfile) |
[Quay.io image tags](https://quay.io/repository/jupyter/base-notebook?tab=tags)

`jupyter/base-notebook` adds base Jupyter Applications like JupyterLab, Jupyter Notebook, JupyterHub and NBClassic
`jupyter/base-notebook` adds base Jupyter Applications like JupyterLab, Jupyter Notebook, JupyterHub, and NBClassic
and serves as the basis for all other stacks besides `jupyter/docker-stacks-foundation`.

It contains:
Expand Down Expand Up @@ -83,7 +83,7 @@ It contains:
[git](https://git-scm.com/),
[nano](https://www.nano-editor.org/) (actually `nano-tiny`),
[tzdata](https://www.iana.org/time-zones),
[unzip](https://code.launchpad.net/ubuntu/+source/unzip)
[unzip](https://code.launchpad.net/ubuntu/+source/unzip),
and [vi](https://www.vim.org) (actually `vim-tiny`),
- [TeX Live](https://www.tug.org/texlive/) for notebook document conversion

Expand Down Expand Up @@ -193,7 +193,7 @@ It contains:
[Dockerfile commit history](https://github.com/jupyter/docker-stacks/commits/main/images/datascience-notebook/Dockerfile) |
[Quay.io image tags](https://quay.io/repository/jupyter/datascience-notebook?tab=tags)

`jupyter/datascience-notebook` includes libraries for data analysis from the Python, and R, and Julia communities.
`jupyter/datascience-notebook` includes libraries for data analysis from the Python, R, and Julia communities.

- Everything in the `jupyter/scipy-notebook`, `jupyter/r-notebook`, and `jupyter/julia-notebook` images and their ancestor
images
Expand Down Expand Up @@ -244,7 +244,7 @@ Every Monday and whenever a pull request is merged, images are rebuilt and pushe

Whenever a docker image is pushed to the container registry, it is tagged with:

- a `latest` tag
- the `latest` tag
- a 12-character git commit SHA like `1ffe43816ba9`
- a date formatted like `2023-01-30`
- OS version like `ubuntu-22.04`
Expand Down
2 changes: 1 addition & 1 deletion images/docker-stacks-foundation/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \

USER ${NB_UID}

# Pin Python version here, or set it to "default"
# Pin the Python version here, or set it to "default"
ARG PYTHON_VERSION=3.11

# Setup work directory for backward-compatibility
Expand Down
8 changes: 4 additions & 4 deletions images/docker-stacks-foundation/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

set -e

# The _log function is used for everything this script wants to log. It will
# always log errors and warnings, but can be silenced for other messages
# by setting JUPYTER_DOCKER_STACKS_QUIET environment variable.
# The _log function is used for everything this script wants to log.
# It will always log errors and warnings but can be silenced for other messages
# by setting the JUPYTER_DOCKER_STACKS_QUIET environment variable.
_log () {
if [[ "$*" == "ERROR:"* ]] || [[ "$*" == "WARNING:"* ]] || [[ "${JUPYTER_DOCKER_STACKS_QUIET}" == "" ]]; then
echo "$@"
Expand Down Expand Up @@ -62,7 +62,7 @@ if [ "$(id -u)" == 0 ]; then
_log "- home dir: /home/jovyan -> /home/${NB_USER}"
fi
elif ! id -u "${NB_USER}" &> /dev/null; then
_log "ERROR: Neither the jovyan user or '${NB_USER}' exists. This could be the result of stopping and starting, the container with a different NB_USER environment variable."
_log "ERROR: Neither the jovyan user nor '${NB_USER}' exists. This could be the result of stopping and starting, the container with a different NB_USER environment variable."
exit 1
fi
# Ensure the desired user (NB_USER) gets its desired user id (NB_UID) and is
Expand Down
4 changes: 2 additions & 2 deletions tagging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ For example, we dump all the `conda` packages, including their versions.
- All the images are located in a hierarchical tree.
More info on [image relationships](../docs/using/selecting.md#image-relationships).
- We have `tagger` and `manifest` classes, which can be run inside docker containers to obtain tags and build manifest pieces.
- These classes are inherited from the parent image to all the children images.
- Because manifests and tags might change from parent to children, `taggers` and `manifests` are reevaluated on each image.
- These classes are inherited from the parent image to all the child images.
- Because manifests and tags might change from parent to child, `taggers` and `manifests` are reevaluated on each image.
So, the values are not inherited.
- To tag an image and create a manifest, run `make hook/base-notebook` (or another image of your choice).

Expand Down
2 changes: 1 addition & 1 deletion tagging/apply_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def apply_tags(
arg_parser.add_argument(
"--short-image-name",
required=True,
help="Short image name to apply tags for",
help="Short image name",
)
arg_parser.add_argument(
"--tags-dir",
Expand Down
2 changes: 1 addition & 1 deletion tagging/merge_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def merge_tags(
arg_parser.add_argument(
"--short-image-name",
required=True,
help="Short image name to apply tags for",
help="Short image name",
)
arg_parser.add_argument(
"--tags-dir",
Expand Down
2 changes: 1 addition & 1 deletion tagging/write_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def write_manifest(
arg_parser.add_argument(
"--short-image-name",
required=True,
help="Short image name to create manifests for",
help="Short image name",
)
arg_parser.add_argument(
"--hist-lines-dir",
Expand Down
2 changes: 1 addition & 1 deletion tagging/write_tags_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def write_tags_file(
arg_parser.add_argument(
"--short-image-name",
required=True,
help="Short image name to write tags for",
help="Short image name",
)
arg_parser.add_argument(
"--tags-dir",
Expand Down
6 changes: 3 additions & 3 deletions tests/R_mimetype_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
def check_r_mimetypes(container: TrackedContainer) -> None:
"""Check if Rscript command can be executed"""
LOGGER.info("Test that R command can be executed ...")
Rcommand = 'if (length(getOption("jupyter.plot_mimetypes")) != 5) {stop("missing jupyter.plot_mimetypes")}'
R_MIMETYPES_CHECK_CMD = 'if (length(getOption("jupyter.plot_mimetypes")) != 5) {stop("missing jupyter.plot_mimetypes")}'
logs = container.run_and_wait(
timeout=10,
tty=True,
command=["Rscript", "-e", Rcommand],
command=["Rscript", "-e", R_MIMETYPES_CHECK_CMD],
)
LOGGER.debug(f"{logs=}")
assert len(logs) == 0, f"Command {Rcommand=} failed"
assert len(logs) == 0, f"Command {R_MIMETYPES_CHECK_CMD=} failed"
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def __init__(
self.kwargs: Any = kwargs

def run_detached(self, **kwargs: Any) -> Container:
"""Runs a docker container using the preconfigured image name
and a mix of the preconfigured container options and those passed
"""Runs a docker container using the pre-configured image name
and a mix of the pre-configured container options and those passed
to this method.
Keeps track of the docker.Container instance spawned to kill it
Expand Down
2 changes: 1 addition & 1 deletion tests/docker-stacks-foundation/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
test_packages
~~~~~~~~~~~~~~~
This test module tests if R and Python packages installed can be imported.
This test module tests if the R and Python packages installed can be imported.
It's a basic test aiming to prove that the package is working properly.
The goal is to detect import errors that can be caused by incompatibilities between packages, for example:
Expand Down
2 changes: 1 addition & 1 deletion tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_image(short_image_name: str, registry: str, owner: str) -> None:
arg_parser.add_argument(
"--short-image-name",
required=True,
help="Short image name to run test on",
help="Short image name",
)
arg_parser.add_argument(
"--registry",
Expand Down

0 comments on commit 0a75e3d

Please sign in to comment.