Skip to content

Commit

Permalink
extend pre-commit (pyg-team#4292)
Browse files Browse the repository at this point in the history
* extend pre-commit

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update

* remove unused hooks

* added name

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Matthias Fey <[email protected]>
  • Loading branch information
3 people authored Mar 18, 2022
1 parent 7cff983 commit 47d4534
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 94 deletions.
87 changes: 3 additions & 84 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,85 +8,8 @@ on: # yamllint disable-line rule:truthy

jobs:

flake8:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install flake8
- name: Run linting
run: |
flake8 .
pyroma:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install pyroma
- name: Check package metadata
run: |
pyroma --min=10 .
yamllint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install yamllint
- name: Run linting
run: |
yamllint .
isort:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
pip install isort
- name: Run linting
run: |
isort --check-only .
pylint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

Expand All @@ -96,17 +19,14 @@ jobs:
python-version: 3.9

- name: Install dependencies
run: |
pip install pylint
run: pip install pylint

- name: Run linting
continue-on-error: true
run: |
pylint **/*.py
run: pylint **/*.py

mypy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

Expand All @@ -116,8 +36,7 @@ jobs:
python-version: 3.9

- name: Install dependencies
run: |
pip install mypy
run: pip install mypy

- name: Check type hints
continue-on-error: true
Expand Down
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@ ci:
autoupdate_schedule: quarterly

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-yaml
exclude: |
(?x)^(
conda/pytorch-geometric/meta.yaml|
conda/pyg/meta.yaml
)$
- repo: https://github.com/regebro/pyroma
rev: "3.2"
hooks:
- id: pyroma
name: Check packaging
args: [--min=10, .]

- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.31.0
hooks:
Expand All @@ -13,3 +32,9 @@ repos:
hooks:
- id: isort
name: Sort imports

- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
name: Check PEP8
2 changes: 1 addition & 1 deletion benchmark/kernel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Run (or modify) the whole test suite via
$ python main.py
```

For more comprehensive time-measurement and memory usage information, you may use
For more comprehensive time-measurement and memory usage information, you may use

```
$ python main_performance.py
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ENV NVIDIA_REQUIRE_CUDA "cuda>=10.0 brand=tesla,driver>=384,driver<385 brand=tes

# PyTorch (Geometric) installation
RUN rm /etc/apt/sources.list.d/cuda.list && \
rm /etc/apt/sources.list.d/nvidia-ml.list
rm /etc/apt/sources.list.d/nvidia-ml.list

RUN apt-get update && apt-get install -y \
curl \
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_static/img/pyg1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/source/_static/img/pyg2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion docs/source/modules/profile.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ torch_geometric.profile
.. automodule:: torch_geometric.profile
:members:
:undoc-members:

2 changes: 1 addition & 1 deletion examples/quiver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ python multi_gpu_quiver.py

### Distributed Training

A Quiver-based distributed PyG example is coming soon.
A Quiver-based distributed PyG example is coming soon.
1 change: 0 additions & 1 deletion graphgym/grids/example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ gnn.layers_mp l_mp [2,4,6,8]
gnn.layers_post_mp l_post [2,3]
gnn.stage_type stage ['skipsum','skipconcat']
gnn.agg agg ['add','mean','max']

2 changes: 1 addition & 1 deletion graphgym/sample/dimensions.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
act bn drop agg l_mp l_pre l_post stage batch lr optim epoch
act bn drop agg l_mp l_pre l_post stage batch lr optim epoch
2 changes: 1 addition & 1 deletion graphgym/sample/dimensionsatt.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
l_tw
l_tw
1 change: 0 additions & 1 deletion torch_geometric/nn/sequential.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ class {{cls_name}}(torch.nn.Module):
def __repr__(self) -> str:
return 'Sequential(\n{}\n)'.format('\n'.join(
[f' ({idx}): ' + str(self[idx]) for idx in range(len(self))]))

0 comments on commit 47d4534

Please sign in to comment.