Bump pre-commit from 4.3.0 to 4.4.0 #17
Workflow file for this run
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: CI | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| release: | |
| types: [published] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| env: | |
| FORCE_COLOR: 1 | |
| jobs: | |
| package: | |
| name: Build & inspect our package | |
| runs-on: ubuntu-latest | |
| env: | |
| # Avoid local version identifiers in built packages | |
| SETUPTOOLS_SCM_NO_LOCAL: "1" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - uses: hynek/build-and-inspect-python-package@v2 | |
| test: | |
| needs: [package] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10","3.11","3.12","3.13"] | |
| name: Test on Python ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| cache-dependency-path: pyproject.toml | |
| - name: Install package + dev deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e .[dev] | |
| - name: Lint (ruff) | |
| run: | | |
| ruff --version | |
| ruff check can_waveshare tests --output-format=github || true | |
| - name: Run tests | |
| run: pytest -q | |
| - name: Verify entry point is discoverable | |
| run: | | |
| python - <<'PY' | |
| import importlib.metadata as md, can | |
| eps = md.entry_points().select(group='can.interface') | |
| names = {ep.name for ep in eps} | |
| assert 'waveshare' in names, names | |
| cls = [ep for ep in eps if ep.name == 'waveshare'][0].load() | |
| assert issubclass(cls, can.BusABC), cls | |
| print("Entry point present and loadable:", cls) | |
| PY | |
| - name: Build sdist & wheel | |
| run: | | |
| python -m pip install --upgrade build | |
| python -m build | |
| - name: Check install from wheel | |
| run: | | |
| pip install --force-reinstall --no-deps dist/*.whl | |
| python - <<'PY' | |
| import importlib.metadata as md, can | |
| eps = md.entry_points().select(group='can.interface') | |
| assert any(ep.name=='waveshare' for ep in eps), eps | |
| print("Installed wheel exposes entry point OK.") | |
| PY | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: Packages | |
| path: dist | |
| dist_upload: | |
| runs-on: ubuntu-latest | |
| if: (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')) || (github.event_name == 'release' && github.event.action == 'published') | |
| permissions: | |
| id-token: write | |
| needs: [test] | |
| steps: | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: Packages | |
| path: dist | |
| - name: Publish package to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| upload-release-assets: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| needs: [test] | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: Packages | |
| path: dist | |
| - name: Upload release assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/* | |
| fail_on_unmatched_files: true | |
| test-pypi-upload: | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| name: Upload to Test PyPI | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v5 | |
| with: | |
| name: Packages | |
| path: dist | |
| - name: Publish release to PyPI | |
| continue-on-error: true | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ |