Skip to content

move root clazz lookup to a separate method #1725

move root clazz lookup to a separate method

move root clazz lookup to a separate method #1725

Workflow file for this run

name: tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
include:
- {name: PyPy 3.7, python: 'pypy-3.7', os: ubuntu}
- {name: Python 3.7, python: '3.7', os: ubuntu}
- {name: Python 3.8, python: '3.8', os: ubuntu}
- {name: Python 3.9, python: '3.9', os: ubuntu}
- {name: Python 3.10, python: '3.10', os: ubuntu}
- {name: Python 3.11, python: '3.11', os: ubuntu}
# - {name: Python 3.12, python: '3.12-dev', os: ubuntu}
- {name: Windows py37, python: '3.7', os: windows}
- {name: MacOS py37, python: '3.7', os: macos}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install libxml2
if: startsWith(matrix.python, 'pypy') || startsWith(matrix.python, '3.12-dev')
run: |
sudo apt-get install libxml2-dev libxslt-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install .[lxml,cli,test,soap]
- name: Test
run: |
pytest --cov=./xsdata --cov-report=xml --cov-branch --doctest-glob="docs/*.rst"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
w3c-tests:
name: W3C ${{ matrix.mode }} tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
mode: [xsd, json, xml]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
repository: tefra/xsdata-w3c-tests
ref: main
submodules: true
path: w3c-tests
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools pytest pytest-xdist xmlschema
python -m pip install .[lxml,cli]
- name: Test
run: |
pytest -n auto --mode ${{ matrix.mode }} w3c-tests/tests
benchmark:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install .[lxml,cli,test]
- name: Benchmark
run: |
pytest --benchmark-only --benchmark-columns=min,max,mean,median tests/integration/benchmarks
minimum:
name: Minimum Installation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install pip install .
run: |
pip install -e .[test]
- name: Verify
run: |
python benchmark.py -c XmlEventWriter
python benchmark.py -c XmlEventHandler
python benchmark.py -c JsonParser
python benchmark.py -c JsonSerializer
xsdata | xargs -0 python -c "import sys; assert 'Install cli' in sys.argv[1]"
pre-commit:
name: Pre-commit Hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]