From 7336bf4c3f25eed0d0b8b41a678911afd5dec6a3 Mon Sep 17 00:00:00 2001 From: Advitya Gemawat Date: Mon, 28 Aug 2023 20:00:23 -0400 Subject: [PATCH 1/5] Update release-erroranalysis.yml --- .github/workflows/release-erroranalysis.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/release-erroranalysis.yml b/.github/workflows/release-erroranalysis.yml index 80604ddece..b52abe7611 100644 --- a/.github/workflows/release-erroranalysis.yml +++ b/.github/workflows/release-erroranalysis.yml @@ -27,31 +27,47 @@ jobs: with: python-version: 3.8 + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: ${{ matrix.pythonVersion }} + + - name: Install pytorch + shell: bash -l {0} + run: | + conda install --yes --quiet pytorch torchvision captum cpuonly -c pytorch + - name: update and upgrade pip, setuptools, wheel, and twine + shell: bash -l {0} run: | python -m pip install --upgrade pip pip install --upgrade setuptools wheel twine - name: install requirements.txt for erroranalysis + shell: bash -l {0} run: | pip install -r requirements.txt pip install -r requirements-dev.txt working-directory: erroranalysis - name: pip freeze + shell: bash -l {0} run: pip freeze - name: build wheel for erroranalysis + shell: bash -l {0} run: python setup.py sdist bdist_wheel working-directory: erroranalysis # run tests before publishing to PyPI - name: install erroranalysis wheel locally + shell: bash -l {0} run: find ./dist/ -name '*.whl' -exec pip install {} \; working-directory: erroranalysis - name: run erroranalysis tests + shell: bash -l {0} run: pytest ./tests/ working-directory: erroranalysis From f11192d3603c1b12ca21ab465d09faf76cc1f021 Mon Sep 17 00:00:00 2001 From: Advitya Gemawat Date: Tue, 29 Aug 2023 16:34:17 -0400 Subject: [PATCH 2/5] pinned conda version --- .github/workflows/release-erroranalysis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-erroranalysis.yml b/.github/workflows/release-erroranalysis.yml index b52abe7611..0cbccc679e 100644 --- a/.github/workflows/release-erroranalysis.yml +++ b/.github/workflows/release-erroranalysis.yml @@ -30,7 +30,7 @@ jobs: - uses: conda-incubator/setup-miniconda@v2 with: auto-update-conda: true - python-version: ${{ matrix.pythonVersion }} + python-version: 3.8 - name: Install pytorch shell: bash -l {0} From 29f345da806485676cad8862396d85e7008cc755 Mon Sep 17 00:00:00 2001 From: Advitya Gemawat Date: Thu, 31 Aug 2023 09:30:55 -0400 Subject: [PATCH 3/5] python vision tests --- .github/workflows/CI-python-vision.yml | 146 +++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 .github/workflows/CI-python-vision.yml diff --git a/.github/workflows/CI-python-vision.yml b/.github/workflows/CI-python-vision.yml new file mode 100644 index 0000000000..cb7c5567b1 --- /dev/null +++ b/.github/workflows/CI-python-vision.yml @@ -0,0 +1,146 @@ +name: CI Python Vision + +on: + push: + branches: [main] + pull_request: + branches: [main] + paths: + - "erroranalysis/**" + - "rai_test_utils/**" + - ".github/workflows/CI-python-vision.yml" + +jobs: + ci-python: + strategy: + matrix: + packageDirectory: + ["erroranalysis", "rai_test_utils"] + operatingSystem: [ubuntu-latest, macos-latest, windows-latest] + pythonVersion: ["3.8", "3.9", "3.10"] + exclude: + - operatingSystem: macos-latest + pythonVersion: "3.8" + + runs-on: ${{ matrix.operatingSystem }} + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.pythonVersion }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.pythonVersion }} + + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: ${{ matrix.pythonVersion }} + + - if: ${{ matrix.operatingSystem != 'macos-latest' }} + name: Install pytorch on non-MacOS + shell: bash -l {0} + run: | + conda install --yes --quiet pytorch torchvision captum cpuonly -c pytorch + + - if: ${{ matrix.operatingSystem == 'macos-latest' }} + name: Install Anaconda packages on MacOS, which should not include cpuonly according to official docs + shell: bash -l {0} + run: | + conda install --yes --quiet pytorch torchvision captum -c pytorch + + - if: ${{ matrix.operatingSystem == 'macos-latest' }} + name: Install latest lightgbm from conda-forge for MacOS + shell: bash -l {0} + run: | + conda install --yes --quiet lightgbm -c conda-forge + + - name: Setup tools + shell: bash -l {0} + run: | + python -m pip install --upgrade pip + pip install --upgrade setuptools + pip install --upgrade "pip-tools<=7.1.0" + + - name: Install package dependencies + shell: bash -l {0} + run: | + pip install -r requirements-dev.txt + working-directory: ${{ matrix.packageDirectory }} + + - name: Install package extras + shell: bash -l {0} + run: | + pip install -r requirements-object-detection.txt + working-directory: ${{ matrix.packageDirectory }} + + - name: Install package + shell: bash -l {0} + run: | + pip install -v -e . + working-directory: ${{ matrix.packageDirectory }} + + - name: Pip freeze + shell: bash -l {0} + run: | + pip freeze > installed-requirements-dev.txt + cat installed-requirements-dev.txt + working-directory: raiwidgets + + - name: Upload requirements + uses: actions/upload-artifact@v3 + with: + name: requirements-dev.txt + path: raiwidgets/installed-requirements-dev.txt + + - name: Run tests + shell: bash -l {0} + run: | + pytest --durations=10 --doctest-modules --junitxml=junit/test-results.xml --cov=${{ matrix.packageDirectory }} --cov-report=xml --cov-report=html + working-directory: ${{ matrix.packageDirectory }} + + - name: Upload code coverage results + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.packageDirectory }}-code-coverage-results + path: ${{ matrix.packageDirectory }}/htmlcov + # Use always() to always run this step to publish test results when there are test failures + if: ${{ always() }} + + - if: ${{ (matrix.operatingSystem == 'windows-latest') && (matrix.pythonVersion == '3.8') }} + name: Upload to codecov + id: codecovupload1 + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ${{ matrix.packageDirectory }} + env_vars: OS,PYTHON + fail_ci_if_error: false + files: ./${{ matrix.packageDirectory }}/coverage.xml + flags: unittests + name: codecov-umbrella + verbose: true + + - if: ${{ (steps.codecovupload1.outcome == 'failure') && (matrix.pythonVersion == '3.8') && (matrix.operatingSystem == 'windows-latest') }} + name: Retry upload to codecov + id: codecovupload2 + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ${{ matrix.packageDirectory }} + env_vars: OS,PYTHON + fail_ci_if_error: false + files: ./${{ matrix.packageDirectory }}/coverage.xml + flags: unittests + name: codecov-umbrella + verbose: true + + - name: Set codecov status + if: ${{ (matrix.pythonVersion == '3.8') && (matrix.operatingSystem == 'windows-latest') }} + shell: bash + run: | + if ${{ (steps.codecovupload1.outcome == 'success') || (steps.codecovupload2.outcome == 'success') }} ; then + echo fine + else + exit 1 + fi From e4540a094c9952c53f71f379f5b12c0a5470244b Mon Sep 17 00:00:00 2001 From: Advitya Gemawat Date: Thu, 31 Aug 2023 11:16:34 -0400 Subject: [PATCH 4/5] comment updates --- .github/workflows/CI-python-vision.yml | 53 -------------------------- 1 file changed, 53 deletions(-) diff --git a/.github/workflows/CI-python-vision.yml b/.github/workflows/CI-python-vision.yml index cb7c5567b1..b2faccffbf 100644 --- a/.github/workflows/CI-python-vision.yml +++ b/.github/workflows/CI-python-vision.yml @@ -80,13 +80,6 @@ jobs: pip install -v -e . working-directory: ${{ matrix.packageDirectory }} - - name: Pip freeze - shell: bash -l {0} - run: | - pip freeze > installed-requirements-dev.txt - cat installed-requirements-dev.txt - working-directory: raiwidgets - - name: Upload requirements uses: actions/upload-artifact@v3 with: @@ -98,49 +91,3 @@ jobs: run: | pytest --durations=10 --doctest-modules --junitxml=junit/test-results.xml --cov=${{ matrix.packageDirectory }} --cov-report=xml --cov-report=html working-directory: ${{ matrix.packageDirectory }} - - - name: Upload code coverage results - uses: actions/upload-artifact@v3 - with: - name: ${{ matrix.packageDirectory }}-code-coverage-results - path: ${{ matrix.packageDirectory }}/htmlcov - # Use always() to always run this step to publish test results when there are test failures - if: ${{ always() }} - - - if: ${{ (matrix.operatingSystem == 'windows-latest') && (matrix.pythonVersion == '3.8') }} - name: Upload to codecov - id: codecovupload1 - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ${{ matrix.packageDirectory }} - env_vars: OS,PYTHON - fail_ci_if_error: false - files: ./${{ matrix.packageDirectory }}/coverage.xml - flags: unittests - name: codecov-umbrella - verbose: true - - - if: ${{ (steps.codecovupload1.outcome == 'failure') && (matrix.pythonVersion == '3.8') && (matrix.operatingSystem == 'windows-latest') }} - name: Retry upload to codecov - id: codecovupload2 - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - directory: ${{ matrix.packageDirectory }} - env_vars: OS,PYTHON - fail_ci_if_error: false - files: ./${{ matrix.packageDirectory }}/coverage.xml - flags: unittests - name: codecov-umbrella - verbose: true - - - name: Set codecov status - if: ${{ (matrix.pythonVersion == '3.8') && (matrix.operatingSystem == 'windows-latest') }} - shell: bash - run: | - if ${{ (steps.codecovupload1.outcome == 'success') || (steps.codecovupload2.outcome == 'success') }} ; then - echo fine - else - exit 1 - fi From b15705abbab72ffecb49b783c83d33f89f307041 Mon Sep 17 00:00:00 2001 From: Advitya Gemawat Date: Thu, 31 Aug 2023 11:27:17 -0400 Subject: [PATCH 5/5] comment updates --- .github/workflows/CI-python-vision.yml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/CI-python-vision.yml b/.github/workflows/CI-python-vision.yml index b2faccffbf..25061ac3ec 100644 --- a/.github/workflows/CI-python-vision.yml +++ b/.github/workflows/CI-python-vision.yml @@ -49,12 +49,6 @@ jobs: run: | conda install --yes --quiet pytorch torchvision captum -c pytorch - - if: ${{ matrix.operatingSystem == 'macos-latest' }} - name: Install latest lightgbm from conda-forge for MacOS - shell: bash -l {0} - run: | - conda install --yes --quiet lightgbm -c conda-forge - - name: Setup tools shell: bash -l {0} run: | @@ -68,16 +62,10 @@ jobs: pip install -r requirements-dev.txt working-directory: ${{ matrix.packageDirectory }} - - name: Install package extras - shell: bash -l {0} - run: | - pip install -r requirements-object-detection.txt - working-directory: ${{ matrix.packageDirectory }} - - - name: Install package + - name: Install package + extras shell: bash -l {0} run: | - pip install -v -e . + pip install -v -e .[object-detection] working-directory: ${{ matrix.packageDirectory }} - name: Upload requirements