Add type hints to all public methods, functions and classes #210
This file contains hidden or 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
| name: Python Package | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: | |
| - "3.9" | |
| - "3.10" | |
| - "3.11" | |
| - "3.12" | |
| - "3.13" | |
| - "pypy-3.7" | |
| - "pypy-3.8" | |
| - "pypy-3.9" | |
| - "pypy-3.10" | |
| architecture: ["x86", "x64"] | |
| exclude: | |
| - os: macos-latest # No Numpy binary wheel | |
| python-version: "pypy-3.7" | |
| - os: macos-latest | |
| python-version: "3.9" | |
| - os: macos-latest | |
| python-version: "3.10" | |
| - os: macos-latest | |
| architecture: "x86" | |
| - os: ubuntu-latest | |
| architecture: "x86" | |
| - os: windows-latest | |
| python-version: "pypy-3.9" | |
| - os: windows-latest | |
| python-version: "pypy-3.10" | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: ${{ matrix.architecture }} | |
| - name: Install requirements | |
| run: pip install numpy pytest | |
| - name: "Workaround: Generate _soundfile.py explicitly" | |
| run: | | |
| pip install cffi>=1.0 | |
| python soundfile_build.py | |
| - name: Install editable package | |
| run: pip install --editable . --verbose | |
| - name: Run tests | |
| run: python -m pytest | |
| type-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.9" | |
| - name: Install requirements | |
| run: pip install numpy pytest pyright | |
| - name: "Workaround: Generate _soundfile.py explicitly" | |
| run: | | |
| pip install cffi>=1.0 | |
| python soundfile_build.py | |
| - name: Install editable package | |
| run: pip install --editable . --verbose | |
| - name: Run type check | |
| run: python -m pyright soundfile.py |