Skip to content

Commit

Permalink
Add and run isort & codespell against python files
Browse files Browse the repository at this point in the history
  • Loading branch information
alecbcs committed Jan 6, 2024
1 parent 06954d7 commit c4404d9
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bin/license
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ from __future__ import print_function

import os
import re
from collections import defaultdict
import sys
from collections import defaultdict

#: SPDX license id must appear in the first <license_lines> lines of a file
license_lines = 7
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/requirements/style.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
black==23.12.1
flake8==7.0.0
isort==5.13.2
codespell==2.2.6
4 changes: 3 additions & 1 deletion .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ jobs:
run: |
pip install -r .github/workflows/requirements/style.txt
- name: Lint and Format Check with Flake8 and Black
- name: Lint and Format Check
run: |
black --diff --check .
codespell
isort
flake8
6 changes: 3 additions & 3 deletions bin/benchpark
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# SPDX-License-Identifier: Apache-2.0

import argparse
import subprocess
import pathlib
import os
import shutil
import pathlib
import shlex
import shutil
import subprocess
import sys

DEBUG = False
Expand Down
3 changes: 2 additions & 1 deletion docs/generate-sys-defs-list.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python3

import yaml
import glob

import pandas as pd
import yaml


def main():
Expand Down
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ requires-python = ">=3.8"

[tool.black]
line-length = 88
color = true
target-version = ['py38', 'py39', 'py310', 'py311']
include = '\.pyi?$|bin\/benchpark'
exclude = '''
Expand All @@ -23,3 +24,12 @@ exclude = '''
| repo
)/
'''

[tool.isort]
profile = "black"
skip_gitignore = true
color_output = true

[tool.codespell]
skip = '*.rst'
ignore-words-list = 'fom'
3 changes: 2 additions & 1 deletion repo/amg2023/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
#
# SPDX-License-Identifier: Apache-2.0

import sys

from ramble.appkit import *

import sys

class Amg2023(SpackApplication):
"""AMG2023 benchmark"""
Expand Down
1 change: 1 addition & 0 deletions repo/cray-mpich/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from spack.package import *
from spack.pkg.builtin.cray_mpich import CrayMpich as BuiltinCM


class CrayMpich(BuiltinCM):

variant("gtl", default=False, description="enable GPU-aware mode")
Expand Down
1 change: 1 addition & 0 deletions repo/cublas/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from spack.package import *


class Cublas(Package):

provides("blas")
3 changes: 2 additions & 1 deletion repo/hypre/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
#
# SPDX-License-Identifier: Apache-2.0

import os

from spack.package import *
from spack.pkg.builtin.hypre import Hypre as BuiltinHypre

import os

class Hypre(BuiltinHypre):
requires("+rocm", when="^rocblas")
Expand Down
1 change: 1 addition & 0 deletions repo/lapack-xl/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from spack.package import *


class LapackXl(Package):

provides("lapack")
Expand Down
3 changes: 2 additions & 1 deletion repo/lbann/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
#
# SPDX-License-Identifier: Apache-2.0

import sys

from ramble.appkit import *

import sys

class LBANN(SpackApplication):
"""LBANN benchmark"""
Expand Down
3 changes: 2 additions & 1 deletion repo/raja-perf/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
#
# SPDX-License-Identifier: Apache-2.0

import sys

from ramble.appkit import *

import sys

class RajaPerf(SpackApplication):
"""RAJA Performance suite"""
Expand Down
6 changes: 3 additions & 3 deletions repo/raja-perf/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
#
# SPDX-License-Identifier: Apache-2.0

import os
import socket
import glob
import os
import re

import socket
from os import environ as env
from os.path import join as pjoin

from spack import *


def spec_uses_toolchain(spec):
gcc_toolchain_regex = re.compile(".*gcc-toolchain.*")
using_toolchain = list(filter(gcc_toolchain_regex.match, spec.compiler_flags["cxxflags"]))
Expand Down
1 change: 1 addition & 0 deletions repo/rocblas/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from spack.package import *
from spack.pkg.builtin.rocblas import Rocblas as BuiltinRocblas


class Rocblas(BuiltinRocblas):

provides("blas")
Expand Down
1 change: 1 addition & 0 deletions repo/rocsolver/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from spack.package import *
from spack.pkg.builtin.rocsolver import Rocsolver as BuiltinRocsolver


class Rocsolver(BuiltinRocsolver):

provides("lapack")
3 changes: 2 additions & 1 deletion repo/saxpy/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
#
# SPDX-License-Identifier: Apache-2.0

import sys

from ramble.appkit import *

import sys

class Saxpy(SpackApplication):
"""saxpy benchmark"""
Expand Down
4 changes: 3 additions & 1 deletion repo/saxpy/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
#
# SPDX-License-Identifier: Apache-2.0

from spack.package import *
import os
import shutil

import spack.repo
from spack.package import *


class Saxpy(CMakePackage, CudaPackage, ROCmPackage):
"""Test saxpy problem."""
Expand Down

0 comments on commit c4404d9

Please sign in to comment.