Skip to content

Set up PyType checks #302

Set up PyType checks

Set up PyType checks #302

Workflow file for this run

name: Continuous Integration (CI)
on:
push:
branches:
- main
pull_request:
branches:
- main
merge_group:
jobs:
format-test:
name: Format / Unit Tests / Python ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
# Tests currently fail for 3.8 and 3.9.
python-version: ['3.10', '3.11']
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./python/ml_croissant
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install library
run: pip install .[dev]
- name: PyTest
run: pytest .
- name: PyLint
run: pylint **/*.py
pytype-test:
name: PyType / Python 3.11
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./python/ml_croissant
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install library
run: pip install .[dev]
- name: PyType
run: pytype --verbosity 2 .
validation-test:
name: Validation / JSON-LD Tests / Python 3.11
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./python/ml_croissant
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install library
run: pip install .
- name: Validate JSON-LD files
# wiki-text is excluded at the moment. See: https://github.com/mlcommons/croissant/issues/101.
# movielens is excluded at the moment. See: https://github.com/mlcommons/croissant/issues/103.
run: |
JSON_FILES=$(find ../../datasets/ -type f -name "*.json" ! -path '*wiki-text*' ! -path '*movielens*')
for file in ${JSON_FILES}
do
echo "Validating ${file}..."
python scripts/validate.py --file ${file}
done
generation-test:
name: Generation / JSON-LD Tests / Python 3.11
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./python/ml_croissant
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install library
run: pip install .
- name: Generate JSON-LD files
run: python scripts/load.py --file ../../datasets/titanic/metadata.json --record_set passengers