Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated release file for erroranalysis #2289

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/CI-python-vision.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
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"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

erroranalysis supports 3.6 onwards. Are we willing to drop support for them? If so, please update the setup.py file. Not testing and hoping that it works sounds dangerous to me.

@imatiach-msft FYI

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

- 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 -v -e .[object-detection]
working-directory: ${{ matrix.packageDirectory }}

- 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 }}
16 changes: 16 additions & 0 deletions .github/workflows/release-erroranalysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,47 @@ jobs:
with:
python-version: 3.8

- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.8

- 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

Expand Down