Skip to content

Fix/geolib 216 pydantic issue distilled #41

Fix/geolib 216 pydantic issue distilled

Fix/geolib 216 pydantic issue distilled #41

Workflow file for this run

# This workflow is aimed at testing GEOLib with Pydantic v1
name: ci-pydantic-v1
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
CI:
strategy:
fail-fast: false
matrix:
python-version: [3.9, "3.10", "3.11", "3.12"]
os: [ubuntu-22.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4.1.0
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4.7.1
with:
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.6.1
- name: Cache Poetry virtualenv
uses: actions/cache@v3
id: cache
with:
path: ~/.virtualenvs
key: venv--${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}-v1
restore-keys: |
venv--${{ matrix.os }}-${{ matrix.python-version }}-v1
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
# To force Pydantic v1, we install the package before the dependencies. This
# simulates a user who has Pydantic v1 required from another package.
- name: Install Pydantic v1
run: |
poetry remove pydantic-settings pydantic-extra-types
poetry add pydantic==1.10.7
# Install dependencies. This function will take the already installed Pydantic v1
- name: Install Dependencies
run: poetry install -E server
- name: Test with pytest
run: poetry run pytest --cov=geolib --cov-report xml:coverage-reports/coverage-hydrolib-core.xml --junitxml=xunit-reports/xunit-result-hydrolib-core.xml -m "unittest and not workinprogress"