diff --git a/README.md b/README.md index 47589dc..303e46f 100644 --- a/README.md +++ b/README.md @@ -159,7 +159,7 @@ To debug tests running in the container, use the `rapids.cudf.pytest.debug`: make rapids.cudf.pytest.debug args="-k 'test_reindex_dataframe'" ``` -This launches pytest with `ptvsd` for debugging in VSCode. +This launches pytest with `debugpy` for debugging in VSCode. ### Working interactively in the RAPIDS container diff --git a/dockerfiles/rapids.Dockerfile b/dockerfiles/rapids.Dockerfile index 38ee818..8a27918 100644 --- a/dockerfiles/rapids.Dockerfile +++ b/dockerfiles/rapids.Dockerfile @@ -27,7 +27,7 @@ if [[ "$USE_FISH_SHELL" == "YES" ]]; then \ fi' \ && apt update \ && apt install --no-install-recommends -y \ - jq ed git vim nano sudo curl wget entr \ + jq ed git vim nano sudo curl wget entr less \ # CMake dependencies curl libssl-dev libcurl4-openssl-dev zlib1g-dev \ # Need tzdata for the pyarrow<->ORC tests diff --git a/etc/bash-utils.sh b/etc/bash-utils.sh index d8d3939..63ed137 100755 --- a/etc/bash-utils.sh +++ b/etc/bash-utils.sh @@ -129,7 +129,7 @@ # Commands to run each project's pytests: # # Note: These commands automatically change into the correct directory before executing `pytest`. -# Note: Pass --debug to use with the VSCode debugger `ptvsd`. All other arguments are forwarded to pytest. +# Note: Pass --debug to use with the VSCode debugger `debugpy`. All other arguments are forwarded to pytest. # Note: Arguments that end in '.py' are assumed to be pytest files used to reduce the number of tests # collected on startup by pytest. These arguments will be expanded out to their full paths relative # to the directory where pytests is run. @@ -143,7 +143,7 @@ # Usage: # test-cudf-python -n - Run all pytests in parallel with `pytest-xdist` # test-cudf-python -v -x -k 'a_test_function_name' - Run all tests named 'a_test_function_name', be verbose, and exit on first fail -# test-cudf-python -v -x -k 'a_test_function_name' --debug - Run all tests named 'a_test_function_name', and start ptvsd for VSCode debugging +# test-cudf-python -v -x -k 'a_test_function_name' --debug - Run all tests named 'a_test_function_name', and start debugpy for VSCode debugging # test-cudf-python -v -x -k 'test_a or test_b' foo/test_file.py - Run all tests named 'test_a' or 'test_b' in file paths matching foo/test_file.py # ### @@ -1259,7 +1259,7 @@ test-python() { if [[ $debug != true ]]; then eval "set -x; pytest $args $paths"; else - eval "set -x; python -m ptvsd --host 0.0.0.0 --port 5678 --wait -m pytest $args $paths"; + eval "set -x; python -m debugpy --listen 0.0.0.0:5678 --wait-for-client -m pytest $args $paths"; fi ) } diff --git a/etc/conda-install.sh b/etc/conda-install.sh index 1db9690..48fc2a3 100755 --- a/etc/conda-install.sh +++ b/etc/conda-install.sh @@ -54,16 +54,21 @@ touch $INSIDE__ENV_YML CHANGED="$(diff -qw $OUTSIDE_ENV_YML $INSIDE__ENV_YML || true)" FRESH_CONDA_ENV=${FRESH_CONDA_ENV:-0} +RECREATE_CONDA_ENV=0 -# if no directory for the conda env, create the conda env -if [ ! -d "$CONDA_HOME/envs/$ENV_NAME" ]; then - FRESH_CONDA_ENV=1 +create-conda-env() { # create a new environment mamba update -n base -c defaults conda mamba update -n base -c conda-forge mamba mamba env create -n $ENV_NAME --file $INSIDE__ENV_YML # copy the conda environment.yml from inside the container to the outside cp $INSIDE__ENV_YML $OUTSIDE_ENV_YML +} + +# if no directory for the conda env, create the conda env +if [ ! -d "$CONDA_HOME/envs/$ENV_NAME" ]; then + FRESH_CONDA_ENV=1 + create-conda-env # otherwise if the environment.yml inside/outside are different, update the existing conda env elif [ -n "${CHANGED// }" ]; then ( @@ -91,17 +96,28 @@ elif [ -n "${CHANGED// }" ]; then cp $INSIDE__ENV_YML $OUTSIDE_ENV_YML else while true; do - read -p "Failed to update conda environment. Continue anyway? (Y/N, default: Y) " CHOICE /dev/null 2>&1; diff --git a/etc/conda-merge.sh b/etc/conda-merge.sh index 3289c2a..98c6c01 100755 --- a/etc/conda-merge.sh +++ b/etc/conda-merge.sh @@ -20,7 +20,7 @@ dependencies: - pytest-xdist - python=${PYTHON_VERSION} - pip: - - ptvsd + - debugpy EOF CUDA_TOOLKIT_VERSION=${CONDA_CUDA_TOOLKIT_VERSION:-$CUDA_SHORT_VERSION}; diff --git a/etc/rapids/.bashrc b/etc/rapids/.bashrc index 1a8a698..9c3e269 100644 --- a/etc/rapids/.bashrc +++ b/etc/rapids/.bashrc @@ -33,6 +33,9 @@ shopt -s checkwinsize # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" +# Support UTF-8 characters in less +export LESSCHARSET='utf-8' + # set variable identifying the chroot you work in (used in the prompt below) if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot)