# This workflow will install the package and dependencies, run tests and lint with a single version of Python name: Python package build and test permissions: contents: read on: push: pull_request: branches: - main schedule: # * is a special character in YAML so you have to quote this string - cron: '30 7 * * 1' # 7:30 on monday morning jobs: build: runs-on: "ubuntu-22.04" strategy: matrix: python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] sklearn-version: ["1.7", "1.8"] exclude: - python-version: "3.10" sklearn-version: "1.8" steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install uv uv venv -p ${{ matrix.python-version }} ${{ matrix.python-version }} source ${{ matrix.python-version }}/bin/activate uv pip install .[dev] uv pip install "scikit-learn==${{ matrix.sklearn-version }}.*" - name: Test with pytest if: always() run: | source ${{ matrix.python-version }}/bin/activate pytest . --cov=tubular/ --cov-report=html --cov-config=.coveragerc - name: Upload coverage pytest html test results to github if: always() uses: actions/upload-artifact@v4 with: name: coverage-html-pytest-results-${{ matrix.python-version }}-sklearn-${{ matrix.sklearn-version }} path: htmlcov - name: Update feature table run: | source ${{ matrix.python-version }}/bin/activate python utils/feature_table.py - name: Fail if update feature table produced changes run: | if [[ -n "$(git status --porcelain)" ]]; then echo "Changes detected: " git status --porcelain echo "README.md may be out of date, run script feature_table.py and commit the results (or enable pre-commit to do this automatically)" git --no-pager diff README.md exit 1 fi lint: runs-on: "ubuntu-22.04" strategy: matrix: python-version: ["3.10"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install linters run: | python -m pip install uv uv venv -p ${{ matrix.python-version }} $HOME/lints source $HOME/lints/bin/activate uv pip install -r requirements-dev.txt - name: Lint with ruff run: | source $HOME/lints/bin/activate ruff --version ruff check --output-format github . - name: Check for typos with codespell run: | source $HOME/lints/bin/activate codespell --version codespell . - name: Check for typos with typos run: | source $HOME/lints/bin/activate typos --version typos . - name: lint code examples in docs run: | source $HOME/lints/bin/activate prek run blacken-docs --all-files