Skip to content

Commit

Permalink
ci config and pre-commit hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
freider committed Feb 6, 2024
1 parent 29a928a commit b45bf10
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 86 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: snok/install-poetry@v1
- name: Install poetry
uses: snok/install-poetry@v1
with:
version: 1.4.0
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install packages
run: poetry install
- name: Run tests with pytest
run: poetry run pytest -s
- name: mypy
run: poetry run pytest
- name: Ruff
run: poetry run ruff check --diff
- name: Ruff format
run: poetry run ruff format --diff
- name: Mypy
run: poetry run mypy .
- name: lint
run: poetry run black --check .
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.2.0"
hooks:
- id: ruff
# Autofix, and respect `exclude` and `extend-exclude` settings.
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
103 changes: 27 additions & 76 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ markdown-it-py = ">=2.2.0, <4.0"

[tool.poetry.group.dev.dependencies]
mypy = "^0.971"
black = "^22.8.0"
pytest = "^8.0.0"
ruff = "^0.2.1"
# would be nice if we could specify pre-commit here too, but it requires Python 3.9

[build-system]
requires = ["poetry-core>=1.1.0"]
Expand Down

0 comments on commit b45bf10

Please sign in to comment.