diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..9cfbe8e --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,44 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python package + +permissions: {} + +on: + push: + branches: ["main", "ci"] + pull_request: + branches: ["main"] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10", "3.11", "3.12", "3.13", "3.13t", "3.14", "3.14t", "pypy3.11"] + + steps: + - uses: actions/checkout@v5 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install '.[dev]' + - name: Compile + run: | + python -m compileall -x '/\.git/' . + - name: Lint with ruff + run: | + ruff check + - name: Type check with pytype + run: | + pytype -j auto -k $(find urpm -name '*.py') + - name: Test with pytest + run: | + pytest -v diff --git a/pyproject.toml b/pyproject.toml index 8951b6c..9345eeb 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,8 @@ dependencies = [ dev = [ "pytest>=7.0", "pytest-cov>=4.0", + "pytype", + "ruff" ] [project.scripts]