Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI and pre-commit update #14

Merged
merged 7 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -35,10 +35,11 @@ jobs:
push: always

test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
Expand All @@ -47,12 +48,12 @@ jobs:
- "3.12"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
Expand All @@ -76,16 +77,16 @@ jobs:
matrix:
tool:
- "black --check --diff"
- "isort --check --diff"
- "mypy"
- "pydocstyle"
- "pylint"
- "ruff"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "poetry"
Expand All @@ -97,11 +98,11 @@ jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "poetry"
Expand All @@ -110,7 +111,7 @@ jobs:
- name: Build docs
run: poetry run make -C docs/ html
- name: Upload the built documentation
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: documentation
path: docs/_build/
Expand All @@ -124,18 +125,18 @@ jobs:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "poetry"
- name: Build the package
run: poetry build
- name: Upload the built package
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: package
path: dist/*
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,4 @@ cython_debug/
output/
.coveralls.yml
.pypirc
.vscode-ctags
7 changes: 7 additions & 0 deletions .mdl_style.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
all

# Our changelog does this, by design.
exclude_rule 'MD024'

# Example shell command don't have output.
exclude_rule 'MD014'
1 change: 1 addition & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style '.mdl_style.rb'
33 changes: 18 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
repos:
- repo: https://github.com/python-poetry/poetry
rev: "1.7.0"
rev: "1.8.0"
hooks:
- id: poetry-check
- repo: https://github.com/ambv/black
rev: 23.9.1
- id: poetry-lock
args: ["--no-update"]
- repo: https://github.com/psf/black
rev: "24.4.0"
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: "5.13.2"
hooks:
- id: isort
- repo: https://github.com/pycqa/pydocstyle
rev: 6.3.0
rev: "6.3.0"
hooks:
- id: pydocstyle
- repo: local
hooks:
- id: pylint
name: pylint
entry: poetry run pylint
language: system
types: [python]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.1.5"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.7"
hooks:
- id: ruff
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.6.1"
rev: "v1.9.0"
hooks:
- id: mypy
- repo: https://github.com/markdownlint/markdownlint
rev: "v0.12.0"
hooks:
- id: markdownlint

exclude: ^example/

ci:
skip:
- poetry-lock # Due to errors during PyPI connection.
Loading