diff --git a/.azure_pipelines/ci-eval-pr.yaml b/.azure_pipelines/ci-eval-pr.yaml index 4e7f86034..7b2825523 100644 --- a/.azure_pipelines/ci-eval-pr.yaml +++ b/.azure_pipelines/ci-eval-pr.yaml @@ -40,13 +40,14 @@ jobs: source activate $(condaEnvFileSuffix) pip install yapf==0.32.0 pip install isort==5.10.1 - ./format.sh + echo Using $(yapf --version) isort $(isort --vn) + ./format.sh --eval displayName: Format Code - bash: | - num_changed_files=`git ls-files --others -m --exclude-standard | wc -l` + num_changed_files=`git ls-files --others -m --exclude-standard ./trulens_eval | wc -l` if [ $num_changed_files -ne 0 ]; then echo "The following files have changed after running format.sh. Please format your code and update the PR." - git ls-files --others -m --exclude-standard + git ls-files --others -m --exclude-standard ./trulens_eval echo "\n\nOutputting git diff for checked in files.\n" git diff fi diff --git a/.azure_pipelines/ci-eval.yaml b/.azure_pipelines/ci-eval.yaml index cbc108fdd..2db591a1a 100644 --- a/.azure_pipelines/ci-eval.yaml +++ b/.azure_pipelines/ci-eval.yaml @@ -59,13 +59,14 @@ jobs: - bash: | set -e source activate $(condaEnvFileSuffix) - ./format.sh + echo Using $(yapf --version) isort $(isort --vn) + ./format.sh --eval displayName: Format Code - bash: | - num_changed_files=`git ls-files --others -m --exclude-standard | wc -l` + num_changed_files=`git ls-files --others -m --exclude-standard ./trulens_eval | wc -l` if [ $num_changed_files -ne 0 ]; then echo "The following files have changed after running format.sh. Please format your code and update the PR." - git ls-files --others -m --exclude-standard + git ls-files --others -m --exclude-standard ./trulens_eval echo "\n\nOutputting git diff for checked in files.\n" git diff fi diff --git a/.azure_pipelines/ci.yaml b/.azure_pipelines/ci.yaml index eb4fcee9f..1e7af009a 100644 --- a/.azure_pipelines/ci.yaml +++ b/.azure_pipelines/ci.yaml @@ -22,33 +22,33 @@ jobs: strategy: matrix: - py37_tf1_keras: - condaEnvFileSuffix: "python37" + py38_tf1_keras: + condaEnvFileSuffix: "python38" requirementsFile: "tests/keras/requirements_tfv1.txt" testSubdirectory: "tests/keras" - py37_tf1_tf_keras: - condaEnvFileSuffix: "python37" + py38_tf1_tf_keras: + condaEnvFileSuffix: "python38" requirementsFile: "tests/tf_keras/requirements_tfv1.txt" testSubdirectory: "tests/tf_keras" - py37_pytorch: - condaEnvFileSuffix: "python37" + py38_pytorch: + condaEnvFileSuffix: "python38" requirementsFile: "tests/pytorch/requirements.txt" testSubdirectory: "tests/pytorch" - py37_tf1: - condaEnvFileSuffix: "python37" + py38_tf1: + condaEnvFileSuffix: "python38" requirementsFile: "tests/tf/requirements.txt" testSubdirectory: "tests/tf" - py37_tf2: - condaEnvFileSuffix: "python37" + py38_tf2: + condaEnvFileSuffix: "python38" requirementsFile: "tests/tf2/requirements.txt" testSubdirectory: "tests/tf2" - py37_tf2_non_eager: - condaEnvFileSuffix: "python37" + py38_tf2_non_eager: + condaEnvFileSuffix: "python38" requirementsFile: "tests/tf2/requirements.txt" testSubdirectory: "tests/tf2_non_eager" @@ -92,14 +92,14 @@ jobs: - bash: | set -e source activate $(condaEnvFileSuffix) - echo Using yapf $(yapf --version) - ./format.sh + echo Using $(yapf --version) isort $(isort --vn) + ./format.sh --explain displayName: Format Code - bash: | - num_changed_files=`git ls-files --others -m --exclude-standard | wc -l` + num_changed_files=`git ls-files --others -m --exclude-standard ./trulens_explain | wc -l` if [ $num_changed_files -ne 0 ]; then echo "The following files have changed after running format.sh. Please format your code and update the PR." - git ls-files --others -m --exclude-standard + git ls-files --others -m --exclude-standard ./trulens_explain echo "\n\nOutputting git diff for checked in files.\n" git diff fi diff --git a/format.sh b/format.sh index 3de858f81..50012868e 100755 --- a/format.sh +++ b/format.sh @@ -1,5 +1,15 @@ #/bin/bash +if [ $# -eq 0 ] ; then + FORMAT_PATH=. +elif [ $1 = "--explain" ]; then + FORMAT_PATH=./trulens_explain +elif [ $1 = "--eval" ]; then + FORMAT_PATH=./trulens_eval +else + echo "Got invalid flag $1" + exit 1 +fi -isort . - -yapf --style .style.yapf -r -i --verbose --parallel -r -i . +echo "Formatting $FORMAT_PATH" +isort $FORMAT_PATH +yapf --style .style.yapf -r -i --verbose --parallel -r -i $FORMAT_PATH diff --git a/trulens_explain/Makefile b/trulens_explain/Makefile index dda8647c1..804e50da8 100644 --- a/trulens_explain/Makefile +++ b/trulens_explain/Makefile @@ -3,7 +3,7 @@ SHELL:=bash ACTIVATE:=source $$(conda info --base)/etc/profile.d/conda.sh ; conda activate ; conda activate -CONDA_ENV:=python37 +CONDA_ENV:=python38 TEST_ENV:=PYTHONPATH=. CUDA_VISIBLE_DEVICES= format: diff --git a/trulens_explain/tools/conda_python37.yaml b/trulens_explain/tools/conda_python38.yaml similarity index 92% rename from trulens_explain/tools/conda_python37.yaml rename to trulens_explain/tools/conda_python38.yaml index a32d6358e..cd5ec4a97 100644 --- a/trulens_explain/tools/conda_python37.yaml +++ b/trulens_explain/tools/conda_python38.yaml @@ -1,5 +1,5 @@ #TODO: This is incomplete and does not include all the dependencies required for development. -name: python37 +name: python38 channels: - defaults dependencies: @@ -30,4 +30,4 @@ dependencies: - python-markdown-math==0.7 - yapf==0.32.0 - isort==5.10.1 -prefix: /home/truera/miniconda3/envs/python37 +prefix: /home/truera/miniconda3/envs/python38