Switched from Blue to Ruff and updated some basic type annotations #300
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Test Build | |
on: | |
push: | |
branches: ["main"] | |
paths: ["lib/**", "tests/**"] | |
pull_request: | |
branches: ["main"] | |
paths: ["lib/**", "tests/**"] | |
workflow_dispatch: {} | |
jobs: | |
build: | |
runs-on: ["ubuntu-latest"] | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Add test locales | |
run: | | |
sudo apt-get update | |
sudo apt install locales -y | |
sudo locale-gen en_US.UTF-8 fr_FR.UTF-8 ko_KR.UTF-8 | |
- 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 --upgrade pip setuptools wheel | |
python -m pip install flake8 pytest pytest-cov | |
pip install -e .[wcwidth,conversion] | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=20 --max-line-length=127 --statistics | |
- name: Generate coverage report | |
run: pytest --cov-branch --cov=./lib/ --cov-report=xml | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: ./coverage/reports/ | |
env_vars: OS,PYTHON | |
fail_ci_if_error: true | |
files: ./coverage.xml | |
flags: unittests | |
name: codecov-umbrella | |
verbose: true |