Skip to content

model_fields not settable directly #2380

model_fields not settable directly

model_fields not settable directly #2380

Workflow file for this run

name: testing
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
max-parallel: 2
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/requirements-${{ matrix.os }}_py${{ matrix.python-version }}.txt
pip install -r requirements/requirements-${{ matrix.os }}_py${{ matrix.python-version }}_extras.txt
- name: Set SSL_CERT_FILE (Linux)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: echo "SSL_CERT_FILE=$(python -m certifi)" >> $GITHUB_ENV
- name: Set SSL_CERT_FILE (Windows)
if: matrix.os == 'windows-latest'
run: echo "SSL_CERT_FILE=$(python -m certifi)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Format API key name (Linux/MacOS)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
echo "API_KEY_NAME=$(echo ${{ format('MP_API_KEY_{0}_{1}', matrix.os, matrix.python-version) }} | awk '{gsub(/-|\./, "_"); print}' | tr '[:lower:]' '[:upper:]')" >> $GITHUB_ENV
- name: Format API key name (Windows)
if: matrix.os == 'windows-latest'
run: |
echo "API_KEY_NAME=$(echo ${{ format('MP_API_KEY_{0}_{1}', matrix.os, matrix.python-version) }} | awk '{gsub(/-|\./, "_"); print}' | tr '[:lower:]' '[:upper:]')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Test with pytest
env:
MP_API_KEY: ${{ secrets[env.API_KEY_NAME] }}
#MP_API_ENDPOINT: https://api-preview.materialsproject.org/
run: |
pip install -e .
pytest -x --cov=mp_api --cov-report=xml
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
auto-gen-release:
needs: [test]
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.API_VER_BUMP_TOKEN }}
steps:
- uses: rymndhng/[email protected]
with:
bump_version_scheme: norelease