Skip to content

Upgrading the versions of pandas and some other dependencies. Also dropping support for Python 3.8. #2778

Upgrading the versions of pandas and some other dependencies. Also dropping support for Python 3.8.

Upgrading the versions of pandas and some other dependencies. Also dropping support for Python 3.8. #2778

Workflow file for this run

---
name: Tests
on:
push:
branches:
- master
pull_request:
jobs:
static-analysis:
name: Static analysis
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/prepare-poetry
with:
python-version: "3.10"
# Post in-line comments for any issues found
# Do not run if coming from a forked repo
# See https://github.com/marketplace/actions/lint-action
- name: Run linters (with annotations)
if: github.event.pull_request.head.repo.full_name == github.repository
uses: wearerequired/lint-action@v2
with:
flake8: true
flake8_command_prefix: poetry run
flake8_dir: resqpy
mypy: true
mypy_command_prefix: poetry run
mypy_args: resqpy
# Alternative step that works with forked repo
- name: Run linters (without annotations)
if: github.event.pull_request.head.repo.full_name != github.repository
run: |
poetry run flake8 .
poetry run mypy resqpy
- name: Code formatting
run: poetry run yapf --diff -r -p .
unit-tests:
name: Unit tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/prepare-poetry
with:
python-version: ${{ matrix.python-version }}
- name: Run pytest
run: poetry run pytest --cov=resqpy --cov-report=xml --junitxml=pytest.xml
- name: Upload pytest artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: Unit Test Results (Python ${{ matrix.python-version }})
path: pytest.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: true
legacy-dependencies:
# Test against older versions of numpy and pandas,
# To ensure resqpy works with the lower bounds of our published constraints
name: Unit tests (older dependencies)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/prepare-poetry
with:
python-version: 3.8
- name: Downgrade numpy and pandas
# Use caret-style requirements (~) to fix minor version but allow patches
run: |
poetry add numpy@~1.22 pandas@~1.1
poetry show
- name: Run pytest
run: poetry run pytest