diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index a9d3ec90..1571f611 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -19,34 +19,34 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' # Use Python 3.10 - - name: Install git run: | - if [[ "$RUNNER_OS" == "Linux" ]]; then + if [ "$RUNNER_OS" == "Linux" ]; then sudo apt-get update sudo apt-get install -y git - elif [[ "$RUNNER_OS" == "macOS" ]]; then + elif [ "$RUNNER_OS" == "macOS" ]; then brew install git - elif [[ "$RUNNER_OS" == "Windows" ]]; then - choco install git + elif [ "$RUNNER_OS" == "Windows" ]; then + choco install git -y --no-progress || powershell -Command "Start-Sleep -Seconds 30; choco install git -y --no-progress" fi shell: bash + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.10' # Use Python 3.10 + - name: Install dependencies run: | python -m pip install --upgrade pip if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install jupyter nbconvert flake8 flake8-nb + pip install jupyter nbconvert flake8 flake8-nb ipython shell: bash - name: Create Flake8 configuration file run: | echo "[flake8]" > .flake8 - echo "max-line-length = 99" >> .flake8 + echo "max-line-length = 119" >> .flake8 shell: bash - name: Run Flake8 linting on notebooks @@ -71,7 +71,7 @@ jobs: done shell: bash - - name: Run converted Python scripts + - name: Run converted Python scripts with IPython id: execute run: | mkdir -p logs @@ -79,7 +79,7 @@ jobs: for script in converted_scripts/*.py; do [ -e "$script" ] || continue echo "Running $script" - python "$script" > "logs/$(basename "$script" .py).txt" 2>&1 || script_errors=$((script_errors+1)) + ipython "$script" > "logs/$(basename "$script" .py).txt" 2>&1 || script_errors=$((script_errors+1)) done echo "script_errors=$script_errors" >> $GITHUB_ENV shell: bash