Add type hints, pyproject.toml, and CI/CD for code review readiness #1
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: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install linting tools | |
| run: pip install ruff mypy | |
| - name: Run ruff check | |
| run: ruff check mapachespim/ | |
| - name: Run ruff format check | |
| run: ruff format --check mapachespim/ | |
| - name: Run mypy | |
| run: mypy mapachespim/ --ignore-missing-imports | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.8", "3.10", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install package with dev dependencies | |
| run: pip install -e ".[dev]" | |
| - name: Run tests | |
| run: pytest tests/ -v --tb=short |