From 623aba69c05f4e366581372cebdf3a3ea4816ae2 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Thu, 9 Feb 2023 16:39:40 -0800 Subject: [PATCH 1/5] Turn off linting by default in VS Code for Python Linting is on by default if you specify the paths to any linters, so the previous settings would turn on **all** linters. Also drop linters that don't see much use. --- src/python/devcontainer-feature.json | 9 ++++----- src/python/install.sh | 30 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/python/devcontainer-feature.json b/src/python/devcontainer-feature.json index 361270b2a..a8771636d 100644 --- a/src/python/devcontainer-feature.json +++ b/src/python/devcontainer-feature.json @@ -63,13 +63,12 @@ "python.defaultInterpreterPath": "/usr/local/python/current/bin/python", "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", "python.formatting.blackPath": "/usr/local/py-utils/bin/black", - "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", - "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", + "python.linting.flake8Enabled": false, "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", - "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", - "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", - "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint" + "python.linting.mypyEnabled": false, + "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint", + "python.linting.pylintEnabled": false } } }, diff --git a/src/python/install.sh b/src/python/install.sh index 3f6b4d9ac..5c2226fc6 100755 --- a/src/python/install.sh +++ b/src/python/install.sh @@ -26,7 +26,7 @@ CONFIGURE_JUPYTERLAB_ALLOW_ORIGIN="${CONFIGUREJUPYTERLABALLOWORIGIN:-""}" # alongside PYTHON_VERSION, but not set as default. ADDITIONAL_VERSIONS="${ADDITIONALVERSIONS:-""}" -DEFAULT_UTILS=("pylint" "flake8" "autopep8" "black" "yapf" "mypy" "pydocstyle" "pycodestyle" "bandit" "pipenv" "virtualenv") +DEFAULT_UTILS=("pylint" "flake8" "autopep8" "black" "mypy" "pipenv" "virtualenv") PYTHON_SOURCE_GPG_KEYS="64E628F8D684696D B26995E310250568 2D347EA6AA65421D FB9921286F5E1540 3A5CA953F73C700D 04C367C218ADD4FF 0EDDC5F26A45C816 6AF053F07D9DC8D2 C9BE28DEE6DF025C 126EB563A74B06BF D9866941EA5BBD71 ED9D77D5" GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com keyserver hkps://keys.openpgp.org @@ -76,7 +76,7 @@ updaterc() { fi } -# Import the specified key in a variable name passed in as +# Import the specified key in a variable name passed in as receive_gpg_keys() { local keys=${!1} local keyring_args="" @@ -94,7 +94,7 @@ receive_gpg_keys() { local retry_count=0 local gpg_ok="false" set +e - until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; + until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; do echo "(*) Downloading GPG key..." ( echo "${keys}" | xargs -n 1 gpg -q ${keyring_args} --recv-keys) 2>&1 && gpg_ok="true" @@ -119,7 +119,7 @@ find_version_from_git_tags() { local repository=$2 local prefix=${3:-"tags/v"} local separator=${4:-"."} - local last_part_optional=${5:-"false"} + local last_part_optional=${5:-"false"} if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then local escaped_separator=${separator//./\\.} local last_part @@ -201,24 +201,24 @@ check_packages() { add_symlink() { if [[ ! -d "${CURRENT_PATH}" ]]; then - ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}" + ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}" fi if [ "${OVERRIDE_DEFAULT_VERSION}" = "true" ]; then if [[ $(ls -l ${CURRENT_PATH}) != *"-> ${INSTALL_PATH}"* ]] ; then rm "${CURRENT_PATH}" - ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}" + ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}" fi fi } install_from_source() { - VERSION=$1 + VERSION=$1 echo "(*) Building Python ${VERSION} from source..." # Install prereqs if missing check_packages curl ca-certificates gnupg2 tar make gcc libssl-dev zlib1g-dev libncurses5-dev \ libbz2-dev libreadline-dev libxml2-dev xz-utils libgdbm-dev tk-dev dirmngr \ - libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev + libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev if ! type git > /dev/null 2>&1; then check_packages git fi @@ -227,7 +227,7 @@ install_from_source() { find_version_from_git_tags VERSION "https://github.com/python/cpython" INSTALL_PATH="${PYTHON_INSTALL_PATH}/${VERSION}" - + if [ -d "${INSTALL_PATH}" ]; then echo "(!) Python version ${VERSION} already exists." exit 1 @@ -275,9 +275,9 @@ install_from_source() { } install_using_oryx() { - VERSION=$1 + VERSION=$1 INSTALL_PATH="${PYTHON_INSTALL_PATH}/${VERSION}" - + if [ -d "${INSTALL_PATH}" ]; then echo "(!) Python version ${VERSION} already exists." exit 1 @@ -359,7 +359,7 @@ export DEBIAN_FRONTEND=noninteractive # General requirements check_packages curl ca-certificates gnupg2 tar make gcc libssl-dev zlib1g-dev libncurses5-dev \ libbz2-dev libreadline-dev libxml2-dev xz-utils libgdbm-dev tk-dev dirmngr \ - libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev + libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev # Install Python from source if needed @@ -370,7 +370,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then usermod -a -G python "${USERNAME}" CURRENT_PATH="${PYTHON_INSTALL_PATH}/current" - + install_python ${PYTHON_VERSION} # Additional python versions to be installed but not be set as default. @@ -391,7 +391,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then updaterc "if [[ \"\${PATH}\" != *\"${CURRENT_PATH}/bin\"* ]]; then export PATH=${CURRENT_PATH}/bin:\${PATH}; fi" PATH="${INSTALL_PATH}/bin:${PATH}" fi - + # Updates the symlinks for os-provided, or the installed python version in other cases chown -R "${USERNAME}:python" "${PYTHON_INSTALL_PATH}" chmod -R g+r+w "${PYTHON_INSTALL_PATH}" @@ -416,7 +416,7 @@ if [[ "${INSTALL_PYTHON_TOOLS}" = "true" ]] && [[ $(python --version) != "" ]]; umask 0002 mkdir -p ${PIPX_BIN_DIR} chown -R "${USERNAME}:pipx" ${PIPX_HOME} - chmod -R g+r+w "${PIPX_HOME}" + chmod -R g+r+w "${PIPX_HOME}" find "${PIPX_HOME}" -type d -print0 | xargs -0 -n 1 chmod g+s # Update pip if not using os provided python From ad0b0cf5e9344131a0d72b614d138335f4bbd5b5 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Fri, 10 Feb 2023 10:45:03 -0800 Subject: [PATCH 2/5] Fix tests --- test/python/install_additional_python.sh | 8 -------- test/python/install_os_provided_python.sh | 10 +--------- test/python/install_via_oryx.sh | 10 +--------- test/python/test.sh | 8 -------- 4 files changed, 2 insertions(+), 34 deletions(-) diff --git a/test/python/install_additional_python.sh b/test/python/install_additional_python.sh index caf2a19d1..5ea2a4410 100755 --- a/test/python/install_additional_python.sh +++ b/test/python/install_additional_python.sh @@ -14,12 +14,8 @@ check "python version 3.9.13 installed" bash -c "ls -l /usr/local/python | gre # Check that tools can execute - make sure something didn't get messed up in this scenario check "autopep8" autopep8 --version check "black" black --version -check "yapf" yapf --version -check "bandit" bandit --version check "flake8" flake8 --version check "mypy" mypy --version -check "pycodestyle" pycodestyle --version -check "pydocstyle" pydocstyle --version check "pylint" pylint --version # Check paths in settings @@ -27,12 +23,8 @@ check "current symlink is correct" bash -c "which python | grep /usr/local/pytho check "current symlink works" /usr/local/python/current/bin/python --version check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8" check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black" -check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf" -check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit" check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8" check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy" -check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle" -check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle" check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint" # Report result diff --git a/test/python/install_os_provided_python.sh b/test/python/install_os_provided_python.sh index 3eb014ccb..850ae93a4 100755 --- a/test/python/install_os_provided_python.sh +++ b/test/python/install_os_provided_python.sh @@ -13,12 +13,8 @@ check "pip is installed" pip3 --version # Check that tools can execute check "autopep8" autopep8 --version check "black" black --version -check "yapf" yapf --version -check "bandit" bandit --version check "flake8" flake8 --version check "mypy" mypy --version -check "pycodestyle" pycodestyle --version -check "pydocstyle" pydocstyle --version check "pylint" pylint --version # Check paths in settings @@ -26,13 +22,9 @@ check "current symlink is correct" bash -c "which python | grep /usr/local/pytho check "current symlink works" /usr/local/python/current/bin/python --version check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8" check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black" -check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf" -check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit" check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8" check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy" -check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle" -check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle" check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/python/install_via_oryx.sh b/test/python/install_via_oryx.sh index 3eb014ccb..850ae93a4 100755 --- a/test/python/install_via_oryx.sh +++ b/test/python/install_via_oryx.sh @@ -13,12 +13,8 @@ check "pip is installed" pip3 --version # Check that tools can execute check "autopep8" autopep8 --version check "black" black --version -check "yapf" yapf --version -check "bandit" bandit --version check "flake8" flake8 --version check "mypy" mypy --version -check "pycodestyle" pycodestyle --version -check "pydocstyle" pydocstyle --version check "pylint" pylint --version # Check paths in settings @@ -26,13 +22,9 @@ check "current symlink is correct" bash -c "which python | grep /usr/local/pytho check "current symlink works" /usr/local/python/current/bin/python --version check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8" check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black" -check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf" -check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit" check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8" check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy" -check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle" -check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle" check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint" # Report result -reportResults \ No newline at end of file +reportResults diff --git a/test/python/test.sh b/test/python/test.sh index 832763d9d..4adaac6a4 100755 --- a/test/python/test.sh +++ b/test/python/test.sh @@ -13,12 +13,8 @@ check "pip is installed" pip3 --version # Check that tools can execute check "autopep8" autopep8 --version check "black" black --version -check "yapf" yapf --version -check "bandit" bandit --version check "flake8" flake8 --version check "mypy" mypy --version -check "pycodestyle" pycodestyle --version -check "pydocstyle" pydocstyle --version check "pylint" pylint --version # Check paths in settings @@ -26,12 +22,8 @@ check "current symlink is correct" bash -c "which python | grep /usr/local/pytho check "current symlink works" /usr/local/python/current/bin/python --version check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8" check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black" -check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf" -check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit" check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8" check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy" -check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle" -check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle" check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint" # Report result From 482ccd77341d7f196ab6a5f49097a800a7262685 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 1 Mar 2023 00:22:26 +0000 Subject: [PATCH 3/5] Revert all changes --- src/python/devcontainer-feature.json | 9 ++++--- src/python/install.sh | 30 +++++++++++------------ test/python/install_additional_python.sh | 8 ++++++ test/python/install_os_provided_python.sh | 10 +++++++- test/python/install_via_oryx.sh | 10 +++++++- test/python/test.sh | 8 ++++++ 6 files changed, 54 insertions(+), 21 deletions(-) diff --git a/src/python/devcontainer-feature.json b/src/python/devcontainer-feature.json index a8771636d..361270b2a 100644 --- a/src/python/devcontainer-feature.json +++ b/src/python/devcontainer-feature.json @@ -63,12 +63,13 @@ "python.defaultInterpreterPath": "/usr/local/python/current/bin/python", "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", "python.formatting.blackPath": "/usr/local/py-utils/bin/black", + "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", + "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", - "python.linting.flake8Enabled": false, "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", - "python.linting.mypyEnabled": false, - "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint", - "python.linting.pylintEnabled": false + "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", + "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", + "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint" } } }, diff --git a/src/python/install.sh b/src/python/install.sh index 5c2226fc6..3f6b4d9ac 100755 --- a/src/python/install.sh +++ b/src/python/install.sh @@ -26,7 +26,7 @@ CONFIGURE_JUPYTERLAB_ALLOW_ORIGIN="${CONFIGUREJUPYTERLABALLOWORIGIN:-""}" # alongside PYTHON_VERSION, but not set as default. ADDITIONAL_VERSIONS="${ADDITIONALVERSIONS:-""}" -DEFAULT_UTILS=("pylint" "flake8" "autopep8" "black" "mypy" "pipenv" "virtualenv") +DEFAULT_UTILS=("pylint" "flake8" "autopep8" "black" "yapf" "mypy" "pydocstyle" "pycodestyle" "bandit" "pipenv" "virtualenv") PYTHON_SOURCE_GPG_KEYS="64E628F8D684696D B26995E310250568 2D347EA6AA65421D FB9921286F5E1540 3A5CA953F73C700D 04C367C218ADD4FF 0EDDC5F26A45C816 6AF053F07D9DC8D2 C9BE28DEE6DF025C 126EB563A74B06BF D9866941EA5BBD71 ED9D77D5" GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com keyserver hkps://keys.openpgp.org @@ -76,7 +76,7 @@ updaterc() { fi } -# Import the specified key in a variable name passed in as +# Import the specified key in a variable name passed in as receive_gpg_keys() { local keys=${!1} local keyring_args="" @@ -94,7 +94,7 @@ receive_gpg_keys() { local retry_count=0 local gpg_ok="false" set +e - until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; + until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; do echo "(*) Downloading GPG key..." ( echo "${keys}" | xargs -n 1 gpg -q ${keyring_args} --recv-keys) 2>&1 && gpg_ok="true" @@ -119,7 +119,7 @@ find_version_from_git_tags() { local repository=$2 local prefix=${3:-"tags/v"} local separator=${4:-"."} - local last_part_optional=${5:-"false"} + local last_part_optional=${5:-"false"} if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then local escaped_separator=${separator//./\\.} local last_part @@ -201,24 +201,24 @@ check_packages() { add_symlink() { if [[ ! -d "${CURRENT_PATH}" ]]; then - ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}" + ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}" fi if [ "${OVERRIDE_DEFAULT_VERSION}" = "true" ]; then if [[ $(ls -l ${CURRENT_PATH}) != *"-> ${INSTALL_PATH}"* ]] ; then rm "${CURRENT_PATH}" - ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}" + ln -s -r "${INSTALL_PATH}" "${CURRENT_PATH}" fi fi } install_from_source() { - VERSION=$1 + VERSION=$1 echo "(*) Building Python ${VERSION} from source..." # Install prereqs if missing check_packages curl ca-certificates gnupg2 tar make gcc libssl-dev zlib1g-dev libncurses5-dev \ libbz2-dev libreadline-dev libxml2-dev xz-utils libgdbm-dev tk-dev dirmngr \ - libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev + libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev if ! type git > /dev/null 2>&1; then check_packages git fi @@ -227,7 +227,7 @@ install_from_source() { find_version_from_git_tags VERSION "https://github.com/python/cpython" INSTALL_PATH="${PYTHON_INSTALL_PATH}/${VERSION}" - + if [ -d "${INSTALL_PATH}" ]; then echo "(!) Python version ${VERSION} already exists." exit 1 @@ -275,9 +275,9 @@ install_from_source() { } install_using_oryx() { - VERSION=$1 + VERSION=$1 INSTALL_PATH="${PYTHON_INSTALL_PATH}/${VERSION}" - + if [ -d "${INSTALL_PATH}" ]; then echo "(!) Python version ${VERSION} already exists." exit 1 @@ -359,7 +359,7 @@ export DEBIAN_FRONTEND=noninteractive # General requirements check_packages curl ca-certificates gnupg2 tar make gcc libssl-dev zlib1g-dev libncurses5-dev \ libbz2-dev libreadline-dev libxml2-dev xz-utils libgdbm-dev tk-dev dirmngr \ - libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev + libxmlsec1-dev libsqlite3-dev libffi-dev liblzma-dev uuid-dev # Install Python from source if needed @@ -370,7 +370,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then usermod -a -G python "${USERNAME}" CURRENT_PATH="${PYTHON_INSTALL_PATH}/current" - + install_python ${PYTHON_VERSION} # Additional python versions to be installed but not be set as default. @@ -391,7 +391,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then updaterc "if [[ \"\${PATH}\" != *\"${CURRENT_PATH}/bin\"* ]]; then export PATH=${CURRENT_PATH}/bin:\${PATH}; fi" PATH="${INSTALL_PATH}/bin:${PATH}" fi - + # Updates the symlinks for os-provided, or the installed python version in other cases chown -R "${USERNAME}:python" "${PYTHON_INSTALL_PATH}" chmod -R g+r+w "${PYTHON_INSTALL_PATH}" @@ -416,7 +416,7 @@ if [[ "${INSTALL_PYTHON_TOOLS}" = "true" ]] && [[ $(python --version) != "" ]]; umask 0002 mkdir -p ${PIPX_BIN_DIR} chown -R "${USERNAME}:pipx" ${PIPX_HOME} - chmod -R g+r+w "${PIPX_HOME}" + chmod -R g+r+w "${PIPX_HOME}" find "${PIPX_HOME}" -type d -print0 | xargs -0 -n 1 chmod g+s # Update pip if not using os provided python diff --git a/test/python/install_additional_python.sh b/test/python/install_additional_python.sh index 5ea2a4410..caf2a19d1 100755 --- a/test/python/install_additional_python.sh +++ b/test/python/install_additional_python.sh @@ -14,8 +14,12 @@ check "python version 3.9.13 installed" bash -c "ls -l /usr/local/python | gre # Check that tools can execute - make sure something didn't get messed up in this scenario check "autopep8" autopep8 --version check "black" black --version +check "yapf" yapf --version +check "bandit" bandit --version check "flake8" flake8 --version check "mypy" mypy --version +check "pycodestyle" pycodestyle --version +check "pydocstyle" pydocstyle --version check "pylint" pylint --version # Check paths in settings @@ -23,8 +27,12 @@ check "current symlink is correct" bash -c "which python | grep /usr/local/pytho check "current symlink works" /usr/local/python/current/bin/python --version check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8" check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black" +check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf" +check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit" check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8" check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy" +check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle" +check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle" check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint" # Report result diff --git a/test/python/install_os_provided_python.sh b/test/python/install_os_provided_python.sh index 850ae93a4..3eb014ccb 100755 --- a/test/python/install_os_provided_python.sh +++ b/test/python/install_os_provided_python.sh @@ -13,8 +13,12 @@ check "pip is installed" pip3 --version # Check that tools can execute check "autopep8" autopep8 --version check "black" black --version +check "yapf" yapf --version +check "bandit" bandit --version check "flake8" flake8 --version check "mypy" mypy --version +check "pycodestyle" pycodestyle --version +check "pydocstyle" pydocstyle --version check "pylint" pylint --version # Check paths in settings @@ -22,9 +26,13 @@ check "current symlink is correct" bash -c "which python | grep /usr/local/pytho check "current symlink works" /usr/local/python/current/bin/python --version check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8" check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black" +check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf" +check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit" check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8" check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy" +check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle" +check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle" check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint" # Report result -reportResults +reportResults \ No newline at end of file diff --git a/test/python/install_via_oryx.sh b/test/python/install_via_oryx.sh index 850ae93a4..3eb014ccb 100755 --- a/test/python/install_via_oryx.sh +++ b/test/python/install_via_oryx.sh @@ -13,8 +13,12 @@ check "pip is installed" pip3 --version # Check that tools can execute check "autopep8" autopep8 --version check "black" black --version +check "yapf" yapf --version +check "bandit" bandit --version check "flake8" flake8 --version check "mypy" mypy --version +check "pycodestyle" pycodestyle --version +check "pydocstyle" pydocstyle --version check "pylint" pylint --version # Check paths in settings @@ -22,9 +26,13 @@ check "current symlink is correct" bash -c "which python | grep /usr/local/pytho check "current symlink works" /usr/local/python/current/bin/python --version check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8" check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black" +check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf" +check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit" check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8" check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy" +check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle" +check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle" check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint" # Report result -reportResults +reportResults \ No newline at end of file diff --git a/test/python/test.sh b/test/python/test.sh index 4adaac6a4..832763d9d 100755 --- a/test/python/test.sh +++ b/test/python/test.sh @@ -13,8 +13,12 @@ check "pip is installed" pip3 --version # Check that tools can execute check "autopep8" autopep8 --version check "black" black --version +check "yapf" yapf --version +check "bandit" bandit --version check "flake8" flake8 --version check "mypy" mypy --version +check "pycodestyle" pycodestyle --version +check "pydocstyle" pydocstyle --version check "pylint" pylint --version # Check paths in settings @@ -22,8 +26,12 @@ check "current symlink is correct" bash -c "which python | grep /usr/local/pytho check "current symlink works" /usr/local/python/current/bin/python --version check "which autopep8" bash -c "which autopep8 | grep /usr/local/py-utils/bin/autopep8" check "which black" bash -c "which black | grep /usr/local/py-utils/bin/black" +check "which yapf" bash -c "which yapf | grep /usr/local/py-utils/bin/yapf" +check "which bandit" bash -c "which bandit | grep /usr/local/py-utils/bin/bandit" check "which flake8" bash -c "which flake8 | grep /usr/local/py-utils/bin/flake8" check "which mypy" bash -c "which mypy | grep /usr/local/py-utils/bin/mypy" +check "which pycodestyle" bash -c "which pycodestyle | grep /usr/local/py-utils/bin/pycodestyle" +check "which pydocstyle" bash -c "which pydocstyle | grep /usr/local/py-utils/bin/pydocstyle" check "which pylint" bash -c "which pylint | grep /usr/local/py-utils/bin/pylint" # Report result From 6b02170239d890e75bf8542050a37efe65f0ac1c Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 1 Mar 2023 00:25:23 +0000 Subject: [PATCH 4/5] Remove paths to under-utilized tools and turn off all linting by default --- src/python/devcontainer-feature.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/python/devcontainer-feature.json b/src/python/devcontainer-feature.json index 361270b2a..a8771636d 100644 --- a/src/python/devcontainer-feature.json +++ b/src/python/devcontainer-feature.json @@ -63,13 +63,12 @@ "python.defaultInterpreterPath": "/usr/local/python/current/bin/python", "python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", "python.formatting.blackPath": "/usr/local/py-utils/bin/black", - "python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", - "python.linting.banditPath": "/usr/local/py-utils/bin/bandit", "python.linting.flake8Path": "/usr/local/py-utils/bin/flake8", + "python.linting.flake8Enabled": false, "python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", - "python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", - "python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", - "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint" + "python.linting.mypyEnabled": false, + "python.linting.pylintPath": "/usr/local/py-utils/bin/pylint", + "python.linting.pylintEnabled": false } } }, From 8516fb08a7bd4167bfe7b5ee233c6753296e9cdd Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 1 Mar 2023 00:25:32 +0000 Subject: [PATCH 5/5] Bump the version number --- src/python/devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/devcontainer-feature.json b/src/python/devcontainer-feature.json index a8771636d..c5f0d76f9 100644 --- a/src/python/devcontainer-feature.json +++ b/src/python/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "python", - "version": "1.0.20", + "version": "1.0.21", "name": "Python", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/python", "description": "Installs the provided version of Python, as well as PIPX, and other common Python utilities. JupyterLab is conditionally installed with the python feature. Note: May require source code compilation.",