10000 Run pre-commit checks on diff with trunk by daskol · Pull Request #58 · nntile/nntile · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Run pre-commit checks on diff with trunk #58

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

Merged
merged 1 commit into from
Jun 28, 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
21 changes: 19 additions & 2 deletions .github/workflows/check-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,34 @@ permissions:

jobs:
lint:
runs-on: ubuntu-latest
name: Linting with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Pull all PR commits
run: |
# Un-shallow refs.
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
# Deepen topic branch; checkout topic branch.
git fetch origin ${{ github.event.pull_request.head.ref }} \
--depth=$(( ${{ github.event.pull_request.commits }} + 1 ))
git checkout ${{ github.event.pull_request.head.ref }}
# Fetch main for common origin.
git fetch origin main:main --depth=100
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
cache: 'pip'
python-version: 3.12
- uses: pre-commit/action@v3.0.0
with:
extra_args: ''
extra_args: >
--from-ref "$(git merge-base main HEAD)"
--to-ref "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"

# TODO(@daskol): We need rework this stage: pre-build images, build StarPU
# in-tree, rework layout and defaults, etc.
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ repos:
- id: mypy
files: (nntile/|tests/typing_test\.py)
additional_dependencies: [numpy, scipy]
args: [--config=pyproject.toml]
args: [--config=wrappers/python/pyproject.toml]
3 changes: 3 additions & 0 deletions wrappers/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ markers = [
]
filterwarnings = ["ignore::DeprecationWarning"]

[tool.ruff]
line-length = 80

[tool.setuptools]
include-package-data = false
platforms = ["Linux"]
Expand Down
Loading
0